:root {
    --bg: #0b0b0c;
    --bg-glow: #2a2210;
    --card: #141416;
    --card-border: #2e2818;
    --input-bg: #0f0f11;
    --text: #f2ede2;
    --muted: #a39d90;
    --border: #3a3527;
    --gold: #d4af37;
    --gold-light: #f3dc8c;
    --gold-dark: #9c7a22;
    --on-gold: #0b0b0c;
    --danger: #ff8a7a;
    --danger-bg: rgba(255, 99, 79, 0.12);
    --success: #f3dc8c;
    --success-bg: rgba(212, 175, 55, 0.12);
    --buy: #3ecf8e;
    --buy-bg: rgba(62, 207, 142, 0.14);
    --sell: #ff6b6b;
    --sell-bg: rgba(255, 107, 107, 0.14);
    --radius: 12px;
    color-scheme: dark;                 /* dropdown & kontrol bawaan browser ikut gelap */
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 50% 0%, var(--bg-glow), var(--bg) 55%);
    background-color: var(--bg);
}

.page {
    max-width: 440px;
    margin: 0 auto;
    padding: 40px 16px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    width: 40px;
    height: 50px;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-name span { color: var(--gold); }

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

h1 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    color: var(--gold-light);
}

.lead {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 0.95rem;
}

.field { margin-bottom: 16px; }

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    background: var(--input-bg);
}

input::placeholder { color: #6b665c; }

input:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.has-error input, .has-error select { border-color: var(--danger); }

.hint {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.error {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: var(--danger);
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }

.btn {
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 50%, var(--gold-dark));
    color: var(--on-gold);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover { filter: brightness(1.08); }

.btn-secondary {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold-light);
}

.btn-secondary:hover { background: rgba(212, 175, 55, 0.1); filter: none; }

.switch {
    margin: 18px 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
}

.switch a {
    color: var(--gold);
    font-weight: 600;
    text-decoration: none;
}

.switch a:hover { color: var(--gold-light); }

.profile {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 16px;
    margin: 0 0 22px;
    font-size: 0.95rem;
}

.profile dt { color: var(--muted); }
.profile dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ================= Sinyal ================= */

a.btn {
    display: block;
    text-align: center;
    text-decoration: none;
}

.label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 380px) {
    .field-row { grid-template-columns: 1fr; gap: 0; }
}

/* Pilihan BUY / SELL berbentuk dua tombol */
.side-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.side-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.side-toggle label {
    margin: 0;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--muted);
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.side-toggle label:hover { border-color: #5a4f33; color: var(--text); }
.side-toggle input:focus-visible + label { box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3); }
.side-toggle input:checked + .side-buy {
    border-color: var(--buy);
    background: var(--buy-bg);
    color: var(--buy);
    box-shadow: 0 0 18px rgba(62, 207, 142, 0.18);
}
.side-toggle input:checked + .side-sell {
    border-color: var(--sell);
    background: var(--sell-bg);
    color: var(--sell);
    box-shadow: 0 0 18px rgba(255, 107, 107, 0.18);
}

.notice {
    margin: 4px 0 18px;
    padding: 10px 12px;
    border-left: 3px solid var(--gold);
    background: rgba(212, 175, 55, 0.07);
    color: var(--muted);
    font-size: 0.85rem;
}
.notice strong { color: var(--gold-light); }

/* Tombol Google (mengikuti pedoman merek Google: latar putih, logo G berwarna) */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 0.8rem;
    animation: fade-in 0.6s ease 0.85s both;
}
.divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #fff;
    color: #1f1f1f;
    font-weight: 600;
    text-decoration: none;
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
    animation: fade-up 0.6s cubic-bezier(.2, .8, .2, 1) 0.9s both;
}
.btn-google:hover { background: #f8f9fa; box-shadow: 0 4px 16px rgba(212, 175, 55, 0.25); }

.form-section {
    margin: 22px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--card-border);
    color: var(--gold);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}
.card form > .form-section:first-of-type,
.card > .form-section:first-of-type { margin-top: 0; }

input[readonly], input:disabled {
    color: var(--muted);
    background: #0c0c0d;
    border-style: dashed;
    cursor: not-allowed;
}

.empty {
    margin: 0;
    padding: 24px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
}
.badge-buy { background: var(--buy-bg); color: var(--buy); }
.badge-sell { background: var(--sell-bg); color: var(--sell); }
.badge-status { background: rgba(212, 175, 55, 0.12); color: var(--gold-light); letter-spacing: 0.3px; }

/* Status sinyal */
.status-pending, .status-running, .status-tp, .status-sl { letter-spacing: 0.3px; }
.status-pending { background: rgba(163, 157, 144, 0.14); color: var(--muted); }
.status-running {
    background: rgba(212, 175, 55, 0.14);
    color: var(--gold-light);
    animation: pulse-gold 2s ease-in-out infinite;
}
.status-tp { background: var(--buy-bg); color: var(--buy); }
.status-sl { background: var(--sell-bg); color: var(--sell); }

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.35); }
    50% { box-shadow: 0 0 0 4px rgba(212, 175, 55, 0); }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.text-buy { color: var(--buy); }
.text-sell { color: var(--sell); }
.link { color: var(--gold); font-weight: 600; text-decoration: none; transition: color 0.2s ease; }
.link:hover { color: var(--gold-light); }

/* ================= Layout aplikasi (menu kiri) ================= */

:root { --sidebar-w: 248px; }

body.app { min-height: 100vh; }

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: 22px 14px 16px;
    background: #0e0e10;
    border-right: 1px solid var(--card-border);
}

.sidebar .brand {
    justify-content: flex-start;
    gap: 10px;
    margin: 0 8px 28px;
}
.sidebar .brand-mark { width: 32px; height: 40px; }
.sidebar .brand-name { font-size: 1.25rem; }

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-item:hover { background: rgba(212, 175, 55, 0.07); color: var(--text); }
.nav-item.is-active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.04));
    color: var(--gold-light);
}
.nav-item.is-active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--gold);
}
.nav-item.is-disabled { opacity: 0.45; cursor: not-allowed; }
.nav-item.is-disabled:hover { background: none; color: var(--muted); }
.icon { flex-shrink: 0; }

.soon {
    margin-left: auto;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 8px 0;
    border-top: 1px solid var(--card-border);
}
.avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    color: var(--on-gold);
    font-weight: 700;
}
.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.sidebar-user-info strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.88rem;
}
.sidebar-user-info small { color: var(--muted); font-size: 0.75rem; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.icon-btn:hover { color: var(--gold-light); border-color: var(--border); background: rgba(212, 175, 55, 0.06); }

.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 60px;
    padding: 0 28px;
    background: rgba(11, 11, 12, 0.82);
    border-bottom: 1px solid var(--card-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.topbar-title {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
    font-weight: 600;
}
.menu-btn { display: none; }

/* Ticker harga live */
.ticker {
    display: flex;
    gap: 10px;
    margin-left: auto;
}
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--card);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.3s ease;
}
.ticker-pair { color: var(--muted); font-weight: 600; letter-spacing: 0.5px; }
.ticker-bid { color: var(--gold-light); min-width: 64px; text-align: right; }
.ticker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--buy);
    box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.6);
    animation: live-dot 1.6s ease-out infinite;
}
.ticker-item.is-stale .ticker-dot { background: #6b665c; animation: none; }
.ticker-item.is-stale .ticker-bid { color: var(--muted); }
.ticker-item.flash-up { animation: flash-up 0.8s ease; }
.ticker-item.flash-down { animation: flash-down 0.8s ease; }

@keyframes live-dot {
    0% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.6); }
    100% { box-shadow: 0 0 0 8px rgba(62, 207, 142, 0); }
}
@keyframes flash-up {
    0% { border-color: var(--buy); background: var(--buy-bg); }
    100% { border-color: var(--card-border); background: var(--card); }
}
@keyframes flash-down {
    0% { border-color: var(--sell); background: var(--sell-bg); }
    100% { border-color: var(--card-border); background: var(--card); }
}

.app-content {
    max-width: 1400px;
    padding: 28px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    animation: fade-up 0.6s cubic-bezier(.2, .8, .2, 1) both;
}
.page-head h2 { margin: 0 0 4px; font-size: 1.45rem; color: var(--gold-light); }
.page-head p { margin: 0; font-size: 0.93rem; }

.btn-inline {
    width: auto;
    padding: 11px 20px;
    white-space: nowrap;
}

/* Kartu statistik */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    animation: fade-up 0.6s cubic-bezier(.2, .8, .2, 1) both;
    transition: border-color 0.25s ease;
}
.stat:hover { border-color: #5a4f33; }
.stat:nth-child(1) { animation-delay: 0.10s; }
.stat:nth-child(2) { animation-delay: 0.16s; }
.stat:nth-child(3) { animation-delay: 0.22s; }
.stat:nth-child(4) { animation-delay: 0.28s; }
.stat-label { color: var(--muted); font-size: 0.82rem; }
.stat-value { font-size: 1.7rem; line-height: 1.1; }
.stat-value small { color: var(--muted); font-size: 0.9rem; font-weight: 500; }

.meter {
    width: 100%;
    height: 6px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: #232018;
    -webkit-appearance: none;
    appearance: none;
}
.meter::-webkit-progress-bar { background: #232018; border-radius: 999px; }
.meter::-webkit-progress-value { background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); border-radius: 999px; }
.meter::-moz-progress-bar { background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); border-radius: 999px; }

/* Panel konten di halaman aplikasi */
.panel { padding: 20px; animation-delay: 0.3s; }
.panel-narrow { max-width: 560px; }
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.panel-head h3 { margin: 0; font-size: 1rem; color: var(--gold); letter-spacing: 0.3px; }

/* Tabel sinyal */
.table-wrap {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}
.signal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.signal-table th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}
.signal-table td {
    padding: 12px;
    border-bottom: 1px solid #1f1c14;
}
.signal-table tbody tr {
    transition: background-color 0.2s ease;
    animation: fade-in 0.5s ease both;
    animation-delay: 0.45s;
}
.signal-table tbody tr:hover { background: rgba(212, 175, 55, 0.05); }
.signal-table tbody tr:last-child td { border-bottom: 0; }
.signal-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.signal-table .tp { color: var(--buy); }
.signal-table .sl { color: var(--sell); }
.signal-pair { font-weight: 700; letter-spacing: 0.5px; }
.signal-table .points { font-weight: 700; }
.signal-table .actions { text-align: right; white-space: nowrap; }
.signal-table .actions form { margin: 0; }

.btn-delete {
    padding: 5px 12px;
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 6px;
    background: transparent;
    color: var(--sell);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn-delete:hover { background: var(--sell-bg); border-color: var(--sell); }
.locked { color: #6b665c; font-size: 0.78rem; }

.stat-sub { color: var(--muted); font-size: 0.78rem; }

/* Sinyal berjalan: poin floating + bar SL -> TP */
.live-bar {
    display: block;
    width: 96px;
    height: 10px;
    margin-top: 6px;
    overflow: visible;
}
.live-bar-sl { fill: rgba(255, 107, 107, 0.45); }
.live-bar-tp { fill: rgba(62, 207, 142, 0.45); }
.live-bar-entry { fill: var(--gold); }
.live-bar-now {
    fill: var(--text);
    transition: x 0.6s ease;
}
.live-points {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}
.live-points::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: live-dot 1.6s ease-out infinite;
}
.live-points.muted::before { animation: none; }
tr.live-hit td { background: rgba(212, 175, 55, 0.12); transition: background-color 0.4s ease; }

/* Dashboard: sinyal terbaru (kiri) + leaderboard (kanan) */
.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1180px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

.signal-table.is-compact td,
.signal-table.is-compact th { padding-left: 8px; padding-right: 8px; }
.signal-table.is-compact .signal-pair { display: block; margin-bottom: 3px; }

/* Peringkat analis */
.stats-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) { .stats-2 { grid-template-columns: 1fr; } }

.my-rank-card {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 10px 16px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: var(--radius);
    background: var(--card);
    font-size: 0.8rem;
}
.my-rank-card strong { color: var(--gold-light); font-size: 1.6rem; line-height: 1.1; }

.podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    align-items: end;
    gap: 14px;
    margin-bottom: 20px;
}
.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 14px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    text-align: center;
    text-decoration: none;
    animation: fade-up 0.6s cubic-bezier(.2, .8, .2, 1) both;
    transition: border-color 0.25s ease, transform 0.25s ease;
}
.podium-item:hover { border-color: var(--gold); }
.podium-1 { padding-top: 30px; border-color: rgba(212, 175, 55, 0.5); background: linear-gradient(180deg, rgba(212, 175, 55, 0.14), var(--card) 70%); animation-delay: 0.15s; }
.podium-2 { animation-delay: 0.25s; }
.podium-3 { animation-delay: 0.35s; }
.podium-avatar {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1f1c14;
    border: 2px solid var(--gold-dark);
    color: var(--gold-light);
    font-size: 1.3rem;
    font-weight: 700;
}
.podium-1 .podium-avatar { width: 64px; height: 64px; border-color: var(--gold); font-size: 1.6rem; box-shadow: 0 0 20px rgba(212, 175, 55, 0.35); }
.podium-name { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.podium-points { font-weight: 700; font-size: 1.1rem; }
.podium-meta { font-size: 0.75rem; }
@media (max-width: 640px) {
    .podium { grid-template-columns: 1fr; }
    .podium-1 { order: -1; }
}

.search input {
    width: 220px;
    padding: 8px 12px;
    font-size: 0.88rem;
}
.ranking-table tr.is-me td { background: rgba(212, 175, 55, 0.08); }
.ranking-table tr.is-me td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.analyst-link { display: block; color: var(--text); font-weight: 600; text-decoration: none; transition: color 0.2s ease; }
.analyst-link:hover { color: var(--gold-light); text-decoration: underline; }
.analyst-link em { color: var(--gold); font-style: normal; font-size: 0.8rem; }
.ranking-table .lb-meta { display: block; }
.winrate-cell { min-width: 110px; }
.winrate-cell span { font-weight: 600; font-size: 0.85rem; }
.winrate-cell .meter { display: block; margin-top: 4px; }

/* Profil analis */
.back-link { display: inline-block; margin-bottom: 14px; font-size: 0.9rem; }
.analyst-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}
.analyst-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    color: var(--on-gold);
    font-size: 1.6rem;
    font-weight: 700;
}
.analyst-id { flex: 1; min-width: 0; }
.analyst-id h2 { margin: 0 0 4px; color: var(--gold-light); font-size: 1.4rem; }
.analyst-id h2 em { color: var(--gold); font-style: normal; font-size: 0.9rem; }
.analyst-id p { margin: 0; font-size: 0.9rem; }
.analyst-rank { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.78rem; }
.rank-lg { width: 48px; height: 48px; font-size: 1.2rem; }
@media (max-width: 560px) {
    .analyst-head { flex-wrap: wrap; }
}

.stat-value-sm { font-size: 1.25rem; }

.points-chart { display: block; width: 100%; height: 180px; }
.chart-zero { stroke: #3a3527; stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.points-chart.is-up .chart-line { stroke: var(--buy); }
.points-chart.is-down .chart-line { stroke: var(--sell); }
.points-chart.is-up .chart-area { fill: rgba(62, 207, 142, 0.1); }
.points-chart.is-down .chart-area { fill: rgba(255, 107, 107, 0.1); }

.side-stats { display: grid; gap: 14px; margin: 0; }
.side-stats > div {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
}
.side-stats dd { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 0.85rem; }
.side-stats dd strong { font-size: 1.05rem; }
.history { margin-top: 20px; }

/* Leaderboard */
.leaderboard { animation-delay: 0.4s; }
.my-rank { color: var(--muted); font-size: 0.85rem; }
.my-rank strong { color: var(--gold-light); font-size: 1rem; }

.lb-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.lb-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-bottom: 1px solid #1f1c14;
    border-radius: 6px;
    animation: fade-in 0.5s ease 0.5s both;
    transition: background-color 0.2s ease;
}
.lb-row:last-child { border-bottom: 0; }
.lb-row:hover { background: rgba(212, 175, 55, 0.05); }
.lb-row.is-me { background: rgba(212, 175, 55, 0.09); box-shadow: inset 3px 0 0 var(--gold); }
.lb-info { min-width: 0; }
.lb-name {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 600;
    font-size: 0.92rem;
}
.lb-meta { color: var(--muted); font-size: 0.74rem; }
.lb-points { font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-gap { padding: 2px; text-align: center; color: #6b665c; letter-spacing: 2px; }

.rank {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}
.rank-1 {
    border: 0;
    background: linear-gradient(135deg, #f7e3a1, #d4af37 55%, #9c7a22);
    color: var(--on-gold);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.45);
}
.rank-2 { border: 0; background: linear-gradient(135deg, #f1f1f1, #b9bcc2 55%, #7d8188); color: #16171a; }
.rank-3 { border: 0; background: linear-gradient(135deg, #f0c39a, #c27c45 55%, #8a5229); color: #1a120b; }

.lb-name em { color: var(--gold); font-style: normal; font-weight: 600; font-size: 0.8rem; }
.lb-note { margin: 12px 0 0; font-size: 0.75rem; }
.stat-main { border-color: rgba(212, 175, 55, 0.35); }

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 0.9rem;
}

.app-content > .alert { animation: pop-in 0.5s cubic-bezier(.2, .8, .2, 1) 0.1s both; }

/* Layar konfirmasi sinyal (pengaman salah entri) */
.review-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.review-pair { font-size: 1.6rem; font-weight: 700; letter-spacing: 1px; }
.badge-lg { padding: 4px 14px; font-size: 0.85rem; }

.review-levels {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
}
.lvl {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: 8px;
    background: var(--input-bg);
    animation: fade-up 0.5s cubic-bezier(.2, .8, .2, 1) both;
}
.lvl:nth-child(1) { animation-delay: 0.35s; }
.lvl:nth-child(2) { animation-delay: 0.42s; }
.lvl:nth-child(3) { animation-delay: 0.49s; }
.lvl dt { color: var(--muted); font-size: 0.85rem; }
.lvl dd { margin: 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.lvl-note { min-width: 64px; color: var(--muted); font-size: 0.8rem; text-align: right; }
.lvl-tp { border-left-color: var(--buy); }
.lvl-tp dd { color: var(--buy); }
.lvl-sl { border-left-color: var(--sell); }
.lvl-sl dd { color: var(--sell); }
.lvl-entry { border-left-color: var(--gold); }

.review-rr { margin: 0 0 16px; color: var(--muted); font-size: 0.92rem; }
.review-rr strong { color: var(--gold-light); font-size: 1.05rem; }

.warn-box {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 170, 60, 0.45);
    border-radius: 8px;
    background: rgba(255, 170, 60, 0.08);
    color: #ffc27a;
    font-size: 0.88rem;
    animation: pop-in 0.4s ease 0.55s both, shake 0.45s ease 0.95s;
}
.warn-box ul { margin: 8px 0 0; padding-left: 18px; }
.warn-box li + li { margin-top: 6px; }

.ok-box {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--buy-bg);
    color: var(--buy);
    font-size: 0.88rem;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 400;
    font-size: 0.88rem;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.check:hover { border-color: #5a4f33; }
.check.has-error { border-color: var(--danger); }
.check input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    padding: 0;
    accent-color: var(--gold);
}
.check strong { color: var(--gold-light); }

.review-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin-top: 16px;
}

.sidebar-backdrop { display: none; }

/* Tablet: statistik 2 kolom */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}

/* HP & tablet kecil: menu kiri jadi laci yang bisa dibuka */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(.2, .8, .2, 1);
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.5);
    }
    body.sidebar-open .sidebar { transform: none; }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 20;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    body.sidebar-open { overflow: hidden; }

    .app-main { margin-left: 0; }
    .menu-btn { display: grid; }
    .topbar { padding: 0 16px; }
    .app-content { padding: 20px 16px; }
}

@media (max-width: 560px) {
    .page-head { flex-direction: column; align-items: stretch; }
    .btn-inline { width: 100%; }
    .stats { gap: 10px; }
    .stat { padding: 14px; }
    .stat-value { font-size: 1.4rem; }
}

/* ================= Animasi ================= */

/* Cahaya emas di latar yang "bernapas" pelan */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(212, 175, 55, 0.16), transparent 70%);
    animation: breathe 7s ease-in-out infinite alternate;
}

/* Logo: perisai dan G "digambar", lalu cakra muncul dan berputar pelan */
.logo-draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 1.2s cubic-bezier(.65, 0, .35, 1) 0.2s forwards;
}
.logo-g { animation-delay: 0.6s; animation-duration: 1s; }
.logo-cakra {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: fade-in 0.6s ease-out 1.4s forwards, spin 14s linear 1.4s infinite;
}

/* Nama merek turun masuk, kartu naik masuk */
.brand { animation: fade-down 0.7s cubic-bezier(.2, .8, .2, 1) both; }
.brand-name span {
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold), var(--gold-dark));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer-text 6s ease-in-out 1.5s infinite;
}

.card {
    position: relative;
    overflow: hidden;
    animation: fade-up 0.8s cubic-bezier(.2, .8, .2, 1) 0.15s both;
}

/* Kilau emas yang menyapu garis atas kartu */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
    transform: translateX(-100%);
    animation: sweep 4s ease-in-out 1.2s infinite;
}

/* Isi kartu muncul berurutan */
.card > h1,
.card > .lead,
.card > .alert,
.card form .field,
.card form .btn,
.card > .switch,
.card .profile > * {
    animation: fade-up 0.6s cubic-bezier(.2, .8, .2, 1) both;
}
.card > h1 { animation-delay: 0.30s; }
.card > .lead { animation-delay: 0.38s; }
.card form .field:nth-of-type(1) { animation-delay: 0.46s; }
.card form .field:nth-of-type(2) { animation-delay: 0.52s; }
.card form .field:nth-of-type(3) { animation-delay: 0.58s; }
.card form .field:nth-of-type(4) { animation-delay: 0.64s; }
.card form .field:nth-of-type(5) { animation-delay: 0.70s; }
.card form .field:nth-of-type(6) { animation-delay: 0.76s; }
.card form .btn { animation-delay: 0.82s; }
.card > .switch { animation-delay: 0.90s; }
.card .profile > * { animation-delay: 0.4s; }

/* Pesan error bergetar, pesan sukses muncul lembut */
.card > .alert-error { animation: fade-up 0.4s ease both, shake 0.45s ease 0.4s; }
.card > .alert-success { animation: pop-in 0.5s cubic-bezier(.2, .8, .2, 1) 0.35s both; }
.error { animation: fade-in 0.4s ease both; }

/* Input */
input, select {
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
input:hover, select:hover { border-color: #5a4f33; }
input:focus, select:focus { background-color: #121214; }
.field:focus-within label { color: var(--gold-light); }
label { transition: color 0.25s ease; }

/* Tombol: kilau menyapu saat hover, sedikit mengecil saat ditekan */
.btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.3s ease, filter 0.3s ease;
}
.btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}
.btn:hover { box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3); }
.btn:hover::after { left: 120%; }
.btn:active { transform: scale(0.98); }
.btn-secondary::after { background: linear-gradient(100deg, transparent, rgba(243, 220, 140, 0.25), transparent); }
.btn-secondary:hover { box-shadow: 0 8px 24px rgba(212, 175, 55, 0.15); }

/* Status memproses (diaktifkan oleh assets/app.js saat form dikirim) */
.btn.is-loading {
    color: transparent;
    pointer-events: none;
}
.btn.is-loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(11, 11, 12, 0.25);
    border-top-color: var(--on-gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-secondary.is-loading::before {
    border-color: rgba(243, 220, 140, 0.25);
    border-top-color: var(--gold-light);
}

.switch a { transition: color 0.2s ease; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}
@keyframes fade-down {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: none; }
}
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pop-in {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: none; }
}
@keyframes shake {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
@keyframes sweep {
    0% { transform: translateX(-100%); }
    50%, 100% { transform: translateX(100%); }
}
@keyframes shimmer-text {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes breathe {
    from { opacity: 0.55; transform: scale(1); }
    to { opacity: 1; transform: scale(1.08); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes draw {
    to { stroke-dashoffset: 0; }
}

/* Hormati pengguna yang mematikan animasi di perangkatnya */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0s !important;
        transition-duration: 0.01ms !important;
    }
    .btn.is-loading::before { animation-iteration-count: infinite !important; animation-duration: 1.5s !important; }
}

/* ================= Saldo & langganan analis ================= */
.text-gold { color: var(--gold-light); }

.sidebar-saldo {
    margin-top: 2px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.sidebar-saldo:hover { color: var(--gold-light); }

.follow-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    border-color: rgba(212, 175, 55, 0.35);
}
.follow-box strong { color: var(--gold-light); }
.follow-box p { margin: 4px 0 0; font-size: 0.85rem; }
.follow-box .btn-inline { flex-shrink: 0; }
.follow-box.is-following { background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), transparent 70%), var(--card); }

.badge.badge-following {
    margin-top: 4px;
    background: rgba(212, 175, 55, 0.14);
    color: var(--gold-light);
    font-size: 0.68rem;
}

.follow-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.follow-chip {
    display: flex;
    flex-direction: column;
    padding: 8px 14px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s ease;
}
.follow-chip:hover { border-color: var(--gold); }
.follow-chip strong { font-size: 0.85rem; }
.follow-chip small { color: var(--muted); font-size: 0.72rem; }

.sub-list { display: flex; flex-direction: column; }
.sub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 4px;
    border-bottom: 1px solid #1f1c14;
}
.sub-row:last-child { border-bottom: 0; }
.sub-info { min-width: 0; }
.sub-info .lb-meta { display: block; margin-top: 2px; }
.sub-toggle { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.lb-row.lb-row-plain { grid-template-columns: minmax(0, 1fr) auto; color: var(--text); text-decoration: none; }
.lb-row-plain .lb-meta { display: block; }

@media (max-width: 640px) {
    .follow-box, .sub-row { flex-direction: column; align-items: stretch; }
    .sub-toggle { justify-content: space-between; }
}
