/* Shared dashboard styling · used by all role dashboards */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px; color: #1a232c; background: #f5f7fa;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}

/* Top bar with role badge */
.dash-top {
  background: linear-gradient(90deg, #003c64 0%, #002948 100%);
  color: white; padding: 14px 22px;
  display: flex; align-items: center; gap: 14px;
}
.dash-top .logo { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.dash-top .crumb { font-size: 11.5px; opacity: 0.85; }
.dash-top .crumb a { color: white; text-decoration: none; }
.dash-top .crumb a:hover { text-decoration: underline; }
.dash-top .role-badge {
  margin-left: auto; padding: 4px 14px; border-radius: 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}

.dash-header {
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
  border-bottom: 1px solid #c8c8c0; padding: 22px 22px 18px;
}
.dash-header h1 {
  font-size: 28px; font-weight: 700; color: #003c64; letter-spacing: -0.01em;
}
.dash-header .subtitle {
  font-size: 13px; color: #6b7c93; margin-top: 6px;
}
.dash-header .as-of { font-size: 11px; color: #94a3b8; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; }

/* KPI strip · 4-6 across */
.kpi-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; padding: 18px 22px; max-width: 1620px; margin: 0 auto;
}
.kpi {
  background: white; border: 1px solid #c8c8c0; border-radius: 6px;
  padding: 14px 16px; transition: all 0.16s;
}
.kpi:hover { box-shadow: 0 2px 8px rgba(0,60,100,0.10); }
.kpi .label {
  font-size: 10px; color: #6b7c93; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 700;
}
.kpi .value {
  font-size: 26px; font-family: ui-monospace, monospace; font-weight: 700;
  color: #003c64; margin-top: 4px;
}
.kpi .meta { font-size: 11px; color: #6b7c93; margin-top: 4px; line-height: 1.4; }
.kpi .delta { font-size: 11px; margin-top: 3px; font-weight: 600; }
.kpi .delta.up { color: #166534; }
.kpi .delta.down { color: #991b1b; }
.kpi .delta.flat { color: #6b7c93; }
.kpi.green .value { color: #166534; }
.kpi.amber .value { color: #92400e; }
.kpi.red .value { color: #991b1b; }
.kpi.blue .value { color: #0066b3; }

/* Widget grid */
.widget-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 16px;
  padding: 0 22px 22px; max-width: 1620px; margin: 0 auto;
}
.widget-grid.three-col { grid-template-columns: 1fr 1fr 1fr; }
.widget-grid.balanced { grid-template-columns: 1fr 1fr; }
.widget-stack { display: flex; flex-direction: column; gap: 16px; }

.widget {
  background: white; border: 1px solid #c8c8c0; border-radius: 6px;
}
.widget h3 {
  padding: 11px 16px; font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: #003c64; font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
}
.widget .body { padding: 14px 16px; }

/* Chart canvas styling */
.chart {
  width: 100%; height: 220px;
}
.chart-tall { height: 280px; }
.chart text { font-family: -apple-system, sans-serif; }
.chart .axis-label { font-size: 10px; fill: #6b7c93; }
.chart .axis-line { stroke: #c8c8c0; stroke-width: 1; }
.chart .grid-line { stroke: #e2e8f0; stroke-width: 1; stroke-dasharray: 2,3; }
.chart .bar:hover { opacity: 0.85; }

/* Compact tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl thead th {
  background: #f0f0e8; padding: 7px 10px; text-align: left;
  font-size: 10px; font-weight: 700; color: #003c64;
  letter-spacing: 0.04em; text-transform: uppercase;
  border-bottom: 1px solid #c8c8c0;
}
.tbl thead th.right { text-align: right; }
.tbl tbody td { padding: 7px 10px; border-bottom: 1px solid #f0f0e8; }
.tbl tbody tr:hover { background: #f4f8fb; cursor: pointer; }
.tbl .right { text-align: right; font-family: ui-monospace, monospace; }
.tbl .mono { font-family: ui-monospace, monospace; font-size: 11px; }
.tbl a { color: #0066b3; text-decoration: none; }
.tbl a:hover { text-decoration: underline; }

/* Pills */
.pill {
  display: inline-block; font-size: 9.5px; padding: 2px 7px; border-radius: 3px;
  font-weight: 700; letter-spacing: 0.04em;
}
.pill.green { background: #dcfce7; color: #166534; }
.pill.amber { background: #fef3c7; color: #92400e; }
.pill.red { background: #fef2f2; color: #991b1b; }
.pill.blue { background: #dbeafe; color: #1e40af; }
.pill.gray { background: #e2e8f0; color: #475569; }

.gauge-track {
  background: #e2e8f0; border-radius: 4px; height: 10px; position: relative; overflow: hidden;
}
.gauge-fill {
  height: 100%; border-radius: 4px; transition: width 0.4s;
}
.gauge-fill.green { background: linear-gradient(90deg, #34d399, #059669); }
.gauge-fill.amber { background: linear-gradient(90deg, #fbbf24, #d97706); }
.gauge-fill.red { background: linear-gradient(90deg, #f87171, #b91c1c); }
.gauge-fill.blue { background: linear-gradient(90deg, #60a5fa, #1e40af); }

.alert-row {
  padding: 10px 14px; margin: 6px 0; border-radius: 4px;
  background: #fff7ed; border-left: 3px solid #d97706;
  font-size: 12px; line-height: 1.45; cursor: pointer; transition: all 0.12s;
}
.alert-row:hover { background: #ffedd5; }
.alert-row.red { background: #fef2f2; border-left-color: #b91c1c; }
.alert-row.red:hover { background: #fee2e2; }
.alert-row.green { background: #ecfdf5; border-left-color: #10b981; }
.alert-row .alert-title { font-weight: 700; color: #003c64; }
.alert-row .alert-meta { font-size: 11px; color: #6b7c93; margin-top: 2px; }
.alert-row a { color: #0066b3; font-weight: 600; }

.footer-banner {
  background: #fef9c3; border-top: 1px solid #fde047;
  padding: 10px 22px; font-size: 11px; color: #6b6620; margin-top: 22px;
}
