/* ============================================================
   LEAD AGENCY CRM
   PREMIUM ADMIN / CLIENT UI
   ============================================================ */


/* ============================================================
   ROOT VARIABLES
   ============================================================ */

:root {

    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #eef2ff;

    --success: #16a34a;
    --success-light: #dcfce7;

    --danger: #dc2626;
    --danger-light: #fee2e2;

    --warning: #d97706;
    --warning-light: #fef3c7;

    --info: #0284c7;
    --info-light: #e0f2fe;

    --dark: #111827;
    --dark-soft: #374151;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --white: #ffffff;

    --border: #e5e7eb;

    --body-bg: #f5f7fb;

    --sidebar-width: 260px;
    --sidebar-collapsed: 78px;

    --topbar-height: 70px;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --shadow-sm:
        0 1px 2px rgba(15, 23, 42, 0.04);

    --shadow:
        0 5px 20px rgba(15, 23, 42, 0.06);

    --shadow-lg:
        0 15px 40px rgba(15, 23, 42, 0.10);

    --transition:
        all 0.2s ease;
}


/* ============================================================
   RESET
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {

    margin: 0;

    padding: 0;

    background:
        var(--body-bg);

    color:
        var(--gray-800);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    font-size: 14px;

    line-height: 1.6;

    -webkit-font-smoothing:
        antialiased;
}

a {

    color:
        inherit;

    text-decoration:
        none;
}

button,
input,
select,
textarea {

    font:
        inherit;
}

button {

    cursor:
        pointer;
}

img {

    max-width:
        100%;

    display:
        block;
}


/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {

    width:
        7px;

    height:
        7px;
}

::-webkit-scrollbar-track {

    background:
        transparent;
}

::-webkit-scrollbar-thumb {

    background:
        var(--gray-300);

    border-radius:
        20px;
}

::-webkit-scrollbar-thumb:hover {

    background:
        var(--gray-400);
}


/* ============================================================
   APP LAYOUT
   ============================================================ */

.app {

    min-height:
        100vh;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {

    position:
        fixed;

    top:
        0;

    left:
        0;

    bottom:
        0;

    width:
        var(--sidebar-width);

    background:
        var(--white);

    border-right:
        1px solid var(--border);

    z-index:
        1000;

    display:
        flex;

    flex-direction:
        column;

    transition:
        var(--transition);

    overflow:
        hidden;
}


/* Brand */

.sidebar-brand {

    height:
        var(--topbar-height);

    display:
        flex;

    align-items:
        center;

    gap:
        12px;

    padding:
        0 20px;

    border-bottom:
        1px solid var(--border);

    flex-shrink:
        0;
}

.sidebar-brand-icon {

    width:
        38px;

    height:
        38px;

    border-radius:
        10px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #7c3aed
        );

    color:
        var(--white);

    font-weight:
        800;

    font-size:
        16px;

    box-shadow:
        0 6px 15px rgba(
            79,
            70,
            229,
            0.25
        );
}

.sidebar-brand-text {

    white-space:
        nowrap;

    font-size:
        16px;

    font-weight:
        750;

    color:
        var(--gray-900);
}


/* Navigation */

.sidebar-nav {

    padding:
        18px 12px;

    overflow-y:
        auto;

    flex:
        1;
}

.nav-section-title {

    padding:
        8px 10px;

    margin:
        8px 0 6px;

    font-size:
        10px;

    font-weight:
        800;

    letter-spacing:
        0.08em;

    text-transform:
        uppercase;

    color:
        var(--gray-400);
}

.nav-item {

    display:
        flex;

    align-items:
        center;

    gap:
        12px;

    min-height:
        44px;

    padding:
        10px 12px;

    margin-bottom:
        4px;

    border-radius:
        9px;

    color:
        var(--gray-600);

    font-weight:
        550;

    transition:
        var(--transition);

    position:
        relative;
}

.nav-item:hover {

    color:
        var(--primary);

    background:
        var(--primary-light);
}

.nav-item.active {

    color:
        var(--primary);

    background:
        var(--primary-light);

    font-weight:
        650;
}

.nav-item.active::before {

    content:
        "";

    position:
        absolute;

    left:
        0;

    top:
        8px;

    bottom:
        8px;

    width:
        3px;

    border-radius:
        0 4px 4px 0;

    background:
        var(--primary);
}

.nav-icon {

    width:
        20px;

    min-width:
        20px;

    height:
        20px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-size:
        17px;
}

.nav-label {

    white-space:
        nowrap;

    overflow:
        hidden;

    text-overflow:
        ellipsis;
}

.nav-badge {

    margin-left:
        auto;

    min-width:
        20px;

    height:
        20px;

    padding:
        0 6px;

    border-radius:
        20px;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    background:
        var(--danger-light);

    color:
        var(--danger);

    font-size:
        10px;

    font-weight:
        800;
}


/* Sidebar Footer */

.sidebar-footer {

    padding:
        12px;

    border-top:
        1px solid var(--border);

    flex-shrink:
        0;
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-wrapper {

    margin-left:
        var(--sidebar-width);

    min-height:
        100vh;

    transition:
        var(--transition);
}


/* ============================================================
   TOPBAR
   ============================================================ */

.topbar {

    position:
        sticky;

    top:
        0;

    z-index:
        900;

    height:
        var(--topbar-height);

    background:
        rgba(
            255,
            255,
            255,
            0.94
        );

    backdrop-filter:
        blur(12px);

    -webkit-backdrop-filter:
        blur(12px);

    border-bottom:
        1px solid var(--border);

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    padding:
        0 28px;
}

.topbar-left {

    display:
        flex;

    align-items:
        center;

    gap:
        14px;

    min-width:
        0;
}

.sidebar-toggle {

    width:
        40px;

    height:
        40px;

    border:
        1px solid var(--border);

    background:
        var(--white);

    border-radius:
        9px;

    color:
        var(--gray-600);

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    transition:
        var(--transition);
}

.sidebar-toggle:hover {

    color:
        var(--primary);

    border-color:
        #c7d2fe;

    background:
        var(--primary-light);
}

.page-title {

    margin:
        0;

    font-size:
        18px;

    font-weight:
        750;

    color:
        var(--gray-900);

    white-space:
        nowrap;

    overflow:
        hidden;

    text-overflow:
        ellipsis;
}

.page-subtitle {

    margin:
        1px 0 0;

    font-size:
        12px;

    color:
        var(--gray-500);
}


/* Topbar Right */

.topbar-actions {

    display:
        flex;

    align-items:
        center;

    gap:
        10px;
}

.topbar-action {

    width:
        40px;

    height:
        40px;

    border:
        1px solid var(--border);

    border-radius:
        9px;

    background:
        var(--white);

    color:
        var(--gray-600);

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    transition:
        var(--transition);

    position:
        relative;
}

.topbar-action:hover {

    color:
        var(--primary);

    border-color:
        #c7d2fe;

    background:
        var(--primary-light);
}

.notification-dot {

    position:
        absolute;

    top:
        8px;

    right:
        8px;

    width:
        7px;

    height:
        7px;

    border-radius:
        50%;

    background:
        var(--danger);

    border:
        2px solid var(--white);
}


/* User Menu */

.user-menu {

    display:
        flex;

    align-items:
        center;

    gap:
        10px;

    padding:
        4px 8px 4px 4px;

    border:
        1px solid var(--border);

    border-radius:
        30px;

    background:
        var(--white);

    cursor:
        pointer;

    transition:
        var(--transition);
}

.user-menu:hover {

    border-color:
        var(--gray-300);

    box-shadow:
        var(--shadow-sm);
}

.user-avatar {

    width:
        32px;

    height:
        32px;

    border-radius:
        50%;

    background:
        var(--primary-light);

    color:
        var(--primary);

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-weight:
        800;

    font-size:
        12px;
}

.user-info {

    line-height:
        1.2;
}

.user-name {

    display:
        block;

    font-weight:
        700;

    font-size:
        12px;

    color:
        var(--gray-800);
}

.user-role {

    display:
        block;

    font-size:
        10px;

    color:
        var(--gray-400);

    margin-top:
        2px;
}


/* ============================================================
   CONTENT
   ============================================================ */

.content {

    padding:
        28px;

    max-width:
        1800px;

    margin:
        0 auto;
}


/* ============================================================
   PAGE HEADER
   ============================================================ */

.content-header {

    display:
        flex;

    align-items:
        flex-start;

    justify-content:
        space-between;

    gap:
        20px;

    margin-bottom:
        24px;
}

.content-header-title {

    margin:
        0;

    font-size:
        24px;

    line-height:
        1.3;

    font-weight:
        800;

    color:
        var(--gray-900);
}

.content-header-description {

    margin:
        5px 0 0;

    color:
        var(--gray-500);

    font-size:
        13px;
}

.content-header-actions {

    display:
        flex;

    align-items:
        center;

    gap:
        8px;

    flex-wrap:
        wrap;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {

    min-height:
        40px;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    gap:
        8px;

    padding:
        9px 15px;

    border:
        1px solid transparent;

    border-radius:
        8px;

    font-size:
        13px;

    font-weight:
        700;

    transition:
        var(--transition);

    white-space:
        nowrap;
}

.btn:disabled {

    opacity:
        0.55;

    cursor:
        not-allowed;
}

.btn-primary {

    color:
        var(--white);

    background:
        var(--primary);

    box-shadow:
        0 5px 12px rgba(
            79,
            70,
            229,
            0.18
        );
}

.btn-primary:hover {

    background:
        var(--primary-dark);

    transform:
        translateY(-1px);
}

.btn-secondary {

    color:
        var(--gray-700);

    background:
        var(--white);

    border-color:
        var(--border);
}

.btn-secondary:hover {

    border-color:
        var(--gray-300);

    background:
        var(--gray-50);
}

.btn-success {

    color:
        var(--white);

    background:
        var(--success);
}

.btn-success:hover {

    background:
        #15803d;
}

.btn-danger {

    color:
        var(--white);

    background:
        var(--danger);
}

.btn-danger:hover {

    background:
        #b91c1c;
}

.btn-warning {

    color:
        var(--white);

    background:
        var(--warning);
}

.btn-sm {

    min-height:
        34px;

    padding:
        7px 11px;

    font-size:
        12px;
}

.btn-lg {

    min-height:
        48px;

    padding:
        12px 20px;

    font-size:
        14px;
}


/* ============================================================
   STAT CARDS
   ============================================================ */

.stats-grid {

    display:
        grid;

    grid-template-columns:
        repeat(
            4,
            minmax(
                0,
                1fr
            )
        );

    gap:
        16px;

    margin-bottom:
        20px;
}

.stat-card {

    position:
        relative;

    background:
        var(--white);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    padding:
        20px;

    box-shadow:
        var(--shadow-sm);

    overflow:
        hidden;

    transition:
        var(--transition);
}

.stat-card:hover {

    transform:
        translateY(-2px);

    box-shadow:
        var(--shadow);
}

.stat-top {

    display:
        flex;

    align-items:
        flex-start;

    justify-content:
        space-between;

    gap:
        10px;
}

.stat-icon {

    width:
        44px;

    height:
        44px;

    border-radius:
        11px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-size:
        19px;

    background:
        var(--primary-light);

    color:
        var(--primary);
}

.stat-card.success .stat-icon {

    background:
        var(--success-light);

    color:
        var(--success);
}

.stat-card.warning .stat-icon {

    background:
        var(--warning-light);

    color:
        var(--warning);
}

.stat-card.danger .stat-icon {

    background:
        var(--danger-light);

    color:
        var(--danger);
}

.stat-card.info .stat-icon {

    background:
        var(--info-light);

    color:
        var(--info);
}

.stat-label {

    margin-top:
        16px;

    color:
        var(--gray-500);

    font-size:
        12px;

    font-weight:
        600;
}

.stat-value {

    margin-top:
        3px;

    font-size:
        26px;

    line-height:
        1.2;

    font-weight:
        800;

    color:
        var(--gray-900);
}

.stat-footer {

    margin-top:
        10px;

    display:
        flex;

    align-items:
        center;

    gap:
        6px;

    font-size:
        11px;

    color:
        var(--gray-500);
}

.stat-change {

    font-weight:
        750;
}

.stat-change.up {

    color:
        var(--success);
}

.stat-change.down {

    color:
        var(--danger);
}


/* ============================================================
   DASHBOARD GRID
   ============================================================ */

.dashboard-grid {

    display:
        grid;

    grid-template-columns:
        minmax(
            0,
            2fr
        )
        minmax(
            320px,
            1fr
        );

    gap:
        20px;

    margin-bottom:
        20px;
}


/* ============================================================
   CARDS
   ============================================================ */

.card {

    background:
        var(--white);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow-sm);

    overflow:
        hidden;
}

.card-header {

    min-height:
        60px;

    padding:
        16px 20px;

    border-bottom:
        1px solid var(--border);

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        15px;
}

.card-title {

    margin:
        0;

    font-size:
        14px;

    font-weight:
        750;

    color:
        var(--gray-900);
}

.card-subtitle {

    margin:
        2px 0 0;

    font-size:
        11px;

    color:
        var(--gray-500);
}

.card-body {

    padding:
        20px;
}

.card-footer {

    padding:
        14px 20px;

    border-top:
        1px solid var(--border);

    background:
        var(--gray-50);
}


/* ============================================================
   WALLET CARD
   ============================================================ */

.wallet-card {

    position:
        relative;

    padding:
        24px;

    border-radius:
        var(--radius-lg);

    background:
        linear-gradient(
            135deg,
            #312e81,
            var(--primary)
        );

    color:
        var(--white);

    overflow:
        hidden;

    box-shadow:
        0 12px 30px rgba(
            79,
            70,
            229,
            0.22
        );
}

.wallet-card::before {

    content:
        "";

    position:
        absolute;

    width:
        180px;

    height:
        180px;

    border-radius:
        50%;

    right:
        -70px;

    top:
        -80px;

    background:
        rgba(
            255,
            255,
            255,
            0.08
        );
}

.wallet-card::after {

    content:
        "";

    position:
        absolute;

    width:
        130px;

    height:
        130px;

    border-radius:
        50%;

    left:
        -60px;

    bottom:
        -70px;

    background:
        rgba(
            255,
            255,
            255,
            0.06
        );
}

.wallet-label {

    position:
        relative;

    z-index:
        1;

    font-size:
        12px;

    opacity:
        0.8;
}

.wallet-balance {

    position:
        relative;

    z-index:
        1;

    margin-top:
        5px;

    font-size:
        32px;

    line-height:
        1.2;

    font-weight:
        850;
}

.wallet-footer {

    position:
        relative;

    z-index:
        1;

    margin-top:
        22px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        10px;
}

.wallet-meta {

    font-size:
        11px;

    opacity:
        0.8;
}


/* ============================================================
   PROGRESS
   ============================================================ */

.progress {

    width:
        100%;

    height:
        7px;

    background:
        var(--gray-100);

    border-radius:
        20px;

    overflow:
        hidden;
}

.progress-bar {

    height:
        100%;

    background:
        var(--primary);

    border-radius:
        inherit;

    transition:
        width 0.4s ease;
}

.progress-bar.success {

    background:
        var(--success);
}

.progress-bar.warning {

    background:
        var(--warning);
}

.progress-bar.danger {

    background:
        var(--danger);
}


/* ============================================================
   BADGES
   ============================================================ */

.badge {

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    min-height:
        24px;

    padding:
        3px 8px;

    border-radius:
        20px;

    font-size:
        10px;

    font-weight:
        750;

    white-space:
        nowrap;
}

.badge-primary {

    background:
        var(--primary-light);

    color:
        var(--primary);
}

.badge-success {

    background:
        var(--success-light);

    color:
        var(--success);
}

.badge-danger {

    background:
        var(--danger-light);

    color:
        var(--danger);
}

.badge-warning {

    background:
        var(--warning-light);

    color:
        var(--warning);
}

.badge-info {

    background:
        var(--info-light);

    color:
        var(--info);
}

.badge-gray {

    background:
        var(--gray-100);

    color:
        var(--gray-600);
}


/* ============================================================
   TABLE
   ============================================================ */

.table-wrapper {

    width:
        100%;

    overflow-x:
        auto;
}

.table {

    width:
        100%;

    min-width:
        760px;

    border-collapse:
        collapse;
}

.table th {

    padding:
        12px 16px;

    text-align:
        left;

    font-size:
        10px;

    font-weight:
        800;

    text-transform:
        uppercase;

    letter-spacing:
        0.04em;

    color:
        var(--gray-500);

    background:
        var(--gray-50);

    border-bottom:
        1px solid var(--border);

    white-space:
        nowrap;
}

.table td {

    padding:
        14px 16px;

    color:
        var(--gray-700);

    border-bottom:
        1px solid var(--border);

    vertical-align:
        middle;
}

.table tbody tr {

    transition:
        var(--transition);
}

.table tbody tr:hover {

    background:
        #fafbff;
}

.table tbody tr:last-child td {

    border-bottom:
        0;
}

.table-primary {

    font-weight:
        700;

    color:
        var(--gray-900);
}

.table-secondary {

    margin-top:
        2px;

    font-size:
        11px;

    color:
        var(--gray-400);
}


/* ============================================================
   FORMS
   ============================================================ */

.form-grid {

    display:
        grid;

    grid-template-columns:
        repeat(
            2,
            minmax(
                0,
                1fr
            )
        );

    gap:
        18px;
}

.form-group {

    margin:
        0;
}

.form-group.full {

    grid-column:
        1 / -1;
}

.form-label {

    display:
        block;

    margin-bottom:
        7px;

    font-size:
        12px;

    font-weight:
        700;

    color:
        var(--gray-700);
}

.form-label .required {

    color:
        var(--danger);
}

.form-control,
.form-select,
.form-textarea {

    width:
        100%;

    min-height:
        42px;

    padding:
        9px 12px;

    background:
        var(--white);

    border:
        1px solid var(--gray-300);

    border-radius:
        8px;

    outline:
        none;

    color:
        var(--gray-800);

    transition:
        var(--transition);
}

.form-textarea {

    min-height:
        110px;

    resize:
        vertical;
}

.form-control::placeholder {

    color:
        var(--gray-400);
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {

    border-color:
        var(--primary);

    box-shadow:
        0 0 0 3px rgba(
            79,
            70,
            229,
            0.10
        );
}

.form-help {

    margin-top:
        5px;

    color:
        var(--gray-400);

    font-size:
        11px;
}

.form-error {

    margin-top:
        5px;

    color:
        var(--danger);

    font-size:
        11px;

    font-weight:
        600;
}


/* ============================================================
   SEARCH / FILTER BAR
   ============================================================ */

.filter-bar {

    padding:
        14px;

    background:
        var(--white);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    display:
        flex;

    align-items:
        center;

    gap:
        10px;

    flex-wrap:
        wrap;

    margin-bottom:
        16px;
}

.filter-search {

    position:
        relative;

    flex:
        1;

    min-width:
        220px;
}

.filter-search-icon {

    position:
        absolute;

    left:
        12px;

    top:
        50%;

    transform:
        translateY(-50%);

    color:
        var(--gray-400);
}

.filter-search input {

    padding-left:
        38px;
}


/* ============================================================
   ALERTS
   ============================================================ */

.alert {

    padding:
        12px 14px;

    border:
        1px solid transparent;

    border-radius:
        9px;

    display:
        flex;

    align-items:
        flex-start;

    gap:
        10px;

    margin-bottom:
        15px;

    font-size:
        12px;
}

.alert-success {

    background:
        var(--success-light);

    border-color:
        #bbf7d0;

    color:
        #166534;
}

.alert-danger {

    background:
        var(--danger-light);

    border-color:
        #fecaca;

    color:
        #991b1b;
}

.alert-warning {

    background:
        var(--warning-light);

    border-color:
        #fde68a;

    color:
        #92400e;
}

.alert-info {

    background:
        var(--info-light);

    border-color:
        #bae6fd;

    color:
        #075985;
}


/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {

    text-align:
        center;

    padding:
        55px 20px;
}

.empty-icon {

    width:
        58px;

    height:
        58px;

    margin:
        0 auto 15px;

    border-radius:
        50%;

    background:
        var(--gray-100);

    color:
        var(--gray-400);

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-size:
        23px;
}

.empty-title {

    margin:
        0;

    font-size:
        15px;

    font-weight:
        750;

    color:
        var(--gray-800);
}

.empty-text {

    margin:
        5px auto 0;

    max-width:
        420px;

    color:
        var(--gray-500);

    font-size:
        12px;
}


/* ============================================================
   MODAL
   ============================================================ */

.modal-backdrop {

    position:
        fixed;

    inset:
        0;

    z-index:
        2000;

    display:
        none;

    align-items:
        center;

    justify-content:
        center;

    padding:
        20px;

    background:
        rgba(
            15,
            23,
            42,
            0.50
        );

    backdrop-filter:
        blur(4px);
}

.modal-backdrop.show {

    display:
        flex;
}

.modal {

    width:
        100%;

    max-width:
        560px;

    max-height:
        calc(
            100vh - 40px
        );

    overflow-y:
        auto;

    background:
        var(--white);

    border-radius:
        var(--radius-lg);

    box-shadow:
        var(--shadow-lg);

    animation:
        modalIn 0.2s ease;
}

@keyframes modalIn {

    from {

        opacity:
            0;

        transform:
            translateY(
                10px
            )
            scale(
                0.98
            );
    }

    to {

        opacity:
            1;

        transform:
            translateY(0)
            scale(1);
    }
}

.modal-header {

    padding:
        18px 20px;

    border-bottom:
        1px solid var(--border);

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;
}

.modal-title {

    margin:
        0;

    font-size:
        16px;

    font-weight:
        800;

    color:
        var(--gray-900);
}

.modal-close {

    width:
        32px;

    height:
        32px;

    border:
        0;

    background:
        var(--gray-100);

    border-radius:
        8px;

    color:
        var(--gray-500);

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;
}

.modal-body {

    padding:
        20px;
}

.modal-footer {

    padding:
        14px 20px;

    border-top:
        1px solid var(--border);

    display:
        flex;

    justify-content:
        flex-end;

    gap:
        8px;
}


/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        15px;

    padding:
        14px 16px;

    border-top:
        1px solid var(--border);

    flex-wrap:
        wrap;
}

.pagination-info {

    font-size:
        11px;

    color:
        var(--gray-500);
}

.pagination-links {

    display:
        flex;

    align-items:
        center;

    gap:
        5px;
}

.page-link {

    min-width:
        32px;

    height:
        32px;

    padding:
        0 8px;

    border:
        1px solid var(--border);

    border-radius:
        7px;

    background:
        var(--white);

    color:
        var(--gray-600);

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-size:
        11px;

    font-weight:
        650;
}

.page-link:hover {

    background:
        var(--gray-50);
}

.page-link.active {

    background:
        var(--primary);

    border-color:
        var(--primary);

    color:
        var(--white);
}


/* ============================================================
   AVATAR
   ============================================================ */

.avatar {

    width:
        38px;

    height:
        38px;

    border-radius:
        50%;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    background:
        var(--primary-light);

    color:
        var(--primary);

    font-weight:
        800;

    font-size:
        12px;

    flex-shrink:
        0;
}

.avatar-sm {

    width:
        30px;

    height:
        30px;

    font-size:
        10px;
}


/* ============================================================
   INLINE FLEX
   ============================================================ */

.flex {

    display:
        flex;
}

.flex-center {

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;
}

.flex-between {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;
}

.flex-wrap {

    flex-wrap:
        wrap;
}

.gap-1 {

    gap:
        4px;
}

.gap-2 {

    gap:
        8px;
}

.gap-3 {

    gap:
        12px;
}

.gap-4 {

    gap:
        16px;
}

.gap-5 {

    gap:
        20px;
}


/* ============================================================
   TEXT UTILITIES
   ============================================================ */

.text-muted {

    color:
        var(--gray-500);
}

.text-primary {

    color:
        var(--primary);
}

.text-success {

    color:
        var(--success);
}

.text-danger {

    color:
        var(--danger);
}

.text-warning {

    color:
        var(--warning);
}

.text-center {

    text-align:
        center;
}

.text-right {

    text-align:
        right;
}

.fw-600 {

    font-weight:
        600;
}

.fw-700 {

    font-weight:
        700;
}

.fw-800 {

    font-weight:
        800;
}


/* ============================================================
   SPACING
   ============================================================ */

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }


/* ============================================================
   DIVIDER
   ============================================================ */

.divider {

    height:
        1px;

    background:
        var(--border);

    margin:
        20px 0;
}


/* ============================================================
   AUTH LAYOUT
   ============================================================ */

.auth-page {

    min-height:
        100vh;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    padding:
        25px;

    background:
        linear-gradient(
            135deg,
            #eef2ff 0%,
            #f8fafc 50%,
            #eef2ff 100%
        );
}

.auth-container {

    width:
        100%;

    max-width:
        430px;
}

.auth-card {

    background:
        var(--white);

    border:
        1px solid var(--border);

    border-radius:
        18px;

    padding:
        32px;

    box-shadow:
        var(--shadow-lg);
}

.auth-brand {

    text-align:
        center;

    margin-bottom:
        25px;
}

.auth-brand-icon {

    width:
        50px;

    height:
        50px;

    margin:
        0 auto 12px;

    border-radius:
        14px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #7c3aed
        );

    color:
        var(--white);

    font-size:
        20px;

    font-weight:
        850;
}

.auth-title {

    margin:
        0;

    font-size:
        22px;

    font-weight:
        850;

    color:
        var(--gray-900);
}

.auth-subtitle {

    margin:
        5px 0 0;

    color:
        var(--gray-500);

    font-size:
        12px;
}

.auth-footer {

    margin-top:
        20px;

    text-align:
        center;

    color:
        var(--gray-500);

    font-size:
        11px;
}


/* ============================================================
   TOGGLE
   ============================================================ */

.switch {

    position:
        relative;

    width:
        42px;

    height:
        23px;

    display:
        inline-block;
}

.switch input {

    opacity:
        0;

    width:
        0;

    height:
        0;
}

.switch-slider {

    position:
        absolute;

    inset:
        0;

    cursor:
        pointer;

    background:
        var(--gray-300);

    border-radius:
        30px;

    transition:
        0.2s;
}

.switch-slider::before {

    content:
        "";

    position:
        absolute;

    width:
        17px;

    height:
        17px;

    left:
        3px;

    top:
        3px;

    border-radius:
        50%;

    background:
        var(--white);

    transition:
        0.2s;

    box-shadow:
        0 1px 3px rgba(
            0,
            0,
            0,
            0.2
        );
}

.switch input:checked
+ .switch-slider {

    background:
        var(--primary);
}

.switch input:checked
+ .switch-slider::before {

    transform:
        translateX(
            19px
        );
}


/* ============================================================
   MOBILE SIDEBAR OVERLAY
   ============================================================ */

.sidebar-overlay {

    display:
        none;

    position:
        fixed;

    inset:
        0;

    z-index:
        999;

    background:
        rgba(
            15,
            23,
            42,
            0.45
        );
}

.sidebar-overlay.show {

    display:
        block;
}


/* ============================================================
   COLLAPSED SIDEBAR
   ============================================================ */

body.sidebar-collapsed
.sidebar {

    width:
        var(--sidebar-collapsed);
}

body.sidebar-collapsed
.main-wrapper {

    margin-left:
        var(--sidebar-collapsed);
}

body.sidebar-collapsed
.sidebar-brand-text,
body.sidebar-collapsed
.nav-label,
body.sidebar-collapsed
.nav-badge,
body.sidebar-collapsed
.nav-section-title {

    display:
        none;
}

body.sidebar-collapsed
.sidebar-brand {

    justify-content:
        center;

    padding:
        0;
}

body.sidebar-collapsed
.nav-item {

    justify-content:
        center;

    padding:
        10px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (
    max-width: 1200px
) {

    .stats-grid {

        grid-template-columns:
            repeat(
                2,
                minmax(
                    0,
                    1fr
                )
            );
    }

    .dashboard-grid {

        grid-template-columns:
            1fr;
    }
}


@media (
    max-width: 900px
) {

    .sidebar {

        transform:
            translateX(
                -100%
            );

        box-shadow:
            var(--shadow-lg);
    }

    body.sidebar-mobile-open
    .sidebar {

        transform:
            translateX(0);
    }

    .main-wrapper {

        margin-left:
            0;
    }

    body.sidebar-collapsed
    .main-wrapper {

        margin-left:
            0;
    }

    body.sidebar-collapsed
    .sidebar {

        width:
            var(--sidebar-width);
    }

    body.sidebar-collapsed
    .sidebar-brand-text,
    body.sidebar-collapsed
    .nav-label,
    body.sidebar-collapsed
    .nav-badge,
    body.sidebar-collapsed
    .nav-section-title {

        display:
            block;
    }

    body.sidebar-collapsed
    .sidebar-brand {

        justify-content:
            flex-start;

        padding:
            0 20px;
    }

    body.sidebar-collapsed
    .nav-item {

        justify-content:
            flex-start;

        padding:
            10px 12px;
    }

    .content {

        padding:
            20px;
    }

    .topbar {

        padding:
            0 20px;
    }

    .user-info {

        display:
            none;
    }
}


@media (
    max-width: 640px
) {

    body {

        font-size:
            13px;
    }

    .topbar {

        height:
            62px;

        padding:
            0 14px;
    }

    .topbar-action {

        width:
            36px;

        height:
            36px;
    }

    .sidebar-toggle {

        width:
            36px;

        height:
            36px;
    }

    .page-title {

        font-size:
            15px;
    }

    .content {

        padding:
            14px;
    }

    .content-header {

        flex-direction:
            column;

        margin-bottom:
            18px;
    }

    .content-header-title {

        font-size:
            20px;
    }

    .content-header-actions {

        width:
            100%;
    }

    .content-header-actions
    .btn {

        flex:
            1;
    }

    .stats-grid {

        grid-template-columns:
            1fr;

        gap:
            12px;
    }

    .stat-card {

        padding:
            16px;
    }

    .stat-value {

        font-size:
            23px;
    }

    .form-grid {

        grid-template-columns:
            1fr;

        gap:
            14px;
    }

    .form-group.full {

        grid-column:
            auto;
    }

    .card-header,
    .card-body {

        padding:
            15px;
    }

    .wallet-card {

        padding:
            20px;
    }

    .wallet-balance {

        font-size:
            28px;
    }

    .filter-bar {

        align-items:
            stretch;
    }

    .filter-search {

        min-width:
            100%;
    }

    .filter-bar
    .form-select,
    .filter-bar
    .btn {

        flex:
            1;

        min-width:
            0;
    }

    .pagination {

        align-items:
            flex-start;

        flex-direction:
            column;
    }

    .auth-card {

        padding:
            24px 18px;
    }
}


@media (
    max-width: 400px
) {

    .topbar-actions {

        gap:
            5px;
    }

    .user-menu {

        padding:
            3px;
    }

    .user-avatar {

        width:
            30px;

        height:
            30px;
    }

    .content {

        padding:
            10px;
    }

    .btn {

        padding:
            8px 11px;
    }
}


/* ============================================================
   PRINT
   ============================================================ */

@media print {

    .sidebar,
    .topbar,
    .content-header-actions,
    .sidebar-toggle {

        display:
            none !important;
    }

    .main-wrapper {

        margin-left:
            0 !important;
    }

    .content {

        padding:
            0;
    }

    .card {

        box-shadow:
            none;
    }
}