/* ═══════════════════════════════════════════════════════════════════════════
   ArxAI v3.0 — Unified Design System
   ═══════════════════════════════════════════════════════════════════════════
   
   TABLE OF CONTENTS
   ─────────────────
   1.  IMPORTS & RESET .................. Fonts, box-sizing
   2.  DESIGN TOKENS — LIGHT ........... :root variables
   3.  DESIGN TOKENS — DARK ............ [data-theme="dark"] variables
   4.  BASE STYLES ..................... html, body, particles
   5.  LAYOUT .......................... app-layout, sidebar, content
   6.  COMPONENTS — BUTTONS ............ .btn, .btn-primary, etc.
   7.  COMPONENTS — FORMS .............. .form-input, .form-label, etc.
   8.  COMPONENTS — CARDS .............. .card, .admin-kpi-card, etc.
   9.  COMPONENTS — BADGES ............. .badge, .badge-success, etc.
   10. COMPONENTS — ALERTS & TOAST ..... .alert, .toast, etc.
   11. COMPONENTS — TABLES ............. .admin-table, etc.
   12. COMPONENTS — MISC ............... empty-state, pagination, etc.
   13. PAGE — DASHBOARD ................ .admin-kpi-grid, .stats-grid
   14. PAGE — LIBRARY .................. .library-grid, .library-card
   15. PAGE — STUDIO ................... .studio-*, .feature-*
   16. PAGE — STUDIO V4 ................ .studio-shell, .studio-nav-*
   17. PAGE — FEED ..................... .feed-layout, .feed-post-*
   18. PAGE — BILLING & SETTINGS ....... billing, referral, settings
   19. PAGE — ADMIN PANEL .............. Admin-specific overrides
   20. ANIMATIONS & KEYFRAMES .......... fadeIn, slideUp, spin, etc.
   21. UTILITIES ....................... .stagger-enter, etc.
   22. RESPONSIVE — TABLET (≤1080px) ... Media queries
   23. RESPONSIVE — MOBILE (≤768px) .... Media queries
   24. RESPONSIVE — SMALL (≤520px) ..... Media queries

   HOW TO EDIT:
   - Search for section numbers (e.g. "§13") to jump to sections
   - Each section has a clear header with ═══ borders
   - CSS variables are in sections 2-3, change colors/spacing there
   - Admin overrides are in section 19

   ═══════════════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════════════
   §1-12. BASE DESIGN SYSTEM
   From style.css — Reset, tokens, layout, components, utilities, and responsive
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   ArxAI v3 — SaaS Modern Design System
   Inspired by Vercel, Linear, Stripe
   ═══════════════════════════════════════════════════════════════════ */

/* ── CSS Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ── */
:root {
    /* Surfaces — Light (warm cream + subtle blue tint for depth) */
    --bg-root: #f4f5fa;
    --bg-primary: #fefeff;
    --bg-secondary: #f8f9fc;
    --bg-tertiary: #f0f1f8;
    --bg-elevated: #ffffff;
    --bg-hover: #eceef6;
    --bg-active: #e2e4f0;

    /* Borders — visible but soft */
    --border-subtle: rgba(91,63,217,0.07);
    --border-color: rgba(91,63,217,0.12);
    --border-strong: rgba(91,63,217,0.20);
    --border-focus: #5b3fd9;

    /* Text — high contrast, readable */
    --text-primary: #1a1a2e;
    --text-secondary: #3d3d5c;
    --text-tertiary: #6b6b8a;
    --text-muted: #9898b0;
    --text-inverse: #ffffff;

    /* Brand — rich indigo-violet */
    --brand-primary: #5b3fd9;
    --brand-primary-hover: #6d51e8;
    --brand-primary-muted: rgba(91,63,217,0.08);
    --brand-secondary: #00c896;
    --brand-secondary-muted: rgba(0,200,150,0.08);
    --brand-gradient: linear-gradient(135deg, #5b3fd9 0%, #00c896 100%);

    /* Semantic */
    --success: #0d9f4f;
    --success-muted: rgba(13,159,79,0.08);
    --warning: #c27803;
    --warning-muted: rgba(194,120,3,0.08);
    --danger: #c02424;
    --danger-muted: rgba(192,36,36,0.07);
    --info: #1d5ec9;
    --info-muted: rgba(29,94,201,0.07);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows — clean depth */
    --shadow-sm: 0 1px 3px rgba(91,63,217,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(91,63,217,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(91,63,217,0.10), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 24px rgba(91,63,217,0.14);
    --shadow-glow-success: 0 0 20px rgba(13,159,79,0.14);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-display: 'Space Grotesk', var(--font-sans);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --content-max-width: 1200px;

    /* Neon-to-soft mapping (for studio-v4 & feed light mode) */
    --neon-card-bg: rgba(255, 255, 255, 0.96);
    --neon-card-border: rgba(91, 63, 217, 0.14);
    --neon-card-shadow: 0 8px 32px rgba(91, 63, 217, 0.08), 0 2px 8px rgba(0,0,0,0.04);
    --neon-gradient-border-opacity: 0.18;
    --neon-nav-bg: rgba(248, 249, 253, 0.95);
    --neon-nav-border: rgba(91, 63, 217, 0.14);
    --neon-nav-active-bg: linear-gradient(135deg, #5b3fd9 0%, #00c896 100%);
    --neon-nav-active-text: #fff;
    --neon-nav-active-shadow: 0 6px 20px rgba(91, 63, 217, 0.25);
    --neon-accent: #5b3fd9;
    --neon-accent-soft: rgba(91, 63, 217, 0.08);
    --neon-result-bg: rgba(248, 249, 253, 0.90);
    --neon-result-border: rgba(91, 63, 217, 0.12);
    --neon-input-bg: rgba(244, 245, 252, 0.92);
    --neon-tab-bg: rgba(244, 245, 252, 0.85);
    --neon-tab-active-bg: var(--brand-gradient);
    --neon-tab-active-text: #fff;
    --neon-media-bg: rgba(244, 245, 252, 0.92);

    /* Body gradient for light mode depth */
    --body-bg-image: linear-gradient(160deg, #f4f5fa 0%, #eceef6 40%, #f4f5fa 100%);

    /* Toast colors */
    --toast-success-text: #0d6832;
    --toast-error-text: #9b1c1c;
    --toast-info-text: #1e40af;
    --toast-warning-text: #92400e;
}

/* ── Dark Theme — Deep Navy Blue with Neon ── */
[data-theme="dark"] {
    /* Surfaces — Deep navy blue for particles effect */
    --bg-root: #020c1b;
    --bg-primary: #0a1628;
    --bg-secondary: rgba(10, 22, 40, 0.85);
    --bg-tertiary: #0f1e35;
    --bg-elevated: #132744;
    --bg-hover: #1a3050;
    --bg-active: #1f3a5c;
    --border-subtle: rgba(0, 180, 216, 0.08);
    --border-color: rgba(0, 180, 216, 0.15);
    --border-strong: rgba(0, 180, 216, 0.25);
    --text-primary: #e8f0fe;
    --text-secondary: #a0b8d8;
    --text-tertiary: #6889a8;
    --text-muted: #3d5a7a;
    --text-inverse: #020c1b;
    --brand-primary: #00b4d8;
    --brand-primary-hover: #48cae4;
    --brand-primary-muted: rgba(0, 180, 216, 0.10);
    --brand-secondary: #00e09e;
    --brand-secondary-muted: rgba(0, 224, 158, 0.10);
    --brand-gradient: linear-gradient(135deg, #00b4d8 0%, #00e09e 100%);
    --success: #34d399;
    --success-muted: rgba(52,211,153,0.12);
    --warning: #fbbf24;
    --warning-muted: rgba(251,191,36,0.12);
    --danger: #f87171;
    --danger-muted: rgba(248,113,113,0.12);
    --info: #60a5fa;
    --info-muted: rgba(96,165,250,0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.50);
    --shadow-md: 0 4px 14px rgba(0,10,30,0.60);
    --shadow-lg: 0 8px 32px rgba(0,10,30,0.70);
    --shadow-glow: 0 0 24px rgba(0, 180, 216, 0.15);
    --shadow-glow-success: 0 0 20px rgba(52,211,153,0.15);

    /* Neon vars — deep blue with cyan neon accents */
    --neon-card-bg: rgba(10, 22, 40, 0.90);
    --neon-card-border: rgba(0, 180, 216, 0.12);
    --neon-card-shadow: 0 16px 36px rgba(0,10,30,0.6), inset 0 1px 0 rgba(0, 180, 216, 0.05);
    --neon-gradient-border-opacity: 0.35;
    --neon-nav-bg: rgba(10, 22, 40, 0.90);
    --neon-nav-border: rgba(0, 180, 216, 0.10);
    --neon-nav-active-bg: linear-gradient(135deg, #00b4d8 0%, #0096c7 100%);
    --neon-nav-active-text: #ffffff;
    --neon-nav-active-shadow: 0 0 20px rgba(0, 180, 216, 0.25);
    --neon-accent: #00b4d8;
    --neon-accent-soft: rgba(0, 180, 216, 0.10);
    --neon-result-bg: rgba(10, 22, 40, 0.75);
    --neon-result-border: rgba(0, 180, 216, 0.10);
    --neon-input-bg: rgba(10, 18, 32, 0.85);
    --neon-tab-bg: rgba(10, 18, 32, 0.85);
    --neon-tab-active-bg: linear-gradient(135deg, #00b4d8 0%, #0096c7 100%);
    --neon-tab-active-text: #ffffff;
    --neon-media-bg: rgba(2, 12, 27, 0.92);

    /* Body background — deep navy */
    --body-bg-image: none;

    /* Toast colors — dark */
    --toast-success-text: #86efac;
    --toast-error-text: #fca5a5;
    --toast-info-text: #93c5fd;
    --toast-warning-text: #fcd34d;
}

/* ── Base ── */
html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-root);
    background-image: var(--body-bg-image);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ── Particles Canvas ── */
.particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* Particles — re-enable mouse tracking via JS overlay */
.app-layout {
    position: relative;
}

/* Smooth theme transition for all themed elements */
.card, .app-sidebar, .sidebar, .admin-sidebar,
.form-input, .studio-input, .btn,
.studio-panel-wrap, .studio-preview-card,
.quick-card, .template-card, .modal,
.sidebar-user, .sidebar-cta, .user-card,
.app-tool-btn, .mobile-topbar, .app-mobile-header,
.toast, .badge, .alert {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

a { color: var(--brand-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-primary-hover); }

code, pre {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
}

img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--border-subtle); margin: var(--space-lg) 0; }

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-sans);
    font-size: 0.87rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0 rgba(124,92,255,0);
}
.btn-primary:hover:not(:disabled) {
    background: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    border-color: var(--border-color);
}

.card-glow:hover {
    box-shadow: var(--shadow-glow);
    border-color: rgba(124,92,255,0.2);
}

/* ═══════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════ */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-input,
select.form-input,
textarea.form-input,
input[type="text"].form-input,
input[type="email"].form-input,
input[type="password"].form-input,
input[type="number"].form-input,
input[type="url"].form-input {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.87rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-muted);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    min-height: 80px;
    resize: vertical;
}

select.form-input {
    cursor: pointer;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236b6b82' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

/* ═══════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-brand { background: var(--brand-primary-muted); color: var(--brand-primary); }
.badge-success { background: var(--success-muted); color: var(--success); }
.badge-warning { background: var(--warning-muted); color: var(--warning); }
.badge-danger { background: var(--danger-muted); color: var(--danger); }
.badge-info { background: var(--info-muted); color: var(--info); }

/* ═══════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.87rem;
    font-weight: 500;
    border: 1px solid;
}

.alert-error { background: var(--danger-muted); color: var(--danger); border-color: rgba(220,38,38,0.2); }
.alert-success { background: var(--success-muted); color: var(--success); border-color: rgba(22,163,74,0.2); }
.alert-info { background: var(--info-muted); color: var(--info); border-color: rgba(37,99,235,0.2); }
.alert-warning { background: var(--warning-muted); color: var(--warning); border-color: rgba(217,119,6,0.2); }

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead th {
    padding: 10px 14px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    white-space: nowrap;
}

tbody td {
    padding: 10px 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.empty-state-icon { font-size: 2.5rem; margin-bottom: var(--space-md); opacity: 0.6; }
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-sm); }
.empty-state-desc { font-size: 0.85rem; color: var(--text-tertiary); max-width: 400px; margin: 0 auto; }

/* ═══════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════ */
.page-header {
    margin-bottom: var(--space-lg);
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.87rem;
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════
   APP LAYOUT — Sidebar + Content
   ═══════════════════════════════════════════ */
.app-layout {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Sidebar ── */
.app-sidebar,
.sidebar,
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    transition: transform var(--transition-slow);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-gradient);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
}

.sidebar-brand-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-brand-version {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) var(--space-sm);
}

.sidebar-section {
    margin-bottom: var(--space-lg);
}

.sidebar-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: var(--space-sm);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-decoration: none;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--brand-primary-muted);
    color: var(--brand-primary);
    font-weight: 600;
}

.sidebar-link-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-credits {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

/* ── Main Content ── */
.app-content,
.main-content,
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-xl) var(--space-xl) var(--space-2xl);
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    animation: fadeIn 0.3s ease;
}

.page-content {
    max-width: var(--content-max-width);
}

/* Mobile header */
.app-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 90;
    align-items: center;
    padding: 0 var(--space-md);
    gap: var(--space-md);
}

.mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Tool buttons (theme/lang) */
.app-tool-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.app-tool-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.sidebar-tools {
    display: flex;
    gap: 6px;
    padding: 0 var(--space-md) var(--space-md);
}

/* ── Backward-compatible old class names ── */
.sidebar-brand .sidebar-logo,
.sidebar-brand .sidebar-name { display: inherit; }
.sidebar-brand .sidebar-version { font-size: 0.68rem; color: var(--text-muted); padding: 2px 6px; background: var(--bg-tertiary); border-radius: var(--radius-full); }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-decoration: none;
    margin-bottom: 2px;
}
.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.nav-item.nav-active {
    background: var(--brand-primary-muted);
    color: var(--brand-primary);
    font-weight: 600;
}
.nav-item.nav-admin {
    color: var(--warning);
}
.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-bottom {
    padding: var(--space-sm);
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}

.sidebar-cta {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin: var(--space-sm) var(--space-sm) var(--space-md);
}
.sidebar-cta .sidebar-cta-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.sidebar-cta p {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
    line-height: 1.5;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    margin: var(--space-sm);
}
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-email {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-icon-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.btn-icon-sm:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.admin-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 12px 12px 6px;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Mobile top bar */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 90;
    align-items: center;
    padding: 0 var(--space-md);
    gap: var(--space-sm);
}
.mobile-menu-toggle {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}
.mobile-brand {
    display: flex; align-items: center; gap: 6px;
    text-decoration: none; color: var(--text-primary);
}
.mobile-topbar-actions {
    margin-left: auto;
    display: flex; gap: 6px; align-items: center;
}
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height); left: 0; right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 89;
    padding: var(--space-sm);
    flex-direction: column;
}
.mobile-nav.is-open { display: flex; }

.app-tool-btn-mobile {
    width: 32px; height: 32px;
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════ */
.landing-page {
    background: var(--bg-root);
}

.landing-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.landing-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) 0;
    gap: var(--space-md);
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.landing-brand-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-gradient);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
}

.landing-brand-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.landing-brand-version {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

.landing-topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Hero */
.landing-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-2xl);
    align-items: center;
    padding: var(--space-2xl) 0 60px;
}

.landing-hero-content { max-width: 560px; }

.landing-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin: var(--space-md) 0;
    background: linear-gradient(135deg, var(--text-primary) 40%, var(--brand-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.landing-hero-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.landing-kpis {
    display: flex;
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.landing-kpi strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.landing-kpi span {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.landing-hero-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.landing-hero-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 70% 30%, rgba(124,92,255,0.06) 0%, transparent 50%);
    pointer-events: none;
}

.landing-hero-panel h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.benefit-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.benefit-item {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.87rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--brand-primary);
}

.landing-note {
    margin-top: var(--space-md);
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Sections */
.landing-section {
    padding: 60px 0;
}

.landing-section-head {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.landing-section-head h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.landing-section-head p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Template grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-md);
}

.template-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-normal);
}

.template-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.template-tags { margin-bottom: var(--space-sm); }

.template-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.template-card p {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    line-height: 1.6;
}

/* Pricing grid */
.landing-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.landing-pricing-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: all var(--transition-normal);
}

.landing-pricing-card.is-highlight {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-glow);
    position: relative;
}

.landing-pricing-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.landing-pricing-price {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: var(--space-sm);
}

.landing-pricing-card p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* CTA */
.landing-cta {
    text-align: center;
    padding: 60px 0 80px;
}

.landing-cta h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.landing-cta p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* ═══════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.auth-brand {
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(circle at 40% 50%, rgba(124,92,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.auth-brand-content {
    max-width: 420px;
    position: relative;
}

.auth-logo {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-gradient);
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
}

.auth-brand-name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.auth-brand-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-xl);
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.auth-feature-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.auth-feature strong {
    display: block;
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.auth-feature span {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.auth-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
}

.auth-form-inner {
    width: 100%;
    max-width: 400px;
}

.auth-tools {
    display: flex;
    gap: 6px;
    margin-bottom: var(--space-lg);
}

.auth-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.auth-subtitle {
    font-size: 0.87rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
}

.auth-subtitle a {
    color: var(--brand-primary);
    font-weight: 600;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-footer {
    margin-top: var(--space-xl);
    text-align: center;
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   DASHBOARD — Sales Hero
   ═══════════════════════════════════════════ */
.sales-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.sales-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 60%;
    height: 180%;
    background: radial-gradient(ellipse, rgba(124,92,255,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.sales-hero-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--space-sm) 0 var(--space-sm);
    line-height: 1.3;
}

.sales-hero-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.sales-hero-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.sales-kpi-grid {
    display: flex;
    gap: var(--space-xl);
}

.sales-kpi-item strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sales-kpi-item span {
    font-size: 0.76rem;
    color: var(--text-tertiary);
}

.sales-hero-panel {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.sales-hero-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.sales-hero-panel p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* Quick grid */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.quick-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.quick-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.quick-card-icon { font-size: 1.8rem; margin-bottom: var(--space-sm); }
.quick-card-label { font-size: 0.87rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.quick-card-desc { font-size: 0.76rem; color: var(--text-tertiary); }

/* Credits badge */
.credits-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.credits-value {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--brand-primary);
}

/* ═══════════════════════════════════════════
   STUDIO
   ═══════════════════════════════════════════ */
.studio-shell {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--space-lg);
    align-items: flex-start;
}

.studio-panel-wrap {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.studio-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
}

.studio-tab-btn {
    flex: 1;
    padding: 12px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.studio-tab-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.studio-tab-btn.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }

.studio-panel { display: none; padding: var(--space-lg); }
.studio-panel.is-active { display: block; }

.studio-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.studio-section-note {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.studio-module {
    margin-bottom: var(--space-md);
}

.studio-module-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.studio-field {
    margin-bottom: var(--space-md);
}

.studio-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.studio-input {
    width: 100%;
    padding: 9px 12px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
    resize: vertical;
}

.studio-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-muted);
}

.studio-input::placeholder { color: var(--text-muted); }

textarea.studio-input { min-height: 72px; }

.studio-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Chips */
.studio-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.studio-chip {
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.studio-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.studio-chip.active { background: var(--brand-primary-muted); border-color: var(--brand-primary); color: var(--brand-primary); }

/* Ratio */
.studio-ratio-row {
    display: flex;
    gap: 6px;
}

.studio-ratio-btn {
    flex: 1;
    padding: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.studio-ratio-btn:hover { border-color: var(--border-strong); }
.studio-ratio-btn.active { background: var(--brand-primary-muted); border-color: var(--brand-primary); color: var(--brand-primary); }

/* Grid helpers */
.studio-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.studio-slider-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

/* Toggle switch */
.studio-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.studio-switch input { display: none; }

.studio-switch-ui {
    width: 38px;
    height: 20px;
    background: var(--bg-active);
    border-radius: 10px;
    position: relative;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.studio-switch-ui::after {
    content: '';
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-fast);
}

.studio-switch input:checked + .studio-switch-ui {
    background: var(--brand-primary);
}

.studio-switch input:checked + .studio-switch-ui::after {
    transform: translateX(18px);
}

.studio-switch-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.studio-feature-toggle {
    margin-top: var(--space-sm);
}

.studio-advanced-toggle-row {
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

/* Action */
.studio-form-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.studio-action-btn {
    flex: 1;
}

/* Inline alert */
.studio-inline-alert {
    margin: var(--space-md) 0 0;
}

/* Stage (preview) */
.studio-stage {
    position: sticky;
    top: var(--space-lg);
}

.studio-stage-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    gap: var(--space-md);
}

.studio-stage-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.studio-stage-subtitle {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.studio-preview-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    min-height: 300px;
}

.studio-preview-card img {
    border-radius: var(--radius-md);
    max-width: 100%;
}

/* Upsell */
.studio-upsell {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.studio-upsell h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.studio-upsell p {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.studio-upsell-grid {
    display: grid;
    gap: var(--space-sm);
}

.studio-upsell-item {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--brand-secondary);
}

/* Reference preview */
.studio-reference-preview {
    margin-top: 10px;
}

.studio-reference-thumb {
    width: 112px;
    height: 112px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--border-subtle);
}

.studio-reference-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.studio-reference-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* Editor */
.studio-editor-wrap {
    position: relative;
}

.studio-editor-canvas-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.studio-editor-canvas {
    max-width: 100%;
    border-radius: var(--radius-md);
}

.studio-editor-meta {
    margin-top: var(--space-sm);
    font-size: 0.76rem;
    color: var(--text-muted);
    text-align: center;
}

/* Editor toolbar */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.editor-tool-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.editor-tool-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.editor-tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.editor-tool-btn span {
    font-size: 1.1rem;
}

/* Resize row */
.editor-resize-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.editor-resize-input {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 80px;
}

.editor-resize-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 20px;
}

.editor-resize-input .studio-input {
    width: 100%;
}

.editor-resize-lock {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.editor-resize-lock.is-locked {
    background: var(--brand-primary-muted);
    border-color: var(--brand-primary);
}

.editor-resize-lock:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Export row */
.editor-export-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Slider */
.studio-slider {
    width: 100%;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-active);
    border-radius: 3px;
    outline: none;
    margin-top: 6px;
}

.studio-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--brand-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.studio-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fadeIn { animation: fadeIn 0.4s ease forwards; }
.animate-slideUp { animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-pulse { animation: pulse 1.8s ease-in-out infinite; }

/* ═══════════════════════════════════════════
   STUDIO — COLLAPSIBLE STEPS
   ═══════════════════════════════════════════ */
.studio-step {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    background: var(--bg-secondary);
    overflow: hidden;
}

.studio-step-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px var(--space-md);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background var(--transition-fast);
}

.studio-step-header:hover {
    background: var(--bg-hover);
}

.studio-step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary-muted);
    color: var(--brand-primary);
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.studio-step-title {
    flex: 1;
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--text-primary);
}

.studio-step-toggle {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.studio-step.is-open .studio-step-toggle {
    transform: rotate(90deg);
}

.studio-step-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 var(--space-md);
}

.studio-step.is-open .studio-step-body {
    max-height: 2000px;
    padding: 0 var(--space-md) var(--space-md);
}

/* ═══════════════════════════════════════════
   STICKY ACTION BAR (mobile studio CTA)
   ═══════════════════════════════════════════ */
.sticky-action-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    padding: 12px var(--space-md);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    align-items: center;
    gap: 12px;
}

.sticky-action-bar .sticky-credits {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sticky-action-bar .sticky-credits strong {
    color: var(--brand-primary);
    font-family: var(--font-display);
}

.sticky-action-bar .btn {
    flex: 1;
    min-width: 0;
}

/* ═══════════════════════════════════════════
   BUTTON LOADING STATE
   ═══════════════════════════════════════════ */
.btn.is-loading {
    pointer-events: none;
    opacity: 0.8;
    position: relative;
}

.btn.is-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════
   SKELETON LOADER
   ═══════════════════════════════════════════ */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--bg-hover) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
}

.skeleton-text:last-child { width: 60%; }

.skeleton-image {
    aspect-ratio: 1;
    width: 100%;
    border-radius: var(--radius-md);
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-lg);
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
    width: calc(100% - 40px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid;
    animation: toastIn 0.3s ease forwards;
    position: relative;
    overflow: hidden;
}

.toast.is-dismissing {
    animation: toastOut 0.3s ease forwards;
}

.toast-success { background: var(--success-muted); color: var(--toast-success-text); border-color: rgba(34,197,94,0.2); }
.toast-error { background: var(--danger-muted); color: var(--toast-error-text); border-color: rgba(239,68,68,0.2); }
.toast-info { background: var(--info-muted); color: var(--toast-info-text); border-color: rgba(59,130,246,0.2); }
.toast-warning { background: var(--warning-muted); color: var(--toast-warning-text); border-color: rgba(245,158,11,0.2); }

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
    flex-shrink: 0;
}

.toast-close:hover { opacity: 1; }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toastProgress 4s linear forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ═══════════════════════════════════════════
   STUDIO PREVIEW STATES
   ═══════════════════════════════════════════ */
.studio-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-tertiary);
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(255,255,255,0.01) 20px,
        rgba(255,255,255,0.01) 40px
    );
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

.studio-preview-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.4;
}

.studio-preview-empty-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.studio-preview-empty-desc {
    font-size: 0.82rem;
    max-width: 300px;
}

.studio-preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: var(--space-md);
}

.studio-preview-loading-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.studio-preview-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ═══════════════════════════════════════════
   STUDIO GENERATION PROGRESS
   ═══════════════════════════════════════════ */
.studio-progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: var(--space-md);
    padding: var(--space-2xl);
    text-align: center;
}

.studio-progress-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border-color);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.studio-progress-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.studio-progress-desc {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    max-width: 320px;
}

.studio-progress-bar-wrap {
    width: 100%;
    max-width: 280px;
    height: 6px;
    background: var(--bg-active);
    border-radius: 3px;
    overflow: hidden;
}

.studio-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 3px;
    animation: progressPulse 2s ease-in-out infinite;
    width: 30%;
}

@keyframes progressPulse {
    0% { width: 20%; margin-left: 0; }
    50% { width: 50%; margin-left: 25%; }
    100% { width: 20%; margin-left: 80%; }
}

.studio-progress-steps {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.studio-progress-step {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.studio-progress-step.is-active {
    color: var(--brand-primary);
    font-weight: 600;
}

.studio-progress-step.is-done {
    color: var(--success);
}

.studio-progress-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-active);
    transition: all var(--transition-fast);
}

.studio-progress-step.is-active .studio-progress-step-dot {
    background: var(--brand-primary);
    box-shadow: 0 0 6px var(--brand-primary-muted);
    animation: pulse 1.5s ease-in-out infinite;
}

.studio-progress-step.is-done .studio-progress-step-dot {
    background: var(--success);
}

.studio-progress-timer {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: var(--space-xs);
}

/* ═══════════════════════════════════════════
   FOCUS VISIBILITY (Accessibility)
   ═══════════════════════════════════════════ */
.btn:focus-visible,
.studio-chip:focus-visible,
.studio-ratio-btn:focus-visible,
.studio-tab-btn:focus-visible,
.sidebar-link:focus-visible,
.quick-card:focus-visible,
.template-card:focus-visible,
.app-tool-btn:focus-visible,
.landing-pricing-card:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--brand-primary-muted);
}

/* ═══════════════════════════════════════════
   FORM VALIDATION STATES (P2.3)
   ═══════════════════════════════════════════ */
.form-input.is-invalid {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.15);
}

.form-input.is-valid {
    border-color: var(--success);
}

.form-error {
    font-size: 0.72rem;
    color: var(--error);
    margin-top: 4px;
    min-height: 0;
    transition: all 0.2s ease;
}

.form-input.is-invalid ~ .form-error {
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ═══════════════════════════════════════════
   ACCESSIBILITY (P2.4)
   ═══════════════════════════════════════════ */
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Skip-to-content link */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    background: var(--brand-primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    text-decoration: none;
}

.skip-to-content:focus {
    top: 16px;
}

/* ═══════════════════════════════════════════
   MODAL / DIALOG SYSTEM (P2.7)
   ═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    padding: var(--space-lg);
}

.modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s ease;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.modal-overlay.is-active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.modal-close:hover {
    background: var(--bg-active);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--border-subtle);
}

@media (max-width: 480px) {
    .modal {
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 90vh;
    }
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
}

/* ═══════════════════════════════════════════
   TYPOGRAPHY SCALE (P2.8)
   ═══════════════════════════════════════════ */
:root {
    --text-xs: 0.72rem;
    --text-sm: 0.82rem;
    --text-base: 0.92rem;
    --text-md: 1rem;
    --text-lg: 1.15rem;
    --text-xl: 1.35rem;
    --text-2xl: 1.75rem;
    --text-3xl: 2.2rem;

    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;

    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;
}

/* ═══════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.card-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════
   LIBRARY PAGE
   ═══════════════════════════════════════════ */
.library-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.library-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.library-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-md);
}

.library-card-img {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.library-card-img img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.library-card-img:hover img {
    transform: scale(1.05);
}

.library-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

.library-card-img:hover .library-card-overlay {
    opacity: 1;
}

.library-card-body {
    padding: var(--space-md);
}

.library-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.library-card-prompt {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.library-card-actions {
    display: flex;
    gap: 8px;
}

/* Library Toolbar */
.library-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.library-toolbar-left,
.library-toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.library-sort-group,
.library-view-group {
    display: flex;
    gap: 4px;
}

.library-sort-group .btn.is-active,
.library-view-group .btn.is-active {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    background: var(--bg-active);
}

.library-select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Card selection checkbox */
.library-card-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.library-card:hover .library-card-select,
.library-card.is-selected .library-card-select {
    opacity: 1;
}

.library-card {
    position: relative;
}

.library-card.is-selected {
    outline: 2px solid var(--brand-primary);
    outline-offset: -2px;
}

.library-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

/* List view mode */
.library-grid-list {
    grid-template-columns: 1fr !important;
}

.library-grid-list .library-card {
    display: grid;
    grid-template-columns: 140px 1fr;
}

.library-grid-list .library-card-img img {
    aspect-ratio: 1;
    height: 140px;
    width: 140px;
}

@media (max-width: 768px) {
    .library-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .library-grid-list .library-card {
        grid-template-columns: 100px 1fr;
    }
    .library-grid-list .library-card-img img {
        height: 100px;
        width: 100px;
    }
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox-overlay.is-active {
    display: flex;
}

.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 100001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-content {
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    max-height: 90vh;
    overflow-y: auto;
    pointer-events: auto;
    z-index: 100000;
}

.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-xl);
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,.4);
}

.lightbox-meta {
    text-align: center;
    color: #fff;
    max-width: 600px;
}

.lightbox-prompt {
    font-size: 0.88rem;
    line-height: 1.5;
    opacity: 0.9;
    margin-bottom: var(--space-sm);
}

.lightbox-info {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.lightbox-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Lightbox Navigation Arrows */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 100001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.08);
}

.lightbox-nav-prev { left: 16px; }
.lightbox-nav-next { right: 16px; }

/* Lightbox Counter */
.lightbox-counter {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 16px;
    z-index: 100001;
    letter-spacing: 0.5px;
}

/* Lightbox Loading Spinner */
.lightbox-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    pointer-events: none;
}

.lightbox-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--brand-primary, #00d4ff);
    border-radius: 50%;
    animation: lightbox-spin 0.8s linear infinite;
}

@keyframes lightbox-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 36px;
        height: 36px;
    }
    .lightbox-nav-prev { left: 8px; }
    .lightbox-nav-next { right: 8px; }
    .lightbox-counter { font-size: 0.72rem; padding: 3px 10px; }
}

@media (max-width: 1200px) {
    .library-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .library-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .library-grid { grid-template-columns: 1fr; }
}

/* Pagination SVG arrow fix — prevent massive overflow */
.pagination svg,
nav[role="navigation"] svg,
.library-grid + div svg {
    width: 1.2em !important;
    height: 1.2em !important;
    max-width: 20px !important;
    max-height: 20px !important;
    display: inline-block;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════
   ADMIN USERS ENHANCEMENTS
   ═══════════════════════════════════════════ */
.admin-filters-card {
    margin-bottom: var(--space-lg);
}

.admin-filters-form {
    display: flex;
    gap: var(--space-md);
    align-items: flex-end;
    flex-wrap: wrap;
}

.admin-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.admin-filter-search {
    flex: 1;
    min-width: 220px;
}

.admin-filter-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-filter-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.85rem;
    width: 100%;
    transition: border-color var(--transition-fast);
}

.admin-filter-input:focus {
    border-color: var(--brand-primary);
    outline: none;
}

.admin-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-subtle);
}

.admin-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--bg-active);
    border-radius: 12px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.sort-header {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}

.sort-header:hover {
    color: var(--brand-primary);
}

.sort-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.4;
}

.sort-icon.active {
    color: var(--brand-primary);
    opacity: 1;
}

.user-info-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-inline-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.admin-inline-select:focus {
    border-color: var(--brand-primary);
    outline: none;
}

.admin-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

.admin-pagination-info {
    text-align: center;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.text-muted { color: var(--text-muted); }

.status-active { color: var(--success); }
.status-suspended { color: var(--warning); }
.status-banned { color: var(--error); }

@media (max-width: 768px) {
    .admin-filters-form {
        flex-direction: column;
    }
    .admin-filter-group {
        min-width: 100%;
    }
}

/* ═══════════════════════════════════════════
   BILLING PAGE
   ═══════════════════════════════════════════ */
.billing-balance-card {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-2xl);
    color: #fff;
    margin-bottom: var(--space-2xl);
}

.billing-balance-main {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.billing-balance-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.2));
}

.billing-balance-amount {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.billing-balance-label {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 2px;
}

.billing-balance-meta {
    display: flex;
    gap: var(--space-xl);
    font-size: 0.82rem;
    opacity: 0.9;
}

.billing-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.billing-section-desc {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
}

.billing-packages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.billing-package {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    position: relative;
    transition: all var(--transition-fast);
}

.billing-package:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-md);
}

.billing-package.is-popular {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--brand-primary-muted);
}

.billing-package-badge-popular {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 12px;
    white-space: nowrap;
}

.billing-package-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.billing-package-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.billing-package-credits {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.billing-package-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.billing-package-save {
    display: inline-block;
    background: var(--success);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    margin-bottom: var(--space-sm);
}

.billing-package-desc {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
    min-height: 36px;
}

.billing-package .btn {
    width: 100%;
}

.billing-payment-section {
    margin-top: var(--space-xl);
}

.billing-payment-grid {
    margin-top: var(--space-md);
}

.billing-payment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
}

.billing-payment-row:last-child {
    border-bottom: none;
}

.billing-bank-details {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.text-success { color: var(--success); }
.text-danger { color: var(--error); }
.text-brand { color: var(--brand-primary); }

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.status-pending {
    background: var(--warning);
    color: #fff;
}

.status-completed {
    background: var(--success);
    color: #fff;
}

@media (max-width: 768px) {
    .billing-packages {
        grid-template-columns: 1fr;
    }
    .billing-balance-meta {
        flex-direction: column;
        gap: var(--space-xs);
    }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .studio-shell {
        grid-template-columns: 1fr;
    }
    .studio-stage {
        position: static;
    }
}

@media (max-width: 768px) {
    .app-sidebar,
    .sidebar,
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.is-open,
    .sidebar.is-open,
    .admin-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay.is-open {
        display: block;
    }

    .app-mobile-header,
    .mobile-topbar {
        display: flex;
    }

    .app-content,
    .main-content,
    .admin-main {
        margin-left: 0;
        padding: calc(var(--header-height) + var(--space-md)) var(--space-md) var(--space-xl);
    }

    .landing-hero {
        grid-template-columns: 1fr;
        padding: var(--space-xl) 0;
    }

    .landing-title {
        font-size: 1.8rem;
    }

    .landing-kpis {
        gap: var(--space-md);
    }

    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

    .sales-hero {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-grid {
        grid-template-columns: 1fr 1fr;
    }

    .landing-pricing-grid {
        grid-template-columns: 1fr;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }

    .studio-slider-grid {
        grid-template-columns: 1fr;
    }

    .studio-grid-2 {
        grid-template-columns: 1fr;
    }

    .sticky-action-bar {
        display: flex;
    }

    .studio-panel {
        padding-bottom: 80px;
    }

    .studio-step-body {
        padding: 0 var(--space-sm);
    }

    .studio-step.is-open .studio-step-body {
        padding: 0 var(--space-sm) var(--space-md);
    }

    .sales-hero-panel {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: 1fr; }
    .landing-hero-actions { flex-direction: column; }
    .sales-hero-actions { flex-direction: column; }
    .sales-kpi-grid { flex-direction: column; gap: var(--space-md); }
}

/* ═══════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════════ */
::selection {
    background: var(--brand-primary-muted);
    color: var(--brand-primary);
}

/* ═══════════════════════════════════════════
   ADMIN MOBILE TABLE → CARD LIST (P3.3)
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Convert admin tables to card list */
    .table-wrap table thead {
        display: none;
    }
    .table-wrap table,
    .table-wrap table tbody,
    .table-wrap table tr,
    .table-wrap table td {
        display: block;
        width: 100%;
    }
    .table-wrap table tr {
        background: var(--bg-secondary);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        padding: var(--space-md);
        margin-bottom: var(--space-sm);
    }
    .table-wrap table td {
        padding: 4px 0;
        text-align: left !important;
        font-size: 0.85rem;
        border: none;
        max-width: 100% !important;
        white-space: normal !important;
        overflow: visible !important;
    }
    .table-wrap table td::before {
        content: attr(data-label);
        display: inline-block;
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.72rem;
        text-transform: uppercase;
        min-width: 100px;
        margin-right: 8px;
    }
    .table-wrap table td:empty {
        display: none;
    }

    /* Compact stats on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    .stat-card {
        padding: var(--space-md);
    }
    .stat-value {
        font-size: 1.1rem;
    }

    /* Stack admin filters on mobile */
    .admin-filters-form {
        flex-direction: column;
    }
    .admin-filter-group {
        min-width: 100%;
    }
    .admin-filter-actions {
        width: 100%;
        justify-content: stretch;
    }
    .admin-filter-actions .btn {
        flex: 1;
    }

    /* Admin pagination mobile */
    .admin-pagination {
        flex-wrap: wrap;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   UI/UX POLISH — Global Enhancements
   ═══════════════════════════════════════════════════════════════════ */

/* ── Stagger entrance animation ── */
@keyframes staggerFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.stagger-enter > * {
    opacity: 0;
    animation: staggerFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.stagger-enter > *:nth-child(1) { animation-delay: 0.04s; }
.stagger-enter > *:nth-child(2) { animation-delay: 0.08s; }
.stagger-enter > *:nth-child(3) { animation-delay: 0.12s; }
.stagger-enter > *:nth-child(4) { animation-delay: 0.16s; }
.stagger-enter > *:nth-child(5) { animation-delay: 0.20s; }
.stagger-enter > *:nth-child(6) { animation-delay: 0.24s; }
.stagger-enter > *:nth-child(7) { animation-delay: 0.28s; }
.stagger-enter > *:nth-child(8) { animation-delay: 0.32s; }

/* ═══════════════════════════════════════════
   LANDING PAGE POLISH
   ═══════════════════════════════════════════ */

/* Animated gradient orb background */
.landing-page::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(124,92,255,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 12s ease-in-out infinite alternate;
}
.landing-page::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -15%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(6,214,160,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 15s ease-in-out infinite alternate-reverse;
}

@keyframes orbFloat {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(30px, -20px) scale(1.05); }
    100% { transform: translate(-20px, 15px) scale(0.95); }
}

.landing-shell { position: relative; z-index: 1; }

/* Landing badge glow */
.landing-hero .badge {
    animation: badgePulse 3s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.3); }
    50%      { box-shadow: 0 0 12px 4px rgba(59,130,246,0.15); }
}

/* Feature cards stagger */

.template-card {
    position: relative;
    overflow: hidden;
}

/* Add subtle top accent bar to template cards */
.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.template-card:hover::before {
    opacity: 1;
}

/* Pricing card enhanced hover */
.landing-pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.landing-pricing-card.is-highlight {
    background: linear-gradient(var(--bg-secondary), var(--bg-secondary)) padding-box,
                var(--brand-gradient) border-box;
    border: 2px solid transparent;
}

/* Landing footer */
.landing-footer {
    text-align: center;
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: var(--space-2xl);
}

.landing-footer a {
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}
.landing-footer a:hover {
    color: var(--brand-primary);
}

/* ═══════════════════════════════════════════
   AUTH PAGES POLISH
   ═══════════════════════════════════════════ */

/* Left brand panel: subtle animated gradient */
.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -40%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(6,214,160,0.06) 0%, transparent 60%);
    pointer-events: none;
    animation: orbFloat 18s ease-in-out infinite alternate;
}

/* Auth form glass effect */
.auth-form-wrap {
    background: var(--bg-root);
    position: relative;
}

/* Input group with icon support */
.form-input-wrap {
    position: relative;
}

.form-input-wrap .form-input {
    padding-right: 44px;
}

.form-input-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
    z-index: 1;
}

.form-input-toggle:hover {
    color: var(--text-primary);
}

/* Auth form submit animation */
.auth-form .btn-primary {
    position: relative;
    overflow: hidden;
}

.auth-form .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.auth-form .btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

/* Auth feature items hover */
.auth-feature {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.auth-feature:hover {
    background: rgba(255,255,255,0.03);
}

/* ═══════════════════════════════════════════
   SIDEBAR POLISH
   ═══════════════════════════════════════════ */

/* Active link left bar indicator */
.sidebar-link.active {
    position: relative;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--brand-primary);
    border-radius: 0 3px 3px 0;
}

/* Nav item active bar too */
.nav-item.nav-active {
    position: relative;
}

.nav-item.nav-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--brand-primary);
    border-radius: 0 3px 3px 0;
}

/* Sidebar user card hover */
.sidebar-user {
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-sm);
}

/* Credits display with mini progress bar */
.sidebar-credits-bar {
    width: 100%;
    height: 3px;
    background: var(--bg-active);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.sidebar-credits-bar-fill {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* ═══════════════════════════════════════════
   DASHBOARD POLISH
   ═══════════════════════════════════════════ */

/* Hero card gradient border on hover */
.sales-hero {
    transition: box-shadow var(--transition-normal);
}

.sales-hero:hover {
    box-shadow: 0 0 30px rgba(124,92,255,0.08);
}

/* Stat card hover glow */
.stat-card {
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Quick card press effect */
.quick-card:active {
    transform: translateY(0) scale(0.98);
}

/* Section separator */
.dashboard-section {
    margin-bottom: var(--space-xl);
}

.dashboard-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Recent activity table row hover */
.card table tbody tr {
    transition: background var(--transition-fast), transform var(--transition-fast);
}

/* ═══════════════════════════════════════════
   STUDIO POLISH (Priority)
   ═══════════════════════════════════════════ */

/* Sliding tab indicator */
.studio-tabs {
    position: relative;
}

.studio-tab-btn {
    position: relative;
    z-index: 1;
}

.studio-tab-btn.active {
    background: rgba(124,92,255,0.05);
}

/* Tab icon styling */
.studio-tab-icon {
    font-size: 1rem;
    margin-right: 4px;
}

/* Step completion state */
.studio-step.is-completed .studio-step-number {
    background: var(--success-muted);
    color: var(--success);
}

.studio-step.is-completed .studio-step-title {
    color: var(--text-tertiary);
}

/* Ant-march dashed border for empty preview */
@keyframes antMarch {
    to { stroke-dashoffset: -20; }
}

.studio-preview-empty {
    background: none;
    position: relative;
}

.studio-preview-empty::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
    animation: dashMove 1s linear infinite;
    pointer-events: none;
}

@keyframes dashMove {
    to { border-color: var(--border-strong); }
}

/* Generate button idle pulse */
.studio-action-btn.btn-primary:not(.is-loading):not(:disabled) {
    animation: gentlePulse 3s ease-in-out infinite;
}

.studio-action-btn.btn-primary:hover {
    animation: none;
}

@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124,92,255,0); }
    50%      { box-shadow: 0 0 16px 4px rgba(124,92,255,0.2); }
}

/* Studio panel scrollbar */
.studio-panel-wrap {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-active) transparent;
}

/* Studio step header improved */
.studio-step-header {
    border-radius: var(--radius-md);
}

/* Studio chip enhanced */
.studio-chip {
    transition: all var(--transition-fast);
}

.studio-chip:active {
    transform: scale(0.95);
}

/* Ratio button enhanced */
.studio-ratio-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* Studio status indicator */
.studio-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    flex-shrink: 0;
}

.studio-status-dot.is-idle     { background: var(--text-muted); }
.studio-status-dot.is-working  { background: var(--warning); animation: pulse 1.5s infinite; }
.studio-status-dot.is-done     { background: var(--success); }
.studio-status-dot.is-error    { background: var(--danger); }

/* ═══════════════════════════════════════════
   LIBRARY POLISH
   ═══════════════════════════════════════════ */

/* Card image skeleton placeholder */
.library-card-img {
    background: var(--bg-tertiary);
}

/* Improved overlay */
.library-card-overlay {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.45);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

/* Lightbox enhanced — already styled in main section */

/* Video elements in library cards — match image sizing */
.library-card-img video {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    border-radius: 0;
    transition: transform 0.3s ease;
}
.library-card-img:hover video {
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════
   TEMPLATES POLISH
   ═══════════════════════════════════════════ */

/* Template card icon area */
.template-card .template-tags {
    margin-bottom: var(--space-sm);
}

/* Template card CTA button hover */
.template-card .btn {
    margin-top: var(--space-md);
    transition: all var(--transition-normal);
}

.template-card:hover .btn {
    transform: translateX(2px);
}

/* Template card description clamp */
.template-card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══════════════════════════════════════════
   BILLING POLISH
   ═══════════════════════════════════════════ */

/* Balance card animated shimmer */
@keyframes shimmerGradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.billing-balance-card {
    background: linear-gradient(-45deg,
        #7c5cff, #6d4fe0,
        #06d6a0, #05b388,
        #7c5cff
    );
    background-size: 300% 300%;
    animation: shimmerGradient 8s ease infinite;
}

/* Package card glow ring */
.billing-package {
    position: relative;
}

.billing-package::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-xl) + 2px);
    background: var(--brand-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.billing-package:hover::before {
    opacity: 0.15;
}

.billing-package.is-popular::before {
    opacity: 0.2;
}

/* Studio lightweight runtime layout (Laravel parity pass) */
.studio-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 8px;
}

.studio-tab:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.studio-tab.active {
    color: #071325;
    background: linear-gradient(130deg, #4ce3ff 0%, #68baff 42%, #8f96ff 66%, #aa79ff 100%);
    border-color: rgba(76, 227, 255, 0.8);
}

.studio-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.studio-result-item {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.studio-result-media {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
}

.studio-result-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.studio-result-meta {
    padding: 10px 12px 12px;
}

.studio-result-title {
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.studio-result-prompt {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.studio-result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.studio-content-block {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-tertiary);
}

.studio-content-block h4 {
    margin: 0 0 6px;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.studio-content-block p,
.studio-content-block li {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Package price number animation on hover */
.billing-package:hover .billing-package-price {
    color: var(--brand-primary);
    transition: color var(--transition-fast);
}

/* Payment section step indicator */
.billing-payment-grid {
    position: relative;
}

.billing-bank-details {
    border-left: 3px solid var(--brand-primary);
}

/* ═══════════════════════════════════════════
   SETTINGS POLISH
   ═══════════════════════════════════════════ */

/* Disabled inputs visual */
.form-input:disabled,
.form-input[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(255,255,255,0.015) 4px,
        rgba(255,255,255,0.015) 8px
    );
}

/* Settings card title icon */
.card-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Password strength indicator */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.password-strength-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--bg-active);
    transition: background var(--transition-fast);
}

.password-strength-bar.is-weak   { background: var(--danger); }
.password-strength-bar.is-medium { background: var(--warning); }
.password-strength-bar.is-strong { background: var(--success); }

.password-strength-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════
   ADMIN POLISH
   ═══════════════════════════════════════════ */

/* Admin sidebar brand icon */
.admin-sidebar .sidebar-brand-icon {
    background: linear-gradient(135deg, var(--warning), var(--danger));
}

/* Admin page header */
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   GLOBAL MICRO-ANIMATIONS
   ═══════════════════════════════════════════ */

/* Card entrance from page load */
.card {
    animation: fadeIn 0.35s ease forwards;
}

/* Button click ripple */
.btn:active:not(:disabled) {
    transform: scale(0.97);
}

/* Link underline animation */
.auth-subtitle a,
.landing-footer a {
    position: relative;
}

.auth-subtitle a::after,
.landing-footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--brand-primary);
    transition: width var(--transition-fast);
}

.auth-subtitle a:hover::after,
.landing-footer a:hover::after {
    width: 100%;
}

/* Badge hover subtle zoom */
.badge {
    transition: transform var(--transition-fast);
}

.badge:hover {
    transform: scale(1.05);
}

/* Page title entrance */
.page-title {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Smooth focus for all interactive elements */
.btn,
.form-input,
.studio-input,
.studio-chip,
.studio-ratio-btn,
.studio-tab-btn,
.admin-filter-input {
    transition-property: background, border-color, box-shadow, color, transform, opacity;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* ═══════════════════════════════════════════
   MOBILE RESPONSIVE POLISH
   ═══════════════════════════════════════════ */

/* Table overflow swipe hint */
.table-responsive,
.table-wrap {
    position: relative;
}

.table-responsive::after,
.table-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(90deg, transparent, var(--bg-root));
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.table-responsive.is-scrollable::after,
.table-wrap.is-scrollable::after {
    opacity: 1;
}

@media (max-width: 768px) {
    /* Landing topbar compact */
    .landing-topbar {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .landing-topbar-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .landing-topbar-actions .btn-ghost {
        display: none;
    }

    /* Auth mobile polish */
    .auth-form-wrap {
        padding: var(--space-xl) var(--space-md);
    }

    .auth-form-inner {
        max-width: 100%;
    }

    /* Dashboard mobile spacing */
    .sales-hero {
        padding: var(--space-md);
    }

    .sales-hero-title {
        font-size: 1.2rem;
    }

    .sales-hero-desc {
        font-size: 0.85rem;
    }

    /* Billing mobile */
    .billing-balance-card {
        padding: var(--space-lg);
    }

    .billing-balance-amount {
        font-size: 1.8rem;
    }

    /* Settings mobile  */
    .settings-grid {
        gap: var(--space-md);
    }

    /* Template cards mobile spacing */
    .template-card {
        padding: var(--space-md);
    }

    /* Page title smaller on mobile */
    .page-title {
        font-size: 1.3rem;
    }

    /* Compact cards */
    .card {
        padding: var(--space-md);
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .billing-balance-main {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }

    .landing-hero-content {
        text-align: center;
    }

    .landing-hero-actions {
        justify-content: center;
    }

    .landing-kpis {
        justify-content: center;
        text-align: center;
    }

    .auth-tools {
        justify-content: flex-end;
    }

    /* Sidebar user compact */
    .sidebar-user-name {
        font-size: 0.78rem;
    }

    .sidebar-user-credits {
        font-size: 0.68rem;
    }
}

/* ═══════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════ */
@media print {
    .app-sidebar,
    .admin-sidebar,
    .sidebar,
    .app-mobile-header,
    .mobile-topbar,
    .sidebar-overlay,
    .sticky-action-bar,
    .toast-container {
        display: none !important;
    }

    .app-content,
    .main-content,
    .admin-main {
        margin-left: 0 !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}

/* ═══════════════════════════════════════════
   REDUCED MOTION PREFERENCE
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   §15. PAGE — STUDIO
   Studio page layout and components
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   Studio — Uses main design system tokens
   ═══════════════════════════════════════════ */

.app-shell {
    max-width: 1260px;
    margin: 0 auto;
    padding: 28px 20px 40px;
}

.studio-header {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
}

.studio-header h1 {
    margin: 0;
    font-size: 2rem;
    font-family: var(--font-display);
    color: var(--text-primary);
}

.studio-header p {
    margin: 8px 0 0;
    color: var(--text-secondary);
}

.studio-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
}

.feature-list {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 14px;
}

.feature-list-heading {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--brand-primary);
    margin-bottom: 10px;
    font-weight: 700;
}

.feature-item {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    padding: 12px;
    margin-bottom: 8px;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.feature-item:hover {
    transform: translateX(2px);
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-glow);
}

.feature-item.is-active {
    border-color: var(--brand-primary);
    box-shadow:
        0 0 0 1px var(--brand-primary-muted) inset,
        var(--shadow-glow);
    background: var(--brand-primary-muted);
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-title {
    font-size: 1.06rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.32;
}

.feature-panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 18px;
}

.feature-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.feature-panel-head h2 {
    margin: 0;
    font-size: 1.5rem;
    font-family: var(--font-display);
    color: var(--text-primary);
}

.feature-badge {
    display: inline-flex;
    padding: 5px 11px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.feature-panel-desc {
    margin: 8px 0 16px;
    color: var(--text-secondary);
}

.feature-panel h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--text-primary);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.preset-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    background: var(--bg-tertiary);
}

.preset-key {
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.68rem;
    color: var(--brand-primary);
    margin-bottom: 4px;
}

.preset-value {
    color: var(--text-primary);
    font-weight: 600;
}

.preset-empty {
    color: var(--text-tertiary);
}

.next-step {
    margin-top: 14px;
    border-left: 3px solid var(--brand-primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--brand-primary-muted);
    color: var(--text-secondary);
}

/* ── Studio Module (inside layouts) ── */
.studio-module {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.studio-module-head h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.studio-module-head p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 var(--space-lg);
}

.studio-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group-full {
    grid-column: 1 / -1;
}

.studio-results-wrap {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.studio-results-wrap h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin: 0 0 var(--space-md);
}

@media (max-width: 1024px) {
    .studio-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .studio-header h1 {
        font-size: 1.5rem;
    }

    .studio-form-grid {
        grid-template-columns: 1fr;
    }

    .preset-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   §16. PAGE — STUDIO V4
   Studio V4 modular neon layout with workspace split
   ═══════════════════════════════════════════════════════════════════════════ */

/* Studio V4 - modular neon layout — theme-aware */
.studio-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
    align-items: flex-start;
}

.studio-nav-card,
.studio-panel-card {
    position: relative;
    border-radius: 22px;
    border: 1px solid var(--neon-card-border);
    background: var(--neon-card-bg);
    box-shadow: var(--neon-card-shadow);
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.studio-nav-card::before,
.studio-panel-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(130deg, #34f3ff, #59c2ff, #8f96ff, #bc6cff, #ff5ec4, #ffad6a, #35f8c2);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: var(--neon-gradient-border-opacity);
    pointer-events: none;
}

.studio-nav-card {
    padding: 14px;
    position: sticky;
    top: 20px;
}

.studio-nav-label {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--neon-accent);
    margin-bottom: 10px;
    font-weight: 700;
}

.studio-nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.studio-nav-item {
    position: relative;
    display: block;
    padding: 12px;
    border-radius: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--neon-nav-border);
    background: var(--neon-nav-bg);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .3s ease, color .3s ease;
}

.studio-nav-item:hover {
    transform: translateX(2px);
    color: var(--text-primary);
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-glow);
}

.studio-nav-item.is-active {
    color: var(--neon-nav-active-text);
    border-color: var(--brand-primary);
    background: var(--neon-nav-active-bg);
    box-shadow: var(--neon-nav-active-shadow);
}

.studio-nav-item-title {
    font-size: 0.96rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.studio-nav-item-desc {
    font-size: 0.78rem;
    line-height: 1.35;
    opacity: 0.9;
}

.studio-nav-extra {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--neon-card-border);
    border-radius: 14px;
    padding: 12px;
    color: var(--text-secondary);
    background: var(--neon-nav-bg);
}

.studio-nav-extra strong {
    color: var(--neon-accent);
    font-size: 0.9rem;
}

.studio-nav-extra span {
    font-size: 0.8rem;
    line-height: 1.4;
}

.studio-panel-card {
    padding: 18px;
}

.studio-module-head h2 {
    margin: 0 0 6px;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    color: var(--text-primary);
    font-family: var(--font-display);
}

.studio-module-head p {
    margin: 0 0 14px;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.studio-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.studio-estimate-card {
    border-radius: 14px;
    border: 1px solid var(--neon-result-border);
    background: var(--neon-result-bg);
    padding: 10px 12px;
    display: grid;
    gap: 7px;
}

.studio-estimate-chip {
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--brand-primary);
    color: var(--neon-tab-active-text);
    background: var(--neon-tab-active-bg);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.studio-estimate-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.83rem;
    line-height: 1.5;
}

.studio-results-wrap {
    margin-top: 14px;
    border-radius: 16px;
    border: 1px solid var(--neon-result-border);
    background: var(--neon-result-bg);
    padding: 14px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.studio-results-wrap h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--text-primary);
}

.studio-result-item {
    border-radius: 16px;
    border: 1px solid var(--neon-result-border);
    background: var(--neon-result-bg);
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.studio-result-media {
    aspect-ratio: 1 / 1;
    background: var(--neon-media-bg);
}

.studio-result-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.studio-result-meta {
    padding: 12px;
}

.studio-result-actions,
.studio-share-actions,
.studio-editor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.studio-share-actions {
    margin-top: 10px;
}

.studio-video-output,
.studio-content-output {
    display: grid;
    gap: 10px;
}

.studio-content-block {
    border-radius: 12px;
    border: 1px solid var(--neon-result-border);
    background: var(--neon-result-bg);
    padding: 10px 12px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.studio-content-block h4 {
    margin: 0 0 6px;
    font-size: 0.83rem;
    color: var(--neon-accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.studio-content-block p,
.studio-content-block li,
.studio-content-block span,
.studio-content-block em {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.studio-scene-list {
    margin: 0;
    padding-left: 16px;
    display: grid;
    gap: 8px;
}

.studio-editor-area {
    margin-top: 14px;
    border: 1px solid var(--neon-result-border);
    border-radius: 16px;
    background: var(--neon-result-bg);
    padding: 12px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.studio-editor-canvas {
    width: 100%;
    max-height: 520px;
    border-radius: 10px;
    border: 1px solid var(--neon-result-border);
    background: var(--neon-media-bg);
}

/* ── Studio Workspace — Input + Preview split ── */
.studio-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 20px;
    align-items: flex-start;
}

.studio-input-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.studio-preview-panel {
    position: sticky;
    top: 20px;
    min-height: 400px;
    border-radius: 18px;
    border: 1px solid var(--neon-result-border);
    background: var(--neon-result-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.studio-preview-panel.has-results {
    min-height: 0;
}

/* Placeholder when no results yet */
.studio-preview-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    gap: 16px;
    min-height: 400px;
}

.studio-preview-placeholder-icon {
    font-size: 3.5rem;
    opacity: 0.5;
    filter: grayscale(0.3);
    animation: previewPulse 3s ease-in-out infinite;
}

@keyframes previewPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.08); opacity: 0.7; }
}

.studio-preview-placeholder-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.studio-preview-placeholder-desc {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    max-width: 280px;
    line-height: 1.5;
}

.studio-preview-placeholder-tips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    max-width: 300px;
}

.studio-preview-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: left;
}

.studio-preview-tip-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--neon-accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* Preview results header */
.studio-preview-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--neon-result-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.studio-preview-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.studio-preview-body {
    padding: 14px;
    flex: 1;
}

/* Results grid — responsive inside preview panel */
.studio-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.studio-results-grid .studio-result-item {
    border-radius: 14px;
}

/* ── Responsive ── */
@media (max-width: 1080px) {
    .studio-shell {
        grid-template-columns: 1fr;
    }

    .studio-nav-card {
        position: static;
    }
}

@media (max-width: 900px) {
    .studio-workspace {
        grid-template-columns: 1fr;
    }

    .studio-preview-panel {
        position: static;
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    .studio-form-grid {
        grid-template-columns: 1fr;
    }

    .studio-panel-card,
    .studio-nav-card {
        border-radius: 16px;
    }
}

/* ═══════════════════════════════════════════
   TTS MODULE
   ═══════════════════════════════════════════ */
.studio-module-header {
    margin-bottom: var(--space-lg, 16px);
}

.studio-module-header h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.studio-module-header p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.88rem;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-active, #2a2a3a);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--brand-primary, #00d4ff);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px var(--brand-primary-muted, rgba(0,212,255,0.3));
    transition: transform 0.15s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--brand-primary, #00d4ff);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.studio-results-section {
    margin-top: var(--space-xl, 20px);
    padding-top: var(--space-lg, 16px);
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
}

.studio-results-section h3 {
    margin: 0 0 var(--space-md, 12px);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tts-output-card {
    border-radius: 16px;
    border: 1px solid var(--neon-result-border, var(--border-subtle));
    background: var(--neon-result-bg, var(--bg-secondary));
    padding: var(--space-lg, 16px);
    display: grid;
    gap: var(--space-md, 12px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.tts-audio-player {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    outline: none;
}

.tts-output-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.video-player-wrap {
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-player-wrap video {
    width: 100%;
    max-height: 500px;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   §17. PAGE — FEED
   Community feed timeline and comments
   ═══════════════════════════════════════════════════════════════════════════ */

/* Feed - community timeline — theme-aware */
.feed-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 16px;
    align-items: flex-start;
}

.feed-composer,
.feed-timeline-card,
.feed-post-card {
    position: relative;
    border-radius: 20px;
    border: 1px solid var(--neon-card-border);
    background: var(--neon-card-bg);
    box-shadow: var(--neon-card-shadow);
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.feed-composer::before,
.feed-timeline-card::before,
.feed-post-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(130deg, #34f3ff, #62bcff, #9589ff, #c96cff, #ff76c7, #ffb770, #3df8cc);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: var(--neon-gradient-border-opacity);
    pointer-events: none;
}

.feed-composer {
    padding: 14px;
    position: sticky;
    top: 20px;
}

.feed-composer h2 {
    margin: 0 0 5px;
    font-size: 1.06rem;
    color: var(--text-primary);
}

.feed-composer .studio-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.feed-composer .form-group-full {
    grid-column: 1 / -1;
}

.feed-composer p {
    margin: 0 0 12px;
    color: var(--text-tertiary);
    font-size: 0.84rem;
}

.feed-media-preview {
    width: 100%;
    min-height: 160px;
    border-radius: 12px;
    border: 1px dashed var(--neon-card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    background: var(--neon-media-bg);
    margin-bottom: 10px;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.feed-media-preview img,
.feed-media-preview video {
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}

.feed-preview-unavailable {
    padding: 14px;
    text-align: center;
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
}

.feed-preview-unavailable strong {
    color: var(--text-primary);
    font-size: 0.88rem;
}

.feed-assets-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.feed-asset-btn {
    border: 1px solid var(--neon-card-border);
    border-radius: 10px;
    overflow: hidden;
    padding: 0;
    background: var(--neon-media-bg);
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background 0.3s ease;
}

.feed-asset-btn img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.feed-asset-btn:hover,
.feed-asset-btn.is-active {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.feed-timeline-card {
    padding: 12px;
    display: grid;
    gap: 12px;
}

.feed-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 2px;
}

.feed-tab {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--neon-card-border);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--neon-tab-bg);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.feed-tab.is-active {
    color: var(--neon-tab-active-text);
    border-color: var(--brand-primary);
    background: var(--neon-tab-active-bg);
}

.feed-post-card {
    padding: 12px;
}

.feed-post-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.feed-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-inverse);
    background: var(--brand-gradient);
    box-shadow: var(--shadow-glow);
}

.feed-author {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.feed-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.feed-caption {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 8px;
    white-space: pre-wrap;
}

.feed-prompt {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-left: 2px solid var(--brand-primary);
    background: var(--neon-input-bg);
    border-radius: 8px;
    color: var(--text-tertiary);
    font-size: 0.82rem;
    white-space: pre-wrap;
    transition: background 0.3s ease;
}

.feed-media {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--neon-card-border);
    background: var(--neon-media-bg);
    margin-bottom: 10px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.feed-media img,
.feed-media video {
    width: 100%;
    display: block;
    max-height: 680px;
    object-fit: cover;
}

.feed-media.is-broken {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-media-unavailable {
    padding: 16px;
    text-align: center;
    display: grid;
    gap: 7px;
    color: var(--text-secondary);
}

.feed-media-unavailable strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.feed-media-unavailable span {
    font-size: 0.82rem;
    color: var(--text-tertiary);
}

.feed-video-plan {
    padding: 12px;
    color: var(--text-secondary);
    display: grid;
    gap: 8px;
}

.feed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feed-like-btn.is-liked {
    color: var(--neon-tab-active-text);
    border-color: var(--brand-primary);
    background: var(--neon-tab-active-bg);
}

.feed-share-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.feed-empty {
    padding: 22px 12px;
}

.feed-pagination {
    margin-top: 10px;
    padding: 8px 2px 2px;
    border-top: 1px solid var(--neon-card-border);
}

.feed-pagination nav[role="navigation"] {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.feed-pagination nav[role="navigation"] > div:first-child {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.feed-pagination nav[role="navigation"] > div:last-child > span,
.feed-pagination nav[role="navigation"] > div:last-child > a,
.feed-pagination nav[role="navigation"] > div:last-child > span > span,
.feed-pagination nav[role="navigation"] > div:last-child > span > a {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    margin: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--neon-card-border);
    background: var(--neon-tab-bg);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1;
}

.feed-pagination nav[role="navigation"] > div:last-child > span[aria-current="page"] > span {
    border-color: var(--brand-primary);
    background: var(--neon-tab-active-bg);
    color: var(--neon-tab-active-text);
}

.feed-pagination svg {
    width: 14px;
    height: 14px;
}

.feed-public-wrap {
    max-width: 760px;
    margin: 40px auto;
    padding: 0 16px;
}

.feed-public-card {
    border-radius: 22px;
    border: 1px solid var(--neon-card-border);
    background: var(--neon-card-bg);
    box-shadow: var(--neon-card-shadow);
    padding: 16px;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

@media (max-width: 1120px) {
    .feed-layout {
        grid-template-columns: 1fr;
    }

    .feed-composer {
        position: static;
    }
}

@media (max-width: 768px) {
    .feed-composer .studio-form-grid {
        grid-template-columns: 1fr;
    }

    .feed-assets-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .feed-assets-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ═══════════════════════════════════════════
   Comment Section
   ═══════════════════════════════════════════ */
.feed-comments-section {
    margin-top: var(--space-md, 12px);
    padding-top: var(--space-md, 12px);
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
}

.feed-comments-list {
    display: grid;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: var(--space-sm, 8px);
}

.feed-comment {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--bg-secondary, rgba(255,255,255,0.04));
    font-size: 0.88rem;
    line-height: 1.45;
}

.feed-comment-author {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.feed-comment-body {
    color: var(--text-secondary);
}

.feed-comment-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.feed-comment-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.feed-comment-form .form-input {
    flex: 1;
}

.form-input-sm {
    padding: 6px 10px !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
}

.feed-load-more-comments {
    margin-bottom: var(--space-sm, 8px);
}

.feed-comment-toggle {
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════════
   §19. ADMIN THEME OVERRIDES
   Premium dark neon theme — overrides base design system tokens and component styles
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Sora:wght@400;500;600;700;800&display=swap');

:root {
    --admin-font-ui: 'Sora', 'Segoe UI', Tahoma, sans-serif;
    --admin-font-display: 'Rajdhani', 'Sora', sans-serif;

    --admin-bg-0: #000000;
    --admin-bg-1: #050507;
    --admin-bg-2: #0a0a0e;
    --admin-surface-1: rgba(8, 8, 14, 0.80);
    --admin-surface-2: rgba(12, 12, 20, 0.85);
    --admin-surface-3: rgba(6, 6, 12, 0.90);

    --admin-cyan: #32f0ff;
    --admin-cyan-soft: #1dd4f7;
    --admin-teal: #2de5cd;
    --admin-violet: #8d79ff;
    --admin-magenta: #e56dff;
    --admin-rose: #ff78bf;

    --admin-success: #32e6b6;
    --admin-warning: #ffc96a;
    --admin-danger: #ff7599;
    --admin-info: #7bc8ff;

    --admin-text-1: rgba(236, 244, 255, 0.96);
    --admin-text-2: rgba(174, 195, 236, 0.78);
    --admin-text-3: rgba(136, 160, 208, 0.62);
    --admin-text-4: rgba(110, 132, 176, 0.46);

    --admin-border: rgba(123, 153, 255, 0.18);
    --admin-border-soft: rgba(120, 150, 245, 0.12);
    --admin-border-strong: rgba(64, 230, 255, 0.32);

    --admin-shadow-card:
        0 1px 0 rgba(255, 255, 255, 0.03) inset,
        0 14px 36px rgba(2, 7, 20, 0.56),
        0 2px 8px rgba(0, 0, 0, 0.35);
    --admin-shadow-hover:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 20px 44px rgba(2, 7, 22, 0.66),
        0 0 36px rgba(75, 228, 255, 0.12);
}

body {
    --gx-teal: var(--admin-cyan);
    --gx-teal-muted: rgba(50, 240, 255, 0.16);
    --gx-violet: var(--admin-violet);
    --gx-violet-muted: rgba(141, 121, 255, 0.16);
    --gx-success: var(--admin-success);
    --gx-warning: var(--admin-warning);
    --gx-danger: var(--admin-danger);
    --gx-text-faint: var(--admin-text-4);

    --bg-root: #000000;
    --bg-primary: rgba(2, 2, 6, 0.92);
    --bg-secondary: var(--admin-surface-1);
    --bg-tertiary: rgba(8, 8, 16, 0.90);
    --bg-elevated: var(--admin-surface-2);
    --bg-hover: rgba(18, 18, 36, 0.60);
    --bg-active: rgba(14, 14, 28, 0.75);

    --border-subtle: rgba(115, 140, 225, 0.17);
    --border-color: var(--admin-border);
    --border-strong: rgba(126, 155, 245, 0.34);
    --border-focus: var(--admin-cyan);

    --text-primary: var(--admin-text-1);
    --text-secondary: var(--admin-text-2);
    --text-tertiary: var(--admin-text-3);
    --text-muted: var(--admin-text-4);

    --brand-primary: var(--admin-violet);
    --brand-primary-hover: #b4a5ff;
    --brand-primary-muted: rgba(141, 121, 255, 0.2);
    --brand-secondary: var(--admin-cyan);
    --brand-secondary-muted: rgba(50, 240, 255, 0.16);
    --brand-gradient: linear-gradient(135deg, var(--admin-cyan) 0%, var(--admin-violet) 52%, var(--admin-magenta) 100%);

    --success: var(--admin-success);
    --success-muted: rgba(50, 230, 182, 0.15);
    --warning: var(--admin-warning);
    --warning-muted: rgba(255, 201, 106, 0.14);
    --danger: var(--admin-danger);
    --danger-muted: rgba(255, 117, 153, 0.15);
    --error: var(--admin-danger);
    --info: var(--admin-info);
    --info-muted: rgba(123, 200, 255, 0.15);

    font-family: var(--admin-font-ui);
    background:
        radial-gradient(ellipse at 15% 10%, rgba(50, 240, 255, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 15%, rgba(141, 121, 255, 0.03) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 90%, rgba(229, 109, 255, 0.025) 0%, transparent 45%),
        #000000;
    color: var(--text-secondary);
}

body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

body::before {
    width: 420px;
    height: 420px;
    top: -180px;
    right: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(50, 240, 255, 0.06) 0%, transparent 60%);
    filter: blur(40px);
}

body::after {
    width: 460px;
    height: 460px;
    bottom: -220px;
    left: -160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(229, 109, 255, 0.05) 0%, transparent 60%);
    filter: blur(40px);
}

.app-layout {
    position: relative;
    min-height: 100vh;
    z-index: 1;
}

.app-sidebar,
.sidebar,
.admin-sidebar {
    width: var(--sidebar-width);
    top: 16px;
    left: 16px;
    bottom: 16px;
    height: auto;
    border: 1px solid var(--admin-border-soft);
    border-radius: 30px;
    background:
        linear-gradient(170deg, rgba(6, 6, 14, 0.97) 0%, rgba(3, 3, 8, 0.98) 52%, rgba(0, 0, 4, 0.99) 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03) inset,
        0 24px 55px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(123, 121, 255, 0.04);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    overflow: hidden;
}

.app-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 8%, rgba(50, 240, 255, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 85% 78%, rgba(229, 109, 255, 0.04) 0%, transparent 40%);
    pointer-events: none;
}

.sidebar-brand {
    position: relative;
    gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(128, 154, 238, 0.2);
    background: linear-gradient(180deg, rgba(141, 121, 255, 0.04) 0%, rgba(141, 121, 255, 0) 100%);
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    color: #041124;
    background: linear-gradient(135deg, var(--admin-cyan) 0%, var(--admin-violet) 72%, var(--admin-magenta) 100%);
    box-shadow: 0 0 18px rgba(50, 240, 255, 0.24);
}

.sidebar-brand-name {
    display: block;
    font-family: var(--admin-font-display);
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-primary);
}

.sidebar-brand-version {
    display: inline-flex;
    margin-top: 2px;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--admin-cyan);
    background: rgba(50, 240, 255, 0.14);
    border: 1px solid rgba(50, 240, 255, 0.2);
    border-radius: 999px;
    padding: 2px 8px;
}

.sidebar-nav {
    padding: 12px 10px 10px;
}

.sidebar-section {
    margin-bottom: 18px;
}

.sidebar-section-title {
    padding: 0 12px;
    margin-bottom: 8px;
    font-size: 0.63rem;
    letter-spacing: 0.15em;
    font-weight: 700;
    color: rgba(149, 171, 224, 0.54);
    text-transform: uppercase;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 9px 12px;
    color: rgba(179, 200, 241, 0.76);
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover {
    transform: translateX(2px);
    color: var(--text-primary);
    border-color: rgba(123, 153, 255, 0.26);
    background: rgba(16, 16, 30, 0.50);
}

.sidebar-link.active {
    color: #07152a;
    border-color: rgba(50, 240, 255, 0.42);
    background: linear-gradient(135deg, rgba(50, 240, 255, 0.94) 0%, rgba(122, 201, 255, 0.9) 50%, rgba(168, 124, 255, 0.9) 100%);
    box-shadow:
        0 8px 18px rgba(12, 26, 52, 0.45),
        0 0 18px rgba(50, 240, 255, 0.26);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 18%;
    bottom: 18%;
    width: 3px;
    border-radius: 2px;
    background: #8fffff;
    box-shadow: 0 0 10px rgba(143, 255, 255, 0.8);
}

.sidebar-link-icon {
    width: 18px;
    text-align: center;
    opacity: 0.82;
}

.sidebar-link.active .sidebar-link-icon {
    opacity: 1;
}

.sidebar-tools {
    padding: 0 14px 12px;
}

.sidebar-footer {
    position: relative;
    padding: 14px;
    border-top: 1px solid rgba(118, 143, 223, 0.22);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.sidebar-user {
    background: rgba(4, 4, 12, 0.80);
    border: 1px solid rgba(120, 148, 230, 0.14);
}

.sidebar-user-avatar {
    background: linear-gradient(145deg, var(--admin-cyan) 0%, var(--admin-violet) 100%);
    color: #051022;
    box-shadow: 0 0 16px rgba(50, 240, 255, 0.26);
}

.sidebar-user-name {
    color: var(--text-primary);
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-credits {
    color: var(--admin-cyan);
    font-weight: 600;
}

.app-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(122, 148, 231, 0.24);
    background: rgba(6, 6, 16, 0.80);
    color: var(--text-secondary);
}

.app-tool-btn:hover {
    color: var(--text-primary);
    border-color: rgba(50, 240, 255, 0.4);
    background: rgba(8, 8, 20, 0.90);
    box-shadow: 0 0 12px rgba(50, 240, 255, 0.18);
}

.sidebar-overlay {
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.app-content,
.main-content,
.admin-main {
    position: relative;
    margin-left: calc(var(--sidebar-width) + 40px);
    padding: 24px 28px 34px;
    min-height: 100vh;
}

.app-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 30px 0 0 30px;
    background:
        radial-gradient(circle at 72% 8%, rgba(50, 240, 255, 0.025) 0%, transparent 30%),
        radial-gradient(circle at 22% 88%, rgba(229, 109, 255, 0.02) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

.app-content > * {
    position: relative;
    z-index: 1;
}

.app-mobile-header {
    background: rgba(0, 0, 0, 0.96);
    border-bottom: 1px solid rgba(122, 148, 224, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.mobile-menu-btn {
    border-radius: 12px;
    background: rgba(4, 4, 12, 0.88);
    border-color: rgba(123, 152, 235, 0.34);
}

.page-header {
    margin-bottom: 18px;
    padding: 18px 20px;
    border-radius: 24px;
    border: 1px solid var(--admin-border-soft);
    background:
        linear-gradient(145deg, rgba(6, 6, 14, 0.90) 0%, rgba(3, 3, 10, 0.88) 65%, rgba(2, 2, 8, 0.90) 100%);
    box-shadow: var(--admin-shadow-card);
}

.page-title {
    margin-bottom: 3px;
    font-family: var(--admin-font-display);
    font-size: clamp(1.55rem, 2.3vw, 2rem);
    letter-spacing: 0.03em;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.84rem;
    color: var(--text-tertiary);
}
.card,
.admin-section,
.admin-filters-card {
    border: 1px solid var(--admin-border-soft);
    border-radius: 20px;
    background:
        linear-gradient(150deg, rgba(4, 4, 12, 0.90) 0%, rgba(2, 2, 8, 0.90) 58%, rgba(1, 1, 6, 0.92) 100%);
    box-shadow: var(--admin-shadow-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.card,
.admin-section {
    padding: 16px 18px;
}

.card:hover,
.admin-section:hover,
.admin-filters-card:hover {
    border-color: rgba(126, 155, 245, 0.34);
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.admin-kpi-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border: 1px solid var(--admin-border-soft);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(4, 4, 12, 0.88) 0%, rgba(2, 2, 8, 0.92) 100%);
    box-shadow: var(--admin-shadow-card);
    overflow: hidden;
}

.admin-kpi-card::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    right: -80px;
    top: -90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(50, 240, 255, 0.12) 0%, rgba(50, 240, 255, 0) 72%);
    pointer-events: none;
}

.admin-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(122, 151, 233, 0.34);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.admin-kpi-value {
    font-family: var(--admin-font-display);
    font-size: 1.55rem;
    line-height: 1.1;
    letter-spacing: 0.02em;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-kpi-label {
    margin-top: 2px;
    font-size: 0.74rem;
    letter-spacing: 0.03em;
    color: var(--text-tertiary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.stat-card {
    display: flex;
    gap: 11px;
    align-items: center;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(124, 151, 232, 0.34);
}

.stat-value {
    font-family: var(--admin-font-display);
    font-size: 1.4rem;
    line-height: 1.05;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.73rem;
    color: var(--text-tertiary);
}

.admin-grid-sidebar {
    display: grid;
    grid-template-columns: 1.6fr minmax(280px, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-section-title {
    font-family: var(--admin-font-display);
    font-size: 1.06rem;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: 0.03em;
}

.admin-section-subtitle {
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.card-section-title {
    margin: 0 0 10px;
    font-family: var(--admin-font-display);
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: 0.03em;
}

.admin-config-grid,
.admin-detail-grid,
.branding-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.admin-config-item,
.admin-detail-field,
.branding-preview-item {
    border-radius: 14px;
    border: 1px solid rgba(116, 144, 224, 0.24);
    background: rgba(4, 4, 12, 0.72);
    padding: 10px 12px;
}

.admin-config-label,
.admin-detail-field label,
.preview-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.admin-config-value,
.admin-detail-field span {
    display: block;
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.branding-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.branding-preview-item img {
    width: auto;
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 5px 14px rgba(2, 8, 24, 0.56));
}

.diag-result-box {
    border-radius: 12px;
    border: 1px solid rgba(114, 140, 217, 0.28);
    background: rgba(2, 2, 8, 0.80);
    padding: 10px 12px;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.form-group {
    margin-bottom: 10px;
}

.form-label,
.admin-filter-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.form-input,
.admin-filter-input,
.admin-inline-select {
    width: 100%;
    padding: 9px 11px;
    color: var(--text-primary);
    background: rgba(2, 2, 6, 0.90);
    border: 1px solid rgba(118, 146, 224, 0.32);
    border-radius: 11px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-input:focus,
.admin-filter-input:focus,
.admin-inline-select:focus {
    outline: none;
    border-color: rgba(50, 240, 255, 0.62);
    box-shadow: 0 0 0 3px rgba(50, 240, 255, 0.16);
    background: rgba(2, 2, 8, 0.95);
}

.admin-inline-select {
    padding: 5px 8px;
    font-size: 0.78rem;
    min-width: 84px;
}

.admin-inline-select-status-active {
    border-color: rgba(50, 230, 182, 0.46);
    color: var(--admin-success);
}

.admin-inline-select-status-suspended {
    border-color: rgba(255, 201, 106, 0.48);
    color: var(--admin-warning);
}

.admin-inline-select-status-banned {
    border-color: rgba(255, 117, 153, 0.48);
    color: var(--admin-danger);
}

.btn {
    border-radius: 12px;
    font-family: var(--admin-font-ui);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-primary {
    color: #061225;
    border-color: rgba(50, 240, 255, 0.35);
    background: linear-gradient(135deg, rgba(50, 240, 255, 0.94) 0%, rgba(123, 211, 255, 0.92) 52%, rgba(209, 126, 255, 0.92) 100%);
    box-shadow: 0 7px 18px rgba(7, 22, 46, 0.42), 0 0 18px rgba(50, 240, 255, 0.18);
}

.btn-primary:hover:not(:disabled) {
    color: #041023;
    border-color: rgba(50, 240, 255, 0.5);
    box-shadow: 0 9px 20px rgba(5, 19, 42, 0.5), 0 0 25px rgba(50, 240, 255, 0.26);
}

.btn-secondary {
    color: var(--text-primary);
    border-color: rgba(121, 148, 228, 0.34);
    background: rgba(6, 6, 16, 0.80);
}

.btn-secondary:hover:not(:disabled) {
    border-color: rgba(50, 240, 255, 0.4);
    background: rgba(8, 8, 20, 0.94);
}

.btn-ghost {
    color: var(--text-secondary);
    border-color: rgba(117, 145, 224, 0.26);
    background: rgba(4, 4, 12, 0.55);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: rgba(126, 154, 234, 0.42);
    background: rgba(6, 6, 16, 0.72);
}

.btn-sm {
    padding: 6px 11px;
    border-radius: 10px;
    font-size: 0.76rem;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #09162e;
    border: 1px solid rgba(45, 229, 205, 0.5);
    background: linear-gradient(135deg, rgba(45, 229, 205, 0.94) 0%, rgba(50, 240, 255, 0.88) 100%);
    box-shadow: 0 6px 14px rgba(8, 21, 45, 0.38);
}

.btn-export:hover {
    color: #041022;
    box-shadow: 0 9px 18px rgba(8, 22, 45, 0.48), 0 0 16px rgba(45, 229, 205, 0.2);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(121, 149, 230, 0.3);
    background: rgba(12, 12, 30, 0.75);
    font-size: 0.69rem;
    line-height: 1;
    letter-spacing: 0.03em;
    font-weight: 700;
    color: var(--text-secondary);
}

.badge-success {
    color: var(--admin-success);
    border-color: rgba(50, 230, 182, 0.46);
    background: rgba(50, 230, 182, 0.14);
}

.badge-warning,
.badge-image {
    color: var(--admin-warning);
    border-color: rgba(255, 201, 106, 0.46);
    background: rgba(255, 201, 106, 0.14);
}

.badge-danger {
    color: var(--admin-danger);
    border-color: rgba(255, 117, 153, 0.46);
    background: rgba(255, 117, 153, 0.14);
}

.badge-info,
.badge-content {
    color: var(--admin-info);
    border-color: rgba(123, 200, 255, 0.44);
    background: rgba(123, 200, 255, 0.14);
}

.badge-edit {
    color: var(--admin-violet);
    border-color: rgba(141, 121, 255, 0.46);
    background: rgba(141, 121, 255, 0.15);
}

.badge-payment {
    color: var(--admin-cyan);
    border-color: rgba(50, 240, 255, 0.42);
    background: rgba(50, 240, 255, 0.14);
}

.badge-refund {
    color: var(--admin-rose);
    border-color: rgba(255, 120, 191, 0.44);
    background: rgba(255, 120, 191, 0.14);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.status-dot.green {
    color: var(--admin-success);
    background: var(--admin-success);
}

.status-dot.yellow {
    color: var(--admin-warning);
    background: var(--admin-warning);
}

.status-dot.red {
    color: var(--admin-danger);
    background: var(--admin-danger);
}

.status-dot.blue {
    color: var(--admin-info);
    background: var(--admin-info);
}

.table-wrap {
    overflow-x: auto;
    border-radius: 14px;
}
.admin-table,
.data-table {
    width: 100%;
    min-width: 730px;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.admin-table thead th,
.data-table thead th {
    padding: 8px 10px;
    border: 0;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
}

.admin-table tbody tr,
.data-table tbody tr {
    background: rgba(4, 4, 10, 0.82);
    border-radius: 13px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.admin-table tbody tr:hover,
.data-table tbody tr:hover {
    background: rgba(10, 10, 22, 0.88);
    box-shadow: 0 0 0 1px rgba(125, 154, 238, 0.24) inset;
}

.admin-table tbody td,
.data-table tbody td {
    padding: 10px 10px;
    border: 0;
    vertical-align: middle;
    font-size: 0.81rem;
    color: var(--text-secondary);
}

.admin-table tbody td:first-child,
.data-table tbody td:first-child {
    border-radius: 13px 0 0 13px;
}

.admin-table tbody td:last-child,
.data-table tbody td:last-child {
    border-radius: 0 13px 13px 0;
}

.sort-header {
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sort-header:hover {
    color: var(--admin-cyan);
}

.sort-icon {
    opacity: 0.45;
    color: var(--text-muted);
}

.sort-icon.active {
    opacity: 1;
    color: var(--admin-cyan);
}

.admin-filters-card {
    margin-bottom: 14px;
    padding: 14px 16px;
}

.admin-filters-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.admin-filter-group {
    min-width: 140px;
    flex: 0 1 auto;
}

.admin-filter-search {
    flex: 1 1 240px;
}

.admin-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-active-filters {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(117, 144, 222, 0.22);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(121, 149, 230, 0.3);
    background: rgba(4, 4, 10, 0.80);
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.admin-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
}

.admin-pagination-info {
    margin-top: 8px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.alert {
    border-radius: 14px;
    border: 1px solid var(--admin-border-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.alert-success {
    color: var(--admin-success);
    border-color: rgba(50, 230, 182, 0.34);
    background: rgba(50, 230, 182, 0.12);
}

.alert-error {
    color: var(--admin-danger);
    border-color: rgba(255, 117, 153, 0.36);
    background: rgba(255, 117, 153, 0.12);
}

.alert-warning {
    color: var(--admin-warning);
    border-color: rgba(255, 201, 106, 0.36);
    background: rgba(255, 201, 106, 0.12);
}

.alert-info {
    color: var(--admin-info);
    border-color: rgba(123, 200, 255, 0.36);
    background: rgba(123, 200, 255, 0.12);
}

.admin-alert-list {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.admin-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 14px;
    border: 1px solid rgba(121, 149, 230, 0.3);
    background: rgba(4, 4, 10, 0.82);
    padding: 10px 12px;
}

.admin-alert-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(50, 240, 255, 0.14);
    color: var(--admin-cyan);
}

.admin-alert-title {
    font-size: 0.83rem;
    color: var(--text-primary);
    font-weight: 700;
}

.admin-alert-body {
    min-width: 0;
}

.admin-alert-detail {
    margin-top: 2px;
    font-size: 0.76rem;
    color: var(--text-tertiary);
}

.admin-alert-item.info {
    border-color: rgba(123, 200, 255, 0.35);
    background: rgba(123, 200, 255, 0.1);
}

.admin-alert-item.warning {
    border-color: rgba(255, 201, 106, 0.35);
    background: rgba(255, 201, 106, 0.1);
}

.admin-alert-item.error {
    border-color: rgba(255, 117, 153, 0.35);
    background: rgba(255, 117, 153, 0.1);
}

.admin-alert-item.success {
    border-color: rgba(50, 230, 182, 0.35);
    background: rgba(50, 230, 182, 0.1);
}

.admin-activity-list {
    display: grid;
    gap: 8px;
}

.admin-activity-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 9px;
    border-radius: 12px;
    border: 1px solid rgba(117, 144, 222, 0.22);
    background: rgba(4, 4, 10, 0.78);
    padding: 9px 10px;
}

.admin-activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-activity-text {
    font-size: 0.77rem;
    color: var(--text-secondary);
}

.admin-activity-time {
    font-size: 0.69rem;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.admin-empty-state {
    border-radius: 14px;
    border: 1px dashed rgba(119, 145, 220, 0.38);
    background: rgba(10, 17, 43, 0.58);
    text-align: center;
    padding: 22px 14px;
}

.empty-icon {
    font-size: 1.55rem;
    margin-bottom: 6px;
    opacity: 0.88;
}

.empty-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.empty-state {
    border-radius: 16px;
    border: 1px dashed rgba(119, 145, 220, 0.35);
    background: rgba(11, 18, 44, 0.62);
}

.admin-detail-row {
    display: none;
}

.admin-detail-row.active {
    display: table-row;
}

.admin-detail-content {
    border-radius: 12px;
    border: 1px solid rgba(114, 141, 220, 0.26);
    background: rgba(10, 17, 42, 0.64);
    padding: 10px;
}

.admin-thumb {
    border-radius: 10px;
    border: 1px solid rgba(120, 148, 230, 0.28);
    background: rgba(23, 35, 73, 0.72);
    overflow: hidden;
}

.admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.admin-thumb:hover img {
    transform: scale(1.06);
}

.admin-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1300;
    background: rgba(1, 6, 20, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 16px;
}

.admin-lightbox.active {
    display: flex;
}

.admin-lightbox-inner {
    position: relative;
    width: min(95vw, 1040px);
    border-radius: 16px;
    border: 1px solid rgba(120, 148, 229, 0.32);
    background: rgba(10, 17, 42, 0.86);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    padding: 14px 14px 36px;
}

.admin-lightbox-img {
    display: block;
    width: 100%;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(6, 12, 30, 0.8);
}

.admin-lightbox-close,
.admin-lightbox-prev,
.admin-lightbox-next {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(120, 148, 230, 0.34);
    background: rgba(20, 32, 68, 0.78);
    color: var(--text-primary);
    cursor: pointer;
}

.admin-lightbox-close {
    top: 8px;
    right: 8px;
}

.admin-lightbox-prev {
    left: 8px;
    top: calc(50% - 18px);
}

.admin-lightbox-next {
    right: 8px;
    top: calc(50% - 18px);
}

.admin-lightbox-info {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(20, 32, 68, 0.9);
    border: 1px solid rgba(120, 148, 230, 0.3);
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.indicator-profit,
.indicator-loss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.indicator-profit {
    color: var(--admin-success);
    border: 1px solid rgba(50, 230, 182, 0.42);
    background: rgba(50, 230, 182, 0.14);
}

.indicator-loss {
    color: var(--admin-danger);
    border: 1px solid rgba(255, 117, 153, 0.42);
    background: rgba(255, 117, 153, 0.14);
}

.user-info-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--admin-cyan) 0%, var(--admin-violet) 100%);
    color: #061327;
    font-size: 0.72rem;
    font-weight: 700;
}

.text-right {
    text-align: right;
}

.text-bold {
    font-weight: 700;
    color: var(--text-primary);
}

.text-brand {
    color: var(--admin-cyan);
}

.text-dim,
.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--admin-success);
}

.text-mono {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    letter-spacing: -0.01em;
}

.status-active {
    color: var(--admin-success);
}

.status-suspended {
    color: var(--admin-warning);
}

.status-banned {
    color: var(--admin-danger);
}

@media (max-width: 1320px) {
    .admin-grid-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1180px) {
    .app-sidebar,
    .sidebar,
    .admin-sidebar {
        width: 248px;
        border-radius: 24px;
    }

    .app-content,
    .main-content,
    .admin-main {
        margin-left: 280px;
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 980px) {
    .admin-grid-2,
    .admin-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body::before,
    body::after {
        display: none;
    }

    .app-mobile-header {
        display: flex;
    }

    .app-sidebar,
    .sidebar,
    .admin-sidebar {
        top: 0;
        left: 0;
        bottom: 0;
        width: min(84vw, 300px);
        border-radius: 0 22px 22px 0;
        border-left: 0;
        border-top: 0;
        border-bottom: 0;
        transform: translateX(-105%);
    }

    .app-sidebar.is-open,
    .sidebar.is-open,
    .admin-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay.is-open {
        display: block;
    }

    .app-content,
    .main-content,
    .admin-main {
        margin-left: 0;
        padding: calc(var(--header-height) + 14px) 12px 18px;
    }

    .app-content::before {
        border-radius: 0;
    }

    .page-header {
        padding: 14px 14px;
        border-radius: 16px;
    }

    .page-title {
        font-size: 1.38rem;
    }

    .card,
    .admin-section,
    .admin-filters-card {
        padding: 12px 12px;
        border-radius: 16px;
    }

    .admin-kpi-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-filters-form {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-filter-group,
    .admin-filter-search {
        min-width: 100%;
        width: 100%;
    }

    .admin-filter-actions {
        width: 100%;
    }

    .admin-filter-actions .btn {
        flex: 1;
    }

    .table-wrap {
        overflow-x: auto;
    }

    .table-wrap table thead {
        display: table-header-group;
    }

    .table-wrap table,
    .table-wrap table tbody,
    .table-wrap table tr {
        display: table;
        width: max-content;
        min-width: 100%;
    }

    .table-wrap table tbody {
        display: table-row-group;
    }

    .table-wrap table tr {
        display: table-row;
        background: transparent;
        box-shadow: none;
        border: 0;
        padding: 0;
        margin: 0;
    }

    .table-wrap table th,
    .table-wrap table td {
        display: table-cell;
        white-space: nowrap;
    }

    .table-wrap table td::before {
        content: none;
    }

    .admin-table,
    .data-table {
        min-width: 620px;
        border-spacing: 0 6px;
    }
}

[data-theme="light"] body {
    --text-primary: #0e1730;
    --text-secondary: #24345f;
    --text-tertiary: #3f5388;
    --text-muted: #5f74a7;
    --gx-text-faint: rgba(95, 116, 167, 0.76);

    --bg-root: #e8eefc;
    --bg-primary: rgba(235, 241, 255, 0.92);
    --bg-secondary: rgba(245, 248, 255, 0.88);
    --bg-tertiary: rgba(230, 238, 255, 0.92);
    --bg-elevated: rgba(250, 252, 255, 0.9);
    --bg-hover: rgba(216, 228, 255, 0.9);
    --bg-active: rgba(208, 223, 255, 0.92);

    --border-subtle: rgba(79, 105, 176, 0.2);
    --border-color: rgba(78, 105, 178, 0.24);
    --border-strong: rgba(51, 94, 191, 0.34);
}

[data-theme="light"] body {
    background:
        radial-gradient(circle at 12% 10%, rgba(50, 240, 255, 0.18) 0%, rgba(50, 240, 255, 0) 38%),
        radial-gradient(circle at 84% 13%, rgba(229, 109, 255, 0.16) 0%, rgba(229, 109, 255, 0) 42%),
        linear-gradient(170deg, #ecf2ff 0%, #dfe8ff 40%, #d8e3ff 100%);
}

/* Rainbow 7-color border pass */
:root {
    --admin-rainbow-7: linear-gradient(
        120deg,
        #ff4fc9 0%,
        #ff8461 16%,
        #ffe66a 32%,
        #7dff83 48%,
        #45f6ff 64%,
        #7c8fff 80%,
        #ff4fc9 100%
    );
    --admin-neon-pink-1: rgba(255, 93, 210, 0.92);
    --admin-neon-pink-2: rgba(255, 93, 210, 0.58);
    --admin-neon-pink-3: rgba(255, 93, 210, 0.32);
}

@keyframes adminRainbowFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 250% 50%; }
}

.page-header,
.card,
.admin-section,
.admin-filters-card,
.admin-config-item,
.admin-detail-field,
.branding-preview-item,
.admin-alert-item,
.admin-activity-item,
.admin-empty-state,
.diag-result-box,
.sidebar-user,
.admin-detail-content,
.quick-card,
.template-card,
.sales-hero,
.sales-hero-panel,
.billing-package,
.billing-balance-card,
.library-card,
.studio-panel,
.studio-step,
.studio-result-card,
.studio-preview-main,
.studio-progress-card,
.studio-editor-wrap {
    position: relative;
}

.page-header::after,
.card::after,
.admin-section::after,
.admin-filters-card::after,
.admin-config-item::after,
.admin-detail-field::after,
.branding-preview-item::after,
.admin-alert-item::after,
.admin-activity-item::after,
.admin-empty-state::after,
.diag-result-box::after,
.sidebar-user::after,
.admin-detail-content::after,
.quick-card::after,
.template-card::after,
.sales-hero::after,
.sales-hero-panel::after,
.billing-package::after,
.billing-balance-card::after,
.library-card::after,
.studio-panel::after,
.studio-step::after,
.studio-result-card::after,
.studio-preview-main::after,
.studio-progress-card::after,
.studio-editor-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.25px;
    background: var(--admin-rainbow-7);
    background-size: 260% 260%;
    animation: adminRainbowFlow 14s linear infinite;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.55;
    mix-blend-mode: screen;
    filter:
        drop-shadow(0 0 2px var(--admin-neon-pink-1))
        drop-shadow(0 0 5px var(--admin-neon-pink-2))
        drop-shadow(0 0 10px var(--admin-neon-pink-3));
    z-index: 2;
}

.app-sidebar::after,
.sidebar::after,
.admin-sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    background: var(--admin-rainbow-7);
    background-size: 260% 260%;
    animation: adminRainbowFlow 7s linear infinite;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 1;
    mix-blend-mode: screen;
    filter:
        drop-shadow(0 0 4px var(--admin-neon-pink-1))
        drop-shadow(0 0 12px var(--admin-neon-pink-2))
        drop-shadow(0 0 28px var(--admin-neon-pink-3));
    z-index: 3;
}

.admin-kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.2px;
    background: var(--admin-rainbow-7);
    background-size: 260% 260%;
    animation: adminRainbowFlow 6.5s linear infinite;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 1;
    mix-blend-mode: screen;
    filter:
        drop-shadow(0 0 4px var(--admin-neon-pink-1))
        drop-shadow(0 0 10px var(--admin-neon-pink-2))
        drop-shadow(0 0 20px var(--admin-neon-pink-3));
    z-index: 3;
}

.admin-kpi-card > *,
.page-header > *,
.card > *,
.admin-section > * {
    position: relative;
    z-index: 1;
}

/* Hotfix: disable heavy animated borders on Studio core blocks to avoid render jank */
.studio-panel::after,
.studio-step::after,
.studio-result-card::after,
.studio-preview-main::after,
.studio-progress-card::after,
.studio-editor-wrap::after {
    display: none;
}

/* Fallback for browsers with weak mask-composite support */
@supports not ((-webkit-mask-composite: xor) or (mask-composite: exclude)) {
    .page-header::after,
    .card::after,
    .admin-section::after,
    .admin-filters-card::after,
    .admin-config-item::after,
    .admin-detail-field::after,
    .branding-preview-item::after,
    .admin-alert-item::after,
    .admin-activity-item::after,
    .admin-empty-state::after,
    .diag-result-box::after,
    .sidebar-user::after,
    .admin-detail-content::after,
    .quick-card::after,
    .template-card::after,
    .sales-hero::after,
    .sales-hero-panel::after,
    .billing-package::after,
    .billing-balance-card::after,
    .library-card::after,
    .app-sidebar::after,
    .sidebar::after,
    .admin-sidebar::after,
    .admin-kpi-card::before,
    .studio-feature-sidebar::after,
    .studio-feature-item::after {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-header::after,
    .card::after,
    .admin-section::after,
    .admin-filters-card::after,
    .admin-config-item::after,
    .admin-detail-field::after,
    .branding-preview-item::after,
    .admin-alert-item::after,
    .admin-activity-item::after,
    .admin-empty-state::after,
    .diag-result-box::after,
    .sidebar-user::after,
    .admin-detail-content::after,
    .quick-card::after,
    .template-card::after,
    .sales-hero::after,
    .sales-hero-panel::after,
    .billing-package::after,
    .billing-balance-card::after,
    .library-card::after,
    .app-sidebar::after,
    .sidebar::after,
    .admin-sidebar::after,
    .admin-kpi-card::before,
    .studio-feature-sidebar::after,
    .studio-feature-item.active::after {
        animation: none !important;
    }
}


/* Refinement pass: cleaner and closer to reference */
body {
    background:
        radial-gradient(circle at 11% 0%, rgba(57, 224, 255, 0.14) 0%, rgba(57, 224, 255, 0) 33%),
        radial-gradient(circle at 100% 4%, rgba(120, 111, 255, 0.14) 0%, rgba(120, 111, 255, 0) 42%),
        linear-gradient(158deg, #06142a 0%, #0a1f41 44%, #081736 100%);
}

.app-layout::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    left: calc(var(--sidebar-width) + 24px);
    width: 1px;
    background: linear-gradient(180deg, rgba(63, 232, 255, 0), rgba(63, 232, 255, 0.34), rgba(63, 232, 255, 0));
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.app-sidebar,
.sidebar,
.admin-sidebar {
    border-radius: 22px;
    border-color: rgba(81, 125, 218, 0.34);
    background: linear-gradient(180deg, rgba(34, 61, 112, 0.96) 0%, rgba(30, 48, 93, 0.97) 35%, rgba(34, 34, 81, 0.98) 100%);
    box-shadow:
        0 18px 40px rgba(0, 9, 30, 0.56),
        0 0 24px rgba(56, 217, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-brand {
    padding: 18px 18px 14px;
    border-bottom-color: rgba(97, 136, 221, 0.34);
}

.sidebar-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: linear-gradient(132deg, #57ddff 0%, #7a8fff 48%, #ab77ff 100%);
}

.sidebar-brand-name {
    font-size: 1.08rem;
}

.sidebar-brand-version {
    border-radius: 999px;
    font-size: 0.61rem;
}

.sidebar-link {
    margin-bottom: 5px;
    border-radius: 11px;
    font-size: 0.9rem;
    letter-spacing: 0;
}

.sidebar-link:hover {
    transform: none;
    background: rgba(74, 106, 172, 0.26);
}

.sidebar-link.active {
    color: #031326;
    background: linear-gradient(130deg, #4ce3ff 0%, #68baff 42%, #8f96ff 66%, #aa79ff 100%);
    box-shadow: 0 6px 16px rgba(10, 24, 56, 0.46), 0 0 18px rgba(76, 227, 255, 0.28);
}

.sidebar-link.active::before {
    display: none;
}

.sidebar-user {
    border-radius: 12px;
}

.app-content,
.main-content,
.admin-main {
    margin-left: calc(var(--sidebar-width) + 34px);
    padding: 20px 22px 26px;
}

.app-content > * {
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
}

.page-header {
    position: relative;
    border-radius: 20px;
    border-color: rgba(84, 129, 223, 0.4);
    background: linear-gradient(145deg, rgba(31, 52, 101, 0.95) 0%, rgba(22, 40, 84, 0.92) 60%, rgba(17, 31, 67, 0.94) 100%);
}

.page-header::before {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(76, 227, 255, 0), rgba(76, 227, 255, 0.62), rgba(76, 227, 255, 0));
}

.page-title {
    letter-spacing: 0.02em;
}

.card,
.admin-section,
.admin-filters-card {
    border-radius: 18px;
    border-color: rgba(84, 129, 223, 0.36);
    background: linear-gradient(152deg, rgba(27, 48, 95, 0.94) 0%, rgba(19, 37, 78, 0.94) 54%, rgba(17, 32, 69, 0.95) 100%);
    box-shadow: 0 10px 28px rgba(1, 8, 28, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.admin-kpi-card {
    border-radius: 17px;
    border-color: rgba(82, 129, 226, 0.42);
    background: linear-gradient(152deg, rgba(33, 56, 107, 0.95) 0%, rgba(23, 43, 87, 0.94) 100%);
    box-shadow: 0 9px 22px rgba(2, 10, 33, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.admin-kpi-card::after {
    opacity: 0.68;
}

.admin-kpi-value {
    font-size: 2rem;
}

.form-input,
.admin-filter-input,
.admin-inline-select {
    border-radius: 10px;
    background: rgba(14, 29, 65, 0.9);
    border-color: rgba(86, 131, 223, 0.5);
}

.form-input:focus,
.admin-filter-input:focus,
.admin-inline-select:focus {
    border-color: rgba(80, 225, 255, 0.74);
    box-shadow: 0 0 0 3px rgba(80, 225, 255, 0.18);
}

.btn {
    border-radius: 10px;
}

.btn-primary {
    background: linear-gradient(132deg, #55defd 0%, #5fd5ff 36%, #8f93ff 72%, #7fe6d9 100%);
    border-color: rgba(78, 222, 255, 0.55);
    box-shadow: 0 8px 16px rgba(7, 21, 46, 0.38), 0 0 14px rgba(78, 222, 255, 0.22);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(27, 45, 88, 0.66);
}

.table-wrap {
    border-radius: 16px;
}

.admin-table,
.data-table {
    border-spacing: 0 9px;
}

.admin-table thead th,
.data-table thead th {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    padding: 0 12px 8px;
}

.admin-table tbody tr,
.data-table tbody tr {
    background: linear-gradient(120deg, rgba(26, 45, 90, 0.96) 0%, rgba(21, 39, 80, 0.95) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(72, 113, 203, 0.26),
        0 7px 18px rgba(1, 8, 27, 0.34);
}

.admin-table tbody tr:hover,
.data-table tbody tr:hover {
    background: linear-gradient(120deg, rgba(35, 59, 114, 0.98) 0%, rgba(27, 48, 98, 0.97) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(96, 226, 255, 0.34),
        0 9px 18px rgba(1, 10, 30, 0.4);
}

.admin-table tbody td,
.data-table tbody td {
    padding: 13px 12px;
    font-size: 0.86rem;
}

.admin-alert-item,
.admin-activity-item,
.admin-config-item,
.admin-detail-field,
.branding-preview-item {
    border-color: rgba(89, 132, 223, 0.34);
    background: rgba(24, 42, 85, 0.74);
}

.admin-empty-state {
    border-color: rgba(95, 140, 234, 0.46);
    background: rgba(16, 30, 67, 0.56);
}

/* Studio feature rail */
.studio-image-feature-layout {
    display: grid;
    grid-template-columns: minmax(230px, 292px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.studio-image-feature-content {
    min-width: 0;
}

.studio-feature-sidebar {
    position: relative;
    border-radius: 18px;
    padding: 14px 12px;
    background:
        linear-gradient(168deg, rgba(28, 44, 88, 0.9) 0%, rgba(19, 33, 70, 0.94) 100%);
    border: 1px solid rgba(84, 130, 226, 0.34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 16px 28px rgba(2, 9, 31, 0.36);
}

.studio-feature-sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.15px;
    background: var(--admin-rainbow-7);
    background-size: 250% 250%;
    animation: adminRainbowFlow 8s linear infinite;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.76;
    mix-blend-mode: screen;
}

.studio-feature-sidebar > * {
    position: relative;
    z-index: 1;
}

.studio-feature-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 4px 8px;
    color: #42e9ff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.studio-feature-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #37ecff;
    box-shadow: 0 0 12px rgba(55, 236, 255, 0.86);
}

.studio-feature-item {
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    border-radius: 14px;
    border: 1px solid rgba(86, 128, 214, 0.3);
    background:
        linear-gradient(150deg, rgba(29, 46, 90, 0.88) 0%, rgba(18, 34, 76, 0.92) 100%);
    padding: 11px 12px;
    color: var(--text-secondary);
    text-align: left;
    transition:
        transform 0.18s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        background 0.22s ease;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 8px;
}

.studio-feature-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(120deg, rgba(74, 236, 255, 0.7), rgba(162, 122, 255, 0.68), rgba(255, 115, 200, 0.72));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.42;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.studio-feature-item:last-child {
    margin-bottom: 0;
}

.studio-feature-item:hover {
    transform: translateX(2px);
    border-color: rgba(95, 229, 255, 0.6);
    box-shadow:
        0 12px 22px rgba(4, 12, 36, 0.38),
        0 0 18px rgba(63, 223, 255, 0.22);
}

.studio-feature-item:hover::after {
    opacity: 0.9;
}

.studio-feature-item.active {
    border-color: rgba(76, 236, 255, 0.9);
    background:
        linear-gradient(145deg, rgba(31, 83, 129, 0.6) 0%, rgba(39, 57, 112, 0.76) 45%, rgba(96, 64, 154, 0.56) 100%);
    box-shadow:
        0 16px 28px rgba(3, 12, 36, 0.48),
        0 0 20px rgba(80, 230, 255, 0.3),
        0 0 32px rgba(221, 96, 255, 0.22);
}

.studio-feature-item.active::after {
    opacity: 1;
    background: var(--admin-rainbow-7);
    background-size: 250% 250%;
    animation: adminRainbowFlow 6s linear infinite;
}

.studio-feature-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    color: #8ad8ff;
    background: rgba(80, 120, 210, 0.2);
    border: 1px solid rgba(96, 136, 230, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.studio-feature-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.studio-feature-item.active .studio-feature-icon {
    color: #031e2b;
    background: linear-gradient(135deg, #5df0ff 0%, #7db7ff 50%, #c18dff 100%);
    border-color: rgba(138, 240, 255, 0.8);
    box-shadow:
        0 0 14px rgba(87, 232, 255, 0.44),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.studio-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.studio-feature-text strong {
    display: block;
    color: rgba(235, 245, 255, 0.96);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.studio-feature-text small {
    display: block;
    color: rgba(152, 178, 223, 0.82);
    font-size: 0.8rem;
    line-height: 1.25;
}

.studio-feature-item.active .studio-feature-text strong {
    color: #edfbff;
}

.studio-feature-item.active .studio-feature-text small {
    color: rgba(180, 250, 255, 0.92);
}

.studio-feature-context {
    position: relative;
    margin-bottom: 14px;
    border-radius: 12px;
    border: 1px solid rgba(90, 134, 227, 0.38);
    background: linear-gradient(140deg, rgba(23, 42, 88, 0.92) 0%, rgba(20, 36, 79, 0.9) 100%);
    color: rgba(186, 240, 255, 0.95);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 10px 13px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 8px 18px rgba(1, 8, 28, 0.34);
}

.studio-feature-context::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(76, 227, 255, 0), rgba(76, 227, 255, 0.72), rgba(76, 227, 255, 0));
    opacity: 0.9;
}

@media (max-width: 1180px) {
    .studio-image-feature-layout {
        grid-template-columns: 1fr;
    }

    .studio-feature-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        align-items: stretch;
    }

    .studio-feature-heading {
        grid-column: 1 / -1;
        margin-bottom: 4px;
    }

    .studio-feature-item {
        margin-bottom: 0;
        min-height: 74px;
    }

    .app-layout::after {
        display: none;
    }

    .app-content,
    .main-content,
    .admin-main {
        margin-left: 274px;
    }
}

@media (max-width: 768px) {
    .studio-feature-sidebar {
        grid-template-columns: 1fr;
    }

    .studio-feature-item {
        min-height: 0;
    }

    .app-sidebar,
    .sidebar,
    .admin-sidebar {
        border-radius: 0 20px 20px 0;
    }

    .app-content,
    .main-content,
    .admin-main {
        margin-left: 0;
    }
}

/* Galaxy black pass for admin/settings: keep neon borders, remove blue-heavy surfaces */
html:not([data-theme="light"]) {
    --admin-rainbow-7: linear-gradient(
        120deg,
        #ff4fd2 0%,
        #ff8e54 16%,
        #ffe86a 32%,
        #66ff8d 48%,
        #45f7ff 64%,
        #7d8fff 80%,
        #ff4fd2 100%
    );
    --admin-neon-pink-1: rgba(255, 94, 214, 0.50);
    --admin-neon-pink-2: rgba(255, 94, 214, 0.25);
    --admin-neon-pink-3: rgba(255, 94, 214, 0.12);
}

html:not([data-theme="light"]) body {
    --admin-bg-0: #010103;
    --admin-bg-1: #05050a;
    --admin-bg-2: #080812;
    --admin-surface-1: rgba(8, 8, 14, 0.86);
    --admin-surface-2: rgba(10, 10, 18, 0.9);
    --admin-surface-3: rgba(5, 5, 10, 0.93);
    --admin-border: rgba(150, 120, 255, 0.24);
    --admin-border-soft: rgba(118, 95, 225, 0.2);
    --admin-border-strong: rgba(72, 236, 255, 0.44);

    --bg-root: #010103;
    --bg-primary: rgba(4, 4, 8, 0.95);
    --bg-secondary: rgba(9, 9, 16, 0.9);
    --bg-tertiary: rgba(12, 12, 20, 0.88);
    --bg-elevated: rgba(11, 11, 19, 0.94);
    --bg-hover: rgba(22, 18, 40, 0.74);
    --bg-active: rgba(28, 22, 52, 0.78);

    --border-subtle: rgba(120, 98, 225, 0.22);
    --border-color: rgba(139, 112, 255, 0.28);
    --border-strong: rgba(76, 235, 255, 0.5);
    --border-focus: #48edff;

    background:
        radial-gradient(circle at 12% -8%, rgba(72, 237, 255, 0.08) 0%, rgba(72, 237, 255, 0) 34%),
        radial-gradient(circle at 92% 0%, rgba(255, 94, 214, 0.07) 0%, rgba(255, 94, 214, 0) 40%),
        radial-gradient(circle at 50% 102%, rgba(132, 112, 255, 0.06) 0%, rgba(132, 112, 255, 0) 45%),
        linear-gradient(164deg, #020206 0%, #090913 45%, #020206 100%);
}

html:not([data-theme="light"]) body::before {
    background: radial-gradient(circle, rgba(72, 237, 255, 0.12) 0%, rgba(72, 237, 255, 0) 62%);
    filter: blur(56px);
}

html:not([data-theme="light"]) body::after {
    background: radial-gradient(circle, rgba(255, 94, 214, 0.11) 0%, rgba(255, 94, 214, 0) 64%);
    filter: blur(58px);
}

html:not([data-theme="light"]) .app-layout::after {
    background: linear-gradient(180deg, rgba(72, 237, 255, 0), rgba(72, 237, 255, 0.48), rgba(72, 237, 255, 0));
    opacity: 0.44;
}

html:not([data-theme="light"]) .app-sidebar,
html:not([data-theme="light"]) .sidebar,
html:not([data-theme="light"]) .admin-sidebar {
    border-color: rgba(146, 114, 255, 0.20);
    background: linear-gradient(182deg, rgba(9, 9, 16, 0.98) 0%, rgba(6, 6, 12, 0.99) 44%, rgba(5, 5, 10, 1) 100%);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.40),
        0 0 16px rgba(72, 237, 255, 0.06),
        0 0 20px rgba(255, 94, 214, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html:not([data-theme="light"]) .sidebar-link:hover {
    background: rgba(36, 28, 66, 0.62);
}

html:not([data-theme="light"]) .page-header {
    border-color: rgba(145, 114, 255, 0.36);
    background: linear-gradient(148deg, rgba(12, 12, 22, 0.96) 0%, rgba(8, 8, 16, 0.96) 58%, rgba(5, 5, 11, 0.98) 100%);
    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.6),
        0 0 24px rgba(73, 238, 255, 0.1),
        0 0 30px rgba(255, 94, 214, 0.08);
}

html:not([data-theme="light"]) .page-header::before {
    background: linear-gradient(90deg, rgba(72, 237, 255, 0), rgba(72, 237, 255, 0.74), rgba(72, 237, 255, 0));
}

html:not([data-theme="light"]) .card,
html:not([data-theme="light"]) .admin-section,
html:not([data-theme="light"]) .admin-filters-card,
html:not([data-theme="light"]) .admin-config-item,
html:not([data-theme="light"]) .branding-preview-item,
html:not([data-theme="light"]) .admin-detail-field,
html:not([data-theme="light"]) .admin-alert-item,
html:not([data-theme="light"]) .admin-activity-item,
html:not([data-theme="light"]) .admin-empty-state,
html:not([data-theme="light"]) .diag-result-box {
    border-color: rgba(142, 111, 255, 0.18);
    background: linear-gradient(152deg, rgba(11, 11, 20, 0.95) 0%, rgba(7, 7, 14, 0.95) 56%, rgba(4, 4, 10, 0.97) 100%);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.35),
        0 0 12px rgba(72, 237, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

html:not([data-theme="light"]) .admin-kpi-card {
    border-color: rgba(146, 114, 255, 0.38);
    background: linear-gradient(152deg, rgba(14, 14, 26, 0.96) 0%, rgba(9, 9, 17, 0.95) 100%);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.56),
        0 0 26px rgba(72, 237, 255, 0.1),
        0 0 26px rgba(255, 94, 214, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html:not([data-theme="light"]) .form-input,
html:not([data-theme="light"]) .admin-filter-input,
html:not([data-theme="light"]) .admin-inline-select {
    background: rgba(8, 8, 14, 0.94);
    border-color: rgba(138, 108, 255, 0.4);
}

html:not([data-theme="light"]) .form-input:focus,
html:not([data-theme="light"]) .admin-filter-input:focus,
html:not([data-theme="light"]) .admin-inline-select:focus {
    border-color: rgba(72, 237, 255, 0.9);
    box-shadow:
        0 0 0 3px rgba(72, 237, 255, 0.2),
        0 0 18px rgba(72, 237, 255, 0.24);
}

html:not([data-theme="light"]) .btn-ghost {
    background: rgba(16, 14, 28, 0.82);
    border-color: rgba(138, 108, 255, 0.34);
}

html:not([data-theme="light"]) .btn-primary {
    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.44),
        0 0 20px rgba(72, 237, 255, 0.24),
        0 0 16px rgba(255, 94, 214, 0.2);
}

html:not([data-theme="light"]) .admin-table tbody tr,
html:not([data-theme="light"]) .data-table tbody tr {
    background: linear-gradient(120deg, rgba(12, 12, 22, 0.96) 0%, rgba(8, 8, 16, 0.95) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(138, 108, 255, 0.24),
        0 9px 18px rgba(0, 0, 0, 0.46);
}

html:not([data-theme="light"]) .admin-table tbody tr:hover,
html:not([data-theme="light"]) .data-table tbody tr:hover {
    background: linear-gradient(120deg, rgba(20, 16, 36, 0.98) 0%, rgba(12, 12, 22, 0.97) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(72, 237, 255, 0.36),
        0 12px 22px rgba(0, 0, 0, 0.52);
}

html:not([data-theme="light"]) .studio-feature-sidebar {
    border-color: rgba(144, 112, 255, 0.36);
    background: linear-gradient(168deg, rgba(10, 10, 18, 0.96) 0%, rgba(6, 6, 12, 0.98) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 16px 30px rgba(0, 0, 0, 0.5),
        0 0 26px rgba(72, 237, 255, 0.1);
}

html:not([data-theme="light"]) .studio-feature-item {
    border-color: rgba(140, 110, 255, 0.34);
    background: linear-gradient(150deg, rgba(12, 12, 22, 0.9) 0%, rgba(7, 7, 14, 0.94) 100%);
}

html:not([data-theme="light"]) .studio-feature-item:hover {
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.52),
        0 0 20px rgba(72, 237, 255, 0.22);
}

html:not([data-theme="light"]) .studio-feature-context {
    border-color: rgba(142, 111, 255, 0.4);
    background: linear-gradient(140deg, rgba(14, 14, 24, 0.95) 0%, rgba(8, 8, 16, 0.94) 100%);
}

html:not([data-theme="light"]) .page-header::after,
html:not([data-theme="light"]) .card::after,
html:not([data-theme="light"]) .admin-section::after,
html:not([data-theme="light"]) .admin-filters-card::after,
html:not([data-theme="light"]) .admin-config-item::after,
html:not([data-theme="light"]) .admin-detail-field::after,
html:not([data-theme="light"]) .branding-preview-item::after,
html:not([data-theme="light"]) .admin-alert-item::after,
html:not([data-theme="light"]) .admin-activity-item::after,
html:not([data-theme="light"]) .admin-empty-state::after,
html:not([data-theme="light"]) .diag-result-box::after,
html:not([data-theme="light"]) .sidebar-user::after,
html:not([data-theme="light"]) .app-sidebar::after,
html:not([data-theme="light"]) .sidebar::after,
html:not([data-theme="light"]) .admin-sidebar::after,
html:not([data-theme="light"]) .admin-kpi-card::before,
html:not([data-theme="light"]) .studio-feature-sidebar::after,
html:not([data-theme="light"]) .studio-feature-item.active::after {
    opacity: 0.6;
    filter:
        drop-shadow(0 0 2px var(--admin-neon-pink-1))
        drop-shadow(0 0 6px var(--admin-neon-pink-2))
        drop-shadow(0 0 12px var(--admin-neon-pink-3));
}
