/* ═══════════════════════════════════════════════════════════
   Ratio Essentials - Design System
   Dark theme, responsive, touch-friendly
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables ───────────────────────────────────────── */
:root {
    --bg-primary: #0f0f14;
    --bg-secondary: #16161e;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --bg-input: #1e1e2a;
    --bg-overlay: rgba(0, 0, 0, 0.6);

    --accent-primary: #7c3aed;
    --accent-primary-hover: #6d28d9;
    --accent-secondary: #3b82f6;
    --accent-secondary-hover: #2563eb;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-on-accent: #ffffff;

    --border-color: #2d2d3a;
    --border-light: #383848;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    --touch-target: 44px;
    --container-max: 1280px;
    --sidebar-width: 260px;
}

/* ─── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-secondary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-primary); }

img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ─── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
p { color: var(--text-secondary); }

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Layout ──────────────────────────────────────────────── */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem 1.5rem;
}

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.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-col { display: flex; flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ─── Navigation / Header ────────────────────────────────── */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.navbar-brand svg, .navbar-brand img { width: 32px; height: 32px; }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.navbar-nav a, .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    min-height: var(--touch-target);
    white-space: nowrap;
}

.navbar-nav a:hover, .nav-link:hover, .nav-link.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-link.active { color: var(--accent-primary); }

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.navbar-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
}

.menu-toggle svg { width: 24px; height: 24px; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: var(--touch-target);
    white-space: nowrap;
    text-decoration: none;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}
.btn-primary:hover { background: var(--accent-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-glow); color: white; }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-light); color: var(--text-primary); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}
.btn-accent:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-glow); color: white; }

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}
.btn-outline:hover { background: var(--accent-primary); color: white; }

.btn-danger { background: var(--accent-danger); color: white; }
.btn-danger:hover { opacity: 0.9; }

.btn-success { background: var(--accent-success); color: white; }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; min-height: 36px; }
.btn-lg { padding: 1rem 2rem; font-size: 1.0625rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0.625rem; min-width: var(--touch-target); }

.btn-google {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    font-weight: 500;
}
.btn-google:hover { background: #f5f5f5; color: #333; }
.btn-google svg { width: 20px; height: 20px; }

/* ─── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.card-clickable:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    cursor: pointer;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.15));
    color: var(--accent-primary);
}

.card-icon svg { width: 24px; height: 24px; }

.card-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.25rem; }
.card-description { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; }

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Service card specifics */
.service-card { position: relative; overflow: hidden; }

.service-card .card-icon {
    width: 56px;
    height: 56px;
}

.service-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-free { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.badge-basic { background: rgba(59, 130, 246, 0.15); color: var(--accent-secondary); }
.badge-pro { background: rgba(124, 58, 237, 0.15); color: var(--accent-primary); }
.badge-complete { background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(59, 130, 246, 0.2)); color: var(--accent-primary); }
.badge-locked { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

/* ─── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    min-height: var(--touch-target);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea { min-height: 120px; resize: vertical; }

.form-error { color: var(--accent-danger); font-size: 0.8125rem; margin-top: 0.25rem; }

.form-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.form-divider::before, .form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ─── Pricing ─────────────────────────────────────────────── */
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    transition: all var(--transition-base);
}

.pricing-card:hover { border-color: var(--border-light); }

.pricing-card.featured {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.pricing-card.featured::before {
    content: 'Più Popolare';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 0.25rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin: 1rem 0;
}

.pricing-price .period { font-size: 1rem; font-weight: 400; color: var(--text-muted); }

.pricing-features {
    list-style: none;
    margin: 1.5rem 0;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.pricing-features li::before {
    content: '✓';
    color: var(--accent-success);
    font-weight: 700;
}

.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.pricing-toggle label { cursor: pointer; color: var(--text-secondary); font-weight: 500; }
.pricing-toggle label.active { color: var(--text-primary); }

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.toggle-switch.active { background: var(--accent-primary); }
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    transition: transform var(--transition-fast);
}
.toggle-switch.active::after { transform: translateX(24px); }

.savings-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ─── Upsell Banner ───────────────────────────────────────── */
.upsell-banner {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.upsell-banner p { color: var(--text-primary); font-weight: 500; margin: 0; }
.upsell-banner .highlight { color: var(--accent-primary); font-weight: 700; }

/* ─── Credits Widget ──────────────────────────────────────── */
.credits-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.credits-count {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.credits-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Flash Messages ──────────────────────────────────────── */
.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    animation: slideDown 0.3s ease;
}

.flash-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); border: 1px solid rgba(16, 185, 129, 0.3); }
.flash-error { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.flash-info { background: rgba(6, 182, 212, 0.15); color: var(--accent-info); border: 1px solid rgba(6, 182, 212, 0.3); }
.flash-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); border: 1px solid rgba(245, 158, 11, 0.3); }

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Tables (Admin) ──────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-color); }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.table th, .table td { padding: 0.875rem 1rem; text-align: left; }
.table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.table td { border-top: 1px solid var(--border-color); }
.table tr:hover td { background: var(--bg-card-hover); }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}
.status-active { background: var(--accent-success); }
.status-inactive { background: var(--text-muted); }
.status-warning { background: var(--accent-warning); }
.status-danger { background: var(--accent-danger); }

/* ─── Auth Pages ──────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
}

.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.auth-header p { color: var(--text-secondary); }

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ─── Landing Page ────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(ellipse at center top, rgba(124, 58, 237, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.hero h1 { margin-bottom: 1.25rem; position: relative; }
.hero p { font-size: 1.125rem; max-width: 640px; margin: 0 auto 2rem; position: relative; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; position: relative; }

.section { padding: 5rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { margin-bottom: 0.75rem; }
.section-header p { max-width: 600px; margin: 0 auto; }

/* ─── Stats ───────────────────────────────────────────────── */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}
.stat-value { font-size: 2rem; font-weight: 800; color: var(--accent-primary); }
.stat-label { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ─── Footer ──────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; color: var(--text-primary); }
.footer-col a { display: block; padding: 0.25rem 0; color: var(--text-secondary); font-size: 0.875rem; }
.footer-col a:hover { color: var(--accent-primary); }
.footer-bottom { text-align: center; color: var(--text-muted); font-size: 0.8125rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }

/* ─── Animations ──────────────────────────────────────────── */
@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in { animation: fadeIn 0.4s ease; }

/* ─── Utilities ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.hidden { display: none !important; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

@media (max-width: 768px) {
    .navbar-nav.desktop-nav { display: none; }
    .menu-toggle { display: flex; }

    .navbar-nav.mobile-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-secondary);
        padding: 1rem;
        z-index: 99;
        border-top: 1px solid var(--border-color);
        overflow-y: auto;
    }

    .navbar-nav.mobile-open a {
        padding: 0.875rem 1rem;
        font-size: 1.0625rem;
    }

    .hero { padding: 4rem 1rem 3rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions .btn { width: 100%; max-width: 320px; }

    .auth-card { padding: 1.75rem; }

    .pricing-card { padding: 1.5rem; }

    .upsell-banner { flex-direction: column; text-align: center; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    .table-wrapper { font-size: 0.875rem; }

    .main-content { padding: 1rem; }

    .section { padding: 3rem 0; }
}

@media (max-width: 480px) {
    html { font-size: 15px; }
    .container { padding: 0 1rem; }
    .auth-card { padding: 1.5rem; border-radius: var(--radius-lg); }
    .card { padding: 1.25rem; }
}

/* ─── Admin Sidebar ───────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
    flex-shrink: 0;
}

.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    border-radius: 0;
    min-height: var(--touch-target);
}

.admin-sidebar .nav-link:hover { background: var(--bg-card); color: var(--text-primary); }
.admin-sidebar .nav-link.active { background: rgba(124, 58, 237, 0.1); color: var(--accent-primary); border-right: 3px solid var(--accent-primary); }
.admin-sidebar .nav-link svg { width: 20px; height: 20px; }

.admin-content { flex: 1; padding: 2rem; overflow-x: hidden; }
.admin-header { margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.5rem; }

@media (max-width: 768px) {
    .admin-sidebar { display: none; }
    .admin-sidebar.mobile-open {
        display: block;
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        z-index: 98;
        width: var(--sidebar-width);
    }
    .admin-content { padding: 1rem; }
}

/* ─── Pagination ──────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 2rem;
    list-style: none;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination a:hover { background: var(--bg-card); color: var(--text-primary); }
.pagination .active { background: var(--accent-primary); color: white; }

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    transform: scale(0.95);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-header h3 { font-size: 1.25rem; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.5rem; min-width: var(--touch-target); min-height: var(--touch-target); display: flex; align-items: center; justify-content: center; }
