/* =========================================================================
   DuinoCoin Dashboard design system
   No framework. Dark, glassy, gold-accented. Everything is driven by the
   CSS variables in :root so re-theming means editing one block.
   ========================================================================= */

:root {
    /* Brand / accent (DuinoCoin gold) */
    --gold: #ffc940;
    --gold-soft: #ffd75e;
    --gold-deep: #f5a623;

    /* Surfaces */
    --bg: #0a0e16;
    --bg-2: #0e131f;
    --surface: #141b2b;
    --surface-2: #1a2233;
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .14);

    /* Text */
    --text: #e8ecf5;
    --muted: #93a0b7;
    --faint: #5f6c82;

    /* Semantic */
    --up: #34d399;
    --down: #fb7185;

    /* Chart series palette */
    --c1: #ffc940;
    --c2: #2dd4bf;
    --c3: #a78bfa;
    --c4: #60a5fa;
    --c5: #f472b6;
    --c6: #fb923c;
    --c7: #4ade80;
    --c8: #22d3ee;
    --c9: #f87171;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    --maxw: 1120px;

    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo,
        Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1100px 600px at 12% -8%, rgba(255, 201, 64, .10), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(96, 165, 250, .08), transparent 55%),
        var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: var(--gold); }

h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.02em; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- Nav ---- */
.nav {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(14px);
    background: rgba(10, 14, 22, .72);
    border-bottom: 1px solid var(--border);
}
.nav__inner {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 62px;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}
.nav__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--text);
    white-space: nowrap;
}
.nav__brand img { width: 26px; height: 26px; }
.nav__brand b { color: var(--gold); }
.nav__links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.nav__links a {
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.nav__links a:hover { color: var(--text); background: var(--surface); }

/* --------------------------------------------------------------- Hero ---- */
.hero { text-align: center; padding: 70px 0 40px; }
.hero__logo {
    width: 84px; height: 84px; margin: 0 auto 18px;
    display: grid; place-items: center;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(255, 201, 64, .18), rgba(255, 201, 64, .02));
    border: 1px solid rgba(255, 201, 64, .25);
    box-shadow: 0 0 40px -8px rgba(255, 201, 64, .35);
}
.hero__logo img { width: 52px; height: 52px; }
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    background: linear-gradient(120deg, #fff 20%, var(--gold-soft) 90%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { color: var(--muted); font-size: 1.05rem; max-width: 620px; margin: 14px auto 0; }
.hero__links {
    display: flex; flex-wrap: wrap; gap: 10px 18px;
    justify-content: center; align-items: center;
    margin-top: 22px; color: var(--faint); font-size: .92rem;
}
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* ------------------------------------------------------------ Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font: inherit; font-weight: 600; font-size: .95rem;
    padding: 11px 20px; border-radius: 12px;
    border: 1px solid transparent; cursor: pointer;
    transition: transform .12s, box-shadow .2s, background .2s, border-color .2s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
    color: #201700;
    background: linear-gradient(160deg, var(--gold-soft), var(--gold-deep));
    box-shadow: 0 8px 20px -8px rgba(245, 166, 35, .7);
}
.btn--primary:hover { box-shadow: 0 10px 26px -6px rgba(245, 166, 35, .85); color: #201700; }
.btn--ghost {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--block { width: 100%; justify-content: center; }
.btn--lg { padding: 14px 24px; font-size: 1rem; }

/* -------------------------------------------------------------- Chips ---- */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px; font-size: .82rem; font-weight: 600;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--muted);
}

/* ------------------------------------------------------------ Section ---- */
.section { padding: 30px 0; scroll-margin-top: 80px; }
.section__head { margin-bottom: 18px; }
.section__eyebrow {
    text-transform: uppercase; letter-spacing: .14em; font-size: .74rem;
    font-weight: 700; color: var(--gold); margin-bottom: 6px;
}
.section__title { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.section__desc { color: var(--muted); margin-top: 6px; max-width: 640px; }

/* --------------------------------------------------------------- Card ---- */
.card {
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}
.card--pad-lg { padding: 28px; }

/* ------------------------------------------------------------- KPIs ------ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.kpi {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    transition: border-color .2s, transform .15s;
}
.kpi:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.kpi::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, var(--gold), transparent 70%);
    opacity: .8;
}
.kpi__label {
    display: flex; align-items: center; gap: 8px;
    color: var(--muted); font-size: .82rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em;
}
.kpi__label .ico { font-size: 1rem; filter: saturate(1.3); }
.kpi__value {
    font-family: var(--mono); font-variant-numeric: tabular-nums;
    font-size: 1.75rem; font-weight: 700; margin-top: 10px; letter-spacing: -.02em;
    line-height: 1.1;
}
.kpi__value small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.kpi__foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; font-size: .82rem; color: var(--faint);
}
.kpi__delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-family: var(--mono); }
.kpi__spark { margin-top: 12px; height: 34px; }
.kpi__spark svg { display: block; width: 100%; height: 34px; }

/* --------------------------------------------------------- Lookup card --- */
.lookup { text-align: center; }
/* keep the search box a comfortable width; results below use the full card */
.lookup #user-form { max-width: 560px; margin-left: auto; margin-right: auto; }
.field { text-align: left; }
.field label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon {
    display: grid; place-items: center; padding: 0 14px;
    background: var(--surface-2); border: 1px solid var(--border-strong);
    border-right: 0; border-radius: 12px 0 0 12px; color: var(--muted); font-weight: 700;
}
.input {
    flex: 1; min-width: 0; font: inherit; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--border-strong);
    border-radius: 0 12px 12px 0; padding: 13px 14px; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.input--full { border-radius: 12px; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 201, 64, .15); }

.user-data { text-align: left; margin-top: 24px; display: none; }
.user-data.is-open { display: block; animation: fade .4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 6px 0 20px; }
.stat-row .kpi { padding: 14px; }
.stat-row .kpi__value { font-size: 1.3rem; margin-top: 6px; }

/* -------------------------------------------------------------- Table ---- */
.table-scroll {
    max-height: 360px; overflow: auto; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-2);
}
.table-scroll--tall { max-height: 460px; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--surface-2); color: var(--muted);
    text-align: left; font-weight: 600; letter-spacing: .03em;
    padding: 11px 14px; border-bottom: 1px solid var(--border);
    text-transform: uppercase; font-size: .72rem;
}
table.data tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(255, 255, 255, .03); }
table.data td.num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.tag-amount {
    font-family: var(--mono); font-weight: 700; color: var(--gold);
}
.memo { color: var(--faint); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------- Charts ---- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart__guide { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0; }
.chart__dot { opacity: 0; }
.chart__tip {
    position: absolute; pointer-events: none; opacity: 0;
    transform: translate(-50%, -120%); transition: opacity .1s;
    background: rgba(10, 14, 22, .96); border: 1px solid var(--border-strong);
    border-radius: 10px; padding: 8px 11px; font-size: .8rem; z-index: 5;
    box-shadow: var(--shadow); white-space: nowrap; min-width: 120px;
}
.chart__tip .t-date { color: var(--muted); font-size: .74rem; margin-bottom: 5px; }
.chart__tip .t-row { display: flex; align-items: center; gap: 7px; }
.chart__tip .t-row + .t-row { margin-top: 3px; }
.chart__tip .t-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.chart__tip .t-name { color: var(--muted); margin-right: auto; padding-right: 12px; }
.chart__tip .t-val { font-family: var(--mono); font-weight: 700; }

.axis text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.grid-line { stroke: var(--border); stroke-width: 1; }

/* -------------------------------------------------------------- Legend --- */
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }
.legend__item { display: flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--muted); }
.legend__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend__item b { color: var(--text); font-family: var(--mono); }

/* Donut layout */
.donut-wrap { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 26px; align-items: center; }
.donut-legend { display: grid; gap: 4px; }
.donut-legend .row {
    display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center;
    padding: 7px 8px; border-radius: 8px;
}
.donut-legend .row:hover { background: rgba(255, 255, 255, .03); }
.donut-legend .dot { width: 11px; height: 11px; border-radius: 3px; }
.donut-legend .name { color: var(--text); }
.donut-legend .val { font-family: var(--mono); color: var(--muted); }
.donut-legend .pct { font-family: var(--mono); color: var(--text); font-weight: 700; min-width: 48px; text-align: right; }

/* ------------------------------------------------------------ Ad / misc -- */
.ad-slot {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
    background: var(--bg-2);
}
.ad-slot span { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.ad-slot iframe { width: 100%; max-width: 468px; height: 60px; border: 0; }

/* -------------------------------------------------------------- Footer --- */
.footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 46px 0; text-align: center; color: var(--muted); }
.footer h2 { font-size: 1.5rem; color: var(--text); }
.footer__links { display: flex; gap: 18px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ------------------------------------------------------------- Spinner --- */
.overlay {
    position: fixed; inset: 0; z-index: 90; display: none;
    place-items: center; background: rgba(6, 9, 15, .7); backdrop-filter: blur(3px);
}
.overlay.is-on { display: grid; }
.spinner {
    width: 46px; height: 46px; border-radius: 50%;
    border: 4px solid rgba(255, 201, 64, .2); border-top-color: var(--gold);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
    height: 320px; border-radius: var(--radius-sm);
    background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
    background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* --------------------------------------------------------------- News --- */
.newsbar {
    background: linear-gradient(90deg, rgba(255, 201, 64, .14), rgba(255, 201, 64, .03));
    border-bottom: 1px solid rgba(255, 201, 64, .22);
}
.newsbar__inner { display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.newsbar__badge {
    flex: none; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: #201700; background: linear-gradient(160deg, var(--gold-soft), var(--gold-deep));
    padding: 3px 10px; border-radius: 999px;
}
.newsbar__text { margin: 0; font-size: .9rem; color: var(--text); }
.newsbar__text b { color: var(--gold); }
.newsbar__close {
    margin-left: auto; flex: none; cursor: pointer; background: transparent; border: 0;
    color: var(--muted); font-size: 1.35rem; line-height: 1; padding: 0 6px; border-radius: 8px;
}
.newsbar__close:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

/* -------------------------------------------------------- Range picker --- */
.section__head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.range {
    display: inline-flex; gap: 2px; padding: 4px;
    background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 12px;
}
.range button {
    font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
    color: var(--muted); background: transparent; border: 0;
    padding: 8px 16px; border-radius: 9px; transition: color .15s, background .15s;
}
.range button:hover { color: var(--text); }
.range button.is-active {
    color: #201700; background: linear-gradient(160deg, var(--gold-soft), var(--gold-deep));
    box-shadow: 0 4px 12px -6px rgba(245, 166, 35, .7);
}
.range.is-busy { opacity: .55; pointer-events: none; }

/* ---------------------------------------------------------- Responsive --- */
@media (max-width: 760px) {
    .donut-wrap { grid-template-columns: 1fr; }
    .hero { padding: 46px 0 30px; }
    .nav__brand span.hide-sm { display: none; }
}
