@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Public Sans', sans-serif;
    background-color: #f4f6fc;
    color: #495057;
    margin: 0;
    overflow-x: hidden;
}

/* =============== SIDEBAR =============== */
.sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    background: #fff;
    border-right: 1px solid #ebedf2;
    z-index: 1040;
    transition: transform 0.3s ease, width 0.3s ease;
}

/* Desktop collapsed state */
.sidebar.sidebar-collapsed {
    transform: translateX(-260px);
}

.sidebar-logo {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #111;
    border-bottom: 1px solid #ebedf2;
    text-decoration: none;
}

.sidebar-logo i {
    color: #6b51df;
    margin-right: 8px;
}

.sidebar-menu {
    padding: 20px 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #99a1b7;
    font-weight: 600;
    padding: 10px 25px;
    letter-spacing: 1px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 8px 25px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.sidebar-menu li a i {
    margin-right: 15px;
    font-size: 18px;
    color: #888;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: #6b51df;
}

.sidebar-menu li.active a {
    background: rgba(107, 81, 223, 0.05);
    color: #6b51df;
    border-right: 3px solid #6b51df;
}

.sidebar-menu li.active a i {
    color: #6b51df;
}

/* Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1039;
}

.sidebar-overlay.active {
    display: block;
}

/* =============== MAIN CONTENT & TOPBAR =============== */
.main-content {
    margin-left: 260px;
    padding-top: 70px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 70px;
    background: #fff;
    border-bottom: 1px solid #ebedf2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 99;
    transition: left 0.3s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-left a {
    color: #888;
    font-size: 24px;
    text-decoration: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-right>a {
    color: #555;
    font-size: 18px;
    text-decoration: none;
    position: relative;
}

.topbar-right>a .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #6b51df;
    color: white;
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 50%;
}

.topbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-left: 10px;
}

.topbar-profile img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.topbar-profile span {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

/* =============== PAGE LAYOUT =============== */
.page-content {
    padding: 25px;
}

.page-header {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title h4 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 600;
    color: #111;
}

.page-title p {
    margin: 0;
    font-size: 13.5px;
    color: #777;
}

/* =============== DASHBOARD CARDS =============== */
.dash-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.015);
    margin-bottom: 25px;
    border: 1px solid #f1f1f1;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dash-card-title {
    font-size: 15px;
    color: #555;
    font-weight: 500;
}

.dash-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.dash-icon-purple {
    background: rgba(107, 81, 223, 0.1);
    color: #6b51df;
}

.dash-icon-orange {
    background: rgba(255, 138, 76, 0.1);
    color: #ff8a4c;
}

.dash-icon-green {
    background: rgba(43, 193, 85, 0.1);
    color: #2bc155;
}

.dash-icon-blue {
    background: rgba(54, 153, 255, 0.1);
    color: #3699ff;
}

.dash-card-amount {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin-bottom: 12px;
}

.dash-card-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
}

.dash-card-bottom span {
    color: #2bc155;
    font-weight: 600;
}

/* =============== BUTTONS =============== */
.btn-primary-custom {
    background: #6b51df;
    border-color: #6b51df;
    color: white;
}

.btn-primary-custom:hover {
    background: #5640b8;
    border-color: #5640b8;
    color: white;
}

/* =============== CARD BOX / TABLES =============== */
.card-box {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.015);
    border: 1px solid #f1f1f1;
}

.card-box-title {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin-bottom: 20px;
}

.table-custom {
    margin-bottom: 0;
}

.table-custom th {
    background: transparent;
    border-bottom: 1px dashed #ebedf2;
    color: #555;
    font-weight: 600;
    font-size: 13.5px;
    padding: 15px 10px;
    white-space: nowrap;
}

.table-custom td {
    vertical-align: middle;
    color: #555;
    border-bottom: 1px dashed #ebedf2;
    padding: 15px 10px;
    font-size: 14px;
}

/* =============== AUTH PAGE =============== */
.auth-bg {
    background: #f4f6fc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.04);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    border: 1px solid #f1f1f1;
}

.auth-logo {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin-bottom: 0px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
}

.auth-logo i {
    color: #6b51df;
    margin-right: 10px;
}

/* ============================================================
   RESPONSIVE — Tablet ≤ 991px
   ============================================================ */
@media (max-width: 991px) {
    .topbar-profile span {
        display: none;
    }
}

/* ============================================================
   RESPONSIVE — Mobile ≤ 767px
   ============================================================ */
@media (max-width: 767px) {

    /* Sidebar hides off-screen, toggled by JS */
    .sidebar {
        transform: translateX(-260px);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    /* Main content + topbar fill full width */
    .main-content {
        margin-left: 0 !important;
    }

    .topbar {
        left: 0 !important;
    }

    /* Tighten padding */
    .page-content {
        padding: 15px;
    }

    /* Page header: stack on small screens */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header>div {
        width: 100%;
    }

    .page-header>div .btn {
        width: 100%;
        text-align: center;
    }

    /* Hide "View Live Site" link text */
    .topbar-right>a.text-danger {
        display: none;
    }

    /* Dashboard cards */
    .dash-card {
        padding: 16px;
    }

    .dash-card-amount {
        font-size: 22px;
    }

    /* Card boxes */
    .card-box {
        padding: 15px;
    }

    /* Scrollable tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Auth */
    .auth-card {
        padding: 1.5rem;
    }

    /* Full-width modals */
    .modal-dialog {
        margin: 0.5rem;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-link {
        padding: 5px 10px;
        font-size: 13px;
    }

    /* Branding columns: stack vertically */
    .border-end {
        border-right: none !important;
        border-bottom: 1px solid #dee2e6 !important;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    /* Input groups */
    .input-group {
        flex-wrap: nowrap;
    }
}

/* ============================================================
   RESPONSIVE — Very small ≤ 480px
   ============================================================ */
@media (max-width: 480px) {
    .page-title h4 {
        font-size: 16px;
    }

    .page-title p {
        font-size: 12px;
    }

    .dash-card-amount {
        font-size: 20px;
    }

    .topbar-profile span {
        display: none;
    }

    .card-box {
        padding: 12px;
    }
}