/* ==========================================================================
   Dashboard (Home) · Round 3 "Insight dashboard" (approved 2026-11-25 after the
   client said the previous one was not eye-catching or informative).
   Navy hero with today's ring meters → three insight cards, each with its own
   chart form → other activities + offline requests.
   Colour = status only, and every coloured mark has a text label beside it.
   ========================================================================== */

/* ---- Hero ---- */
.db-hero { background: var(--tb-primary); color: var(--tb-on-strong); padding: 44px 0 116px; }
.db-hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.db-hero__eyebrow { font-size: var(--tb-fs-meta); font-weight: 600; color: rgba(255, 255, 255, .72); }
.db-hero__title { margin-top: 12px; color: var(--tb-on-strong); font-size: 44px; line-height: 1.08; font-weight: 700; letter-spacing: -.035em; text-wrap: balance; }
.db-hero__detail { margin-top: 16px; font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .8); max-width: 540px; }
.db-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.db-hero__rings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* Ring meter */
.db-ring { padding: 22px 20px 20px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); }
.db-ring__title { font-size: var(--tb-fs-meta); font-weight: 600; color: rgba(255, 255, 255, .85); }
.db-ring__dial { position: relative; width: 140px; height: 140px; margin: 16px auto 0; }
.db-ring__dial svg { width: 100%; height: 100%; display: block; }
.db-ring__track, .db-ring__arc { fill: none; stroke-width: 12; }
.db-ring__track { stroke: rgba(255, 255, 255, .10); }
.db-ring__arc--done { stroke: var(--tb-on-dark-done); }
.db-ring__arc--waiting { stroke: var(--tb-on-dark-waiting); }
.db-ring__arc--rejected { stroke: var(--tb-on-dark-rejected); }
.db-ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.db-ring__pct { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.db-ring__label { margin-top: 4px; font-size: 12px; color: rgba(255, 255, 255, .75); }
.db-ring__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: rgba(255, 255, 255, .85); }
.db-ring__legend li { display: inline-flex; align-items: center; gap: 6px; }
.db-ring__key { width: 8px; height: 8px; border-radius: 50%; }
.db-ring__key--done { background: var(--tb-on-dark-done); }
.db-ring__key--waiting { background: var(--tb-on-dark-waiting); }
.db-ring__key--rejected { background: var(--tb-on-dark-rejected); }
.db-ring__foot { margin-top: 8px; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .68); }
.db-ring__foot .bracket { color: inherit; }

/* ---- Content ---- */
.db { margin-top: -76px; display: flex; flex-direction: column; gap: 20px; }
.db-insights { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; }

/* Insight card (raised: it sits over the hero band) */
.db-card { padding: 24px; border-radius: 16px; background: var(--tb-surface); border: 1px solid var(--tb-border); box-shadow: 0 12px 28px -18px rgba(11, 31, 58, .35); min-width: 0; }
.db-card--column { display: flex; flex-direction: column; }
.db-card__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
.db-card__title { font-size: 14px; font-weight: 600; color: var(--tb-text-neutral); }
.db-card__link { font-size: var(--tb-fs-meta); font-weight: 600; }
.db-card__figure { margin-top: 10px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.db-card__big { font-size: 44px; font-weight: 700; letter-spacing: -.035em; line-height: 1; color: var(--tb-text-strong); }
.db-card__caption { font-size: 15px; font-weight: 500; color: var(--tb-text-neutral); }
.db-card__bracket { font-size: 15px; color: var(--tb-text-muted); }
.db-card__insight { margin-top: 14px; font-size: 13.5px; color: var(--tb-text-neutral); }
.db-card__insight b { color: var(--tb-text-strong); }
.db-card__foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--tb-bg); font-size: var(--tb-fs-meta); color: var(--tb-text-neutral); }
.db-card__foot--stack { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.db-card--column .db-compare + .db-card__foot--stack { margin-top: auto; }
.db-card__foot .bracket { color: inherit; }
.db-warn { color: var(--tb-warn-ink); font-weight: 600; }
.db-warn .bracket { color: inherit; font-weight: 600; }
.db-ok { display: flex; align-items: center; gap: 8px; }
.db-ok .ic { width: 15px; height: 15px; color: var(--tb-success); stroke-width: 2.2; }

/* Tall segmented bar (labels printed on each part) */
.db-seg { display: flex; gap: 2px; height: 40px; margin-top: 20px; }
.db-seg__part { display: flex; align-items: center; min-width: 52px; padding: 0 12px; font-size: 12.5px; font-weight: 700; border-radius: 3px; }
.db-seg__part:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.db-seg__part:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.db-seg__part--pending { background: var(--tb-warning); color: var(--tb-on-strong); justify-content: center; flex-shrink: 0; }
.db-seg__part--expired { background: var(--tb-expired); color: var(--tb-expired-ink); flex: 1; }

/* Legend rows with figures */
.db-keys { margin: 16px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.db-keys li { display: flex; align-items: center; gap: 8px; }
.db-keys__swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.db-keys__swatch--pending { background: var(--tb-warning); }
.db-keys__swatch--expired { background: var(--tb-expired); }
.db-keys__name { flex: 1; }
.db-keys__value { font-weight: 600; color: var(--tb-text-strong); white-space: nowrap; }

/* Comparison bars */
.db-compare { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.db-compare__row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 48px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--tb-text-neutral); }
.db-compare__row b { text-align: right; color: var(--tb-text-strong); }
.db-compare__bar { display: block; height: 10px; }
.db-compare__bar i { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--tb-text-muted); }
.db-compare__bar i.is-primary { background: var(--tb-royal); }

/* Ranked bars */
.db-rank { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.db-rank__row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 52px 48px; align-items: center; gap: 12px; }
.db-rank__track { display: block; height: 10px; }
.db-rank__track i { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--tb-royal); }
.db-rank__row.is-zero .db-rank__track { height: 1px; background: var(--tb-border); }
.db-rank__value { text-align: right; font-weight: 600; color: var(--tb-text-strong); font-variant-numeric: tabular-nums; }
.db-rank__share { text-align: right; font-size: 12px; color: var(--tb-text-muted); }
.db-rank__row.is-zero .db-rank__name, .db-rank__row.is-zero .db-rank__value { color: var(--tb-text-muted); font-weight: 400; }

/* ---- Lower row ---- */
.db-lower { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.db-lower > * { min-width: 0; }

.db-other { padding: 24px; }
.db-other__grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.db-other__item { display: flex; flex-direction: column; padding: 4px 20px; color: inherit; min-height: 44px; }
.db-other__item:first-child { padding-left: 0; }
.db-other__item:last-child { padding-right: 0; }
.db-other__item + .db-other__item { border-left: 1px solid var(--tb-bg); }
.db-other__item:hover { color: inherit; }
.db-other__item:hover .db-other__name { color: var(--tb-royal); }
.db-other__name { display: flex; align-items: center; gap: 6px; font-size: var(--tb-fs-meta); color: var(--tb-text-neutral); }
.db-other__value { margin-top: 6px; font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--tb-text-strong); }
.db-other__value.is-zero { color: var(--tb-text-muted); }
.db-other__track { display: block; margin-top: 12px; height: 6px; border-radius: 3px; background: var(--tb-bg); }
.db-other__track i { display: block; height: 100%; min-width: 4px; border-radius: 3px; background: var(--tb-royal); }
.db-other__meta { margin-top: 8px; font-size: 12.5px; color: var(--tb-text-muted); }

.db-offline { padding: 24px; display: flex; align-items: center; gap: 16px; }
.db-offline__icon { width: 48px; height: 48px; background: var(--tb-surface-muted); border: 0; }
.db-offline__icon .ic { width: 22px; height: 22px; }
.db-offline .tb-empty__text { display: block; margin-top: 4px; }
.db-offline-list { padding: 24px 0 8px; }
.db-offline-list .tb-panel__title { padding: 0 28px 14px; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
    .db-hero__grid { grid-template-columns: 1fr; gap: 32px; }
    .db-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .db-insights > :last-child { grid-column: 1 / -1; }
    .db-lower { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .db-insights { grid-template-columns: 1fr; }
    .db-insights > :last-child { grid-column: auto; }
}
@media (max-width: 560px) {
    .db-hero { padding: 32px 0 96px; }
    .db-hero__title { font-size: 30px; }
    .db-hero__actions .btn-on-dark-primary { width: 100%; }
    .db-hero__rings { gap: 10px; }
    .db-ring { padding: 16px 12px 14px; }
    .db-ring__title { line-height: 1.4; min-height: 2.8em; }   /* both rings line up when one title wraps */
    .db-ring__dial { width: 112px; height: 112px; }
    .db-ring__pct { font-size: 26px; }
    .db-ring__legend { flex-direction: column; align-items: center; gap: 4px; }
    .db-card { padding: 20px; }
    .db-card__big { font-size: 38px; }
    .db-rank__row { grid-template-columns: 96px minmax(0, 1fr) 44px; }
    .db-rank__share { display: none; }
    .db-other { padding: 20px; }
    .db-other__grid { grid-template-columns: 1fr; }
    .db-other__item, .db-other__item:first-child, .db-other__item:last-child { padding: 14px 0; }
    .db-other__item + .db-other__item { border-left: 0; border-top: 1px solid var(--tb-bg); }
    .db-offline { padding: 20px; }
}
