/* ================================================================
   CAPTCHA CLOUD — Indigo SaaS Design System
   Primary: #4F46E5 → #7C3AED  ·  Accent: #06B6D4
   Calistoga + Inter + JetBrains Mono
   ================================================================ */

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #6366F1;
    --primary-50: #EEF2FF;
    --primary-100: #E0E7FF;
    --primary-200: #C7D2FE;
    --gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --gradient-soft: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 100%);
    --gradient-dark: linear-gradient(160deg, #1E1B4B 0%, #0F172A 100%);
    --accent: #06B6D4;
    --accent-bg: #ECFEFF;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --success: #10B981;
    --success-bg: #ECFDF5;
    --error: #EF4444;
    --error-bg: #FEF2F2;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 16px -4px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 40px -8px rgba(0,0,0,0.1);
    --serif: 'Calistoga', Georgia, serif;
    --sans: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.2s;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--sans);
    font-size: 0.938rem;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--primary-hover); }
::selection { background: var(--primary-100); color: var(--text); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ===== LAYOUT ===== */

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px; min-height: 100vh;
    background: var(--gradient-dark);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    transition: transform 0.3s var(--ease);
}

.sidebar .brand { padding: 1.5rem 1.5rem 1.25rem; }
.sidebar .brand-name {
    font-family: var(--serif); font-size: 1.25rem; color: #fff;
    display: flex; align-items: center; gap: 0.6rem; line-height: 1.2;
}
.sidebar .brand-icon {
    width: 34px; height: 34px; background: var(--gradient);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1rem; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79,70,229,0.4);
}
.sidebar .brand-sub {
    font-size: 0.62rem; color: #6366F1; margin-top: 0.2rem;
    letter-spacing: 0.08em; padding-left: 2.85rem;
}

.sidebar nav { flex: 1; padding: 0.25rem 0; overflow-y: auto; }
.sidebar .nav-group {
    font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: #475569; font-weight: 600; padding: 1.25rem 1.5rem 0.4rem;
}
.sidebar nav a {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.6rem 1.5rem; margin: 2px 0.6rem; color: #94A3B8;
    font-size: 0.88rem; font-weight: 500; border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
}
.sidebar nav a i { font-size: 1.1rem; width: 20px; text-align: center; opacity: 0.7; transition: opacity var(--duration); }
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #E2E8F0; }
.sidebar nav a:hover i { opacity: 1; }
.sidebar nav a.active { background: rgba(79,70,229,0.25); color: #fff; font-weight: 600; }
.sidebar nav a.active i { color: #A5B4FC; opacity: 1; }

.sidebar-footer {
    padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.7rem; color: #64748B;
    display: flex; flex-direction: column; gap: 0.4rem;
}
.sidebar-footer .sf-row { display: flex; justify-content: space-between; align-items: center; }
.sidebar-footer a { color: #94A3B8; font-weight: 500; font-size: 0.68rem; transition: color var(--duration); }
.sidebar-footer a:hover { color: #E2E8F0; }

.main { flex: 1; margin-left: 250px; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); padding: 0.85rem 2rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-family: var(--serif); font-size: 1.5rem; color: var(--text); }
.topbar .meta { font-size: 0.78rem; color: var(--text-muted); }

.mobile-toggle {
    display: none; background: none; border: none; font-size: 1.4rem;
    color: var(--text); cursor: pointer; padding: 0.25rem;
}

.content { padding: 1.5rem 2rem 2.5rem; flex: 1; animation: fadeUp 0.35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== ALERTS ===== */

.alert {
    padding: 0.8rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem;
    font-size: 0.9rem; font-weight: 500; display: flex; align-items: center; gap: 0.5rem;
    animation: slideDown 0.3s var(--ease);
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.alert-success { background: var(--success-bg); color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: var(--error-bg); color: #991B1B; border: 1px solid #FECACA; }

/* ===== STAT CARDS ===== */

.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 0.75rem; margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.35rem 1.5rem; position: relative; overflow: hidden;
    transition: all var(--duration) var(--ease);
}
.stat-card::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
    background: var(--gradient); opacity: 0; transition: opacity var(--duration);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card:hover::after { opacity: 1; }
.stat-card .stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.35rem; }
.stat-card .stat-value { font-family: var(--serif); font-size: 2rem; color: var(--text); line-height: 1.1; }
.stat-card .stat-value .stat-unit { font-size: 0.85rem; font-family: var(--sans); color: var(--text-muted); font-weight: 400; }
.stat-card .stat-sub { font-size: 0.75rem; color: var(--text-light); margin-top: 0.25rem; }
.stat-card .stat-accent { color: var(--success); }
.stat-card .stat-warn { color: var(--error); }

/* ===== INFO BANNER ===== */

.info-banner {
    background: var(--gradient); border-radius: var(--radius-lg); padding: 1.75rem 2rem;
    color: #fff; position: relative; overflow: hidden; margin-bottom: 1.5rem;
}
.info-banner::before {
    content: ''; position: absolute; top: -40%; right: -8%; width: 220px; height: 220px;
    background: rgba(255,255,255,0.06); border-radius: 50%;
}
.info-banner::after {
    content: ''; position: absolute; bottom: -50%; right: 20%; width: 160px; height: 160px;
    background: rgba(255,255,255,0.04); border-radius: 50%;
}
.info-banner .ib-content { position: relative; z-index: 1; }
.info-banner .ib-greeting { font-size: 0.85rem; opacity: 0.75; margin-bottom: 0.3rem; }
.info-banner .ib-title { font-family: var(--serif); font-size: 1.35rem; margin-bottom: 0.2rem; }
.info-banner .ib-value { font-family: var(--serif); font-size: 2.8rem; line-height: 1; }
.info-banner .ib-value .ib-unit { font-size: 1rem; font-family: var(--sans); opacity: 0.65; }
.info-banner .ib-actions { position: relative; z-index: 1; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.info-banner .ib-actions a {
    background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600;
    display: flex; align-items: center; gap: 0.3rem; transition: all var(--duration);
}
.info-banner .ib-actions a:hover { background: rgba(255,255,255,0.25); }
.info-banner-split { display: flex; justify-content: space-between; align-items: center; }

/* ===== KEY DISPLAY ===== */

.key-display { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.key-display .key-badge {
    font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem;
    border-radius: 6px; background: var(--primary-50); color: var(--primary);
    min-width: 50px; text-align: center; flex-shrink: 0;
}
.key-display .key-code {
    font-family: var(--mono); font-size: 0.88rem; background: var(--border-light);
    padding: 0.4rem 0.75rem; border-radius: 6px; flex: 1; word-break: break-all;
    color: var(--text-secondary);
}
.key-display .key-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }

/* ===== TABLES ===== */

.table-wrap {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem;
}
table { width: 100%; border-collapse: collapse; }
table thead th {
    font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
    padding: 0.85rem 1.1rem; text-align: left; background: var(--border-light);
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
table tbody td {
    padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem; vertical-align: middle;
}
table tbody tr { transition: background var(--duration) var(--ease); }
table tbody tr:hover { background: var(--primary-50); }
table tbody tr:last-child td { border-bottom: none; }
table .mono { font-family: var(--mono); font-size: 0.84rem; color: var(--text-secondary); }
table .text-right { text-align: right; }
table .text-center { text-align: center; }

/* ===== BADGES ===== */

.badge {
    display: inline-flex; align-items: center; gap: 0.2rem;
    padding: 0.2rem 0.65rem; font-size: 0.72rem; font-weight: 600;
    border-radius: 6px; letter-spacing: 0.01em; white-space: nowrap;
}
.badge-primary { background: var(--primary-100); color: var(--primary-hover); }
.badge-success { background: var(--success-bg); color: #065F46; }
.badge-error { background: var(--error-bg); color: #991B1B; }
.badge-warning { background: var(--warning-bg); color: #92400E; }
.badge-gray { background: var(--border-light); color: var(--text-muted); }
.badge-accent { background: var(--accent-bg); color: #0E7490; }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }

/* ===== BUTTONS ===== */

.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 1.25rem; font-family: var(--sans); font-size: 0.85rem; font-weight: 600;
    border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--duration) var(--ease); line-height: 1.4; white-space: nowrap;
    text-decoration: none;
}
.btn-primary {
    background: var(--gradient); color: #fff; border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(79,70,229,0.25);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(79,70,229,0.35); transform: translateY(-1px); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover { background: var(--border-light); border-color: #CBD5E1; color: var(--text); }
.btn-danger { background: var(--surface); color: var(--error); border-color: #FECACA; }
.btn-danger:hover { background: var(--error-bg); }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.78rem; }
.btn-xs { padding: 0.15rem 0.45rem; font-size: 0.62rem; }
.btn-group { display: flex; gap: 0.3rem; align-items: center; }
.btn-icon { padding: 0.3rem; font-size: 0.9rem; }

/* ===== FORMS ===== */

.form-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem;
}
.form-card .form-title {
    font-family: var(--serif); font-size: 1.15rem; color: var(--text);
    margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 0.45rem;
}
.form-group { margin-bottom: 0.85rem; }
.form-group label {
    display: block; font-size: 0.82rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 0.3rem;
}
.form-group label .label-hint { font-weight: 400; color: var(--text-light); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.6rem 0.85rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface);
    font-family: var(--sans); font-size: 0.9rem; color: var(--text); outline: none;
    transition: all var(--duration) var(--ease);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}
.form-group input:disabled, .form-group input[readonly] {
    background: var(--border-light); color: var(--text-muted); cursor: not-allowed;
}
.form-group input.mono-input { font-family: var(--mono); font-size: 0.78rem; }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group select { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.85rem; }
.form-actions {
    display: flex; gap: 0.5rem; margin-top: 1.25rem; padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}
.form-inline { display: flex; gap: 0.5rem; align-items: flex-end; }

/* ===== TOOLBAR ===== */

.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; gap: 0.75rem; flex-wrap: wrap;
}
.toolbar .record-count { font-size: 0.8rem; color: var(--text-muted); }
.filters { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.filters select, .filters input[type="text"], .filters input[type="date"] {
    padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: var(--sans); font-size: 0.85rem; background: var(--surface); outline: none;
    transition: border-color var(--duration);
}
.filters select:focus, .filters input:focus { border-color: var(--primary-light); }
.filters input[type="text"] { min-width: 180px; }
.filters .filter-sep { color: var(--text-light); font-size: 0.7rem; }

/* ===== PAGINATION ===== */

.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 0.25rem; margin-top: 1.5rem;
}
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 0.6rem; font-size: 0.82rem; font-weight: 600;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-secondary); background: var(--surface);
    transition: all var(--duration) var(--ease); text-decoration: none;
}
.pagination a:hover { background: var(--primary-50); border-color: var(--primary-200); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== CHARTS ===== */

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.5rem; }
.chart-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem; transition: box-shadow var(--duration);
}
.chart-card:hover { box-shadow: var(--shadow); }
.chart-card .chart-title { font-family: var(--serif); font-size: 1.1rem; color: var(--text); }
.chart-card .chart-sub { font-size: 0.75rem; color: var(--text-light); margin-bottom: 0.75rem; }
.chart-card canvas { width: 100% !important; height: 200px !important; }

/* ===== DETAIL CARD ===== */

.detail-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 1.25rem; overflow: hidden;
}
.detail-card .detail-header {
    padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border-light);
    font-family: var(--serif); font-size: 1.05rem; color: var(--text);
    background: var(--border-light); display: flex; align-items: center;
    justify-content: space-between; gap: 0.5rem;
}
.detail-card .detail-body { padding: 1.25rem; }
.detail-card .detail-body.no-pad { padding: 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.detail-item .detail-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.15rem; }
.detail-item .detail-value { font-size: 0.92rem; font-weight: 500; color: var(--text); }

/* ===== TIMELINE ITEM (transactions/logs) ===== */

.timeline-list { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
    background: var(--surface); border: 1px solid var(--border); border-bottom: none;
    padding: 1rem 1.5rem; display: flex; align-items: center; gap: 1rem;
    transition: all var(--duration) var(--ease); position: relative;
}
.timeline-list .timeline-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.timeline-list .timeline-item:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.timeline-list .timeline-item:only-child { border-radius: var(--radius); border-bottom: 1px solid var(--border); }
.timeline-item:hover { background: var(--primary-50); z-index: 1; }
.timeline-item .ti-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.timeline-item .ti-icon.ti-in { background: var(--success-bg); color: var(--success); }
.timeline-item .ti-icon.ti-out { background: var(--error-bg); color: var(--error); }
.timeline-item .ti-icon.ti-info { background: var(--primary-50); color: var(--primary); }
.timeline-item .ti-body { flex: 1; min-width: 0; }
.timeline-item .ti-title { font-size: 0.95rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.timeline-item .ti-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.25rem; }
.timeline-item .ti-meta i { font-size: 0.85rem; vertical-align: -1px; }
.timeline-item .ti-amount { text-align: right; flex-shrink: 0; padding-left: 0.5rem; }
.timeline-item .ti-amount .ti-pts { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
.timeline-item .ti-amount .ti-pts.positive { color: var(--success); }
.timeline-item .ti-amount .ti-pts.negative { color: var(--error); }
.timeline-item .ti-amount .ti-bal { font-size: 0.75rem; color: var(--text-light); margin-top: 0.1rem; }

/* ===== LOG ENTRY ===== */

.log-entry {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.85rem 1.25rem; display: flex; gap: 0.85rem; align-items: flex-start;
    transition: all var(--duration) var(--ease);
}
.log-entry:hover { box-shadow: var(--shadow-xs); }
.log-entry .le-thumb {
    width: 110px; height: 80px; border-radius: var(--radius-sm); overflow: hidden;
    background: var(--border-light); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.log-entry .le-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.log-entry .le-thumb .le-noimg { font-size: 0.6rem; color: var(--text-light); }
.log-entry .le-body { flex: 1; min-width: 0; }
.log-entry .le-head { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.log-entry .le-head .le-id { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--text-light); }
.log-entry .le-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.4rem; font-size: 0.82rem;
}
.log-entry .le-grid span { color: var(--text-light); }
.log-entry .le-grid strong { color: var(--text); margin-left: 0.2rem; }
.log-entry .le-results { margin-top: 0.4rem; font-size: 0.78rem; }
.log-entry .le-results span { color: var(--text-light); }
.log-entry .le-error { margin-top: 0.4rem; font-size: 0.78rem; color: var(--error); }
.log-list { display: flex; flex-direction: column; gap: 0.5rem; }

/* ===== NODE CARDS ===== */

.node-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.node-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.85rem 1.1rem; display: flex; align-items: center; justify-content: space-between;
    transition: all var(--duration) var(--ease);
}
.node-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.node-card .node-name { font-weight: 600; font-size: 0.95rem; }
.node-card .node-host { font-family: var(--mono); font-size: 0.8rem; color: var(--text-muted); }

/* ===== COPY BTN ===== */

.copy-btn {
    display: inline-flex; align-items: center; cursor: pointer;
    font-size: 0.72rem; font-weight: 600; color: var(--primary);
    border: 1px solid var(--primary-200); padding: 0.15rem 0.5rem;
    background: var(--primary-50); border-radius: 5px;
    transition: all var(--duration) var(--ease);
}
.copy-btn:hover { background: var(--primary-100); }

/* ===== MISC ===== */

.empty { text-align: center; padding: 2.5rem 1.5rem; color: var(--text-light); font-size: 0.9rem; }
.points-positive { color: var(--success); font-weight: 700; }
.points-negative { color: var(--error); font-weight: 700; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 0.5rem; }
.mb { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.font-serif { font-family: var(--serif); }
.font-mono { font-family: var(--mono); }

/* ===== MODAL ===== */

.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(15,23,42,0.5); backdrop-filter: blur(4px);
    z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--surface); border-radius: var(--radius-lg);
    width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg); animation: modalIn 0.25s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-light);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-family: var(--serif); font-size: 1.05rem; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.5rem; }

/* ===== PROGRESS BAR ===== */

.progress-bar {
    width: 100%; height: 8px; background: var(--border-light);
    border-radius: 99px; overflow: hidden; position: relative;
}
.progress-bar .progress-fill {
    height: 100%; border-radius: 99px;
    background: var(--gradient); transition: width 0.4s var(--ease);
}
.progress-bar .progress-fill.pg-success { background: var(--success); }
.progress-bar .progress-fill.pg-warning { background: var(--warning); }
.progress-bar .progress-fill.pg-error { background: var(--error); }
.progress-info {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem;
}
.progress-info strong { color: var(--text); }
.quota-card {
    background: var(--gradient-soft); border: 1px solid var(--primary-100);
    border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 0.75rem;
}
.quota-card .qc-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.2rem; }
.quota-card .qc-value { font-family: var(--serif); font-size: 1.3rem; color: var(--text); }
.quota-card .qc-mode { font-size: 0.7rem; }
.quota-none { background: var(--border-light); border-color: var(--border); }

/* ===== AUTH PAGES ===== */

.auth-page { display: flex; min-height: 100vh; }
.auth-hero {
    flex: 1; background: var(--gradient); display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 3rem; color: #fff;
    position: relative; overflow: hidden;
}
.auth-hero::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.07) 0%, transparent 60%);
    animation: heroFloat 20s ease-in-out infinite;
}
@keyframes heroFloat { 0%,100%{transform:translate(0,0)} 50%{transform:translate(20px,-15px)} }
.auth-hero .ah-icon {
    width: 72px; height: 72px; background: rgba(255,255,255,0.12);
    border-radius: 20px; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; margin-bottom: 1.5rem; position: relative; backdrop-filter: blur(10px);
}
.auth-hero h2 { font-family: var(--serif); font-size: 2rem; margin-bottom: 0.4rem; position: relative; }
.auth-hero p { font-size: 0.85rem; opacity: 0.8; max-width: 280px; text-align: center; line-height: 1.6; position: relative; }
.auth-form-wrap {
    width: 440px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 3rem; background: var(--surface);
}
.auth-form { width: 100%; max-width: 340px; }
.auth-form .af-head { margin-bottom: 1.75rem; }
.auth-form .af-head h1 { font-family: var(--serif); font-size: 1.5rem; color: var(--text); margin-bottom: 0.25rem; }
.auth-form .af-head p { font-size: 0.8rem; color: var(--text-muted); }
.auth-form .af-error {
    padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.8rem;
    margin-bottom: 1rem; background: var(--error-bg); color: #991B1B; border: 1px solid #FECACA;
    display: flex; align-items: center; gap: 0.35rem;
}
.auth-form label { display: block; font-size: 0.7rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.25rem; }
.auth-form input {
    width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface);
    font-family: var(--sans); font-size: 0.85rem; color: var(--text);
    margin-bottom: 0.85rem; outline: none; transition: all var(--duration) var(--ease);
}
.auth-form input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(79,70,229,0.08); }
.auth-form .af-submit {
    width: 100%; padding: 0.7rem; background: var(--gradient); color: #fff;
    border: none; border-radius: var(--radius-sm); font-family: var(--sans);
    font-size: 0.85rem; font-weight: 600; cursor: pointer; margin-top: 0.25rem;
    transition: all var(--duration) var(--ease); box-shadow: 0 1px 3px rgba(79,70,229,0.25);
}
.auth-form .af-submit:hover { box-shadow: 0 4px 14px rgba(79,70,229,0.35); transform: translateY(-1px); }
.auth-form .af-links { text-align: center; margin-top: 1.5rem; font-size: 0.75rem; color: var(--text-muted); }
.auth-form .af-links a { color: var(--primary); font-weight: 600; }

.auth-tabs {
    display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; margin-bottom: 1.5rem;
}
.auth-tabs button {
    flex: 1; padding: 0.55rem; background: var(--border-light); border: none;
    font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
    color: var(--text-muted); cursor: pointer; transition: all var(--duration);
}
.auth-tabs button.active { background: var(--primary); color: #fff; }
.auth-tabs button:hover:not(.active) { background: #E2E8F0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.auth-success {
    background: var(--success-bg); border: 1px solid #A7F3D0;
    border-radius: var(--radius); padding: 1.75rem; text-align: center;
}
.auth-success .as-icon { font-size: 2.5rem; color: var(--success); margin-bottom: 0.5rem; }
.auth-success h2 { font-family: var(--serif); font-size: 1.1rem; color: #065F46; margin-bottom: 0.75rem; }
.auth-success .cred-table { width: 100%; text-align: left; border-collapse: collapse; margin-bottom: 0.75rem; }
.auth-success .cred-table th { font-size: 0.6rem; font-weight: 600; color: var(--text-muted); padding: 0.4rem 0; }
.auth-success .cred-table td { font-family: var(--mono); font-size: 0.72rem; padding: 0.4rem 0; word-break: break-all; color: var(--text); }

/* ===== DOC STYLES ===== */

.doc-hero {
    background: var(--gradient); border-radius: var(--radius-lg); padding: 2rem 2.5rem;
    margin-bottom: 1.5rem; color: #fff; position: relative; overflow: hidden;
}
.doc-hero::before { content: ''; position: absolute; top: -40%; right: -10%; width: 300px; height: 300px; background: rgba(255,255,255,0.05); border-radius: 50%; }
.doc-hero h2 { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 0.2rem; position: relative; }
.doc-hero p { font-size: 0.8rem; opacity: 0.8; position: relative; }
.doc-tabs {
    display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; margin-bottom: 1.5rem;
}
.doc-tabs button {
    flex: 1; padding: 0.6rem; background: var(--border-light); border: none;
    font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
    color: var(--text-muted); cursor: pointer; transition: all var(--duration);
    display: flex; align-items: center; justify-content: center; gap: 0.3rem;
}
.doc-tabs button.active { background: var(--primary); color: #fff; }
.doc-tabs button:hover:not(.active) { background: #E2E8F0; }
.doc-panel { display: none; }
.doc-panel.active { display: block; }
.endpoint-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.endpoint-header { padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 0.65rem; }
.endpoint-header .method { padding: 0.2rem 0.55rem; border-radius: 5px; font-family: var(--mono); font-size: 0.68rem; font-weight: 700; color: #fff; }
.method-post { background: var(--primary); }
.method-get { background: var(--success); }
.endpoint-header .path { font-family: var(--mono); font-size: 0.82rem; font-weight: 600; color: var(--text); }
.endpoint-header .desc { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); }
.endpoint-body { padding: 1.25rem; }
.endpoint-body h4 { font-size: 0.78rem; font-weight: 700; color: var(--text); margin: 1rem 0 0.4rem; }
.endpoint-body h4:first-child { margin-top: 0; }
.param-table { width: 100%; border-collapse: collapse; margin-bottom: 0.5rem; }
.param-table th { font-size: 0.62rem; font-weight: 600; color: var(--text-muted); padding: 0.35rem 0.6rem; text-align: left; background: var(--border-light); border-bottom: 1px solid var(--border); }
.param-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border-light); font-size: 0.76rem; }
.param-table code { background: var(--border-light); padding: 0.1rem 0.3rem; border-radius: 4px; font-family: var(--mono); font-size: 0.72rem; }
.code-block {
    background: #0F172A; border-radius: var(--radius-sm); padding: 1.25rem;
    font-family: var(--mono); font-size: 0.72rem; color: #E2E8F0;
    overflow-x: auto; line-height: 1.8; margin: 0.5rem 0 0.75rem;
}
.c-kw { color: #C084FC; } .c-str { color: #60A5FA; } .c-num { color: #34D399; }
.c-cmt { color: #64748B; } .c-fn { color: #F9A8D4; } .c-key { color: #FBBF24; }
.resp-ok { background: var(--success-bg); border: 1px solid #A7F3D0; border-radius: var(--radius-sm); padding: 1rem; font-family: var(--mono); font-size: 0.72rem; color: #065F46; overflow-x: auto; line-height: 1.7; margin: 0.4rem 0; }
.resp-err { background: var(--error-bg); border: 1px solid #FECACA; border-radius: var(--radius-sm); padding: 1rem; font-family: var(--mono); font-size: 0.72rem; color: #991B1B; overflow-x: auto; line-height: 1.7; margin: 0.4rem 0; }
.auth-box { background: var(--gradient-soft); border: 1px solid var(--primary-100); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.auth-box .auth-box-title { font-family: var(--serif); font-size: 0.95rem; margin-bottom: 0.65rem; }
.tip-box { background: var(--warning-bg); border: 1px solid #FDE68A; border-radius: var(--radius-sm); padding: 0.65rem 0.85rem; font-size: 0.74rem; color: #92400E; margin: 0.65rem 0; display: flex; align-items: flex-start; gap: 0.4rem; line-height: 1.6; }
.error-table { width: 100%; border-collapse: collapse; }
.error-table th { font-size: 0.62rem; font-weight: 600; color: var(--text-muted); padding: 0.35rem 0.6rem; text-align: left; background: var(--border-light); border-bottom: 1px solid var(--border); }
.error-table td { padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--border-light); font-size: 0.74rem; }
.flow-steps { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; padding: 0.5rem 0; }
.flow-step { padding: 0.4rem 0.85rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; }
.flow-arrow { color: var(--text-light); font-size: 0.8rem; }

/* ===== USER BALANCE CARD (sidebar) ===== */

.user-balance-card {
    background: var(--gradient); border-radius: 10px;
    padding: 1rem 1.25rem; margin: 0 0.75rem 0.5rem; color: #fff;
}
.user-balance-card .ub-label { font-size: 0.68rem; opacity: 0.65; margin-bottom: 0.15rem; }
.user-balance-card .ub-value { font-family: var(--serif); font-size: 1.7rem; line-height: 1.1; }
.user-balance-card .ub-sub { font-size: 0.68rem; opacity: 0.55; margin-top: 0.2rem; }

/* ===== TOAST ===== */

@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-5px); } }

/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
    .chart-grid, .two-col { grid-template-columns: 1fr; }
    .form-row, .detail-grid { grid-template-columns: 1fr; }
    .form-row-3, .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .mobile-toggle { display: block; }
    .main { margin-left: 0; }
    .topbar { padding: 0.75rem 1rem; }
    .content { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .info-banner-split { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .auth-hero { display: none; }
    .auth-form-wrap { width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr; }
}
