/* ═══════════════════════════════════════════════════════════
   JK135 Analytics Reporting — Ocean Theme
   Production-grade design system. Zero external CSS deps.
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Ocean palette */
  --deep-ocean: #0f2b38;
  --ocean: #1a3a4a;
  --ocean-blue: #2c5f7c;
  --teal: #3a8a9e;
  --sea-foam: #88b7c4;
  --sea-foam-light: #b8d8e2;
  --sand: #f3efe7;
  --sand-light: #faf8f4;
  --coral: #c9553d;
  --coral-light: #e8735c;
  --white: #ffffff;
  --ink: #1e1e1e;
  --slate: #4a5568;
  --mist: #94a3b8;

  /* Design tokens */
  --radius-sm: 0.375rem;
  --radius: 0.625rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 3px rgba(15, 43, 56, 0.06);
  --shadow: 0 2px 8px rgba(15, 43, 56, 0.08), 0 1px 2px rgba(15, 43, 56, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 43, 56, 0.1), 0 2px 4px rgba(15, 43, 56, 0.05);
  --shadow-lg: 0 8px 32px rgba(15, 43, 56, 0.12), 0 2px 8px rgba(15, 43, 56, 0.06);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset & Base ──────────────────────────────────────── */

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ocean);
  background: var(--sand);
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--sea-foam);
  color: var(--deep-ocean);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ── Entrance Animations ──────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58, 138, 158, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(58, 138, 158, 0.08); }
}

/* ── Skip Link (a11y) ─────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--ocean-blue);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.skip-link:focus {
  top: 0;
}

/* ── Site Header ──────────────────────────────────────── */

header.site-header {
  background: linear-gradient(135deg, var(--deep-ocean) 0%, var(--ocean) 50%, var(--ocean-blue) 100%);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(15, 43, 56, 0.25);
}

header.site-header .header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  min-height: 56px;
}

header.site-header h1 {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header.site-header h1::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--coral);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulseGlow 3s ease infinite;
  box-shadow: 0 0 6px rgba(201, 85, 61, 0.4);
}

nav {
  display: flex;
  align-items: center;
  gap: 0;
}

nav a {
  color: var(--sea-foam-light);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 1rem 1rem;
  position: relative;
  transition: color var(--transition);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-out-expo);
}

nav a:hover,
nav a:focus {
  color: var(--white);
}

nav a:hover::after,
nav a:focus::after {
  transform: scaleX(1);
}

nav a.active {
  color: var(--white);
}

nav a.active::after {
  transform: scaleX(1);
  background: var(--sea-foam);
}

/* ── Page Title Bar ───────────────────────────────────── */

.page-title-bar {
  background: var(--white);
  border-bottom: 1px solid rgba(136, 183, 196, 0.2);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 4px rgba(15, 43, 56, 0.04);
}

.page-title-bar .title-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-title-bar h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--deep-ocean);
  letter-spacing: -0.02em;
}

.page-title-bar .subtitle {
  color: var(--slate);
  font-size: 0.85rem;
  margin: 0.125rem 0 0;
}

/* ── Main Container ───────────────────────────────────── */

main, .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ── Cards ────────────────────────────────────────────── */

.card {
  background: var(--white);
  border: 1px solid rgba(136, 183, 196, 0.18);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo);
  animation: fadeUp 0.5s var(--ease-out-expo) both;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ocean);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-icon {
  font-size: 1rem;
  line-height: 1;
}

a.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.card-link .card {
  cursor: pointer;
  border: 1px solid rgba(136, 183, 196, 0.25);
}

a.card-link .card:hover {
  border-color: var(--ocean-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Stagger card animations */
.grid-2 .card:nth-child(2) { animation-delay: 0.06s; }
.grid-auto .card:nth-child(2),
.grid-auto a:nth-child(2) .card { animation-delay: 0.06s; }
.grid-auto .card:nth-child(3),
.grid-auto a:nth-child(3) .card { animation-delay: 0.12s; }

/* ── KPI / Metric Cards ──────────────────────────────── */

.kpi-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--white);
  border: 1px solid rgba(136, 183, 196, 0.18);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.4s var(--ease-out-expo) both;
}

.kpi-card:nth-child(2) { animation-delay: 0.05s; }
.kpi-card:nth-child(3) { animation-delay: 0.1s; }
.kpi-card:nth-child(4) { animation-delay: 0.15s; }
.kpi-card:nth-child(5) { animation-delay: 0.2s; }

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ocean-blue), var(--teal));
}

.kpi-card .kpi-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mist);
  margin-bottom: 0.375rem;
}

.kpi-card .kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--deep-ocean);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.kpi-card .kpi-unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--slate);
  margin-left: 0.125rem;
}

.kpi-card.kpi-coral::before {
  background: linear-gradient(90deg, var(--coral), var(--coral-light));
}

.kpi-card.kpi-teal::before {
  background: linear-gradient(90deg, var(--teal), var(--sea-foam));
}

/* ── Grid Layouts ─────────────────────────────────────── */

.grid-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}

.grid-auto {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.span-2 { grid-column: span 2; }

/* ── Pills & Tags ────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  margin: 3px 4px 3px 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(58, 138, 158, 0.1);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(136, 183, 196, 0.15);
  color: var(--ocean);
  font-size: 0.72rem;
  font-weight: 500;
}

/* ── Typography ───────────────────────────────────────── */

.muted { color: var(--mist); }
.slate { color: var(--slate); }

h1, h2, h3, h4 {
  color: var(--deep-ocean);
  letter-spacing: -0.02em;
}

a {
  color: var(--ocean-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover, a:focus {
  color: var(--coral);
}

/* ── Buttons ──────────────────────────────────────────── */

button, .btn {
  padding: 0.5rem 1.125rem;
  background: var(--ocean-blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  line-height: 1.4;
  font-family: inherit;
}

button:hover, .btn:hover {
  background: var(--deep-ocean);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

button:active, .btn:active {
  transform: translateY(1px);
}

.btn-outline {
  background: transparent;
  color: var(--ocean-blue);
  border: 1px solid var(--ocean-blue);
}

.btn-outline:hover {
  background: var(--ocean-blue);
  color: var(--white);
}

button.btn-danger, .btn-danger {
  background: var(--coral);
}

button.btn-danger:hover, .btn-danger:hover {
  background: #a8432f;
}

button.btn-sm, .btn-sm {
  padding: 0.3rem 0.625rem;
  font-size: 0.75rem;
}

/* ── Forms ────────────────────────────────────────────── */

label {
  display: block;
  color: var(--ocean);
  font-weight: 600;
  font-size: 0.825rem;
  margin-top: 0.875rem;
  margin-bottom: 0.25rem;
}

select,
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(136, 183, 196, 0.4);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--ocean);
  transition: all var(--transition);
}

select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(58, 138, 158, 0.12);
}

textarea {
  resize: vertical;
  min-height: 72px;
}

fieldset {
  border: 1px solid rgba(136, 183, 196, 0.35);
  border-radius: var(--radius);
  padding: 0.875rem;
  margin: 0.875rem 0;
}

legend {
  color: var(--ocean);
  font-weight: 700;
  font-size: 0.825rem;
  padding: 0 0.5rem;
}

fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-right: 1rem;
  font-weight: 400;
}

/* ── Login Page ───────────────────────────────────────── */

.login-page {
  background: linear-gradient(160deg, var(--deep-ocean) 0%, var(--ocean) 40%, var(--ocean-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Subtle animated wave pattern */
.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 70%, rgba(58, 138, 158, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 30%, rgba(136, 183, 196, 0.06) 0%, transparent 50%);
  animation: loginDrift 20s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes loginDrift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-3%, 2%) rotate(2deg); }
}

.login-page main {
  width: 100%;
  max-width: 880px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.6s var(--ease-out-expo) both;
}

.login-title {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-title h1 {
  color: var(--white);
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 0.375rem;
  letter-spacing: -0.03em;
}

.login-title p {
  color: var(--sea-foam-light);
  font-size: 0.875rem;
  margin: 0;
  opacity: 0.85;
}

.form-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.form-grid .card {
  margin-bottom: 0;
  border: none;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.6s var(--ease-out-expo) both;
}

.form-grid .card:nth-child(2) {
  animation-delay: 0.1s;
}

.error-banner {
  max-width: 880px;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem;
  background: rgba(201, 85, 61, 0.12);
  border: 1px solid rgba(201, 85, 61, 0.3);
  border-left: 3px solid var(--coral);
  border-radius: var(--radius-sm);
  color: var(--coral);
  font-weight: 600;
  font-size: 0.875rem;
  animation: fadeUp 0.3s var(--ease-out-expo) both;
}

/* ── Tables ───────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(136, 183, 196, 0.12);
}

th {
  background: var(--sand-light);
  font-weight: 700;
  color: var(--ocean);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tr:hover td {
  background: rgba(58, 138, 158, 0.04);
}

td {
  color: var(--slate);
}

td.mono {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--ocean);
}

/* ── CSS-Only Horizontal Bar Charts ───────────────────── */

.css-hbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.css-hbar-row {
  display: grid;
  grid-template-columns: minmax(80px, 140px) 1fr auto;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.css-hbar-label {
  color: var(--slate);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.css-hbar-track {
  height: 22px;
  background: rgba(136, 183, 196, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.css-hbar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--teal);
  min-width: 2px;
  transition: width 0.6s var(--ease-out-expo);
}

.css-hbar-fill.coral { background: var(--coral); }
.css-hbar-fill.ocean { background: var(--ocean-blue); }

.css-hbar-val {
  color: var(--mist);
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── CSS-Only Donut Charts ────────────────────────────── */

.css-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem 0;
  flex-wrap: wrap;
}

.css-donut {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.css-donut::after {
  content: '';
  position: absolute;
  top: 25%;
  left: 25%;
  width: 50%;
  height: 50%;
  background: var(--white);
  border-radius: 50%;
}

.css-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.css-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--slate);
}

.css-donut-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.css-donut-pct {
  font-weight: 700;
  color: var(--ocean);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* ── CSS-Only Vertical Bar Charts ─────────────────────── */

.css-vbar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem 0.5rem;
  height: 260px;
}

.css-vbar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 100px;
  height: 100%;
  justify-content: flex-end;
}

.css-vbar-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.6s var(--ease-out-expo);
}

.css-vbar-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--deep-ocean);
  font-variant-numeric: tabular-nums;
}

.css-vbar-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mist);
}

/* ── Charts ───────────────────────────────────────────── */

.chart-container {
  width: 100%;
  height: 340px;
  margin: 0.5rem 0;
}

.chart-container-sm {
  height: 260px;
}

/* ── Comments ─────────────────────────────────────────── */

.comments-section {
  margin-top: 1rem;
}

.comment {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--teal);
  margin-bottom: 0.625rem;
  background: rgba(58, 138, 158, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: border-color var(--transition), background var(--transition);
}

.comment:hover {
  border-left-color: var(--ocean-blue);
  background: rgba(58, 138, 158, 0.06);
}

.comment-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mist);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.comment-text {
  color: var(--slate);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ── Error Pages ──────────────────────────────────────── */

.error-page {
  text-align: center;
  padding: 6rem 1.5rem;
  animation: fadeUp 0.5s var(--ease-out-expo) both;
}

.error-code {
  font-size: 7rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--ocean-blue), var(--teal), var(--sea-foam));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
}

.error-message {
  font-size: 1.125rem;
  color: var(--slate);
  margin-bottom: 2rem;
  font-weight: 500;
}

.error-detail {
  color: var(--slate);
  max-width: 400px;
  margin: 0 auto 2rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Noscript ─────────────────────────────────────────── */

noscript .noscript-warning {
  background: linear-gradient(90deg, var(--coral), var(--coral-light));
  color: var(--white);
  padding: 0.875rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
}

/* ── Loading State ────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, rgba(136,183,196,0.1) 25%, rgba(136,183,196,0.2) 50%, rgba(136,183,196,0.1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Utilities ────────────────────────────────────────── */

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.75rem; }
.mb-2 { margin-bottom: 1.25rem; }
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.25rem; }
.gap-sm { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mono { font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace; }

.export-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.divider {
  border: none;
  border-top: 1px solid rgba(136, 183, 196, 0.15);
  margin: 1.25rem 0;
}

/* ── Admin User List ──────────────────────────────────── */

.user-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid rgba(136, 183, 196, 0.12);
  transition: background var(--transition);
}

.user-item:last-child {
  border-bottom: none;
}

.user-item:hover {
  background: rgba(58, 138, 158, 0.03);
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--radius-sm);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.user-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ocean);
}

.user-meta {
  font-size: 0.72rem;
  color: var(--mist);
}

/* ── Report Hub Cards ─────────────────────────────────── */

.report-card {
  border-left: 3px solid var(--teal);
  transition: border-left-color 0.3s var(--ease-out-expo);
}

a.card-link:hover .report-card {
  border-left-color: var(--coral);
}

.report-card .report-desc {
  color: var(--slate);
  font-size: 0.85rem;
  margin: 0.375rem 0 0.75rem;
  line-height: 1.5;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}

@media (max-width: 768px) {
  header.site-header .header-inner {
    padding: 0 1rem;
  }

  header.site-header h1 {
    font-size: 0.95rem;
  }

  nav a {
    padding: 0.75rem 0.625rem;
    font-size: 0.8rem;
  }

  .grid-auto {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  main, .container {
    padding: 1rem;
  }

  .chart-container {
    height: 260px;
  }

  .page-title-bar {
    padding: 1rem;
  }

  .page-title-bar h2 {
    font-size: 1.15rem;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .export-bar {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ── Print ────────────────────────────────────────────── */

/* ── Performance Budget Table ─────────────────────────── */

.budget-table { width: 100%; border-collapse: collapse; }
.budget-table th,
.budget-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.budget-table thead th { font-size: 0.71rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.budget-table tbody tr:last-child td { border-bottom: none; }
.budget-table tbody tr:hover { background: rgba(58,138,158,0.03); }

.budget-badge { display: inline-block; padding: 0.18rem 0.6rem; border-radius: 99px; font-size: 0.73rem; font-weight: 600; white-space: nowrap; }
.budget-ok   { background: rgba(52,168,83,0.12);  color: #1a7a34; }
.budget-warn { background: rgba(251,188,5,0.18);  color: #8a5a00; }
.budget-fail { background: rgba(201,85,61,0.13);  color: #b52200; }

.budget-action { font-size: 0.78rem; color: var(--muted); }

/* ── Error Triage Table ───────────────────────────────── */

.priority-badge { display: inline-block; padding: 0.18rem 0.55rem; border-radius: 4px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.priority-critical { background: rgba(176,0,0,0.12);   color: #900; }
.priority-high     { background: rgba(201,85,61,0.13); color: #b03010; }
.priority-medium   { background: rgba(251,188,5,0.18); color: #8a5a00; }
.priority-low      { background: rgba(136,183,196,0.18); color: #2c5f7c; }
.priority-noise    { background: rgba(150,150,150,0.12); color: #666; }

.triage-msg { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; }
.triage-pages { font-size: 0.76rem; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── KPI sub-label ────────────────────────────────────── */
.kpi-sub { font-size: 0.71rem; color: var(--muted); margin-top: 0.1rem; }

@media print {
  header.site-header, nav, .export-bar, .comments-section, .noscript-warning { display: none; }
  body { background: white; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; animation: none; }
  .kpi-card { animation: none; }
}
