:root {
    --ink: #111827;
    --muted: #6b7280;
    --line: #cbd5e1;
    --panel: #ffffff;
    --canvas: #eff6ff;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --accent: #ec4899;
    --surface: #eff6ff;
    --surface-alt: #f8fafc;
}

body {
    background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 35%, #ffffff 100%);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { text-decoration: none; }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #ecfeff, #f8fafc 55%, #fff7ed);
}

.auth-card {
    width: min(440px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f4221 0%, #04290f 100%);
    color: #d9f99d;
    padding: 18px;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 1000;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.28);
}

.admin-sidebar {
    background: linear-gradient(180deg, #1d4ed8 0%, #2563eb 100%);
    color: #ebf8ff;
}

.admin-sidebar .brand {
    color: #f8fafc;
}

.admin-sidebar a {
    color: #eef2ff;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
    background: rgba(255, 255, 255, .15);
    color: #fff;
    opacity: 1;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.15rem;
    padding: 14px 8px 24px;
    color: #d9f99d;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 6px;
    opacity: .9;
    transition: background .2s ease, color .2s ease;
}

.sidebar a.active,
.sidebar a:hover {
    background: rgba(34, 197, 94, .18);
    color: #ffffff;
    opacity: 1;
}

.main-panel {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 22px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
    transition: transform .25s ease, box-shadow .25s ease;
    color: #fff;
}
.topbar.user-topbar {
    background: linear-gradient(135deg, #047857, #22c55e);
    border: 1px solid rgba(255, 255, 255, .18);
}
.topbar.admin-topbar {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    border: 1px solid rgba(255, 255, 255, .18);
}
.admin-sidebar {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ebf8ff;
}
.admin-sidebar .brand {
    color: #f8fafc;
}
.admin-sidebar a {
    color: #eef2ff;
}
.admin-sidebar a.active,
.admin-sidebar a:hover {
    background: rgba(255, 255, 255, .15);
    color: #fff;
    opacity: 1;
}
.topbar-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}
.topbar-heading {
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 4px;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sidebar-toggler {
    display: none;
}
.topbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    font-size: .85rem;
}
.topbar.user-topbar .wallet-pill,
.topbar.admin-topbar .wallet-pill {
    background: rgba(255, 255, 255, .22);
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
}
.topbar-pill i,
.topbar-icon-btn i {
    font-size: 1rem;
}
.topbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
    background: rgba(255, 255, 255, .12);
}
.topbar-icon-btn:hover {
    background: rgba(255, 255, 255, .2);
}
.topbar .muted {
    color: rgba(255, 255, 255, .82);
}
.topbar strong {
    color: #fff;
}

.muted { color: var(--muted); font-size: .85rem; }

.metric-card,
.content-card,
.table-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 20px;
    padding: 24px;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.metric-card:hover,
.content-card:hover,
.table-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 55px rgba(15, 23, 42, .08);
    border-color: rgba(148, 163, 184, .4);
}

.metric-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    padding: 24px;
    overflow: hidden;
}

.metric-card .icon {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(16, 185, 129, .14);
    color: var(--brand-dark);
    font-size: 1.4rem;
}

.metric-card .metric-title {
    color: #6b7280;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: .4rem;
}

.metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.metric-card .metric-note {
    color: #6b7280;
    font-size: .95rem;
    margin-top: auto;
}

a.metric-card {
    display: flex;
}

.metric-card .metric-title {
    color: #6b7280;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    margin-bottom: .35rem;
}

.metric-card .metric-value {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
}

.metric-card .metric-note {
    color: #6b7280;
    font-size: .9rem;
    margin-top: 1rem;
}

a.metric-card {
    color: inherit;
}

a.metric-card:hover .icon {
    transform: scale(1.05);
}

.status-badge,
.wallet-pill {
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    font-size: .85rem;
}

.status-badge.red { background: #fee2e2; color: #991b1b; }
.status-badge.blue { background: #dbeafe; color: #1d4ed8; }
.wallet-pill { background: #dcfce7; color: #14532d; }
.wallet-pill i { margin-right: 6px; font-size: .95rem; }

.table-card {
    overflow: hidden;
}

.proof-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--line);
}

.bottom-nav { display: none; }

body {
    background: linear-gradient(180deg, #f6fcf8 0%, #eff9f0 38%, #ffffff 100%);
}

.sidebar a,
.bottom-nav a {
    transition: all .2s ease;
}

.sidebar a:hover,
.bottom-nav a:hover {
    transform: translateX(2px);
}

@media print {
    .sidebar,
    .topbar,
    .bottom-nav,
    .no-print,
    .btn {
        display: none !important;
    }
    .main-panel {
        margin: 0;
        width: 100%;
        padding: 0;
    }
    body {
        background: #fff;
    }
    .content-card {
        border: 0;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: block;
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 40;
        box-sizing: border-box;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: transform .25s ease, opacity .25s ease;
        box-shadow: 8px 0 30px rgba(15, 23, 42, .12);
    }
    .sidebar.open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .35);
        z-index: 35;
        opacity: 0;
        transition: opacity .2s ease;
    }
    body.mobile-sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
    }
    body.mobile-sidebar-open {
        overflow: hidden;
    }
    .main-panel {
        width: 100%;
        margin-left: 0;
        padding: 14px 14px 120px;
    }
    .topbar {
        position: sticky;
        top: 0;
        z-index: 30;
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
        margin-bottom: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(14px);
    }
    .topbar > div,
    .topbar .topbar-actions {
        width: 100%;
    }
    .sidebar-toggler {
        display: inline-flex;
        background: #ffffff;
        color: #1d4ed8;
        border: 1px solid rgba(255, 255, 255, .2);
        box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
    }
    .sidebar-toggler i {
        color: currentColor;
    }
    .topbar-heading {
        font-size: 1.1rem;
    }
    .bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        z-index: 20;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        border-top: 1px solid var(--line);
        box-shadow: 0 -12px 30px rgba(15, 23, 42, .08);
    }
    .bottom-nav a {
        color: var(--muted);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 2px;
        min-height: 64px;
        font-size: .74rem;
    }
    .bottom-nav a i { font-size: 1.2rem; }
    .bottom-nav a.active { color: var(--brand); font-weight: 700; }
}
