/*
 * The console dashboard, drawn to the user's design (2 Oct 2026).
 * Light only, like the rest of the console's look. Served as a panel asset
 * (public/css/app/admin-dashboard.css), never inlined into the page.
 */

.db-page { --db-ink: #111827; --db-body: #374151; --db-muted: #6b7280; --db-faint: #9ca3af; --db-line: #edeff5; --db-soft: #f7f8fc; --db-brand: #5b3df5; --db-brand-2: #7c5cf6; --db-tint: #f1edff; --db-green: #16a34a; --db-red: #e11d48; }
.db-page.fi-page { padding-block: .8rem 1.5rem; }
/* The design runs close to the edges: a slim gutter beside the sidebar. */
.fi-main:has(.db-page) { padding-inline: .85rem; }
.db-page .fi-page-header-main-ctn { padding-block: 0; row-gap: 0; }
.db { display: grid; gap: .7rem; font-size: 13px; color: var(--db-body); }
.db [x-cloak] { display: none !important; }
.db h2 { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--db-ink); letter-spacing: -.005em; }
.db a { text-decoration: none; }
.db .is-busy { opacity: .55; transition: opacity .15s; }

/* ------------------------------------------------------------- hero */

.db-hero {
    position: relative;
    display: flex; align-items: center; gap: 1rem;
    min-height: 104px;
    padding: 1.15rem 1.35rem;
    border-radius: 16px;
    color: #fff;
    z-index: 3;
    background: var(--db-sky) right center / auto 128% no-repeat, linear-gradient(100deg, #4527d6 0%, #5134e6 38%, #6a4cf2 70%, #8e75f6 100%);
    box-shadow: 0 10px 30px -18px rgb(69 39 214 / .7);
}
.db-hero-text { position: relative; min-width: 0; }
.db-kicker { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .16em; opacity: .9; }
.db-kicker-i { width: 15px; height: 15px; color: #fff; opacity: .95; }
.db-hero h1 { margin: .3rem 0 .25rem; font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.db-hero p { margin: 0; font-size: 13px; opacity: .9; }
.db-hero-loading { position: absolute; left: 1.35rem; bottom: .45rem; font-size: 11px; opacity: .8; }

.db-range { position: relative; margin-left: auto; align-self: center; z-index: 5; }
.db-range-btn {
    display: flex; align-items: center; gap: .7rem;
    min-width: 182px; padding: .6rem .8rem;
    border-radius: 10px; border: 1px solid rgb(255 255 255 / .45);
    background: rgb(255 255 255 / .12); color: #fff; text-align: left;
    backdrop-filter: blur(6px);
}
.db-range-btn:hover { background: rgb(255 255 255 / .2); }
.db-range-i { width: 20px; height: 20px; flex: none; }
.db-range-text { display: grid; line-height: 1.25; min-width: 0; }
.db-range-text b { font-size: 12.5px; font-weight: 700; }
.db-range-text small { font-size: 10.5px; opacity: .85; white-space: nowrap; }
.db-range-chev { width: 16px; height: 16px; margin-left: auto; opacity: .9; }
.db-range-menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    width: 300px; padding: .35rem;
    border-radius: 12px; background: #fff; color: var(--db-ink);
    box-shadow: 0 18px 40px -12px rgb(17 24 39 / .35), 0 0 0 1px rgb(17 24 39 / .06);
}
.db-range-opt { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; padding: .5rem .6rem; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--db-body); text-align: left; white-space: nowrap; }
.db-range-opt small { font-size: 10.5px; font-weight: 500; color: var(--db-faint); white-space: nowrap; }
.db-range-opt:hover { background: var(--db-soft); }
.db-range-opt.is-on { background: var(--db-tint); color: var(--db-brand); }
.db-range-custom { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .45rem .5rem .55rem; }
.db-range-custom label { display: grid; gap: .2rem; font-size: 10.5px; font-weight: 600; color: var(--db-muted); }
.db-range-custom input, .db-seg-custom input { width: 100%; padding: .35rem .45rem; border: 1px solid var(--db-line); border-radius: 7px; font-size: 12px; color: var(--db-ink); background: #fff; }
.db-range-custom .db-btn { grid-column: 1 / -1; }
.db-btn { padding: .45rem .8rem; border-radius: 8px; background: var(--db-brand); color: #fff; font-size: 12px; font-weight: 700; }
.db-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------- the eight figures */

.db-kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .5rem; transition: opacity .15s; }
.db-kpi {
    display: grid; align-content: start; gap: .45rem;
    padding: .8rem .6rem .7rem;
    min-width: 0;
    border-radius: 12px; background: #fff;
    box-shadow: 0 1px 2px rgb(17 24 39 / .04), 0 0 0 1px var(--db-line);
    color: inherit;
}
a.db-kpi:hover { box-shadow: 0 6px 18px -10px rgb(91 61 245 / .45), 0 0 0 1px #d9d0ff; }
.db-kpi-top { display: flex; align-items: flex-start; gap: .38rem; min-width: 0; }
.db-kpi-label { font-size: 10px; letter-spacing: -.005em; font-weight: 500; color: var(--db-muted); line-height: 1.3; padding-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.db-kpi-value { font-size: 18px; font-weight: 800; color: var(--db-ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-kpi-value.is-long { font-size: 16px; }
.db-kpi-delta { display: flex; align-items: baseline; gap: .3rem; font-size: 10px; white-space: nowrap; overflow: hidden; }
.db-delta { font-weight: 700; white-space: nowrap; }
.db-delta.is-up { color: var(--db-green); }
.db-delta.is-down { color: var(--db-red); }
.db-delta.is-flat, .db-delta.is-new { color: var(--db-muted); }
.db-vs { color: var(--db-faint); white-space: nowrap; }

.db-tile { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; }
.db-tile svg { width: 16px; height: 16px; }
.db-tile.is-green { background: #e7f8ee; color: #16a34a; }
.db-tile.is-purple { background: #f1ebff; color: #7c3aed; }
.db-tile.is-blue { background: #e8efff; color: #2563eb; }
.db-tile.is-rose { background: #ffe9ed; color: #e11d48; }
.db-tile.is-amber { background: #fff3df; color: #f59e0b; }
.db-tile.is-violet { background: #efe9ff; color: #8b5cf6; }
.db-tile.is-teal { background: #e2f7f3; color: #0d9488; }
.db-tile.is-sky { background: #e6f1ff; color: #3b82f6; }

/* ------------------------------------------------------------- cards and rows */

.db-row { display: grid; gap: .7rem; align-items: stretch; }
.db-row.is-charts { grid-template-columns: 1.3fr 1.13fr 1fr; }
.db-row.is-lists { grid-template-columns: 1fr 1fr 1.1fr; }
.db-row.is-money { grid-template-columns: 1.7fr 1fr 1fr 1.52fr; }
.db-row.is-activity { grid-template-columns: 1.65fr 1.58fr .94fr 1fr; }

.db-card {
    min-width: 0;
    padding: .9rem 1rem;
    border-radius: 14px; background: #fff;
    box-shadow: 0 1px 2px rgb(17 24 39 / .04), 0 0 0 1px var(--db-line);
    transition: opacity .15s;
}
.db-card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .65rem; min-height: 26px; }
.db-card-head h2 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-more { display: inline-flex; align-items: center; gap: .3rem; font-size: 11px; font-weight: 600; color: var(--db-brand); white-space: nowrap; }
.db-more svg { width: 13px; height: 13px; }
.db-more:hover { text-decoration: underline; }
.db-empty { padding: .9rem 0; color: var(--db-faint); font-size: 12px; text-align: center; }
.db-feed li.db-empty, .db-region-list li.db-empty { display: block; }

/* Segmented tabs: 7 days / 30 days / Custom. */
.db-seg { display: inline-flex; flex: none; padding: 3px; border-radius: 9px; background: var(--db-soft); box-shadow: inset 0 0 0 1px var(--db-line); }
.db-seg button { white-space: nowrap; padding: .32rem .8rem; border-radius: 7px; font-size: 11px; font-weight: 600; color: var(--db-muted); }
.db-seg button:hover { color: var(--db-ink); }
.db-seg button.is-on { background: var(--db-brand); color: #fff; box-shadow: 0 4px 10px -4px rgb(91 61 245 / .7); }
.db-seg-custom { display: flex; gap: .4rem; margin: -.2rem 0 .6rem; }
.db-seg-custom input { width: auto; flex: 1; }

/* ------------------------------------------------------------- trend charts */

.db-trend { display: flex; flex-direction: column; }
.db-trend-figure { display: flex; align-items: center; gap: .6rem; }
.db-trend-figure b { font-size: 20px; font-weight: 800; color: var(--db-ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.db-pill { display: inline-flex; align-items: center; gap: .15rem; padding: .12rem .45rem; border-radius: 999px; font-size: 10.5px; font-weight: 700; }
.db-pill.is-up { background: #e7f8ee; color: var(--db-green); }
.db-pill.is-down { background: #ffe9ed; color: var(--db-red); }
.db-trend-sub { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .2rem; font-size: 10.5px; color: var(--db-faint); flex-wrap: wrap; }
.db-legend { display: inline-flex; align-items: center; gap: .35rem; color: var(--db-muted); white-space: nowrap; }
.db-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-left: .45rem; }
.db-legend i.is-now { background: var(--db-brand); }
.db-legend i.is-prev { background: #c4b5fd; }

.db-chart { position: relative; flex: 1; min-height: 170px; margin-top: .4rem; }
.db-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.db-grid { stroke: #eef0f6; stroke-width: 1; vector-effect: non-scaling-stroke; }
.db-axis { fill: var(--db-faint); font-size: 9.5px; font-family: inherit; }
.db-line { fill: none; stroke: var(--db-brand); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.db-line-prev { fill: none; stroke: #c4b5fd; stroke-width: 1.6; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.db-dot { fill: #fff; stroke: var(--db-brand); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.db-dot-prev { fill: #c4b5fd; }
.db-hairline { position: absolute; top: 6%; bottom: 17%; width: 0; border-left: 1px dashed #b9abf8; pointer-events: none; }
.db-focus { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 999px; background: var(--db-brand); box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgb(91 61 245 / .25); pointer-events: none; }
.db-tip {
    position: absolute; transform: translate(-50%, calc(-100% - 12px));
    display: grid; gap: .05rem; padding: .35rem .55rem;
    border-radius: 8px; background: #fff; white-space: nowrap; pointer-events: none;
    box-shadow: 0 8px 22px -8px rgb(17 24 39 / .3), 0 0 0 1px var(--db-line);
}
.db-tip small { font-size: 9.5px; color: var(--db-faint); }
.db-tip b { font-size: 11.5px; color: var(--db-ink); font-weight: 800; }

/* ------------------------------------------------------------- rings */

.db-rings { display: grid; gap: .8rem; align-content: start; }
.db-ring-row { display: grid; grid-template-columns: 112px 1fr; gap: 1rem; align-items: center; margin-top: .45rem; }
.db-ring { width: 112px; height: 112px; }
.db-ring-track { fill: none; stroke: #f1f2f7; stroke-width: 13; }
.db-ring-n { font-size: 15px; font-weight: 800; fill: var(--db-ink); }
.db-ring-l { font-size: 7px; fill: var(--db-faint); }
.db-ring-legend { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.db-ring-legend li { display: grid; grid-template-columns: 9px 1fr auto 44px; align-items: center; gap: .5rem; font-size: 11px; }
.db-ring-legend i { width: 9px; height: 9px; border-radius: 999px; }
.db-ring-legend span { color: var(--db-body); }
.db-ring-legend b { font-weight: 700; color: var(--db-ink); font-variant-numeric: tabular-nums; }
.db-ring-legend em { font-style: normal; color: var(--db-faint); text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- tables */

.db-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 11px; }
.db-table th { padding: .45rem .35rem; background: var(--db-soft); color: var(--db-muted); font-size: 9.5px; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-table th:first-child { border-radius: 7px 0 0 7px; }
.db-table th:last-child { border-radius: 0 7px 7px 0; }
.db-table td { padding: .5rem .45rem; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid #f3f4f8; color: var(--db-body); vertical-align: middle; }
.db-table tbody tr:last-child td { border-bottom: 0; }
.db-table.is-dense { font-size: 10.5px; }
.db-table.is-dense td { padding: .42rem .35rem; }
.db-table.is-dense th { padding-inline: .35rem; font-size: 9.5px; }
.db-table.is-dense .db-status { padding: .1rem .35rem; font-size: 9px; }
.db-table .is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-table .is-rank { width: 34px; text-align: center; padding-inline: 0; overflow: visible; }
.db-table .is-muted { color: var(--db-muted); white-space: nowrap; }
.db-table .is-mono { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--db-ink); }
.db-table .is-caps { text-transform: uppercase; }
.db-table .is-nowrap { white-space: nowrap; }
.db-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.db-rank { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: #f1f2f6; color: var(--db-muted); font-size: 11px; font-weight: 700; }
.db-rank.is-1 { background: #fef3c7; color: #b45309; }
.db-rank.is-2 { background: #eef0f4; color: #4b5563; }
.db-rank.is-3 { background: #ffedd5; color: #c2410c; }
.db-who { display: flex; align-items: center; gap: .55rem; min-width: 0; color: var(--db-ink); font-weight: 500; }
.db-avatar { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 999px; font-size: 9.5px; font-weight: 800; color: #fff; background: hsl(var(--h) 62% 52%); }
.db-avatar.is-sm { width: 20px; height: 20px; font-size: 9px; }

.db-status { display: inline-flex; align-items: center; padding: .12rem .45rem; border-radius: 6px; font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.db-status.is-pending { background: #fff4e5; color: #d97706; }
.db-status.is-approved, .db-status.is-completed { background: #e7f8ee; color: #16a34a; }
.db-status.is-rejected, .db-status.is-cancelled { background: #fdecee; color: #e11d48; }
.db-status.is-reviewing { background: #e8efff; color: #2563eb; }
.db-status.is-processing { background: #fff4e5; color: #d97706; }

/* ------------------------------------------------------------- wallet, queues */

.db-wallet, .db-queues { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.db-wallet li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: .55rem; padding: .45rem .5rem; border-radius: 10px; background: var(--db-soft); font-size: 10.5px; color: var(--db-body); }
.db-wallet li > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-wallet li b { font-size: 11.5px; font-weight: 800; color: var(--db-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-queue { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 32px 12px; align-items: center; gap: .45rem; padding: .42rem .15rem; border-radius: 8px; font-size: 10.5px; color: var(--db-body); }
.db-queue > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.db-queue:hover { background: var(--db-soft); }
.db-queue b { font-weight: 700; color: var(--db-ink); font-variant-numeric: tabular-nums; }
.db-queue em { font-style: normal; color: var(--db-faint); text-align: right; font-variant-numeric: tabular-nums; }
.db-queue.is-total { border-top: 1px solid var(--db-line); border-radius: 0; padding-top: .6rem; font-weight: 600; color: var(--db-ink); }
.db-chev { width: 14px; height: 14px; color: var(--db-faint); }
.db-qi { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; }
.db-qi svg { width: 14px; height: 14px; }
.db-qi.is-refund { background: #f1ebff; color: #7c3aed; }
.db-qi.is-reissue { background: #e2f7f3; color: #0d9488; }
.db-qi.is-void { background: #fff3df; color: #f59e0b; }
.db-qi.is-total { background: #ede9fe; color: #6d28d9; }

/* ------------------------------------------------------------- regions */

.db-select { padding: .3rem 1.8rem .3rem .6rem; border: 1px solid var(--db-line); border-radius: 8px; font-size: 11px; color: var(--db-muted); background-color: #fff; }
.db-region-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: .7rem; align-items: center; }
.db-map { width: 100%; height: auto; }
.db-region-list { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.db-region-list li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 36px; align-items: center; gap: .4rem; font-size: 10.5px; }
.db-region-list li > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-region-list i { width: 9px; height: 9px; border-radius: 999px; }
.db-region-list b { font-weight: 700; color: var(--db-ink); font-variant-numeric: tabular-nums; }
.db-region-list em { font-style: normal; color: var(--db-faint); text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- activity */

.db-feed { display: grid; gap: .1rem; margin: 0; padding: 0; list-style: none; }
.db-feed li { display: grid; grid-template-columns: 15px minmax(0, 1.1fr) minmax(0, 1.2fr) auto; align-items: center; gap: .5rem; padding: .33rem 0; font-size: 11px; }
.db-feed-i { width: 15px; height: 15px; color: var(--db-faint); }
.db-feed.is-admin .db-feed-i { color: var(--db-brand-2); }
.db-feed-title { color: var(--db-ink); }
.db-feed-detail { color: var(--db-faint); }
.db-feed time { color: var(--db-faint); font-size: 10.5px; white-space: nowrap; text-align: right; }

.db-sys-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: 9px; font-weight: 600; white-space: nowrap; flex: none; }
.db-sys-badge i { width: 7px; height: 7px; border-radius: 999px; }
.db-sys-badge.is-ok { color: var(--db-green); }
.db-sys-badge.is-ok i { background: #22c55e; }
.db-sys-badge.is-bad { color: var(--db-red); }
.db-sys-badge.is-bad i { background: #f43f5e; }
.db-sys { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.db-sys li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: 10.5px; color: var(--db-ink); }
.db-sys li > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.db-sys em { white-space: nowrap; }
.db-sys em { display: inline-flex; align-items: center; gap: .35rem; font-style: normal; font-size: 9.5px; font-weight: 600; }
.db-sys em i { width: 7px; height: 7px; border-radius: 999px; }
.db-sys em.is-ok { color: var(--db-green); } .db-sys em.is-ok i { background: #22c55e; }
.db-sys em.is-degraded { color: #d97706; } .db-sys em.is-degraded i { background: #f59e0b; }
.db-sys em.is-down { color: var(--db-red); } .db-sys em.is-down i { background: #f43f5e; }
.db-sys em.is-idle { color: var(--db-faint); } .db-sys em.is-idle i { background: #d1d5db; }

.db-alerts { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.db-alert { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: .5rem; padding: .26rem .15rem; border-radius: 8px; font-size: 10.5px; line-height: 1.35; color: var(--db-body); }
a.db-alert:hover { background: var(--db-soft); color: var(--db-ink); }
.db-alert-i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; }
.db-alert-i svg { width: 12px; height: 12px; }
.db-alert-i.is-danger { background: #ffe4e8; color: #e11d48; }
.db-alert-i.is-warning { background: #fff3df; color: #f59e0b; }
.db-alert-i.is-info { background: #e6f0ff; color: #3b82f6; }
.db-alert-i.is-brand { background: #f1ebff; color: #7c3aed; }
.db-alert-i.is-success { background: #e7f8ee; color: #16a34a; }

/* ------------------------------------------------------------- narrower screens */

@media (max-width: 1400px) {
    .db-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .db-row.is-charts { grid-template-columns: 1fr 1fr; }
    .db-row.is-charts .db-rings { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
    .db-row.is-money, .db-row.is-activity { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
    .db-row.is-lists { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .db-hero { flex-direction: column; align-items: flex-start; background: linear-gradient(100deg, #4527d6, #6a4cf2); }
    .db-range { margin-left: 0; }
    .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .db-row.is-charts, .db-row.is-money, .db-row.is-activity { grid-template-columns: 1fr; }
    .db-row.is-charts .db-rings { grid-template-columns: 1fr; }
    .db-region-body { grid-template-columns: 1fr; }
}

/* The narrowest cards keep their titles on one line. */
.db-row.is-money > .db-card:nth-child(3) h2, .db-row.is-activity > .db-card:nth-child(3) h2 { font-size: 11.5px; }
.db-row.is-money > .db-card:nth-child(3) .db-more { font-size: 10.5px; gap: .2rem; }
