@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-muted: #818cf8;
    --bg: #f4f6fb;
    --bg-elevated: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #059669;
    --success-bg: #ecfdf5;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --radius: 12px;
    --radius-lg: 16px;
    --nav-h: 76px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.icon { flex-shrink: 0; vertical-align: middle; }

/* Navbar */
.navbar {
    height: var(--nav-h);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .inner {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
    align-items: center;
    gap: 12px 16px;
}

.navbar:not(.navbar-auth) .inner {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    letter-spacing: -0.02em;
    min-width: 0;
    max-width: 200px;
}

.logo-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logo:hover { color: var(--text); }
.logo .icon { color: var(--primary); flex-shrink: 0; }

.nav-center {
    min-width: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.nav-guest {
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    min-width: 0;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-links a .icon { opacity: 0.75; flex-shrink: 0; }
.nav-links a:hover .icon,
.nav-links a.active .icon { opacity: 1; }

.nav-cta {
    background: var(--primary) !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
}
.nav-cta:hover {
    background: var(--primary-hover) !important;
    color: #fff !important;
}

/* User area (logged in) */
.nav-user {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    justify-self: end;
}

.nav-logout-form {
    display: flex;
    margin: 0;
}

.nav-token {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(165, 180, 252, 0.3);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #e0e7ff !important;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.nav-token-num {
    font-variant-numeric: tabular-nums;
}

.nav-token-unit {
    font-size: 12px;
    opacity: 0.85;
}

.nav-token:hover,
.nav-token.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.25));
    border-color: rgba(165, 180, 252, 0.5);
    color: #fff !important;
}

.nav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6) !important;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.nav-icon-btn:hover,
.nav-icon-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
}

.nav-avatar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.nav-avatar:hover,
.nav-avatar.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff !important;
}

.nav-avatar .icon {
    width: 28px;
    height: 28px;
    padding: 5px;
    background: rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    color: #c7d2fe;
}

.nav-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.nav-logout:hover {
    background: #fee2e2;
    color: var(--error);
}

/* Dark navbar — shared by homepage hero & member pages */
.navbar-dark .logo {
    color: #fff;
}

.navbar-dark .logo .icon {
    color: #a5b4fc;
}

.navbar-dark .nav-links a {
    color: rgba(255, 255, 255, 0.72);
}

.navbar-dark .nav-links a:hover,
.navbar-dark .nav-links a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.navbar-dark .nav-cta {
    background: #fff !important;
    color: #0f172a !important;
}

.navbar-dark .nav-cta:hover {
    background: #e0e7ff !important;
    color: #312e81 !important;
}

.navbar-dark .nav-logout {
    color: rgba(255, 255, 255, 0.5);
}

.navbar-dark .nav-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.navbar-app.navbar-dark {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Auth pages */
.auth-wrap {
    display: flex;
    justify-content: center;
    padding: 32px 0 48px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    background: var(--primary-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.auth-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.auth-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--error);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Main */
.main { padding: 32px 0 80px; min-height: calc(100vh - var(--nav-h)); }

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--error-bg); color: #991b1b; border: 1px solid #fecaca; }
.alert .icon { margin-top: 1px; }

/* Page header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 6px;
}

.page-desc {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 520px;
}

.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Cards */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.card-hover:hover {
    box-shadow: var(--shadow);
    border-color: #c7d2fe;
}

.card-stat {
    padding: 20px 24px;
}

.card-stat .label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.card-stat .value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.card-stat .value.primary { color: var(--primary); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--primary);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.btn:hover {
    background: var(--primary-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn:active { transform: scale(0.98); }

.btn-outline {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #c7d2fe;
    box-shadow: var(--shadow-sm);
}

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-muted {
    background: var(--border-light);
    color: var(--text-secondary);
}

.badge-status-pending {
    background: #f1f5f9;
    color: #64748b;
}

.badge-status-queued {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-status-processing {
    background: #fef3c7;
    color: #b45309;
}

.badge-status-completed {
    background: var(--success-bg);
    color: var(--success);
}

.badge-status-failed {
    background: #fee2e2;
    color: #dc2626;
}

.badge-status-cancelled {
    background: #f3f4f6;
    color: #9ca3af;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
}

.empty-state .icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: var(--primary-light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.empty-state h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* Hero */
.hero {
    text-align: center;
    padding: 48px 0 56px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 16px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.hero .lead {
    color: var(--text-secondary);
    font-size: 17px;
    max-width: 560px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    background: var(--bg-elevated);
    max-width: 520px;
    margin: 0 auto 28px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.upload-zone:hover {
    border-color: var(--primary-muted);
    background: var(--primary-light);
    box-shadow: var(--shadow);
}

.upload-zone .icon-wrap {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--primary-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.upload-zone .title { font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.upload-zone .hint { color: var(--text-muted); font-size: 13px; }

/* Case flow */
.section-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

.case-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.case-item {
    width: 110px;
    text-align: center;
}

.case-item .thumb {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 100%);
    border-radius: 12px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-muted);
    border: 1px solid var(--border);
}

.case-item span { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.case-arrow { color: var(--text-muted); display: flex; align-items: center; }

/* Product card */
.product-card { padding: 0; overflow: hidden; }
.product-card .thumb {
    height: 168px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
}

.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 18px 20px 20px; }
.product-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.product-card .meta { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.product-card .actions { display: flex; gap: 8px; }
.product-card .actions .btn { flex: 1; }

/* Recharge package */
.package-card { text-align: center; position: relative; }
.package-card.featured { border-color: var(--primary-muted); box-shadow: 0 0 0 1px var(--primary-light); }
.package-card .pkg-icon {
    width: 48px; height: 48px;
    margin: 0 auto 16px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
}
.package-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.package-card .price { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 8px; }
.package-card .price small { font-size: 18px; font-weight: 500; color: var(--text-muted); }
.package-card .tokens { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }
.package-card .bonus { font-size: 13px; color: var(--success); font-weight: 500; margin-bottom: 20px; }

/* Table */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--border-light);
    border-bottom: 1px solid var(--border);
}
table.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}
table.data-table tr:hover td { background: #fafbfc; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--bg-elevated);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-muted);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--bg-elevated) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-select option {
    background: #fff;
    color: #0f172a;
}

.required { color: var(--error); }

.form-card { max-width: 560px; }

/* Upload zones */
.upload-zone {
    display: block;
    cursor: pointer;
}

.upload-zone-compact { padding: 28px 20px; }

.upload-preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 10px;
}

.upload-preview-lg {
    max-height: 280px;
    padding: 12px;
}

.upload-default { text-align: center; }

/* Image factory */
.factory-layout {
    display: grid;
    grid-template-columns: 240px 1fr 220px;
    gap: 20px;
    align-items: start;
}

.factory-side,
.factory-main,
.factory-cost { min-width: 0; }

.balance-pill { min-width: 140px; padding: 14px 18px; }

.source-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.source-tab {
    flex: 1;
    cursor: pointer;
}

.source-tab input { display: none; }

.source-tab span {
    display: block;
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.15s;
}

.source-tab input:checked + span {
    background: var(--primary-light);
    border-color: #c7d2fe;
    color: var(--primary);
}

.product-preview {
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e7ff, #f1f5f9);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-muted);
}

.product-preview img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.preview-placeholder {
    font-size: 13px;
    color: var(--text-muted);
}

.hint-inline {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.type-check { cursor: pointer; }

.type-check input { display: none; }

.type-check-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    transition: all 0.15s;
    color: var(--text-secondary);
}

.type-check input:checked + .type-check-inner {
    background: var(--primary-light);
    border-color: #818cf8;
    color: var(--primary);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.type-label {
    font-size: 13px;
    font-weight: 600;
}

.type-price {
    font-size: 11px;
    color: var(--text-muted);
}

.type-check input:checked + .type-check-inner .type-price {
    color: var(--primary);
}

.factory-options {
    display: grid;
    grid-template-columns: 1fr 1fr 100px;
    gap: 14px;
    margin-bottom: 24px;
}

.cost-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 8px;
}

.cost-breakdown {
    list-style: none;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-breakdown li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.cost-breakdown li.muted { color: var(--text-muted); }

.cost-breakdown strong { color: var(--primary); }

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 1024px) {
    .factory-layout { grid-template-columns: 1fr; }
    .factory-options { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .factory-options { grid-template-columns: 1fr; }
    .type-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Gen card */
.gen-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.gen-card:hover { border-color: #c7d2fe; background: var(--primary-light); }
.gen-card .gen-icon {
    width: 40px; height: 40px;
    margin: 0 auto 12px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
}
.gen-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-elevated);
}

@media (max-width: 900px) {
    .page-header { flex-direction: column; }
    .hero { padding: 32px 0 40px; }
}

@media (max-width: 1280px) {
    .navbar-auth .nav-center .nav-links a span {
        display: none;
    }

    .navbar-auth .nav-center .nav-links a {
        padding: 9px 11px;
    }

    .logo { max-width: 160px; font-size: 17px; }
}

@media (max-width: 768px) {
    :root { --nav-h: 64px; }

    .navbar .inner {
        gap: 8px;
    }

    .logo { max-width: 36px; font-size: 0; }
    .logo .icon { width: 24px; height: 24px; }

    .navbar-auth .nav-center { display: none; }

    .nav-guest .nav-links a span { display: none; }
    .nav-guest .nav-links .nav-cta span { display: inline; }

    .nav-avatar-name { display: none; }
    .nav-token { padding: 7px 10px; }
    .nav-icon-btn,
    .nav-logout { width: 34px; height: 34px; }
}

/* ============================================================
   Homepage — Premium landing
   ============================================================ */

.page-home {
    background: #030712;
    color: #f1f5f9;
}

.page-home .main-home { padding: 0; }
.page-home .page-alerts { display: none; }

.home-alerts {
    position: fixed;
    top: calc(var(--nav-h) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: min(480px, 90vw);
}

/* Homepage — transparent nav over hero */
.page-home .navbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: none;
}

.page-home .navbar-auth {
    background: rgba(3, 7, 18, 0.55);
    backdrop-filter: blur(12px);
}

.page-home .main {
    position: relative;
    z-index: 1;
}

/* Hero */
.home-hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-h) + 48px) 0 80px;
    overflow: hidden;
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99, 102, 241, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 90% 60%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 10% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        linear-gradient(165deg, #030712 0%, #0f172a 40%, #1e1b4b 100%);
}

.home-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 75%);
}

.home-hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #c7d2fe;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 28px;
}

.home-hero-copy h1 {
    font-size: clamp(36px, 5.5vw, 58px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.04em;
    color: #fff;
    margin-bottom: 24px;
}

.home-gradient-text {
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 40%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-lead {
    font-size: 18px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.62);
    max-width: 520px;
    margin-bottom: 36px;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 48px;
}

.btn-hero-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset, 0 8px 32px rgba(79, 70, 229, 0.45);
    padding: 16px 32px;
    font-size: 16px;
}

.btn-hero-primary:hover {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 12px 40px rgba(79, 70, 229, 0.55);
    color: #fff;
}

.btn-hero-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: none;
    padding: 16px 32px;
    font-size: 16px;
}

.btn-hero-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.home-stats {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.home-stat strong {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 4px;
}

.home-stat span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

.home-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.12);
}

/* Hero visual */
.home-hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
}

.home-visual-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    animation: home-pulse 4s ease-in-out infinite;
}

@keyframes home-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.home-upload-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    cursor: pointer;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.home-upload-card:hover {
    transform: translateY(-4px);
    border-color: rgba(165, 180, 252, 0.4);
    box-shadow: 0 32px 100px rgba(79, 70, 229, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.home-upload-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
}

.home-upload-body { padding: 24px 20px; }

.home-upload-drop {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 40px 20px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}

.home-upload-card:hover .home-upload-drop {
    border-color: rgba(165, 180, 252, 0.5);
    background: rgba(99, 102, 241, 0.08);
}

.home-upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.2));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c7d2fe;
}

.home-upload-drop p {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px;
}

.home-upload-drop span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.home-upload-footer {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.home-upload-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
}

.home-float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    white-space: nowrap;
}

.home-float-card .icon { color: #34d399; }
.home-float-2 .icon { color: #a5b4fc; }

.home-float-1 {
    top: 12%;
    right: -8%;
    animation: home-float 5s ease-in-out infinite;
}

.home-float-2 {
    bottom: 18%;
    left: -12%;
    animation: home-float 5s ease-in-out infinite 1.5s;
}

@keyframes home-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Platforms bar */
.page-home .home-platforms {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(3, 7, 18, 1) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 48px 0 56px;
}

.home-platforms-label {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.42);
    margin-bottom: 28px;
}

.home-platform-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.home-platform-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 12px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.home-platform-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(165, 180, 252, 0.28);
}

.home-platform-icon-wrap {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.platform-icon {
    display: inline-flex;
    flex-shrink: 0;
    width: var(--platform-icon-size, 40px);
    height: var(--platform-icon-size, 40px);
}

.platform-icon svg,
.platform-icon img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.home-platform-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    text-align: center;
    line-height: 1.4;
}

/* Sections */
.page-home .home-section {
    padding: 96px 0;
    background: #030712;
}

.page-home .home-section-band {
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
        linear-gradient(180deg, #0b1220 0%, #030712 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-home .home-section-band-alt {
    background:
        radial-gradient(ellipse 60% 45% at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 55%),
        linear-gradient(180deg, #030712 0%, #0f172a 100%);
}

.home-section {
    padding: 96px 0;
}

.home-section-dark {
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
}

.home-section-head {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 56px;
}

.page-home .home-section-head h2 {
    color: #fff;
}

.page-home .home-section-head p {
    color: rgba(255, 255, 255, 0.55);
}

.page-home .home-section-tag {
    color: #a5b4fc;
}

.home-section-head h2 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    color: var(--text);
}

.home-section-head p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.home-section-head-light h2 { color: #fff; }
.home-section-head-light p { color: rgba(255, 255, 255, 0.55); }

.home-section-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary);
    margin-bottom: 16px;
}

.home-section-head-light .home-section-tag {
    color: #a5b4fc;
}

/* Workflow */
.home-workflow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.page-home .home-workflow-step {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.page-home .home-workflow-step:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(165, 180, 252, 0.28);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.page-home .home-workflow-num {
    color: rgba(255, 255, 255, 0.06);
}

.page-home .home-workflow-icon {
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
}

.page-home .home-workflow-step h3 {
    color: #f8fafc;
}

.page-home .home-workflow-step p {
    color: rgba(255, 255, 255, 0.48);
}

.home-workflow-step {
    position: relative;
    padding: 32px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: box-shadow 0.25s, transform 0.25s;
}

.home-workflow-step:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.home-workflow-num {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 48px;
    font-weight: 800;
    color: var(--border-light);
    line-height: 1;
    letter-spacing: -0.04em;
}

.home-workflow-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 20px;
}

.home-workflow-step h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.home-workflow-step p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
}

/* Showcase */
.home-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.home-showcase-item {
    width: 160px;
    text-align: center;
    padding: 24px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    transition: background 0.2s, border-color 0.2s;
}

.home-showcase-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(165, 180, 252, 0.3);
}

.home-showcase-item.is-source {
    border-color: rgba(165, 180, 252, 0.4);
    background: rgba(99, 102, 241, 0.12);
}

.home-showcase-thumb {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.15));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c7d2fe;
}

.home-showcase-item h4 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.home-showcase-item p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
}

.home-showcase-arrow {
    color: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
}

/* Features */
.home-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.page-home .home-feature-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.page-home .home-feature-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(165, 180, 252, 0.28);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.page-home .home-feature-icon {
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
}

.page-home .home-feature-card h3 {
    color: #f8fafc;
}

.page-home .home-feature-card p {
    color: rgba(255, 255, 255, 0.48);
}

.home-feature-card {
    padding: 32px 28px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: box-shadow 0.25s;
}

.home-feature-card:hover {
    box-shadow: var(--shadow-lg);
}

.home-feature-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary-light), #ede9fe);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 20px;
}

.home-feature-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.home-feature-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
}

/* CTA */
.home-cta {
    padding: 80px 0;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
}

.home-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.home-cta h2 {
    font-size: clamp(24px, 3.5vw, 32px);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.home-cta p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.75);
}

.btn-cta {
    background: #fff;
    color: #4f46e5;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.btn-cta:hover {
    background: #f8fafc;
    color: #4338ca;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Footer dark */
.site-footer-dark {
    background: #030712;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 40px 0;
}

.home-footer-inner {
    text-align: center;
}

.home-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    margin-bottom: 8px;
}

.home-footer-brand .icon { color: #818cf8; }

.home-footer-inner > p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* Homepage responsive */
@media (max-width: 1024px) {
    .home-hero-inner { grid-template-columns: 1fr; gap: 48px; text-align: center; }
    .home-lead { margin-left: auto; margin-right: auto; }
    .home-hero-actions { justify-content: center; }
    .home-stats { justify-content: center; }
    .home-platform-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-workflow { grid-template-columns: repeat(2, 1fr); }
    .home-features { grid-template-columns: repeat(2, 1fr); }
    .home-float-1 { right: 0; }
    .home-float-2 { left: 0; }
}

@media (max-width: 640px) {
    .home-hero { min-height: auto; padding-bottom: 64px; }
    .home-stats { gap: 16px; }
    .home-stat-divider { display: none; }
    .home-platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .home-platform-card { padding: 16px 10px 14px; }
    .home-workflow { grid-template-columns: 1fr; }
    .home-features { grid-template-columns: 1fr; }
    .home-showcase-arrow { display: none; }
    .home-showcase { gap: 16px; }
    .home-showcase-item { width: calc(50% - 8px); }
    .home-cta-inner { flex-direction: column; text-align: center; }
    .home-float-card { display: none; }
}

/* ============================================================
   App theme — logged-in member pages (matches homepage)
   ============================================================ */

.page-app {
    --bg-elevated: rgba(255, 255, 255, 0.04);
    --text: #f1f5f9;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.45);
    --border: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.06);
    --primary-light: rgba(99, 102, 241, 0.18);
    background: #030712;
    color: var(--text);
}

.page-app .app-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 50% at 50% -5%, rgba(99, 102, 241, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 40% 35% at 95% 70%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        linear-gradient(165deg, #030712 0%, #0f172a 50%, #1e1b4b 100%);
}

.page-app .app-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 10%, transparent 80%);
}

.page-app .navbar,
.page-app .main,
.page-app .site-footer {
    position: relative;
    z-index: 1;
}

/* App main */
.page-app .main-app {
    padding: 36px 0 88px;
    min-height: calc(100vh - var(--nav-h));
}

.page-app .page-content {
    animation: app-fade-in 0.35s ease;
}

@keyframes app-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-app .page-title {
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.page-app .page-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 10px;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    border-radius: 2px;
}

.page-app .page-desc {
    color: rgba(255, 255, 255, 0.5);
}

/* App cards */
.page-app .card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.page-app .card-hover:hover {
    border-color: rgba(165, 180, 252, 0.35);
    box-shadow: 0 12px 40px rgba(79, 70, 229, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.page-app .card-stat .label {
    color: rgba(255, 255, 255, 0.5);
}

.page-app .card-stat .value {
    color: #fff;
}

.page-app .card-stat .value.primary {
    color: #a5b4fc;
}

.page-app .package-card.featured {
    border-color: rgba(165, 180, 252, 0.45);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2), 0 12px 40px rgba(79, 70, 229, 0.2);
}

.page-app .package-card h3 { color: #fff; }
.page-app .package-card .price { color: #fff; }

/* Shared media / template cards */
.material-card { padding: 0; overflow: hidden; }
.material-card-body { padding: 14px; }
.material-meta { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

.media-thumb {
    height: 140px;
    background: linear-gradient(135deg, #e0e7ff, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-muted);
}

.template-card { text-align: center; }
.template-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.template-card .section-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.template-thumb {
    height: 120px;
    background: linear-gradient(135deg, #e0e7ff, #f1f5f9);
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

/* App product / media cards */
.page-app .product-card .thumb {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(30, 27, 75, 0.5));
}

.page-app .product-card h3 { color: #fff; }

.page-app .media-thumb {
    height: 140px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(30, 27, 75, 0.4));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
}

.page-app .template-thumb {
    height: 120px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(30, 27, 75, 0.35));
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
}

.page-app .template-card h3 { color: #fff; }

.page-app .badge-success {
    background: rgba(5, 150, 105, 0.2);
    color: #6ee7b7;
}

/* App empty state */
.page-app .empty-state .icon-wrap {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.page-app .empty-state h3 { color: #fff; }
.page-app .empty-state p { color: rgba(255, 255, 255, 0.45); }

/* App badges */
.page-app .badge {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
}

.page-app .badge-muted {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
}

.page-app .badge-status-pending {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

.page-app .badge-status-queued {
    background: rgba(99, 102, 241, 0.22);
    color: #a5b4fc;
}

.page-app .badge-status-processing {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.page-app .badge-status-completed {
    background: rgba(5, 150, 105, 0.2);
    color: #6ee7b7;
}

.page-app .badge-status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.page-app .badge-status-cancelled {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
}

/* App tables */
.page-app table.data-table th {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.45);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.page-app table.data-table td {
    color: rgba(255, 255, 255, 0.72);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.page-app table.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.page-app table.data-table a {
    color: #a5b4fc;
}

.page-app table.data-table a:hover {
    color: #c7d2fe;
}

/* App forms */
.page-app .form-group label {
    color: rgba(255, 255, 255, 0.6);
}

.page-app .form-input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.page-app .form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.page-app .form-input:focus,
.page-app .form-select:focus {
    border-color: rgba(165, 180, 252, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.page-app .form-select {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a5b4fc' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.page-app .form-select option {
    background: #1e293b;
    color: #f1f5f9;
}

.page-app .source-tab span {
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
}

.page-app .source-tab input:checked + span {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(165, 180, 252, 0.45);
    color: #e0e7ff;
}

.page-app .product-preview {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(30, 27, 75, 0.4));
}

.page-app .type-check-inner {
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.65);
}

.page-app .type-check input:checked + .type-check-inner {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(165, 180, 252, 0.5);
    color: #e0e7ff;
}

.page-app .type-price { color: rgba(255, 255, 255, 0.4); }
.page-app .type-check input:checked + .type-check-inner .type-price { color: #a5b4fc; }

.page-app .cost-value { color: #a5b4fc; }
.page-app .cost-breakdown { color: rgba(255, 255, 255, 0.55); }
.page-app .cost-breakdown li { border-bottom-color: rgba(255, 255, 255, 0.06); }
.page-app .cost-breakdown strong { color: #c7d2fe; }

.page-app .hint-inline { color: rgba(255, 255, 255, 0.4); }

.page-app .upload-zone {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
}

.page-app .upload-zone:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(165, 180, 252, 0.4);
}

.page-app .upload-zone .title { color: #fff; }
.page-app .upload-zone .icon-wrap {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

/* App buttons */
.page-app .btn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
}

.page-app .btn:hover {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    box-shadow: 0 6px 24px rgba(79, 70, 229, 0.45);
}

.page-app .btn-outline {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

.page-app .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* App alerts */
.page-app .alert-success {
    background: rgba(5, 150, 105, 0.15);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.3);
}

.page-app .alert-error {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.3);
}

/* App list items (agent page) */
.page-app .list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
}

.page-app .list-row span:first-child {
    color: rgba(255, 255, 255, 0.65);
}

.card-heading {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-heading-sm { font-size: 15px; margin-bottom: 16px; }

.page-app .card h3,
.page-app .card-heading {
    color: #fff;
}

.page-app .card > p,
.page-app .card .section-desc {
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
}

.page-app .site-footer-dark {
    background: rgba(3, 7, 18, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.page-app .site-footer-dark p {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
}

/* ============================================================
   Auth pages — login / register (guest)
   ============================================================ */

.page-auth {
    background: #030712;
    min-height: 100vh;
}

.page-auth::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(99, 102, 241, 0.25) 0%, transparent 60%),
        linear-gradient(165deg, #030712 0%, #0f172a 60%, #1e1b4b 100%);
}

.page-auth .navbar,
.page-auth .main,
.page-auth .site-footer {
    position: relative;
    z-index: 1;
}

.page-auth .main-auth {
    padding: 48px 0 80px;
}

.page-auth .auth-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-lg);
}

.page-auth .auth-header h1 {
    color: #fff;
}

.page-auth .auth-header p {
    color: rgba(255, 255, 255, 0.45);
}

.page-auth .auth-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.page-auth .form-group label {
    color: rgba(255, 255, 255, 0.6);
}

.page-auth .form-input,
.page-auth .form-select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.page-auth .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a5b4fc' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.page-auth .form-select option {
    background: #1e293b;
    color: #f1f5f9;
}

.page-auth .form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.page-auth .form-check {
    color: rgba(255, 255, 255, 0.6);
}

.page-auth .auth-footer {
    color: rgba(255, 255, 255, 0.45);
}

.page-auth .auth-footer a {
    color: #a5b4fc;
}

.page-auth .btn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.4);
}

/* Front pagination */
.front-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}
.front-pagination-summary {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}
.front-pagination-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.front-pagination-list li { margin: 0; }
.front-pagination-list a,
.front-pagination-list span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    line-height: 1;
}
.front-pagination-list a:hover {
    background: var(--primary-light);
    border-color: #c7d2fe;
    color: var(--primary);
}
.front-pagination-list li.active span {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}
.front-pagination-list li.disabled span {
    color: var(--text-muted);
    background: var(--border-light);
    cursor: not-allowed;
}

.page-app .front-pagination-summary {
    color: rgba(255, 255, 255, 0.45);
}
.page-app .front-pagination-list a,
.page-app .front-pagination-list span {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
}
.page-app .front-pagination-list a:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(165, 180, 252, 0.45);
    color: #e0e7ff;
}
.page-app .front-pagination-list li.active span {
    background: rgba(99, 102, 241, 0.88);
    border-color: rgba(165, 180, 252, 0.55);
    color: #fff;
}
.page-app .front-pagination-list li.disabled span {
    color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.03);
}

.material-pagination,
.product-pagination,
.template-pagination {
    margin-top: 24px;
}

@media (max-width: 640px) {
    .front-pagination {
        flex-direction: column;
        align-items: stretch;
    }
    .front-pagination-list {
        justify-content: center;
    }
}

/* Image generation progress */
.gen-progress-page { max-width: 900px; margin: 0 auto; }
.gen-result-page { max-width: 960px; margin: 0 auto; }
.gen-progress-card { padding: 28px 24px 24px; margin-bottom: 20px; overflow: hidden; }
.gen-progress-done .gen-progress-bar { animation: none; }
.gen-progress-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.gen-orbit { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.gen-orbit-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid rgba(99,102,241,.25);
    border-top-color: #818cf8;
    animation: genSpin 2s linear infinite;
    will-change: transform;
}
.gen-orbit-static .gen-orbit-ring { display: none; }
.gen-orbit-core {
    position: absolute; inset: 14px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,.35), rgba(168,85,247,.2));
    display: flex; align-items: center; justify-content: center;
    color: #c7d2fe;
}
.gen-orbit-static .gen-orbit-core { animation: none; inset: 0; }
.gen-orbit-success { background: rgba(34,197,94,.2); color: #4ade80; }
.gen-status-label { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.gen-status-hint { color: var(--text-muted); font-size: 14px; }
.gen-progress-bar-wrap {
    height: 10px; border-radius: 999px;
    background: rgba(255,255,255,.08); overflow: hidden;
}
.gen-progress-bar {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width .4s ease;
    will-change: width;
}
.gen-progress-percent { text-align: right; font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.gen-steps {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    margin-top: 24px;
}
.gen-step {
    text-align: center; padding: 12px 8px; border-radius: 12px;
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
    opacity: .45; transition: all .35s ease;
}
.gen-step.active { opacity: 1; border-color: rgba(99,102,241,.45); background: rgba(99,102,241,.12); }
.gen-step.done { opacity: .85; border-color: rgba(34,197,94,.35); }
.gen-step-icon { margin-bottom: 6px; color: #a5b4fc; }
.gen-step.done .gen-step-icon { color: #4ade80; }
.gen-step-text { font-size: 12px; color: var(--text-secondary); }
.gen-ref-preview {
    display: flex; align-items: center; gap: 12px; margin-top: 20px;
    padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08);
}
.gen-ref-preview img {
    width: 48px; height: 48px; object-fit: cover; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.12);
}
.gen-ref-preview span { font-size: 13px; color: var(--text-muted); }
.gen-count-badge {
    font-size: 12px; font-weight: 500; color: #a5b4fc;
    background: rgba(99,102,241,.15); padding: 2px 10px; border-radius: 999px; margin-left: 8px;
}
.gen-materials-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px;
}
.gen-material-slot { aspect-ratio: 1; }
.gen-slot-inner {
    width: 100%; height: 100%; border-radius: 14px;
    background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.12);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.2); position: relative; overflow: hidden;
    transition: border-color .3s, transform .3s;
}
.gen-material-slot.filled .gen-slot-inner {
    border-style: solid; border-color: rgba(99,102,241,.35);
    color: transparent; cursor: pointer;
}
.gen-material-slot.filled img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    animation: genReveal .5s ease;
}
.gen-slot-shimmer {
    position: absolute; inset: 0;
    background: rgba(255,255,255,.04);
}
.gen-material-slot.filled .gen-slot-shimmer { display: none; }
.gen-slot-label {
    position: absolute; left: 8px; top: 8px; z-index: 2;
    font-size: 10px; background: rgba(0,0,0,.55); color: #fff;
    padding: 2px 8px; border-radius: 999px;
}
.gen-fail-card { text-align: center; padding: 32px 24px; margin-bottom: 20px; }
.gen-fail-icon { color: #f87171; margin-bottom: 12px; }
@keyframes genSpin { to { transform: rotate(360deg); } }
@keyframes genReveal { from { opacity: 0; } to { opacity: 1; } }

