/* RevShare Pro - Styles */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 0.625rem;
    --radius-lg: 1rem;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Auth Page - Modern Executive Design */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
}

.auth-decor {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 1;
    opacity: 0.15;
    animation: float 20s infinite alternate;
}

.auth-decor-1 {
    top: -100px;
    right: -100px;
    background: var(--primary);
}

.auth-decor-2 {
    bottom: -150px;
    left: -150px;
    background: #6366f1;
    animation-delay: -5s;
}

@keyframes float {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(50px, 50px) scale(1.1);
    }
}

.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 20px 40px -10px rgba(0, 0, 0, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    padding: 3rem 2.5rem;
    animation: authIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
    }
}

.auth-logo-brand .logo-icon {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    border-radius: 14px;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.25);
}

.auth-logo-brand .logo-text {
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

/* Forms */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

/* Forms - Refined for Auth Icons */
.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: #ffffff;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form .form-input {
    background: #fcfcfd;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: white;
    transform: translateY(-1px);
}

.form-input:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    border-color: var(--border-light);
}


/* Buttons - Standardized Design System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 44px;
    /* Touch-friendly minimum */
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-light);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: var(--warning);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    min-height: 52px;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Mobile button enhancements */
@media (max-width: 640px) {
    .btn {
        min-height: 48px;
        font-size: 0.9375rem;
    }

    .btn-lg {
        min-height: 52px;
    }
}

/* Layout & Sidebar Base */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    /* Premium Dark Navy */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: 80px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.sidebar-logo img {
    max-height: 38px;
    width: auto;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    white-space: nowrap;
}

.logo-text .accent {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.75rem;
    overflow-y: auto;
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #94a3b8;
    /* Slate 400 */
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.sidebar .nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: white;
}

.sidebar .nav-item.active {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.sidebar .nav-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.sidebar .nav-item.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-avatar.vector-avatar {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.user-profile-link {
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 12px;
}

.user-profile-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2.5rem;
    background: var(--bg-primary);
    min-width: 0;
}

/* Mobile Header & Responsive */
.mobile-header {
    display: none;
    position: fixed;
    /* Changed from sticky to fixed for better mobile reliability */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    /* Higher than sidebar */
    height: 64px;
    padding: 0 1.25rem;
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.btn-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    font-size: 1.75rem;
    color: white;
    cursor: pointer;
    margin-right: -10px;
    z-index: 1201;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 2000;
        /* Sidebar should be on top of everything */
    }

    .sidebar.open,
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 15px 0 35px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: 84px;
        /* Space for fixed mobile header */
    }

    .mobile-header {
        display: flex;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        z-index: 1500;
        /* Between content and sidebar */
    }

    .sidebar-overlay.open,
    .sidebar-overlay.active {
        display: block;
    }
}

/* Responsive Forms & Security Section */
.security-info-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    width: 100%;
}

.user-email-text {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: monospace;
    word-break: break-all;
    overflow-wrap: break-word;
}

.password-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: flex-end;
}

@media (max-width: 640px) {
    .security-info-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem;
    }

    /* Stack the icon and text vertically too */
    .security-info-box>div:first-child {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .security-info-box .badge {
        align-self: center;
    }

    .user-email-text {
        font-size: 0.75rem;
        /* Smaller on mobile */
        max-width: 100%;
    }

    .password-form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .password-form-grid button {
        width: 100% !important;
        margin-top: 0.5rem;
        min-height: 50px;
        padding: 0 !important;
    }
}

/* Site Config Responsiveness */
.site-config-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.ad-units-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .site-config-box {
        flex-direction: column;
        padding: 1.5rem;
        text-align: center;
    }

    .site-config-box input {
        text-align: center;
        width: 100%;
    }

    .ad-units-flex {
        justify-content: center;
    }

    .form-label {
        text-align: center;
    }
}

.ad-unit-badge {
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.05);
    /* Gray transparency */
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
    font-size: 0.8125rem;
    transition: all 0.2s ease;
}

.ad-unit-badge:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.stat-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Gradient Cards */
.stat-card.gradient-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2), 0 2px 4px -1px rgba(79, 70, 229, 0.1);
}

.stat-card.gradient-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.2), 0 2px 4px -1px rgba(5, 150, 105, 0.1);
}

.stat-card.gradient-warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(217, 119, 6, 0.2), 0 2px 4px -1px rgba(217, 119, 6, 0.1);
}

.stat-card.gradient-info {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(8, 145, 178, 0.2), 0 2px 4px -1px rgba(8, 145, 178, 0.1);
}

.stat-card[class*="gradient-"] .stat-card-title,
.stat-card[class*="gradient-"] .stat-card-value,
.stat-card[class*="gradient-"] .stat-card-subtitle {
    color: white;
}

.stat-card[class*="gradient-"] .stat-card-title {
    opacity: 0.9;
}

.stat-card[class*="gradient-"] .stat-card-subtitle {
    opacity: 0.8;
}

/* Grid */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        padding: 84px 1rem 1.25rem 1rem;
    }

    .page-header button {
        width: 100%;
        min-height: 48px;
        /* Touch target size */
        justify-content: center;
        margin-top: 1rem;
        white-space: nowrap;
        display: flex;
        align-items: center;
        font-size: 0.9375rem;
    }

    /* Daily Share Packs button stacking */
    .share-pack-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .share-pack-actions .btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 48px !important;
    }

    /* Payout Balance Card - centered and full width on mobile */
    .payout-balance-card {
        width: 100%;
        margin: 0 auto;
        text-align: center;
    }
}

/* Responsive Utilities */
.flex-stack-mobile {
    display: flex;
}

@media (max-width: 768px) {
    .flex-stack-mobile {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }
}

@media (max-width: 1024px) {
    .grid-stack-tablet {
        grid-template-columns: 1fr !important;
    }
}

.instruction-box {
    background: #f0f7ff;
    border: 1px solid #cce3ff;
    padding: 12px 16px;
    border-radius: 12px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius);
    position: relative;
}

/* Subtle scroll indicator for mobile */
.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
}

.table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: #fcfcfd;
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
}

.table td {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.table tbody tr:nth-child(even) {
    background: var(--bg-tertiary);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: var(--primary-glow) !important;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background: var(--success-light);
    color: #065f46;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-default {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: var(--danger-light);
    color: #991b1b;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 2000;
    /* Increased to stay above mobile header (1200) */
    animation: fadeIn 0.2s ease-out;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-light);
}

.modal-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fcfcfd;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #fcfcfd;
}

/* Form Layout Helpers */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter Bar & Responsive Actions */
.filter-card {
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-light);
    background: #f8fafc;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-group {
    display: flex;
    background: white;
    border: 1px solid var(--border-light);
    padding: 4px;
    border-radius: 12px;
    box-shadow: var(--shadow-xs);
}

.date-range-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid var(--border-light);
    padding: 6px 14px;
    border-radius: 12px;
    box-shadow: var(--shadow-xs);
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 1rem;
    }

    .filter-group,
    .btn-group,
    .date-range-container {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .btn-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 0.75rem;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .btn-group .btn {
        width: 100%;
        justify-content: center;
        margin: 0 !important;
        border-radius: 10px !important;
        padding: 0.875rem 1rem !important;
        background: white !important;
        border: 1px solid var(--border) !important;
        color: var(--text-secondary) !important;
        font-weight: 600 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    }

    .btn-group .btn:active,
    .btn-group .btn.active {
        background: var(--primary-light) !important;
        border-color: var(--primary) !important;
        color: var(--primary) !important;
    }


    .date-range-container {
        padding: 16px;
        gap: 12px;
        flex-direction: column;
        align-items: stretch;
    }

    .date-input-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .date-input-group label {
        font-size: 0.6875rem;
        font-weight: 800;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-left: 4px;
    }

    .date-range-container input[type="date"] {
        width: 100% !important;
        background: white;
        padding: 12px;
        border-radius: 10px;
        border: 1px solid #cbd5e1;
        /* Clearer, slightly darker border */
        font-size: 0.9375rem;
        color: var(--text-primary);
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .filter-group form {
        flex-direction: column;
        width: 100%;
    }

    .filter-group form button {
        width: 100%;
        margin-top: 8px;
    }

    .mobile-hide {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }
}

.mobile-only {
    display: none;
}

/* Utilities */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.page-subtitle {
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-secondary);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Admin Sidebar */
.sidebar-admin {
    background: linear-gradient(180deg, #1e3a5f 0%, #1e293b 100%);
}

.sidebar-admin .sidebar-header {
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-admin .sidebar-logo {
    color: white;
}

.sidebar-admin .nav-item {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-admin .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-admin .nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Code Snippet Style */
.code-snippet {
    background: #1e293b;
    border-radius: var(--radius);
    padding: 1rem;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-snippet code {
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

.code-snippet .snippet-label {
    position: absolute;
    top: 0;
    right: 1rem;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.site-footer {
    margin-top: auto;
    padding: 2rem 2.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    background: var(--bg-secondary);
    /* White background */
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.02);
    /* Subtle lift */
    width: 100%;
    z-index: 10;
}

.footer-branding {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
}

.footer-link:hover {
    color: var(--primary);
}

.auth-page .site-footer {
    position: relative;
    z-index: 10;
    margin-top: auto;
    border-top: none;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
    .site-footer {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
        padding: 2rem 1.5rem;
    }

    .footer-links {
        justify-content: center;
    }

    .modal-footer {
        flex-direction: column-reverse;
        /* Put primary action on top/bottom depending on preference, usually primary top is better but column-reverse puts first item (cancel) at bottom */
        gap: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
        height: 48px;
    }
}

.auth-page .site-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    border-top: none;
    background: transparent;
    padding: 1.5rem;
}

.site-footer {
    margin-top: auto;
}