/* ============================================================
   ModelGate — Design System
   ============================================================
   Type Scale:    --text-xs through --text-3xl (7 sizes)
   Spacing:       multiples of 0.25rem (4px base)
   Colors:        CSS custom properties only, no hardcoded hex
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* --- Colors --- */
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #ecfdf5;

    --success: #22c55e;
    --success-dark: #16a34a;
    --success-light: #dcfce7;
    --success-text: #166534;

    --danger: #ef4444;
    --danger-dark: #dc2626;
    --danger-light: #fee2e2;
    --danger-text: #991b1b;

    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-text: #92400e;

    /* --- Surfaces --- */
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;

    /* --- Text --- */
    --text: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;

    /* --- Borders --- */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* --- Shadows --- */
    --shadow-xs: 0 1px 2px 0 rgba(0,0,0,0.03);
    --shadow-sm: 0 1px 2px -1px rgba(0,0,0,0.03), 0 2px 6px 0 rgba(0,0,0,0.05);
    --shadow-md: 0 2px 4px -2px rgba(0,0,0,0.03), 0 6px 12px -2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px -2px rgba(0,0,0,0.03), 0 12px 20px -4px rgba(0,0,0,0.08);
    --shadow-xl: 0 8px 12px -4px rgba(0,0,0,0.04), 0 24px 32px -8px rgba(0,0,0,0.1);

    /* --- Type Scale --- */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 2rem;      /* 32px */

    /* --- Radii --- */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* --- Fonts --- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', Monaco, 'Cascadia Code', 'Courier New', monospace;

    /* --- Accent Colors (stat cards) --- */
    --accent-green: #10b981;
    --accent-green-light: #ecfdf5;
    --accent-blue: #3b82f6;
    --accent-blue-light: #eff6ff;
    --accent-orange: #f59e0b;
    --accent-orange-light: #fffbeb;
    --accent-purple: #8b5cf6;
    --accent-purple-light: #f5f3ff;

    /* --- Transitions --- */
    --transition: 150ms ease;

    /* --- Landing Page Emerald/Teal Palette --- */
    --landing-emerald-50:  #ecfdf5;
    --landing-emerald-100: #d1fae5;
    --landing-emerald-200: #a7f3d0;
    --landing-emerald-300: #6ee7b7;
    --landing-emerald-400: #34d399;
    --landing-emerald-500: #10b981;
    --landing-emerald-600: #059669;
    --landing-emerald-700: #047857;
    --landing-emerald-800: #065f46;
    --landing-emerald-900: #064e3b;

    --landing-teal-50:  #f0fdfa;
    --landing-teal-100: #ccfbf1;
    --landing-teal-200: #99f6e4;
    --landing-teal-300: #5eead4;
    --landing-teal-400: #2dd4bf;
    --landing-teal-500: #14b8a6;
    --landing-teal-600: #0d9488;

    --landing-gradient: linear-gradient(135deg, #059669, #0d9488);
    --landing-glass-bg: rgba(255, 255, 255, 0.7);
    --landing-glass-border: rgba(255, 255, 255, 0.3);
}

/* ==================== BASE ==================== */
body {
    font-family: var(--font-sans);
    background: var(--bg-secondary);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh; min-height: 100svh;
    display: flex;
    flex-direction: column;
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

code {
    background: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    font-family: var(--font-mono);
    color: var(--text);
    border: 1px solid var(--border);
}

/* ==================== LAYOUT ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--bg);
    height: 4rem;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.nav-brand-text {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.nav-brand-text span {
    color: var(--primary);
}

.nav-brand:hover .nav-brand-text {
    color: var(--text);
}

.nav-menu {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--text-sm);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

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

.nav-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.nav-hamburger:hover {
    background: var(--bg-secondary);
}

.nav-hamburger svg {
    width: 22px;
    height: 22px;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
}

/* ==================== ALERT ==================== */
.alert {
    padding: 0.75rem 1rem;
    margin: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    animation: slideDown 0.2s ease;
}

.alert.success {
    background: var(--success-light);
    border: 1px solid var(--success);
    color: var(--success-text);
}

.alert.error {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: var(--danger-text);
}

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

/* ==================== AUTH PAGE ==================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 4rem); min-height: calc(100svh - 4rem);
    padding: 1.5rem;
    background: var(--bg-secondary);
}

.auth-box {
    background: var(--bg);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.auth-box h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text);
    font-size: var(--text-xl);
    font-weight: 600;
}

.auth-box .btn {
    width: 100%;
}

.promo-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    color: #065f46;
    font-size: var(--text-sm);
    margin-bottom: 1rem;
    font-weight: 500;
}

.promo-activating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 2.5rem 1rem;
    font-size: var(--text-base);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.promo-activating-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: promo-spin 0.7s linear infinite;
}

@keyframes promo-spin {
    to { transform: rotate(360deg); }
}

.promo-activating.promo-success {
    color: #065f46;
    font-size: var(--text-lg);
}

.promo-activating.promo-neutral {
    color: var(--text-secondary);
}

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

.auth-toggle a {
    margin-left: 0.25rem;
    font-weight: 500;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-links > div {
    margin: 0.5rem 0;
}

.forgot-link a,
.back-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: var(--text-sm);
}

.forgot-link a:hover,
.back-link a:hover {
    text-decoration: underline;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-align: center;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Password input with toggle */
.input-with-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-toggle input {
    flex: 1;
    min-width: 0;
}

.toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
    z-index: 1;
    min-width: 40px;
    min-height: 40px;
}

.toggle-password:hover {
    color: var(--text);
}

.eye-icon {
    width: 20px;
    height: 20px;
}

/* Password match hints */
.hint-success {
    color: var(--primary) !important;
}

.hint-error {
    color: var(--danger) !important;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: var(--text-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

/* Must be after .form-group input to override its padding shorthand */
.form-group .input-with-toggle input {
    padding-right: 2.75rem;
}

.form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    background: var(--bg);
    transition: border-color var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 2px 8px 0 rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

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

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: var(--danger-dark);
    box-shadow: 0 2px 6px 0 rgba(239, 68, 68, 0.3);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: 500;
}

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: var(--text-base);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* ==================== CARDS ==================== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.card-header h3 {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.card-body {
    padding: 1.25rem;
}

.card-body-flush {
    padding: 0;
}

/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
}

.table thead {
    background: var(--bg-secondary);
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: var(--text-sm);
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ==================== PAGE HEADER ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem 1.5rem 0;
}

.page-header h1,
.page-header h2 {
    font-size: var(--text-2xl);
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.025em;
    margin: 0;
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: var(--text-sm);
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
}

.filter-controls select {
    padding: 0.375rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    font-size: var(--text-sm);
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--bg);
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 480px;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: var(--text-xl);
    cursor: pointer;
    color: var(--text-tertiary);
    background: none;
    border: none;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.modal-close:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

.modal-content h3 {
    margin-bottom: 1.25rem;
    color: var(--text);
    font-size: var(--text-lg);
    font-weight: 600;
}

/* ==================== KEY DISPLAY ==================== */
.key-display {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 1rem;
}

.key-display code {
    display: block;
    color: var(--success-text);
    font-size: var(--text-sm);
    word-break: break-all;
    margin-bottom: 0.75rem;
    background: transparent;
    border: none;
    padding: 0;
}

/* ==================== API KEYS TABLE ==================== */
.keys-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ==================== STATUS BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
}

/* ==================== DASHBOARD ==================== */
.dashboard {
    padding: 0 1.5rem;
}

.dashboard h2 {
    margin-bottom: 1.5rem;
    font-size: var(--text-2xl);
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* ==================== CODE BLOCKS ==================== */
.code-block {
    background: #0f172a;
    border: none;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 1rem 0;
    box-shadow: var(--shadow-md);
}

.code-block pre {
    margin: 0;
    padding: 1.25rem;
}

.code-block code {
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    background: none;
    border: none;
    padding: 0;
}

/* ==================== INFO BOX ==================== */
.info-box {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    padding: 0.875rem 1.125rem;
    margin: 1rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: var(--text-sm);
    line-height: 1.7;
    color: var(--text-secondary);
}

.info-box code {
    background: var(--bg);
}

/* ==================== DOCS PAGE ==================== */
.docs-container {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
    padding: 0 1.5rem 2rem;
}

.docs-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 5rem;
    height: fit-content;
}

.docs-sidebar h3 {
    margin-bottom: 0.75rem;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.docs-sidebar ul {
    list-style: none;
    padding: 0;
}

.docs-sidebar ul li {
    margin-bottom: 0.125rem;
}

.docs-sidebar ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-size: var(--text-sm);
}

.docs-sidebar ul li a:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.docs-content {
    max-width: 800px;
}

.docs-content section {
    margin-bottom: 2.5rem;
}

.docs-content h2 {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: var(--text-xl);
    font-weight: 600;
}

.docs-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: var(--text-lg);
    color: var(--text);
    font-weight: 600;
}

.docs-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
    font-size: var(--text-sm);
}

.docs-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.docs-footer h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: 1rem;
}

.docs-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.docs-cta {
    text-align: center;
    margin: 2rem 0;
}

/* Docs: Sidebar section headers */
.docs-sidebar h3 + ul {
    margin-bottom: 1rem;
}

.docs-sidebar ul li a.active {
    background: var(--bg-tertiary);
    color: var(--primary);
    font-weight: 500;
}

/* Docs: Endpoint badge */
.docs-endpoint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.docs-method {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.docs-method--post {
    background: rgba(5, 150, 105, 0.12);
    color: var(--primary-dark);
}

.docs-badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border-radius: var(--radius);
    font-size: var(--text-xs);
    font-weight: 500;
}

/* Docs: Required field marker */
.docs-required {
    color: #f87171;
    font-weight: 700;
    font-size: 0.75rem;
}

/* Docs: Parameter tables */
.docs-params {
    margin: 1rem 0;
}

.docs-params h4 {
    margin-bottom: 0.5rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}

.docs-params table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.docs-params table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.docs-params table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: top;
}

.docs-params table td:first-child {
    white-space: nowrap;
}

.docs-params table td code {
    font-size: var(--text-xs);
}

/* Docs: Tabs for code examples */
.docs-tabs {
    margin: 1rem 0;
}

.docs-tabs-header {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.docs-tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.docs-tab:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

.docs-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.docs-tab-content {
    display: none;
}

.docs-tab-content.active {
    display: block;
}

.docs-tab-content .code-block {
    margin-top: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Docs: Steps */
.docs-steps {
    display: flex;
    gap: 1rem;
    margin: 1.25rem 0;
}

.docs-step {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.docs-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: var(--text-sm);
    font-weight: 700;
}

.docs-step strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: var(--text-sm);
    color: var(--text);
}

.docs-step p {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Docs: Model cards grid */
.docs-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.docs-model-card {
    padding: 1.25rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-xs);
}

.docs-model-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.docs-model-icon {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.docs-model-icon svg {
    width: 28px;
    height: 28px;
}

.docs-model-card strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: var(--text-sm);
    color: var(--text);
}

.docs-model-card p {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Docs: h4 subheadings */
.docs-content h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: var(--text-base);
    color: var(--text);
    font-weight: 600;
}

.resource-card {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-xs);
}

.resource-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    color: var(--text);
    transform: translateY(-2px);
}

.resource-card strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text);
    font-size: var(--text-sm);
}

.resource-card p {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* ==================== ABOUT PAGE ==================== */
.about-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.about-container .card {
    margin-bottom: 1.25rem;
}

.about-container h3 {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.about-container p,
.about-container li {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: var(--text-sm);
}

.about-container ul {
    padding-left: 1.5rem;
}

.about-container li {
    margin-bottom: 0.375rem;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.about-features h4 {
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-size: var(--text-sm);
    font-weight: 600;
}

.about-features p {
    font-size: var(--text-sm);
}

.support-contacts {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.support-contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    flex: 1;
    transition: border-color 0.15s, background 0.15s;
}

.support-contact-item:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.support-contact-item svg {
    color: var(--primary);
    flex-shrink: 0;
}

.support-contact-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-bottom: 0.125rem;
}

.support-contact-value {
    font-size: var(--text-sm);
    color: var(--text);
    font-weight: 500;
}

.about-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* ==================== MODELS PAGE ==================== */
.models-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
    padding: 0 2rem 2rem;
    max-width: 1600px;
    margin: 0;
}

.models-filters {
    position: -webkit-sticky;
    position: sticky;
    top: 5rem;
    align-self: start;
}

.models-filter-toggle {
    display: none;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    font-family: var(--font-sans);
    margin-bottom: 1rem;
}

.models-filter-toggle svg {
    width: 16px;
    height: 16px;
}

.models-filter-close {
    display: none;
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-sans);
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .models-filter-close {
        display: block;
    }
}

.filter-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.filter-section.collapsed .filter-section-header {
    margin-bottom: 0;
}

.filter-section-header:hover h4 {
    color: var(--text);
}

.filter-section-header:hover .filter-collapse-icon {
    color: var(--text-secondary);
}

.filter-section-header h4 {
    margin-bottom: 0;
}

.filter-toggle-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--text-xs);
    color: var(--primary);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: color 150ms ease;
    min-width: 6.5em;
    text-align: right;
}

.filter-toggle-btn:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.filter-section h4 {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-checkboxes label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.filter-checkboxes label:hover {
    color: var(--text);
}

.filter-checkboxes input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--primary);
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-inputs input {
    flex: 1;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    width: 80px;
}

.range-inputs span {
    color: var(--text-tertiary);
}

/* Collapsible filter sections */
.filter-section-header .filter-collapse-icon {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
    transition: transform 200ms ease;
    flex-shrink: 0;
}

.filter-section.collapsed .filter-collapse-icon {
    transform: rotate(-90deg);
}

.filter-section-body {
    overflow: hidden;
    transition: max-height 250ms ease, opacity 200ms ease;
    max-height: 500px;
    opacity: 1;
    padding-top: 0.25rem;
}

.filter-section.collapsed .filter-section-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
}

.filter-section.collapsed {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.filter-section-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.375rem;
}

.models-main {
    min-width: 0;
}

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

.models-header h1,
.models-header h2 {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.025em;
    margin: 0;
}

.models-search {
    position: relative;
    margin-bottom: 1rem;
}

.models-search input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.models-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.models-search svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.models-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.sort-control select {
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    font-size: var(--text-sm);
}

.sort-control select:focus {
    outline: none;
}

.models-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.model-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-xs);
}

.model-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.model-card-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.model-info {
    flex: 1;
    min-width: 0;
}

.model-name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.125rem;
}

.model-creator {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.model-capabilities {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.capability-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
}

.model-price-section {
    text-align: right;
    flex-shrink: 0;
}

.model-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.price-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.price-unit {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== MODEL DETAIL MODAL ==================== */
.model-detail-modal .modal-content {
    max-width: 680px;
    width: 95%;
    padding: 2rem;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.detail-title-area h2 {
    font-size: var(--text-xl);
    margin-bottom: 0.375rem;
    font-weight: 600;
}

.detail-id-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.detail-meta {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.embedding-notice {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
}

.detail-description {
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: var(--text-sm);
}

.detail-section-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Multi-provider pricing table */
.detail-price-unit {
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--text-secondary);
}

.detail-pricing-providers {
    margin-bottom: 1rem;
}

.detail-pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.detail-pricing-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.detail-pricing-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.detail-pricing-table tr:last-child td {
    border-bottom: none;
}

.detail-pricing-table .cheapest-provider {
    background: rgba(5, 150, 105, 0.08);
}

.cheapest-badge {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #059669;
    background: rgba(5, 150, 105, 0.15);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius);
    margin-left: 0.4rem;
    vertical-align: middle;
}

.no-pricing {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    padding: 0.75rem 0;
}

/* Provider label in usage tables */
.provider-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.loading-state,
.error-state,
.no-models {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem 1.5rem;
    margin-top: auto;
}

.footer-top {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-logo {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.footer-tagline {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    line-height: 1.5;
    max-width: 260px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-col-title {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.footer-col a {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-col svg {
    flex-shrink: 0;
}

.footer-bottom {
    max-width: 1200px;
    margin: 1.5rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

.footer-copy {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

/* ==================== LEGAL AGREEMENTS (AUTH) ==================== */

.legal-agreements {
    margin-top: 0.25rem;
}

.legal-checkbox {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.legal-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.legal-checkbox-item input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.legal-checkbox-item a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-underline-offset: 2px;
}

.legal-checkbox-item a:hover {
    color: var(--primary-dark);
}

/* Agreement overlay modal (shown on login when docs need signing) */
.agreement-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
}

.agreement-modal {
    background: var(--bg);
    border-radius: 1rem;
    padding: 2rem 2rem 1.75rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.agreement-modal h2 {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.agreement-desc {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.agreement-modal .legal-checkbox {
    margin-bottom: 1.5rem;
}

.agreement-modal .btn {
    width: 100%;
}

/* ==================== RATING PAGE ==================== */

.rating-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.rating-header {
    margin-bottom: 1.5rem;
}

.rating-header h1,
.rating-header h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.625rem;
}

.rating-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 800px;
}

.rating-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.rating-tab {
    padding: 0.5rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
    font-family: inherit;
}

.rating-tab:hover {
    background: var(--bg-secondary);
    color: var(--text);
    border-color: var(--text-tertiary);
}

.rating-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.rating-toolbar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.rating-control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.rating-control-group select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: var(--text-sm);
    font-family: inherit;
    cursor: pointer;
}

.rating-control-group input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}

.rating-toolbar-stats {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.rating-toolbar-stats strong {
    font-weight: 700;
    color: var(--primary);
}

.rating-toolbar-divider {
    color: var(--text-tertiary);
}

.rating-chart-card {
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.rating-chart-wrap {
    position: relative;
    height: 600px;
}

.rating-chart-wrap canvas {
    transition: opacity 0.3s ease;
}

.rating-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-loading-inner {
    width: 100%;
    height: 100%;
}

.rating-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.rating-bottom {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rating-bottom > :last-child {
    align-self: start;
}

.rating-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rating-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--text-xs);
    color: var(--text);
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border);
    background: var(--bg);
}

.rating-legend-item:hover {
    border-color: var(--text-tertiary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rating-legend-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.rating-legend-count {
    font-size: 0.625rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.rating-section-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.625rem 0;
}

.rating-pareto-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rating-pareto-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.rating-pareto-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.1);
}

.rating-pareto-rank {
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 700;
    flex-shrink: 0;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.rating-pareto-rank.gold {
    background: #fef3c7;
    color: #92400e;
}

.rating-pareto-rank.silver {
    background: #f1f5f9;
    color: #475569;
}

.rating-pareto-rank.bronze {
    background: #fed7aa;
    color: #9a3412;
}

.rating-pareto-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.rating-pareto-info {
    flex: 1;
    min-width: 0;
}

.rating-pareto-item .name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
}

.rating-pareto-item .details {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

.rating-pareto-score {
    flex-shrink: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--primary);
    margin-left: auto;
}

/* Rating Modal */
.rating-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.rating-modal-content {
    position: relative;
    background: var(--bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 540px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.75rem;
    animation: ratingModalIn 0.2s ease;
}

@keyframes ratingModalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.rating-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.rating-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.rating-modal-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    padding-right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rating-pareto-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.rating-modal-provider {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.rating-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

.rating-modal-stat {
    background: var(--bg-secondary);
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius);
}

.rating-modal-stat.highlight {
    background: var(--primary-light);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.rating-modal-stat-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.125rem;
}

.rating-modal-stat-value {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text);
}

.rating-modelgate-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.rating-modelgate-price {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.rating-modelgate-price-label {
    font-weight: 500;
    color: var(--text);
}

.rating-modelgate-price-value {
    font-weight: 700;
    color: var(--primary);
}

.rating-modelgate-price-unit {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.rating-modelgate-cta {
    display: block;
    padding: 0.75rem;
    background: var(--primary);
    color: #fff;
    text-align: center;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-sm);
    transition: background var(--transition);
}

.rating-modelgate-cta:hover {
    background: var(--primary-dark);
    color: #fff;
}

@media (max-width: 900px) {
    .rating-bottom {
        grid-template-columns: 1fr;
    }
    .rating-chart-wrap {
        height: 450px;
    }
    .rating-toolbar {
        gap: 0.75rem;
    }
    .rating-toolbar-stats {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .rating-page {
        padding: 1rem;
    }
    .rating-tabs {
        gap: 0.375rem;
    }
    .rating-tab {
        padding: 0.375rem 0.75rem;
        font-size: var(--text-xs);
    }
    .rating-chart-wrap {
        height: 300px;
    }
    .rating-modal-grid {
        grid-template-columns: 1fr;
    }
    .rating-bottom {
        grid-template-columns: 1fr;
    }
}

/* ==================== DASHBOARD SIDEBAR LAYOUT ==================== */
.dash-layout {
    display: flex;
    height: calc(100vh - 4rem); height: calc(100svh - 4rem);
    overflow: hidden;
}

.dash-sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.dash-sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
}

.dash-sidebar-section {
    margin-bottom: 1.25rem;
}

.dash-sidebar-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 0.75rem;
    margin-bottom: 0.375rem;
}

.dash-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.dash-sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dash-sidebar-link:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

.dash-sidebar-link.active {
    color: var(--primary);
    background: var(--primary-light);
}


.dash-container {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

.table-flush {
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.dash-main {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-secondary);
}

/* Mobile sidebar toggle — FAB in bottom-left */
.dash-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 200;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-sidebar-toggle:active {
    transform: scale(0.92);
}

.dash-sidebar-toggle svg {
    width: 22px;
    height: 22px;
}


/* ==================== USER MENU ==================== */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text);
    transition: all var(--transition);
    box-shadow: var(--shadow-xs);
}

.user-menu-trigger:hover {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.user-email {
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    padding: 0.25rem;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    color: var(--text);
    text-decoration: none;
    background: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: var(--text-sm);
    transition: background var(--transition);
}

.user-menu-item:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.user-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.user-menu-logout {
    color: var(--danger);
}

.user-menu-logout:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* ==================== PAYMENT PAGE ==================== */
.payment-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.payment-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.payment-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.payment-balance-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.payment-balance-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.payment-balance-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
}

.payment-balance-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
}

.payment-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xs);
}

.payment-section {
    margin-bottom: 2rem;
}

.payment-section-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.payment-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.payment-amount-btn {
    position: relative;
    padding: 0.875rem 1rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.payment-amount-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.payment-amount-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.payment-amount-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.payment-custom-amount {
    margin-top: 0.75rem;
}

.payment-custom-amount label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.payment-custom-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-custom-input-row input {
    flex: 1;
    padding: 0.5625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    max-width: 240px;
}

.payment-custom-input-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.payment-currency {
    font-size: var(--text-base);
    color: var(--text-secondary);
    font-weight: 500;
}


.payment-action {
    text-align: center;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    margin-top: 1.25rem;
}

.payment-submit-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.payment-methods {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1rem;
    padding: 0.5rem 0;
}

.payment-method-logo {
    opacity: 1;
}

.payment-note {
    margin-top: 0.5rem;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

/* Payment info card */
.payment-info-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xs);
}

.payment-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.payment-step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    font-size: var(--text-sm);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-step strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.125rem;
}

.payment-step p {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .payment-layout {
        grid-template-columns: 1fr;
    }

    .payment-amounts {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== TRANSACTION HISTORY ==================== */

.tx-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.tx-row:last-child {
    border-bottom: none;
}

.tx-row.skeleton-tx {
    gap: 1rem;
}

.tx-date {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    min-width: 110px;
    white-space: nowrap;
}

.tx-amount {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    min-width: 80px;
}

.tx-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.tx-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.tx-status.succeeded {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.tx-status.canceled {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.tx-status.refunded {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.tx-action {
    margin-left: auto;
    flex-shrink: 0;
}

.tx-cancel-btn {
    font-size: var(--text-xs);
    padding: 0.25rem 0.625rem;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius);
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.tx-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
}

.tx-refund-btn {
    border-color: rgba(139, 92, 246, 0.4);
    color: #8b5cf6;
}

.tx-refund-btn:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: #8b5cf6;
}

.skeleton-line {
    display: inline-block;
    height: 1rem;
    border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
    .tx-row {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    .tx-date {
        min-width: auto;
        width: 100%;
    }
    .tx-action {
        margin-left: 0;
        width: 100%;
    }
    .tx-cancel-btn {
        width: 100%;
        text-align: center;
        padding: 0.375rem 0.625rem;
    }
}

/* ==================== SKELETON LOADING ==================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
    color: transparent !important;
    user-select: none;
}
.skeleton * { visibility: hidden; }
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 1em; width: 60%; display: inline-block; }
.skeleton-value { height: 1.5em; width: 80%; display: inline-block; }
.skeleton-card { min-height: 80px; }
.skeleton-row td { padding: 0.75rem 1rem; }

/* ==================== UTILITIES ==================== */
.text-center { text-align: center; }

/* ==================== DASHBOARD PAGE ==================== */
.dash-header {
    margin-bottom: 1.5rem;
}

.dash-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dash-header h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.dash-header p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.period-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.period-tab {
    padding: 0.375rem 0.875rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.period-tab:hover {
    color: var(--text);
}

.period-tab.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

/* Stat cards row */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-cards-3 {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.stat-icon.green {
    background: var(--accent-green-light);
    color: var(--accent-green);
}

.stat-icon.blue {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
}

.stat-icon.orange {
    background: var(--accent-orange-light);
    color: var(--accent-orange);
}

.stat-icon.purple {
    background: var(--accent-purple-light);
    color: var(--accent-purple);
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-subtitle {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.stat-subtitle.positive {
    color: var(--accent-green);
}

.stat-card-balance {
    position: relative;
}

.stat-topup-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
    text-decoration: none;
}

.stat-topup-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.stat-topup-btn svg {
    flex-shrink: 0;
}

/* ==================== CHARTS ==================== */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-card {
    margin-bottom: 0;
}

.chart-body {
    height: 260px;
    padding: 1rem !important;
}

@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .docs-container {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
        order: -1;
    }

    .docs-steps {
        flex-direction: column;
    }

    .docs-models-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Touch-friendly targets for tablets */
    .modal-close {
        width: 2.75rem;
        height: 2.75rem;
        font-size: var(--text-2xl);
    }

    .filter-checkboxes input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .filter-checkboxes label {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .pagination {
        gap: 0.375rem;
    }
}

@media (max-width: 900px) {
    .dash-sidebar {
        display: none;
        position: fixed;
        top: 4rem;
        left: 0;
        bottom: 0;
        z-index: 150;
        box-shadow: var(--shadow-xl);
    }

    .dash-sidebar.open {
        display: flex;
    }

    .dash-sidebar-toggle {
        display: flex;
    }

    /* Overlay behind sidebar */
    .dash-sidebar-overlay {
        display: none;
        position: fixed;
        top: 4rem;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.3);
        z-index: 149;
    }

    .dash-sidebar-overlay.open {
        display: block;
    }

    .models-layout {
        grid-template-columns: 1fr;
    }

    .models-filters {
        display: none;
        position: fixed;
        top: 4rem;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 150;
        background: var(--bg);
        overflow-y: auto;
        padding: 1rem;
        box-shadow: var(--shadow-xl);
        overscroll-behavior: contain;
    }

    .models-filters.open {
        display: block;
    }

    .models-filter-toggle {
        display: inline-flex;
    }

}

@media (max-width: 768px) {
    .navbar {
        padding: 0 0.75rem;
    }

    .nav-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        order: -1;
    }

    .nav-brand-text {
        font-size: var(--text-xl);
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 4rem;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        flex-direction: column;
        padding: 0.5rem;
        z-index: 99;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu .nav-link {
        padding: 0.75rem 1rem;
        width: 100%;
        border-radius: var(--radius-sm);
    }

    /* Keep nav-actions (login/user menu) always visible on mobile */
    .nav-actions {
        margin-left: auto;
    }

    .user-email {
        max-width: 80px;
        font-size: var(--text-xs);
    }

    .user-menu-trigger {
        padding: 0.25rem 0.5rem;
        font-size: var(--text-xs);
    }

    .user-menu-dropdown {
        right: -0.5rem;
    }

    .auth-container {
        padding: 1rem;
    }

    .auth-box {
        padding: 1.5rem;
    }

    .hide-mobile {
        display: none !important;
    }

    .page-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        padding: 1rem 1rem 0;
    }

    .page-header h1,
    .page-header h2 {
        font-size: var(--text-xl);
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .stat-icon {
        width: 2.25rem;
        height: 2.25rem;
    }

    .stat-icon svg {
        width: 1rem;
        height: 1rem;
    }

    .stat-value {
        font-size: var(--text-lg);
    }

    .stat-label {
        font-size: 0.6875rem;
    }

    .stat-topup-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.625rem;
        top: 0.5rem;
        right: 0.5rem;
    }

    .stat-topup-btn svg {
        width: 10px;
        height: 10px;
    }

    /* Dashboard content spacing */
    .dash-container {
        padding-top: 1rem;
        padding-bottom: 1.5rem;
    }

    .dashboard {
        padding: 0 1rem;
    }

    .dash-header h1 {
        font-size: var(--text-xl);
    }

    .dash-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .period-tabs {
        margin-bottom: 1rem;
    }

    .charts-row {
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .model-card-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .model-price-section {
        text-align: left;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-light);
    }

    .model-price {
        align-items: flex-start;
    }

    .price-value {
        font-size: var(--text-xl);
    }

    .detail-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
        text-align: center;
        align-items: center;
    }

    .footer-tagline {
        max-width: none;
    }

    .table th,
    .table td {
        padding: 0.375rem 0.5rem;
        font-size: var(--text-xs);
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .support-contacts {
        flex-direction: column;
    }

    .generated-image {
        max-width: 100%;
    }

    /* Touch target improvements */
    .modal-close {
        width: 2.5rem;
        height: 2.5rem;
    }

    .btn-small {
        min-height: 36px;
        padding: 0.5rem 0.875rem;
    }

    .filter-checkboxes input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    /* Models page: tighter padding on phone */
    .models-layout {
        padding: 0 0.75rem 1rem;
    }

    /* Logs page */
    .logs-filters {
        gap: 0.5rem;
    }

    .pagination {
        gap: 0.25rem;
    }

    /* Payment page */
    .payment-balance-card {
        padding: 1rem;
    }

    /* Modal on mobile */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }

    /* Docs page */
    .docs-container {
        padding: 0 1rem 1.5rem;
    }
}

/* ============================================================
   LANDING PAGE REDESIGN — Emerald/Teal Premium Theme
   All classes prefixed with lg- to avoid conflicts.
   ============================================================ */

/* -- Page wrapper -- */
.lg-page {
    background: var(--bg);
    overflow-x: hidden;
}

/* -- Shared section elements -- */
.lg-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    text-align: center;
}

.lg-section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* -- Buttons -- */
.lg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    font-size: var(--text-base);
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 200ms ease;
    text-decoration: none;
    border: none;
    line-height: 1.5;
}

.lg-btn-primary {
    background: var(--landing-emerald-600);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.3), 0 4px 12px rgba(5, 150, 105, 0.15);
}

.lg-btn-primary:hover {
    background: var(--landing-emerald-700);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3), 0 8px 24px rgba(5, 150, 105, 0.2);
    transform: translateY(-1px);
}

.lg-btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.lg-btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.lg-btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* -- Gradient text -- */
.lg-gradient-text {
    background: linear-gradient(135deg, var(--landing-emerald-600) 0%, var(--landing-teal-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== HERO ==================== */
.lg-hero {
    padding: 6rem 2rem 4rem;
    background: linear-gradient(180deg, var(--landing-emerald-50) 0%, var(--bg) 100%);
}

.lg-hero-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.lg-hero-content {
    text-align: left;
}

.lg-hero-code {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lg-hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.05;
    letter-spacing: -0.05em;
    margin-bottom: 1.25rem;
}

.lg-hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 560px;
}

.lg-hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lg-hero-note {
    margin-top: 1rem;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}



/* ==================== PROVIDERS ROW ==================== */
.lg-providers {
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    letter-spacing: 0.01em;
}

.lg-providers span {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== CODE WINDOW ==================== */
.lg-code-window {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08),
                0 8px 40px rgba(15, 23, 42, 0.12),
                0 0 80px rgba(5, 150, 105, 0.06);
}

.lg-code-titlebar {
    background: #1e293b;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lg-code-dots {
    display: flex;
    gap: 6px;
}

.lg-code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.lg-code-dots span:nth-child(1) { background: #ef4444; }
.lg-code-dots span:nth-child(2) { background: #f59e0b; }
.lg-code-dots span:nth-child(3) { background: #22c55e; }

.lg-code-filename {
    flex: 1;
    text-align: center;
    font-size: var(--text-xs);
    color: #64748b;
    font-family: var(--font-mono);
}

.lg-code-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #94a3b8;
    font-size: var(--text-xs);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 150ms ease;
}

.lg-code-copy:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

.lg-code-body {
    background: #0f172a;
    padding: 1.5rem;
    margin: 0;
    overflow-x: scroll;
    max-width: 80vw;
}

.lg-code-body::-webkit-scrollbar {
    width: 5px;
    height: 8px;
}

.lg-code-body::-webkit-scrollbar-thumb {
    background: var(--landing-emerald-600);
    border-radius: var(--radius-lg);
}

.lg-code-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.lg-code-body code {
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.8;
    background: none;
    padding: 0;
    border: none;
}

.lg-kw  { color: #c4b5fd; }
.lg-str { color: #6ee7b7; }
.lg-fn  { color: #93c5fd; }

/* ==================== FEATURES ==================== */
.lg-features {
    padding: 5rem 2rem;
    background: var(--bg-secondary);
}

.lg-features-inner {
    max-width: 960px;
    margin: 0 auto;
}

.lg-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.lg-feature-card {
    padding: 1.75rem;
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: box-shadow 200ms ease, border-color 200ms ease;
}

.lg-feature-card:hover {
    border-color: var(--landing-emerald-300);
    box-shadow: 0 2px 12px rgba(5, 150, 105, 0.08);
}

.lg-feature-card h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.lg-feature-card p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== MODELS TABLE ==================== */
.lg-models {
    padding: 5rem 2rem;
    background: var(--bg);
}

.lg-models-inner {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.lg-models-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: left;
}

.lg-mcard {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.5rem;
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lg-mcard:hover {
    border-color: var(--landing-emerald-600);
    box-shadow: 0 0 0 1px var(--landing-emerald-600), 0 4px 20px rgba(5, 150, 105, 0.1);
    transform: translateY(-2px);
}

.lg-mcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lg-mcard-creator {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-weight: 500;
}

.lg-mcard-badge {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
    background: rgba(5, 150, 105, 0.1);
    color: var(--landing-emerald-600);
}

.lg-mcard-badge--vision {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
}

.lg-mcard-badge--image {
    background: rgba(244, 114, 182, 0.1);
    color: #f472b6;
}

.lg-mcard-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.3;
}

.lg-mcard-specs {
    display: flex;
    gap: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.lg-mcard-spec {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.lg-mcard-spec-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-weight: 500;
}

.lg-mcard-spec-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.lg-mcard-spec-value small {
    font-weight: 400;
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

.lg-link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--landing-emerald-600);
    text-decoration: none;
    transition: gap 200ms ease, color 150ms ease;
}

.lg-link-arrow:hover {
    color: var(--landing-emerald-700);
    gap: 0.625rem;
}

/* ==================== STEPS ==================== */
.lg-steps {
    padding: 5rem 2rem;
    background: var(--bg-secondary);
}

.lg-steps-inner {
    max-width: 960px;
    margin: 0 auto;
}

.lg-steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.lg-step {
    flex: 1;
    text-align: center;
    max-width: 220px;
    padding: 0 1rem;
}

.lg-step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--landing-gradient);
    color: #ffffff;
    font-size: var(--text-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.lg-step h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.lg-step p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.lg-step-connector {
    width: 60px;
    height: 0;
    border-top: 2px dashed var(--landing-emerald-300);
    margin-top: 24px;
    flex-shrink: 0;
}

/* ==================== TRUST INDICATORS ==================== */
.lg-trust {
    padding: 4rem 2rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.lg-trust-inner {
    max-width: 960px;
    margin: 0 auto;
}

.lg-trust-grid {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lg-trust-item {
    flex: 1;
    text-align: center;
    padding: 1rem;
}

.lg-trust-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 0.375rem;
}

.lg-trust-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.lg-trust-from {
    font-size: 1.25rem;
    font-weight: 500;
}

.lg-trust-divider {
    width: 1px;
    height: 48px;
    background: var(--border);
    flex-shrink: 0;
}

/* ==================== CHATROOM TEASER ==================== */
.lg-chatroom-teaser {
    padding: 5rem 2rem;
    background: linear-gradient(180deg, var(--landing-emerald-50) 0%, var(--bg) 100%);
}

.lg-chatroom-teaser-inner {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.lg-chatroom-text .lg-section-title {
    text-align: left;
}

.lg-chatroom-text .lg-section-subtitle {
    text-align: left;
    margin-left: 0;
    max-width: none;
    margin-bottom: 2rem;
}

.lg-chat-mockup {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lg-chat-bubble {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    line-height: 1.5;
    max-width: 85%;
}

.lg-chat-bubble--user {
    background: var(--landing-emerald-600);
    color: #ffffff;
    align-self: flex-end;
}

.lg-chat-bubble--ai {
    background: var(--bg-secondary);
    color: var(--text);
    align-self: flex-start;
}

.lg-chat-typing {
    display: flex;
    gap: 4px;
    padding: 0.25rem 0;
}

.lg-chat-typing span {
    width: 6px;
    height: 6px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: lg-typing 1.4s ease-in-out infinite;
}

.lg-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.lg-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes lg-typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* ==================== FINAL CTA ==================== */
.lg-cta {
    padding: 5rem 2rem;
    background: linear-gradient(135deg, var(--landing-emerald-800) 0%, var(--landing-emerald-900) 100%);
    text-align: center;
}

.lg-cta-inner {
    max-width: 720px;
    margin: 0 auto;
}

.lg-cta h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
}

.lg-cta p {
    color: var(--landing-emerald-200);
    font-size: var(--text-lg);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.lg-cta .lg-btn-primary {
    background: #ffffff;
    color: var(--landing-emerald-800);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lg-cta .lg-btn-primary:hover {
    background: var(--landing-emerald-50);
    color: var(--landing-emerald-900);
}

.lg-cta-secondary-btn {
    background: transparent !important;
    color: var(--landing-emerald-200) !important;
    border: 1px solid var(--landing-emerald-200) !important;
    box-shadow: none !important;
}

.lg-cta-secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* ==================== LANDING RESPONSIVE ==================== */
@media (prefers-reduced-motion: reduce) {
    .lg-chat-typing span {
        animation: none;
    }
    .lg-feature-card:hover,
    .lg-btn:hover {
        transform: none;
    }
}

@media (max-width: 1024px) {
    .lg-hero-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        max-width: 640px;
    }

    .lg-hero-content {
        text-align: center;
    }

    .lg-hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .lg-hero-actions {
        justify-content: center;
    }

    .lg-hero-note {
        text-align: center;
    }

    .lg-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lg-chatroom-teaser-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .lg-chatroom-text .lg-section-title,
    .lg-chatroom-text .lg-section-subtitle {
        text-align: center;
    }

    .lg-chatroom-text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .lg-hero {
        padding: 4rem 1.5rem 3rem;
    }

    .lg-hero-title {
        font-size: 6vw;
    }

    .lg-hero-subtitle {
        font-size: var(--text-base);
    }

    .lg-section-title {
        font-size: 1.625rem;
    }

    .lg-features-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .lg-steps-grid {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .lg-step-connector {
        width: 0;
        height: 32px;
        border-top: none;
        border-left: 2px dashed var(--landing-emerald-300);
        margin-top: 0;
    }

    .lg-trust-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .lg-trust-divider {
        display: none;
    }

    .lg-models-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lg-trust-value {
        font-size: 2rem;
    }

    .lg-chat-mockup {
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .stat-cards-3 {
        grid-template-columns: 1fr;
    }

    .model-card {
        padding: 0.75rem 1rem;
    }

    .nav-brand-text {
        font-size: var(--text-lg);
    }

    .mode-tab {
        padding: 0.375rem 0.625rem;
        font-size: var(--text-xs);
    }

    .mode-tab svg {
        display: none;
    }

    .lg-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .lg-btn-large {
        padding: 0.875rem 1.5rem;
    }

    .lg-models-grid {
        grid-template-columns: 1fr;
    }

    .footer-top {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col {
        align-items: center;
    }
}

/* ===================== Logs page ===================== */
.logs-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-ellipsis {
    padding: 0 0.25rem;
    color: var(--text-secondary);
}

.pagination-info {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 0.5rem;
}
