/* ============================================================================
   T1 SERVICE — Management Dashboard styling
   Obsidian "evening" panels · ivory + antique-gold · muted semantics.
   Every figure IBM Plex Mono tabular. Restrained editorial charts.
   ============================================================================ */

/* ---- App shell ---------------------------------------------------------- */
.dash {
  --d-bg:      #100E0A;   /* deepest evening field */
  --d-panel:   #1B1812;   /* widget surface */
  --d-panel-2: #221E18;   /* alt / inset */
  --d-line:    #322D24;   /* hairline on ink */
  --d-line-2:  #423B2F;   /* stronger hairline */
  --d-hi:      #F2ECDD;   /* primary text */
  --d-lo:      #B0A691;   /* secondary text */
  --d-mute:    #837A6E;   /* tertiary / captions */
  --d-gold:    #C5A572;
  --d-gold-dim:#9C7C4A;
  --d-pos:     #6FA86B;   /* forest, lightened for ink */
  --d-pos-dim: #3E6B3A;
  --d-neg:     #C57A6E;   /* oxblood, lightened for ink */
  --d-neg-dim: #8F4A3E;
  --d-warn:    #CBA24E;
  --d-info:    #79A0AE;
  background: var(--d-bg);
  color: var(--d-hi);
  font-family: var(--font-text);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid #000;
  box-shadow: var(--shadow-3);
  display: grid;
  grid-template-columns: 232px 1fr;
}
.dash * { box-sizing: border-box; }
.dash .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums lining-nums; }

/* Sidebar */
.dash-side { background: #0B0907; border-right: 1px solid var(--d-line); padding: 22px 0; display: flex;
  flex-direction: column; min-height: 760px; }
.dash-side .side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 22px 24px; }
.dash-side .side-brand img { height: 30px; width: auto; }
.dash-side .side-brand .nm { font-family: var(--font-display); font-size: 18px; color: var(--d-hi); line-height: 1; }
.dash-side .side-brand .sb { font-size: 8.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: var(--d-gold); margin-top: 4px; }
.dash-side .side-cap { font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--d-mute); padding: 0 22px; margin: 10px 0 10px; }
.dash-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 22px; color: var(--d-lo);
  text-decoration: none; font-size: 14px; border-left: 2px solid transparent; transition: all var(--dur-1) var(--ease); }
.dash-nav a:hover { color: var(--d-hi); background: rgba(255,255,255,.02); }
.dash-nav a.active { color: var(--d-hi); border-left-color: var(--d-gold); background: rgba(197,165,114,.06); }
.dash-nav a .gi { width: 18px; height: 18px; flex: 0 0 18px; color: currentColor; opacity: .85; }
.dash-side .side-foot { margin-top: auto; padding: 20px 22px 4px; border-top: 1px solid var(--d-line); }
.dash-side .side-foot .who { font-size: 13px; color: var(--d-hi); }
.dash-side .side-foot .role { font-size: 11px; color: var(--d-mute); margin-top: 3px; }

/* Main column */
.dash-main { min-width: 0; display: flex; flex-direction: column; }
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 28px; border-bottom: 1px solid var(--d-line); background: var(--d-bg); }
.dash-top .co { display: flex; align-items: center; gap: 14px; }
.dash-top .co .nm { font-family: var(--font-display); font-size: 20px; color: var(--d-hi); line-height: 1; }
.dash-top .co .tax { font-family: var(--font-mono); font-size: 12px; color: var(--d-mute); margin-top: 4px;
  font-variant-numeric: tabular-nums lining-nums; }
.dash-top .controls { display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--d-line-2); border-radius: var(--r-sm); overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--d-lo); font-family: var(--font-text);
  font-size: 13px; padding: 8px 14px; cursor: pointer; border-right: 1px solid var(--d-line); transition: all var(--dur-1) var(--ease); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--d-gold); color: #16130E; font-weight: 600; }
.seg button:not(.on):hover { color: var(--d-hi); background: rgba(255,255,255,.03); }
.pill-period { font-family: var(--font-mono); font-size: 13px; color: var(--d-hi); border: 1px solid var(--d-line-2);
  border-radius: var(--r-sm); padding: 8px 14px; display: inline-flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums lining-nums; background: var(--d-panel); }
.pill-period .g { color: var(--d-gold); }
.dash-ico-btn { background: var(--d-panel); border: 1px solid var(--d-line-2); border-radius: var(--r-sm);
  color: var(--d-lo); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; }
.dash-ico-btn:hover { color: var(--d-hi); border-color: var(--d-gold-dim); }

/* Body grid */
.dash-body { padding: 24px 28px 30px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px;
  background: var(--d-bg); align-content: start; }

/* Widget panel */
.w { background: var(--d-panel); border: 1px solid var(--d-line); border-radius: var(--r-md); padding: 18px 20px; min-width: 0; }
.w-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.w-head .t { font-size: 13.5px; font-weight: 600; color: var(--d-hi); letter-spacing: .01em; }
.w-head .ov { font-size: 9.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--d-mute); }
.w-head .legend { display: flex; gap: 14px; align-items: center; }
.w-head .legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--d-lo); }
.w-head .legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* column spans */
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; }
.c9 { grid-column: span 9; } .c12 { grid-column: span 12; }

/* KPI card */
.kpi .ov { font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--d-mute); margin: 0 0 12px; }
.kpi .val { font-family: var(--font-mono); font-size: 30px; color: var(--d-hi); line-height: 1;
  font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.01em; }
.kpi .val .cur { font-size: 16px; color: var(--d-lo); margin-right: 2px; }
.kpi .val .u { font-size: 16px; color: var(--d-lo); }
.kpi .sub { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; }
.kpi .delta { font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.kpi .delta.pos { color: var(--d-pos); } .kpi .delta.neg { color: var(--d-neg); }
.kpi .sub .vs { color: var(--d-mute); }
.kpi .spark { margin-top: 16px; }

/* Mini stat row inside widgets */
.minirow { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 0;
  border-bottom: 1px solid var(--d-line); font-size: 13px; color: var(--d-lo); }
.minirow:last-child { border-bottom: 0; }
.minirow .v { font-family: var(--font-mono); color: var(--d-hi); font-variant-numeric: tabular-nums lining-nums; }
.minirow .v.pos { color: var(--d-pos); } .minirow .v.neg { color: var(--d-neg); }

/* Aging table */
.aging { width: 100%; border-collapse: collapse; }
.aging th { font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--d-mute);
  text-align: right; padding: 0 0 10px; border-bottom: 1px solid var(--d-line-2); }
.aging th:first-child { text-align: left; }
.aging td { font-size: 13px; padding: 10px 0; border-bottom: 1px solid var(--d-line); color: var(--d-lo);
  text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums lining-nums; }
.aging td:first-child { text-align: left; font-family: var(--font-text); color: var(--d-hi); }
.aging tfoot td { border-bottom: 0; border-top: 1px solid var(--d-line-2); color: var(--d-hi); font-weight: 600; padding-top: 12px; }
.aging .warnv { color: var(--d-warn); } .aging .negv { color: var(--d-neg); }

/* Balance sheet bar */
.bs-bar { display: flex; height: 30px; border-radius: var(--r-xs); overflow: hidden; margin: 6px 0 4px; }
.bs-bar span { display: block; height: 100%; }
.bs-key { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; }
.bs-key .k { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--d-lo); }
.bs-key .k i { width: 9px; height: 9px; border-radius: 2px; }
.bs-key .k b { font-family: var(--font-mono); color: var(--d-hi); font-weight: 500; margin-left: 3px; }

/* Tax deadline list */
.tax-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 12px 0;
  border-bottom: 1px solid var(--d-line); }
.tax-row:last-child { border-bottom: 0; }
.tax-row .form { font-size: 13.5px; color: var(--d-hi); }
.tax-row .form .sub { font-size: 11px; color: var(--d-mute); margin-top: 3px; }
.tax-row .amt { font-family: var(--font-mono); font-size: 14px; color: var(--d-hi); text-align: right;
  font-variant-numeric: tabular-nums lining-nums; }
.tax-row .due { font-family: var(--font-mono); font-size: 11.5px; text-align: right; }
.d-tag { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.d-tag i { width: 5px; height: 5px; border-radius: 50%; }
.d-tag.due-soon { background: rgba(203,162,78,.14); color: var(--d-warn); } .d-tag.due-soon i { background: var(--d-warn); }
.d-tag.filed { background: rgba(111,168,107,.13); color: var(--d-pos); } .d-tag.filed i { background: var(--d-pos); }
.d-tag.scheduled { background: rgba(121,160,174,.13); color: var(--d-info); } .d-tag.scheduled i { background: var(--d-info); }

/* Chart svg helpers */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis-lab { fill: var(--d-mute); font-family: var(--font-mono); font-size: 10px; }
.chart .grid-l { stroke: var(--d-line); stroke-width: 1; }
.chart .val-lab { fill: var(--d-lo); font-family: var(--font-mono); font-size: 10px; }

/* Gauge */
.gauge-wrap { display: flex; align-items: center; gap: 20px; }
.gauge-num { font-family: var(--font-mono); font-size: 28px; color: var(--d-hi); line-height: 1;
  font-variant-numeric: tabular-nums lining-nums; }
.gauge-num .x { font-size: 15px; color: var(--d-lo); }
.gauge-note { font-size: 12px; color: var(--d-lo); margin-top: 8px; line-height: 1.5; }

/* Frame caption for the live demo */
.demo-cap { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-400); margin-bottom: 16px; }
.demo-cap i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: inline-block; }

/* responsive: collapse dashboard chrome on small screens */
@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side { flex-direction: row; align-items: center; min-height: 0; overflow-x: auto; padding: 0;
    border-right: 0; border-bottom: 1px solid var(--d-line); }
  .dash-side .side-brand { padding: 16px 18px; border-right: 1px solid var(--d-line); }
  .dash-side .side-cap, .dash-side .side-foot { display: none; }
  .dash-nav { display: flex; }
  .dash-nav a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; padding: 16px 14px; }
  .dash-nav a.active { border-left: 0; border-bottom-color: var(--d-gold); }
  .c3, .c4, .c5, .c6, .c7, .c8, .c9 { grid-column: span 6; }
}
@media (max-width: 720px) {
  .dash-body { grid-template-columns: 1fr; }
  .c3, .c4, .c5, .c6, .c7, .c8, .c9, .c12 { grid-column: span 1; }
  .dash-top { flex-wrap: wrap; }
}
