/* ============================================================
   INTRISIO — VIP Dashboard tab (js/admin-dashboard.js)
   Uses the vip.css tokens only. Green on goal, amber close,
   red behind, grey no goal or no data yet.
   ============================================================ */
#seg-stats, .db-six, .db-tool { --db-good: #30D158; --db-warn: #FFB340; --db-bad: #FF6961; --db-none: var(--v-text-3); }
.db-top { margin-bottom: 14px; }
.db { transition: opacity .2s; }
.db.busy { opacity: .6; }
.db-site .an { margin-top: 0; }

/* status dots */
.db-dot { display:inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--db-none); flex: none; }
.good > .db-dot, .good > dt > .db-dot { background: var(--db-good); }
.warn > .db-dot, .warn > dt > .db-dot { background: var(--db-warn); }
.bad > .db-dot, .bad > dt > .db-dot { background: var(--db-bad); }
.todo > dt > .db-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--db-warn); }

/* needs attention */
.db-att ul { list-style:none; margin:0; padding:0; display:grid; gap: 10px; }
.db-att li { display:flex; gap: 10px; align-items: baseline; font-size: .92rem; line-height: 1.4; }
.db-att li div { display:grid; gap: 1px; min-width: 0; }
.db-att li b { font-weight: 650; color: var(--v-text); }
.db-att li span { color: var(--v-text-2); font-size: .84rem; }

/* the six numbers */
.db-six { display:grid; gap: 10px; }
.db-six .hub-h { margin: 0; }
.db-tiles { display:grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0; }
.db-tile { display:grid; align-content:start; gap: 3px; padding: 12px 12px 11px; border-radius: 16px; background: var(--v-surface-2); border: 1px solid var(--v-line); min-width: 0; }
.db-tile dt { display:flex; align-items:center; gap: 7px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; color: var(--v-text-2); }
.db-tile dd { margin: 0; font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--v-text); }
.db-tile.bad dd { color: var(--db-bad); }
.db-tile .an-hint { line-height: 1.3; }

/* range bar between the scoreboard and the cards */
.db-rangebar { display:flex; align-items:center; justify-content:space-between; gap: 12px; flex-wrap: wrap; margin: 6px 2px 0; }
body.vip .db-rangebar .hub-h { margin: 0; }

/* section cards */
body.vip .db-grid { display:block; columns: 2 330px; column-gap: 14px; }
.db-card { align-content: start; break-inside: avoid; margin-bottom: 14px; }
.db-grid + .db-hist { margin-top: 0; }
.db-big { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--v-text); display:flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.db-big .an-d, .db-big .an-hint { font-size: .82rem; letter-spacing: 0; }
.db-rows { list-style:none; margin:0; padding:0; display:grid; gap: 9px; }
.db-rows li { display:grid; grid-template-columns: 1fr auto; gap: 1px 10px; font-size: .9rem; padding-bottom: 9px; border-bottom: 1px solid var(--v-line); }
.db-rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.db-rows b { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.db-rows small { grid-column: 1 / -1; font-size: .78rem; color: var(--v-text-3); }
.db-rows small .an-d { font-size: .78rem; }
.db-g { font-size: .8rem; font-weight: 650; color: var(--v-text-3); }
.db-g.up { color: var(--db-good); }
.db-g.down { color: var(--db-bad); }
.db-note { margin: 0; font-size: .8rem; line-height: 1.45; color: var(--v-text-3); }
.db-note b { color: var(--v-text-2); }
.db-card .hub-pill { justify-self: start; }
.db-spark { width: 100%; height: 48px; display:block; }
.db-spark polyline { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.db-spark-x { display:flex; justify-content:space-between; font-size: .72rem; color: var(--v-text-3); margin-top: -4px; }

/* week by week */
.db-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.db-hist table { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
.db-hist th, .db-hist td { padding: 8px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--v-line); }
.db-hist thead th { font-size: .74rem; font-weight: 600; color: var(--v-text-3); }
.db-hist thead th small { display:block; font-weight: 500; }
.db-hist tbody th { text-align: left; font-weight: 600; color: var(--v-text-2); }
.db-hist tr:last-child th, .db-hist tr:last-child td { border-bottom: 0; }
.db-hist td.good { color: var(--db-good); }
.db-hist td.warn { color: var(--db-warn); }
.db-hist td.bad { color: var(--db-bad); }

/* Sunday numbers form */
.db-form select, .db-form input { font: inherit; color: var(--v-text); background: var(--v-surface-2); border: 1px solid var(--v-line-2); border-radius: 12px; padding: 9px 11px; }
.db-fgrid { display:grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.db-f { display:grid; gap: 4px; font-size: .82rem; color: var(--v-text-2); }
.db-f input { width: 100%; box-sizing: border-box; }
.db-f small { font-size: .74rem; color: var(--v-text-3); }
.db-factions { display:flex; align-items:center; gap: 10px; flex-wrap: wrap; }
body.vip .db-factions .btn { width: auto; padding: 11px 22px; }
.db-form .db-goal { width: 64px; padding: 5px 8px; margin: 0 4px 0 2px; }

@media (max-width: 1000px){ .db-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px){
  .db-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-top .sx-head { flex-direction: column; align-items: stretch; }
  .db-top .an-range { justify-content:flex-start; }
  .db-tile dd { font-size: 1.45rem; }
}

/* the site's form styles make labels small caps; the Sunday form reads better plain */
body.vip .db-form label, body.vip .db-f span, body.vip .db-f small, body.vip .db-form .hub-h + select { text-transform: none; letter-spacing: 0; }
body.vip .db-form select { width: auto; max-width: 100%; }
.db-fgrid .db-f { align-content: start; }
.db-f span { font-weight: 600; color: var(--v-text); }
/* a box that starts with the last number typed: amber until it's saved for this week */
.db-f.carried input { border-color: var(--db-warn, #FFB340); }
body.vip .db-f.carried small { color: var(--db-warn, #FFB340); }

/* Santi's Scoreboard tool on his page */
.db-tool { display:grid; gap: 14px; }
.db-tool .sx-card { margin: 0; }
body.vip .db-tool .db-form { max-width: none; }
