:root {
    --bg-surface: #f8fafc;
    --bg-card: #ffffff;
    --border-soft: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --brand-primary: #065f46;
    --brand-primary-hover: #047857;
    --brand-gold: #d97706;
    --accent-indigo: #065f46;
    --paid-bg: #ecfdf5;
    --paid-text: #047857;
    --paid-border: #a7f3d0;
    --pending-bg: #fff7ed;
    --pending-text: #c2410c;
    --pending-border: #fed7aa;
    --sidebar-width: 252px;
}

body {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9375rem;
}

.bg-slate-50 { background-color: var(--bg-surface) !important; }
.border-slate-200 { border-color: var(--border-soft) !important; }
.text-slate-900 { color: var(--text-primary) !important; }
.text-slate-700 { color: #334155 !important; }

.card {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
}

.btn-onyx {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
}
.btn-onyx:hover, .btn-onyx:focus {
    background-color: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
    color: #ffffff;
}

.btn-indigo {
    background-color: var(--brand-gold);
    border-color: var(--brand-gold);
    color: #ffffff;
}
.btn-indigo:hover {
    background-color: #b45309;
    border-color: #b45309;
    color: #ffffff;
}

.field-h-38 { height: 38px; }
.field-h-42 { height: 42px; }

.brand-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--brand-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.market-login-panel {
    background: linear-gradient(145deg, #064e3b 0%, #065f46 55%, #047857 100%);
    color: #ffffff;
}

.market-pill {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fef3c7;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-paid {
    background-color: var(--paid-bg);
    color: var(--paid-text);
    border: 1px solid var(--paid-border);
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
}

.badge-pending {
    background-color: var(--pending-bg);
    color: var(--pending-text);
    border: 1px solid var(--pending-border);
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
}

.badge-neutral {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid var(--border-soft);
    font-weight: 500;
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
}

/* Sidebar & Shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #064e3b 0%, #065f46 60%, #047857 100%);
    border-right: 1px solid #064e3b;
    color: #ffffff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, margin-left 0.2s ease;
    z-index: 1030;
}

.app-sidebar.collapsed {
    margin-left: calc(var(--sidebar-width) * -1);
}

.app-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.84);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 3px;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.app-sidebar .nav-link i {
    color: #fcd34d;
    font-size: 1.02rem;
}

.app-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.app-sidebar .nav-link.active {
    background-color: #ffffff;
    color: #064e3b;
    font-weight: 600;
    border-left-color: #f59e0b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.app-sidebar .nav-link.active i {
    color: #d97706;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    height: 60px;
    background: linear-gradient(90deg, #ffffff 0%, #f0fdf4 100%);
    border-bottom: 2px solid #d1fae5;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-content {
    padding: 1.25rem;
    flex: 1;
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    display: none;
}

.sticky-collection-bar {
    position: sticky;
    top: 60px;
    z-index: 1010;
    background: linear-gradient(90deg, #ecfdf5 0%, #fffbeb 100%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #a7f3d0;
}

.collection-card-mobile {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: #ffffff;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.btn-mark-paid-lg {
    min-height: 44px;
    font-weight: 600;
    border-radius: 10px;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        margin-left: calc(var(--sidebar-width) * -1);
    }
    .app-sidebar.mobile-open {
        margin-left: 0;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    }
    .app-content {
        padding: 0.85rem;
        padding-bottom: 78px;
    }
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 62px;
        background: #ffffff;
        border-top: 1px solid var(--border-soft);
        z-index: 1035;
        justify-content: space-around;
        align-items: center;
    }
    .mobile-bottom-nav a {
        text-decoration: none;
        color: #64748b;
        font-size: 0.72rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 10px;
    }
    .mobile-bottom-nav a.active {
        color: #065f46;
        font-weight: 600;
    }
    .mobile-bottom-nav i {
        font-size: 1.2rem;
    }
}
