/* ============================================================================
   QA Project Dashboard — design system (bluish, minimal, interactive)
   ========================================================================== */
:root {
  /* Brand / blues */
  --primary: #2563eb;        /* blue-600  */
  --primary-strong: #1d4ed8; /* blue-700  */
  --primary-soft: #eaf1ff;   /* tint      */
  --accent: #4f46e5;         /* indigo    */
  --grad: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --grad-soft: linear-gradient(135deg, #3b82f6 0%, #22c1c3 100%);

  /* Status */
  --done: #16a34a; --prog: #2563eb; --blocked: #dc2626;
  --overdue: #d97706; --notstarted: #94a3b8; --unknown: #cbd5e1;

  /* Neutrals */
  --ink: #0f172a; --muted: #64748b; --line: #e6ebf2;
  --card: #ffffff; --bg1: #eef3fe; --bg2: #f7f9fc;

  /* Shape & depth */
  --r: 16px; --r-sm: 10px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow: 0 10px 30px rgba(30,64,175,.10);
  --shadow-lg: 0 20px 48px rgba(30,64,175,.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Lexend", "Segoe UI", system-ui, Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, #e3ecff 0%, transparent 55%),
    radial-gradient(1000px 500px at 100% 0%, #e7fbff 0%, transparent 45%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
/* Form controls don't inherit font-family by default — force Lexend everywhere,
   including placeholders and date/number field text, so nothing falls back to the
   OS font. */
input, select, textarea, button, optgroup {
  font-family: "Lexend", "Segoe UI", system-ui, Roboto, sans-serif;
}
::placeholder { font-family: "Lexend", "Segoe UI", system-ui, Roboto, sans-serif; opacity: .6; }
::-webkit-datetime-edit { font-family: "Lexend", "Segoe UI", system-ui, Roboto, sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
/* Export capture mode (?export=1) — Reports → Export snapshots pages in a hidden iframe;
   strip the app chrome and force a solid white backdrop so captures are just the report. */
body.is-export .topbar, body.is-export footer, body.is-export #qa-loading { display: none !important; }
body.is-export main { padding: 0 !important; }
body.is-export { background: #fff !important; }
/* Hide interactive chrome inside captured reports (copy buttons, filters, sync). */
body.is-export .summary form, body.is-export .itw-copy, body.is-export .page-filter,
body.is-export .hdr-sync, body.is-export .quarter-filter { display: none !important; }
.muted { color: var(--muted); font-size: .85rem; }
.empty { color: var(--muted); font-style: italic; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--card);          /* solid so scrolled content doesn't ghost through */
  border-bottom: 1px solid rgba(226,232,240,.9);
  box-shadow: var(--shadow-sm);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: .7rem 2rem;
  display: flex; align-items: center; gap: 1.75rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--grad);
  color: #fff; font-weight: 700; font-size: .95rem; letter-spacing: .02em;
  display: grid; place-items: center; box-shadow: 0 6px 16px rgba(37,99,235,.35);
}
.brand-text { display: flex; flex-direction: column; font-weight: 600; line-height: 1.15; }
.brand-text small { font-weight: 400; color: var(--muted); font-size: .7rem; }

nav { display: flex; gap: 1.4rem; align-items: center; }
nav > a, .dropdown-toggle {
  position: relative; color: #475569; font-weight: 500; font-size: .92rem; padding: .25rem 0;
}
nav > a::after, .dropdown-toggle::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -3px; height: 2px;
  background: var(--grad); border-radius: 2px; transition: right .22s ease;
}
nav > a:hover, .dropdown-toggle:hover { color: var(--primary-strong); }
nav > a:hover::after, .dropdown:hover .dropdown-toggle::after { right: 0; }

.dropdown { position: relative; }
.dropdown-toggle { cursor: pointer; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 10px); left: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg); min-width: 200px; padding: .4rem;
}
.dropdown::before { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 12px; }
.dropdown:hover .dropdown-menu { display: block; animation: pop .16s ease both; }
.dropdown-menu a { display: block; padding: .5rem .7rem; border-radius: 8px; color: var(--ink); font-size: .9rem; }
/* Group header inside a dropdown (e.g. Projects → Status / Targets). */
.dd-group { padding: .5rem .7rem .2rem; font-size: .68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); }
.dd-group ~ .dd-group { border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .5rem; }
.dropdown-menu .dd-group + a, .dd-group ~ a { padding-left: 1.1rem; }
.dropdown-menu a:hover { background: var(--primary-soft); color: var(--primary-strong); }

/* Second header row: period filter (left) + account menu (right, under the toggle) */
.topbar-sub { max-width: 1180px; margin: 0 auto; padding: 0 2rem .7rem;
  display: flex; align-items: center; gap: 1rem; }
.topbar-sub .user-menu { margin-left: auto; }
.quarter-filter { margin: 0; display: inline-flex; align-items: center; }
/* Bell + account menu grouped at the right of the sub-bar. */
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.topbar-actions .user-menu { margin-left: 0; }

/* Notification bell + dropdown panel. */
.notif { position: relative; }
.notif-bell { position: relative; background: transparent; border: 0; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; color: inherit; box-shadow: none; padding: 0; font-size: 1.05rem; }
.notif-bell:hover { background: rgba(100,116,139,.14); transform: none; box-shadow: none; }
.notif-badge { position: absolute; top: -1px; right: -1px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-size: .66rem;
  font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg2); }
.notif-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 70; width: 440px;
  max-width: 94vw; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg); overflow: hidden; }
.notif-head { padding: .6rem .85rem; border-bottom: 1px solid var(--line); font-size: .78rem;
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.notif-clear { background: transparent; border: 1px solid var(--line); color: var(--muted);
  font-size: .68rem; padding: .18rem .45rem; border-radius: var(--r-pill); cursor: pointer; box-shadow: none; }
.notif-clear:hover { background: var(--primary-soft); color: var(--ink); transform: none; box-shadow: none; }
.notif-body { max-height: 70vh; overflow-y: auto; }
.notif-section { display: flex; align-items: center; gap: .4rem; padding: .5rem .85rem .25rem;
  font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.notif-row { display: flex; align-items: center; gap: .55rem; justify-content: space-between;
  padding: .45rem .85rem; text-decoration: none; color: inherit; border-top: 1px solid var(--line); }
.notif-row:hover { background: var(--primary-soft); text-decoration: none; }
.notif-row-main { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.notif-title { font-weight: 500; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-sub { font-size: .68rem; }
.notif-empty { padding: 1.2rem .85rem; text-align: center; color: var(--muted); font-size: .8rem; }
.notif-more { padding: .4rem .85rem; font-size: .7rem; color: var(--muted); border-top: 1px solid var(--line); }
.notif-foot { display: block; padding: .55rem .85rem; border-top: 1px solid var(--line);
  text-align: center; font-size: .76rem; font-weight: 500; }
.notif-row .chip { font-size: .62rem; }
.period { display: flex; gap: .5rem; align-items: center; }
/* Overview: per-project quarter-target status summary cards. */
.proj-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.proj-status-card { display: block; text-decoration: none; color: inherit; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.25rem; transition: transform .16s ease, box-shadow .16s ease; }
.proj-status-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.proj-status-head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .6rem; }
.proj-status-head strong { font-size: 1.05rem; }
.proj-status-body { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.proj-status-chart { position: relative; width: 118px; height: 118px; flex: 0 0 auto; }
.proj-status-center { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none; }
.proj-status-pct { font-size: 1.25rem; font-weight: 700; color: var(--primary); line-height: 1.1; }
.proj-status-count { font-size: .74rem; color: var(--muted); }
.proj-status-body .chips { flex: 1; min-width: 160px; }

/* Kanboard import preview modal. */
.kb-preview-card { width: min(560px, 94vw); }
.kb-preview-card .wk-modal-body { max-height: 60vh; overflow: auto; }
.kb-preview-card table.grid tfoot td { border-top: 2px solid var(--line); }

/* Imported-quarters list (each with Open / Delete) on the Import Dashboard. */
.import-imports { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.import-imports-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin-bottom: .5rem; }
.import-quarter { display: flex; align-items: center; gap: .8rem; padding: .4rem 0; }
.import-quarter + .import-quarter { border-top: 1px solid var(--line); }
.import-quarter-name { flex: 1; font-weight: 600; }
.import-quarter-open { font-size: .82rem; font-weight: 600; }

/* Import Dashboard form fields: label on top, equal-height controls, aligned. */
.dz-field { display: flex; flex-direction: column; }
.dz-label { font-size: .82rem; color: var(--ink); margin-bottom: .3rem; }
.dz-field > select, .dz-field > input[type="text"] { height: 42px; box-sizing: border-box; margin: 0; }
/* Field that grows to fill the row (CSV drop zone / Epic Link). */
.dz-grow { flex: 1 1 260px; }
.dz-grow .dropzone, .dz-grow > input[type="text"] { width: 100%; min-width: 0; }
/* Drag-and-drop CSV zone. */
.dropzone { display: flex; align-items: center; gap: .55rem; min-width: 320px; height: 42px;
  box-sizing: border-box; cursor: pointer; border: 2px dashed var(--line); border-radius: 10px;
  padding: 0 .9rem; background: var(--card); transition: border-color .15s ease, background .15s ease; }
/* Beat `.account-form label { display:block; margin-bottom:.85rem }` — the drop zone
   is a <label>, so restore flex centering and drop the stray bottom margin. */
.account-form .dropzone { display: flex; align-items: center; margin: 0; }
.dropzone:hover { border-color: var(--primary); }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dz-input { display: none !important; }
.dz-icon { color: var(--muted); font-size: 1.05rem; flex: 0 0 auto; }
.dz-text { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "or generate from an Epic Link" divider on the Import Dashboard. */
.import-or { display: flex; align-items: center; gap: .8rem; margin: 1rem 0 .8rem; color: var(--muted); }
.import-or::before, .import-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.import-or span { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }

/* Per-page filter (replaces the removed global period filter). */
.page-filter { display: inline-flex; align-items: center; gap: .45rem; }
.page-filter > span { font-size: .78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); }
.page-filter select { min-width: 120px; }
/* Disabled/placeholder dropdown items ("coming soon") */
.dropdown-menu .dd-soon { display: block; padding: .5rem .7rem; border-radius: 8px;
  color: var(--muted); font-size: .9rem; cursor: default; opacity: .6; }
.period .period-gran { min-width: 108px; }
.period .period-value { min-width: 120px; }

/* ── Form controls ───────────────────────────────────────────────────────── */
select, .filter-select {
  appearance: none; -webkit-appearance: none;
  font-family: inherit; font-size: .88rem; color: var(--ink);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 13px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: .5rem 1.9rem .5rem .75rem; cursor: pointer; min-width: 150px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
select:hover, .filter-select:hover { border-color: #b9c6dc; }
select:focus, .filter-select:focus, input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
main { max-width: 1180px; margin: 0 auto; padding: 2rem; }
section { margin-bottom: 3rem; animation: rise .35s ease both; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 1.1rem; letter-spacing: -.01em; }
h2 small { color: var(--muted); font-weight: 400; }
footer { text-align: center; color: var(--muted); padding: 2rem; font-size: .8rem; }

/* ── Hero / summary ──────────────────────────────────────────────────────── */
.overall {
  display: flex; align-items: center; gap: 2.25rem; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.5rem 1.75rem; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.overall::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--grad);
}
.big-number strong {
  font-size: 2.8rem; font-weight: 700; line-height: 1; display: block; letter-spacing: -.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.big-number span { color: var(--muted); font-size: .9rem; }
.chart-wrap { position: relative; width: 150px; height: 150px; flex: 0 0 auto; }

/* Weekly Target-vs-Actual trend */
.trend-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 1.25rem 1.5rem; }
.trend-wrap { position: relative; width: 100%; height: 280px; }
/* Per-member RYG cards — large, side by side */
.ryg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.ryg-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 1.25rem 1.4rem; animation: rise .35s ease both;
  cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.ryg-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ryg-clickable { cursor: pointer; }
/* Read-only weekly-tasks modal (per member) opened from a RYG card. */
.wk-ryg-card { width: min(920px, 95vw); }
.ryg-mod { margin-bottom: 1.1rem; }
.ryg-mod:last-child { margin-bottom: 0; }
.ryg-mod-head { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.ryg-top { display: flex; align-items: center; gap: 1.25rem; }
.ryg-card .ryg-chart { width: 110px; height: 110px; }
.ryg-info { min-width: 0; }
.ryg-name { display: block; font-size: 1.05rem; }
.ryg-pct { font-size: 1.9rem; font-weight: 700; line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ryg-tasks-wrap { margin-top: 1rem; max-height: 320px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r-sm); }
.ryg-tasks { font-size: .82rem; box-shadow: none; border: 0; }
.ryg-tasks thead th { position: sticky; top: 0; z-index: 1; }
@media (max-width: 820px) { .ryg-grid { grid-template-columns: 1fr; } }

/* Filed Bugs by QA card (Overview, under Weekly completion). */
.fb-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 1rem 1.25rem; }
.fb-table { width: 100%; }
.fb-proj { font-size: .75rem; }
/* Critical bugs (High–Highest priority) highlighted in light red. */
.fb-table tr.fb-critical > td { background: #fde8e8; }
:root[data-theme="dark"] .fb-table tr.fb-critical > td { background: #3a1d1d; }
.fb-sev { font-size: .78rem; }
.fb-sev-crit { color: #b91c1c; font-weight: 700; }
:root[data-theme="dark"] .fb-sev-crit { color: #f87171; }

/* Per-project filed-bug tiles + click-to-open detail modal. */
.fb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.fb-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; overflow: hidden; }
.fb-tile[role="button"] { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.fb-tile[role="button"]:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.fb-tile-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .7rem .9rem; border-bottom: 1px solid var(--line); background: var(--bg2); }
.fb-tile-name { font-weight: 700; }
.fb-tile-count { white-space: nowrap; }
.fb-tile-list { padding: .3rem .5rem; display: flex; flex-direction: column;
  max-height: 300px; overflow-y: auto; }
.fb-tile-row { display: flex; flex-direction: column; gap: .2rem; padding: .45rem; }
.fb-tile-row + .fb-tile-row { border-top: 1px solid var(--line); }
.fb-tile-row.fb-critical { background: #fde8e8; border-radius: 6px; }
:root[data-theme="dark"] .fb-tile-row.fb-critical { background: #3a1d1d; }
.fb-tile-title { font-size: .82rem; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.fb-tile-sub { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.fb-tile-qa { font-size: .74rem; color: var(--muted); }
.fb-tile-empty { padding: 1.1rem .5rem; margin: 0; }
.fb-modal .fb-modal-card { width: min(940px, 94vw); max-height: 86vh; }
.fb-modal .fb-modal-body { display: block; overflow-y: auto; max-height: 74vh; padding: 0 1rem 1rem; }

/* ── Cards grid (projects) ───────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  animation: rise .35s ease both; position: relative; overflow: hidden;
}
.card::after {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #d7e0f0; }
.card:hover::after { transform: scaleX(1); }
.card.at-risk { border-color: #f6d5b8; }
.card.at-risk::after { background: linear-gradient(135deg, #f59e0b, #ef4444); transform: scaleX(1); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.card-head h3 { margin: 0; font-size: 1.02rem; font-weight: 600; }
.card-head h3 a { color: var(--ink); }
.card-body { display: flex; align-items: center; gap: 1.1rem; margin: .5rem 0 .2rem; }
.chart-mini { position: relative; width: 104px; height: 104px; flex: 0 0 auto; }
.card-stat strong { font-size: 1.6rem; font-weight: 700; display: block; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card-stat span { font-size: .8rem; }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.bar { display: inline-block; width: 70%; height: 9px; background: #eef2f7;
  border-radius: var(--r-pill); overflow: hidden; vertical-align: middle; }
.bar .seg.done { display: block; height: 100%; border-radius: var(--r-pill);
  background: var(--grad-soft); transition: width .6s cubic-bezier(.4,0,.2,1); }
.pct { margin-left: .55rem; font-weight: 600; font-size: .85rem; color: var(--ink); }

/* ── Chips & badges ──────────────────────────────────────────────────────── */
.chips { margin-top: .7rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-size: .72rem; padding: .2rem .55rem; border-radius: var(--r-pill);
  background: #eef2f7; color: #334155; font-weight: 500;
  border: 1px solid rgba(15,23,42,.08); }
.chip.done { background: #e4f6ea; color: #15803d; }
.chip.in_progress { background: #e6effe; color: #1d4ed8; }
.chip.blocked { background: #fde8e8; color: #b91c1c; }
.chip.overdue { background: #fdf0dd; color: #b45309; }
.chip.not_started { background: #eef2f7; color: #475569; }
.chip.unknown { background: #eef2f7; color: #64748b; }

.badge { font-size: .72rem; padding: .18rem .6rem; border-radius: var(--r-pill);
  color: #fff; font-weight: 500; display: inline-block; white-space: nowrap;
  border: 1px solid rgba(15,23,42,.10); }
/* Keep the status column on a single line and sized to its content. */
table.grid td:last-child, table.grid th:last-child { white-space: nowrap; width: 1%; }
.badge.risk { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.status-done { background: var(--done); } .status-in_progress { background: var(--prog); }
.status-blocked { background: var(--blocked); } .status-overdue { background: var(--overdue); }
.status-not_started { background: var(--notstarted); } .status-unknown { background: var(--unknown); color: #334155; }

/* Story-type badges */
.type-badge { font-size: .72rem; padding: .16rem .55rem; border-radius: var(--r-pill);
  border: 1px solid transparent; white-space: nowrap; font-weight: 500; }
.type-story      { background: #e6effe; color: #1d4ed8; border-color: #cfe0fd; }
.type-bug        { background: #fde8e8; color: #b91c1c; border-color: #f6cccc; }
.type-task       { background: #e4f6ea; color: #15803d; border-color: #c9ecd4; }
.type-subtask    { background: #eef2f7; color: #475569; border-color: #e0e6ee; }
.type-epic       { background: #efe9fd; color: #6d28d9; border-color: #ddd0fb; }
.type-improvement{ background: #e2f7f7; color: #0e7490; border-color: #c3ecec; }
.type-newfeature { background: #fff4da; color: #a16207; border-color: #f4e2ad; }
.type-unspecified{ background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }

/* ── By-type cards ───────────────────────────────────────────────────────── */
.type-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
/* Monthly progress: always the 3 quarter months side by side, filling the width. */
.type-cards.month-cards { grid-template-columns: repeat(3, 1fr); }
.qa-speed-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .8rem; margin: -.4rem 0 .9rem; }
.qa-speed-legend .story-key { display: inline-block; margin: 0; padding: .1rem .4rem; border-radius: 6px; background: var(--primary-soft); }
.qa-speed-legend .story-key.k-green { background: #dcfce7; color: #15803d; }
.qa-speed-legend .story-key.k-orange { background: #ffedd5; color: #c2560c; }
.qa-speed-legend .story-key.k-red { background: #fee2e2; color: #b91c1c; }
.type-card { display: block; color: inherit; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .9rem 1rem; box-shadow: var(--shadow-sm); animation: rise .35s ease both;
  transition: transform .16s ease, box-shadow .16s ease; }
.type-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.month-card { cursor: default; text-align: center; }
.month-card:hover { transform: none; box-shadow: var(--shadow-sm); }
.month-card .type-card-head { justify-content: center; }
.month-chart { position: relative; height: 140px; margin: .4rem 0 .6rem; }
.month-chart-center { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none; }
.month-pct { font-size: 1.4rem; font-weight: 700; color: var(--primary); line-height: 1.1; }

/* Filed-bugs section (By member): two cards — bugs by member, stories with bugs. */
.fb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.fb-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); overflow: hidden; animation: rise .35s ease both; }
.fb-card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); }
.fb-card-head h3 { margin: 0; font-size: 1rem; }
.fb-list { max-height: 22rem; overflow-y: auto; }
.fb-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .6rem 1.1rem; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line);
  transition: background .12s ease; }
.fb-row:last-child { border-bottom: 0; }
.fb-row:hover { background: var(--primary-soft); text-decoration: none; }
.fb-row-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.fb-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Per-member highlight on the story (linked-issue) header bar, instead of blue link text. */
.fb-group-head.fb-hl-teal { background: #ccfbf1; }
.fb-group-head.fb-hl-amber { background: #fef3c7; }
.fb-group-head.fb-hl-teal .fb-title a { color: #0f766e; }
.fb-group-head.fb-hl-amber .fb-title a { color: #b45309; }
:root[data-theme="dark"] .fb-group-head.fb-hl-teal { background: #0f2e2b; }
:root[data-theme="dark"] .fb-group-head.fb-hl-amber { background: #3a2c07; }
:root[data-theme="dark"] .fb-group-head.fb-hl-teal .fb-title a { color: #5eead4; }
:root[data-theme="dark"] .fb-group-head.fb-hl-amber .fb-title a { color: #fcd34d; }
.fb-sub { font-size: .78rem; }
.fb-count { flex: none; min-width: 1.9rem; text-align: center; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); border-radius: 999px; padding: .12rem .5rem; }
.fb-list .empty { padding: 1rem 1.1rem; }
.fb-group + .fb-group { border-top: 2px solid var(--line); }
.fb-group-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center;
  justify-content: space-between; gap: .5rem; padding: .5rem 1.1rem;
  background: var(--bg2); border-bottom: 1px solid var(--line); }
.fb-group .fb-row { padding-left: 1.4rem; }
.fb-group .empty { padding: .6rem 1.4rem; }

/* Jira Status: clickable cards + wide detail modal. */
.clickable { cursor: pointer; }
.overall.clickable:hover, .card.clickable:hover, .type-card.clickable:hover {
  transform: translateY(-3px); box-shadow: var(--shadow); }
.js-modal-card { max-width: 1240px; width: 96vw; }
/* Keep column headers and short values (type, project, dates, status) on one line
   so they don't crush into "202 6- 07-"; the body scrolls horizontally if needed. */
.js-modal-card table.grid th { white-space: nowrap; }
.js-modal-card table.grid td:nth-child(2),
.js-modal-card table.grid td:nth-child(3),
.js-modal-card table.grid td:nth-child(5),
.js-modal-card table.grid td:nth-child(6),
.js-modal-card table.grid td:nth-child(7) { white-space: nowrap; }
/* Quarter-targets matching popup. */
.qt-match-card { max-width: 820px; width: 92vw; }
.qt-match-card .wk-modal-body { max-height: 70vh; overflow-y: auto; }
/* Shared-key indicator: 2+ target stories linked to the same Jira key. */
.qt-shared { display: inline-block; margin-left: .4rem; padding: .05rem .45rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; white-space: nowrap; background: #fef3c7; color: #92400e; }
:root[data-theme="dark"] .qt-shared { background: #3a2e12; color: #f6c765; }
.qt-similar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .5rem;
  padding: .5rem .7rem; border-radius: var(--r-sm); background: #fffbeb; border: 1px solid #fde68a; font-size: .9rem; }
:root[data-theme="dark"] .qt-similar { background: #241d0c; border-color: #4a3a12; }
.qt-bulk-similar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: .6rem; margin-bottom: 1rem; padding: .7rem .9rem; border-radius: var(--r-sm);
  background: var(--primary-soft); border: 1px solid var(--line); }
/* Empty-stage warning: stages left blank in the sheet (didn't complete this quarter). */
.qt-warn { padding: .5rem .7rem; border-radius: var(--r-sm); font-size: .9rem;
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
:root[data-theme="dark"] .qt-warn { background: #2a1414; border-color: #5b1d1d; color: #f5a3a3; }
.qt-warn-chip { display: inline-block; margin-left: .4rem; padding: .05rem .45rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; white-space: nowrap; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
:root[data-theme="dark"] .qt-warn-chip { background: #2a1414; color: #f5a3a3; border-color: #5b1d1d; }
.month-count { font-size: .78rem; color: var(--muted); }
.month-load { margin-top: .7rem; border-top: 1px solid var(--line); text-align: left; }
.month-load-toggle { display: flex; align-items: center; gap: .4rem; width: 100%; padding: .55rem .2rem 0;
  background: none; border: 0; box-shadow: none; cursor: pointer; font: inherit; color: var(--ink); }
.month-load-toggle:hover { background: none; transform: none; box-shadow: none; }
.month-load-caret { color: var(--muted); font-size: .72rem; width: 1em; flex: 0 0 auto; }
.month-load-sum { font-size: .82rem; color: var(--muted); }
.month-load-sum strong { color: var(--ink); font-weight: 700; }
.month-load-body { margin-top: .5rem; display: flex; flex-direction: column; gap: .7rem; }
.month-load-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); font-weight: 600; margin-bottom: .35rem; }
.month-load-keys { display: flex; flex-wrap: wrap; gap: .3rem; }
.month-load-keys .story-key { display: inline-block; margin: 0; padding: .1rem .4rem;
  background: var(--primary-soft); border-radius: 6px; }
:root[data-theme="dark"] .month-load-keys .story-key { background: #1b2942; }
/* Completion-speed tint on "Moved to In QA" keys (light): same month / next / third. */
.month-load-keys .story-key.k-green { background: #dcfce7; color: #15803d; }
.month-load-keys .story-key.k-orange { background: #ffedd5; color: #c2560c; }
.month-load-keys .story-key.k-red { background: #fee2e2; color: #b91c1c; }
:root[data-theme="dark"] .month-load-keys .story-key.k-green { background: #14351f; color: #86efac; }
:root[data-theme="dark"] .month-load-keys .story-key.k-orange { background: #3a2510; color: #fdba74; }
:root[data-theme="dark"] .month-load-keys .story-key.k-red { background: #3b1517; color: #fca5a5; }
/* Completed WITHOUT going through In QA — flagged in the QA-completed list + legend. */
.qa-speed-legend .story-key.k-noqa,
.month-load-keys .story-key.k-noqa { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
:root[data-theme="dark"] .qa-speed-legend .story-key.k-noqa,
:root[data-theme="dark"] .month-load-keys .story-key.k-noqa { background: #0f2e2b; color: #5eead4; border-color: #115e59; }
.type-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .55rem; }
.type-card .bar { width: 100%; }

/* ── Toolbar (search + dropdown filters) ─────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; margin: .9rem 0 1.35rem; }
.toolbar .filter-select { margin: 0; }
.toolbar input[type=search] {
  font-family: inherit; font-size: .9rem; padding: .55rem .9rem .55rem 2.1rem;
  border: 1px solid var(--line); border-radius: var(--r-pill); min-width: 260px; background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: .7rem center; background-size: 15px;
}
.toolbar .count { color: var(--muted); font-size: .8rem; }
/* Pagination bar */
.pager { display: flex; align-items: center; gap: 1rem; margin-top: .9rem; flex-wrap: wrap;
  font-size: .85rem; color: var(--muted); }
.pager-rows { display: inline-flex; align-items: center; gap: .4rem; }
.pager-rows select { min-width: 72px; }
.pager-info { }
.pager-nav { margin-left: auto; display: flex; gap: .4rem; }
.pager-nav button { background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: .4rem .7rem; font-size: .82rem; box-shadow: none; cursor: pointer; }
.pager-nav button:hover:not(:disabled) { background: var(--primary-soft); transform: none; box-shadow: none; }
.pager-nav button:disabled { opacity: .45; cursor: default; }

/* Toggle pill (e.g. "Hide completed") — matches the filter aesthetic. */
.toggle-pill { background: #eef2f7; color: #475569; box-shadow: none; font-weight: 500;
  font-size: .82rem; padding: .45rem .9rem; border: 1px solid var(--line);
  border-radius: var(--r-pill); cursor: pointer; }
.toggle-pill:hover { background: #e4e9f0; transform: none; box-shadow: none; }
.toggle-pill.active { background: var(--grad); color: #fff; border-color: transparent; }

/* Columns show/hide dropdown (native <details>). */
.colmenu { position: relative; }
.colmenu > summary { list-style: none; cursor: pointer; user-select: none;
  font-size: .82rem; color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: .5rem .8rem; display: inline-flex; align-items: center; gap: .3rem; }
.colmenu > summary::-webkit-details-marker { display: none; }
.colmenu > summary::after { content: "▾"; color: var(--muted); font-size: .8em; }
.colmenu[open] > summary { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.colmenu-body { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg); padding: .5rem; min-width: 180px; display: grid; gap: .15rem; }
.colmenu-body label { display: flex; align-items: center; gap: .5rem; font-size: .85rem;
  padding: .3rem .5rem; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.colmenu-body label:hover { background: var(--primary-soft); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
/* Compact, wrapping table: fits many columns within the centered layout without
   horizontal scrolling (long text/keys wrap instead of forcing overflow). */
table.grid.compact { font-size: .82rem; }
.story-key { font-size: .72rem; color: var(--muted); margin-top: .12rem; }
table.grid.compact th, table.grid.compact td { padding: .5rem .55rem; overflow-wrap: anywhere; }
/* Keep short columns from being stretched by the long title column. */
table.grid.compact td:nth-child(7), table.grid.compact th:nth-child(7),
table.grid.compact td:nth-child(8), table.grid.compact th:nth-child(8) { white-space: nowrap; }

table.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
table.grid th, table.grid td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line); }
table.grid thead th { background: #f8fafd; font-size: .74rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr { transition: background .12s ease; }
table.grid tbody tr:hover { background: #f5f9ff; }
table.grid tr.at-risk td { background: #fffaf3; }
/* Target-status hierarchy: parent target rows + indented related children. */
table.grid tr.qt-parent td { background: var(--primary-soft); font-weight: 600; border-top: 2px solid var(--line); }
table.grid tr.qt-child .qt-indent { padding-left: 2rem; color: var(--muted); font-weight: 400; }
:root[data-theme="dark"] table.grid tr.qt-parent td { background: #1b2942; }

/* Target-status: collapsible parent cards, patterned on the Weekly week cards. */
[x-cloak] { display: none !important; }
.qt-status-list { display: flex; flex-direction: column; gap: 1rem; }
.qt-accordion { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); overflow: hidden; }
.qt-acc-head { display: flex; align-items: flex-start; gap: .75rem; width: 100%; text-align: left;
  padding: .8rem 1.1rem; background: #f4f7fc; border: 0; border-radius: 0; box-shadow: none;
  cursor: pointer; user-select: none; font: inherit; color: var(--ink); }
.qt-acc-head:hover { background: #eaf0f9; transform: none; box-shadow: none; }
.qt-accordion.has-links > .qt-acc-head:hover { transform: none; box-shadow: none; }
.qt-acc-head.open { border-bottom: 1px solid var(--line); }
.qt-acc-caret { color: var(--muted); font-size: .75rem; width: 1em; flex: 0 0 auto; line-height: 1.5; }
.qt-acc-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.qt-acc-name { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.qt-acc-title .story-key { align-self: flex-start; margin-top: 0; }
/* Parents with linked issues get the gradient header (like the current week). */
.qt-accordion.has-links { border-color: var(--primary); }
.qt-accordion.has-links > .qt-acc-head { background: var(--grad); color: #fff; }
.qt-accordion.has-links > .qt-acc-head:hover { background: var(--grad); filter: brightness(1.05); }
.qt-accordion.has-links > .qt-acc-head .qt-acc-caret { color: rgba(255, 255, 255, .9); }
.qt-accordion.has-links > .qt-acc-head .story-key { color: rgba(255, 255, 255, .82); }
/* Fixed 3-column meta grid so type / status / linked line up across all rows. */
.qt-acc-meta { flex: 0 0 auto; display: grid; grid-template-columns: 74px 96px 82px;
  gap: .5rem; align-items: center; justify-items: start; padding-top: .1rem; }
.qt-acc-meta > * { justify-self: start; }
.qt-acc-count { white-space: nowrap; }
.qt-acc-body { padding: 1rem 1.1rem 1.1rem; }
.qt-acc-body table.grid { border: 1px solid var(--line); }
.qt-link-sum { display: block; overflow-wrap: anywhere; }
.qt-acc-body table.grid td .story-key { display: inline-block; margin-top: .15rem; }
:root[data-theme="dark"] .qt-acc-head { background: #16233c; }
:root[data-theme="dark"] .qt-acc-head:hover,
:root[data-theme="dark"] .qt-acc-head.open { background: #1b2942; }

/* Sanitation: Jira targets vs Kanboard tasks, side by side. */
.san-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .san-grid { grid-template-columns: 1fr; } }
.san-grid table.grid { table-layout: fixed; }
.san-cat { background: var(--primary-soft); color: var(--primary); }
.san-flag { background: #fdecec; color: #b91c1c; margin-left: .35rem; }
table.grid tr.san-outside td { background: #fffaf3; }
table.grid tr.san-outside:hover td { background: #fdf0dd; }
:root[data-theme="dark"] table.grid tr.san-outside td { background: #2a2113; }

/* "Show Pending / Show All" filter button on the Quarter Targets header. */
.qt-pending-btn { font-size: .82rem; font-weight: 600; padding: .4rem .9rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
  box-shadow: none; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.qt-pending-btn:hover { background: var(--primary-soft); border-color: var(--primary); transform: none; box-shadow: none; }
.qt-pending-btn.active { background: var(--grad); border-color: transparent; color: #fff; }
.qt-pending-btn.active:hover { filter: brightness(1.05); background: var(--grad); }

/* Epic group: the parent of all parent stories (epic-generated targets). */
.qt-epic { border: 2px solid var(--primary); border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow-sm); margin-bottom: 1rem; }
.qt-epic-head, .qt-epic-head:hover { background: var(--grad); color: #fff; }
.qt-epic-head .qt-acc-caret, .qt-epic-head .story-key { color: rgba(255, 255, 255, .85); }
.qt-epic-body { padding: .8rem; background: var(--primary-soft); }
:root[data-theme="dark"] .qt-epic-body { background: #16233c; }
.qt-epic-body .qt-status-list { gap: .6rem; }

/* Quarter-targets keyless-row match candidates / search results. */
.qt-cand { display: flex; align-items: baseline; gap: .5rem; padding: .3rem .1rem; border-bottom: 1px solid var(--line); }
.qt-cand:last-child { border-bottom: 0; }
.qt-cand .qt-sum { flex: 1; min-width: 0; }
.qt-cand button { padding: .25rem .8rem; font-size: .78rem; box-shadow: none; }

/* Stories already linked to a target row (a row may link several). */
.qt-linked { margin-top: .6rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg2); padding: .35rem .55rem; }
:root[data-theme="dark"] .qt-linked { background: #16233c; }
.qt-linked-head { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .15rem; }
.qt-linked-row { display: flex; align-items: baseline; gap: .5rem; padding: .22rem 0;
  border-bottom: 1px solid var(--line); }
.qt-linked-row:last-child { border-bottom: 0; }
.qt-linked-row .qt-sum { flex: 1; min-width: 0; }
.qt-primary { font-size: .68rem; font-weight: 600; padding: .05rem .4rem; border-radius: var(--r-pill);
  background: var(--primary-soft); color: var(--primary-strong); }
:root[data-theme="dark"] .qt-primary { background: #1e3a8a; color: #dbeafe; }
.qt-chip-x { padding: .05rem .42rem; font-size: .72rem; line-height: 1.3; background: none;
  color: var(--muted); box-shadow: none; border: 1px solid var(--line); }
.qt-chip-x:hover { background: #fee2e2; color: var(--blocked); border-color: var(--blocked);
  transform: none; box-shadow: none; }
:root[data-theme="dark"] .qt-chip-x:hover { background: #4a1d28; }
.qt-linked-ok { margin-left: .45rem; font-size: .7rem; font-weight: 600; padding: .05rem .45rem;
  border-radius: var(--r-pill); background: rgba(22,163,74,.12); color: var(--done); }
.account-form.qt-card-linked { border-left: 3px solid var(--done); }

/* Resolved-targets table: a target linking several stories renders one row per
   story, with the target name and actions merged across them. */
.qt-target-cell { vertical-align: top; }
.qt-list-table tr.qt-grp-cont td { border-top: 1px dashed var(--line); }
.qt-sum-cell { color: var(--muted); font-size: .88rem; }
.qt-multi { margin-left: .4rem; font-size: .68rem; font-weight: 600; white-space: nowrap;
  padding: .05rem .45rem; border-radius: var(--r-pill);
  background: var(--primary-soft); color: var(--primary-strong); }
:root[data-theme="dark"] .qt-multi { background: #1e3a8a; color: #dbeafe; }

/* Rows highlighted because their Epic Link matches (e.g. Reported Issues epic). */
table.grid tr.epic-hl td { background: #fdecec; }
table.grid tr.epic-hl:hover td { background: #fbdada; }
:root[data-theme="dark"] table.grid tr.epic-hl td { background: #3a1720; }
:root[data-theme="dark"] table.grid tr.epic-hl:hover td { background: #4a1d28; }
.progress-cell { white-space: nowrap; }
th.th-sort { cursor: pointer; user-select: none; }
th.th-sort:hover { color: var(--ink); }
th.th-sort[data-sort=asc]::after { content: " \25B2"; font-size: .65em; }
th.th-sort[data-sort=desc]::after { content: " \25BC"; font-size: .65em; }

/* ── Detail / misc ───────────────────────────────────────────────────────── */
dl.meta { display: grid; grid-template-columns: 150px 1fr; gap: .5rem 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.25rem 1.5rem; box-shadow: var(--shadow-sm); }
dl.meta dt { color: var(--muted); } dl.meta dd { margin: 0; }

.link-row { display: flex; gap: .75rem; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: .7rem .9rem; margin-bottom: .55rem;
  box-shadow: var(--shadow-sm); }
.link-row .link-target { flex: 1; display: flex; flex-direction: column; }
.link-row select { flex: 1; max-width: 380px; }

button { font-family: inherit; padding: .5rem 1.05rem; border: 0; border-radius: var(--r-pill);
  background: var(--grad); color: #fff; font-weight: 500; cursor: pointer;
  box-shadow: 0 6px 16px rgba(37,99,235,.28); transition: transform .12s ease, box-shadow .12s ease; }
button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(37,99,235,.36); }
button:active { transform: translateY(0); }

/* ── User menu ───────────────────────────────────────────────────────────── */
.theme-toggle { margin-left: auto; background: transparent; color: inherit; box-shadow: none;
  font-size: 1.05rem; line-height: 1; padding: .35rem .5rem; border-radius: 10px; cursor: pointer; }
.theme-toggle:hover { background: rgba(100,116,139,.14); transform: none; box-shadow: none; }
.user-menu { margin-left: .5rem; }
.user-toggle { display: flex; align-items: center; gap: .5rem; color: #475569; font-weight: 500; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: .78rem; font-weight: 600; }
.user-name { font-size: .9rem; }
.dropdown-menu.right { left: auto; right: 0; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { padding: .7rem .9rem; border-radius: var(--r-sm); margin-bottom: 1rem; font-size: .9rem; }
.alert.ok { background: #e4f6ea; color: #15803d; border: 1px solid #c9e5cb; }
.alert.error { background: #fde8e8; color: #b91c1c; border: 1px solid #f6cccc; }

/* ── Forms (login / account) ─────────────────────────────────────────────── */
.login-card label, .account-form label { display: block; margin-bottom: .85rem; font-size: .85rem;
  color: var(--muted); font-weight: 500; }
.login-card input, .account-form input {
  display: block; width: 100%; margin-top: .3rem; font-family: inherit; font-size: .95rem;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.btn-block { width: 100%; margin-top: .3rem; padding: .7rem; font-size: .95rem; }

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 380px; padding: 1.5rem; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 2rem; animation: rise .35s ease both; }
.login-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.25rem; }
.login-card h1 { font-size: 1.35rem; margin: 0 0 1.25rem; }
.login-foot { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 1.25rem; }

/* ── Account page ────────────────────────────────────────────────────────── */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.account-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.25rem 1.5rem; box-shadow: var(--shadow-sm); }
.account-form h3 { margin: 0 0 1rem; font-size: 1.05rem; }
@media (max-width: 720px) { .account-grid { grid-template-columns: 1fr; } }

/* ── Weekly Tasks ─────────────────────────────────────────────────────────── */
/* Header + filters on top; action buttons on a second row below. */
.wk-toolbar { display: flex; flex-direction: column; align-items: stretch; gap: .9rem; margin-bottom: 1.25rem; }
.wk-toolbar-top { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.wk-toolbar-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.wk-filters { display: flex; gap: .5rem; }
.wk-add-tasks { margin-left: auto; }
/* In the buttons row, keep all buttons grouped together (left-aligned under the
   header) instead of splitting them across the row. */
.wk-toolbar-controls .wk-add-tasks { margin-left: 0; }
/* Sync-from-Kanboard button — light red to echo the Kanboard logo. */
.wk-kb-sync { background: #ef5350; }
.wk-kb-sync:hover { background: #e53935; }

.wk-week { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); margin-bottom: 1rem; overflow: hidden; }
.wk-week-head { padding: .8rem 1.1rem; font-weight: 600; cursor: pointer; user-select: none;
  background: #f4f7fc; color: var(--ink); }
.wk-week-head:hover { background: #eaf0f9; }
.wk-week-body { padding: 1rem 1.1rem 1.1rem; }
.wk-caret { display: inline-block; width: 1em; color: var(--muted); }

/* Current week — emphasized tab. */
.wk-week.wk-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset, var(--shadow); }
.wk-week.wk-current > .wk-week-head { background: var(--grad); color: #fff; }
.wk-week.wk-current > .wk-week-head:hover { filter: brightness(1.05); }
.wk-week.wk-current > .wk-week-head .wk-caret { color: rgba(255,255,255,.9); }
.wk-now { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(255,255,255,.22); color: #fff; padding: .12rem .5rem; border-radius: var(--r-pill);
  margin-left: .5rem; vertical-align: middle; }
/* Per-week task count badge on the week header (works on light + gradient headers). */
.wk-week-count { display: inline-block; min-width: 1.4rem; text-align: center; font-size: .72rem;
  font-weight: 700; padding: .1rem .5rem; border-radius: var(--r-pill); margin-left: .5rem;
  vertical-align: middle; background: var(--primary-soft); color: var(--primary); }
.wk-week.wk-current > .wk-week-head .wk-week-count { background: rgba(255,255,255,.24); color: #fff; }
:root[data-theme="dark"] .wk-week-count { background: #1b2942; color: #93b4f7; }

.wk-module { margin-top: .9rem; }
/* Module sub-tabs. */
.wk-module-head { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem;
  font-weight: 600; cursor: pointer; user-select: none; padding: .3rem .7rem; color: var(--ink);
  background: #eef2f7; border: 1px solid var(--line); border-radius: var(--r-pill); }
.wk-module-head:hover { background: #e4e9f0; }
.wk-module-head .wk-count { font-weight: 600; color: var(--primary); background: #fff;
  border-radius: var(--r-pill); padding: 0 .45rem; font-size: .72rem; }
.wk-collapsed .wk-week-body { display: none; }

/* Module group row (single-table layout) */
.wk-mrow { cursor: pointer; }
.wk-mrow > td { background: #eef2f7; padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
.wk-mrow:hover > td { background: #e4e9f0; }
.wk-mname { font-weight: 600; font-size: .85rem; }
.wk-mrow .wk-count { font-weight: 600; color: var(--primary); background: #fff;
  border-radius: var(--r-pill); padding: 0 .45rem; font-size: .72rem; margin-left: .35rem; }
.wk-mrow .wk-add { margin-left: .6rem; vertical-align: middle; }
.wk-owner { display: block; font-size: .72rem; color: var(--primary); font-weight: 500; }

/* Delete confirmation modal */
.wk-confirm-card { width: min(420px, 92vw); }
.wk-confirm-body { padding: 1.1rem; color: var(--muted); }
.wk-confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; padding: 0 1.1rem 1.1rem; }
.wk-confirm-cancel { background: #eef2f7; color: var(--ink); box-shadow: none; }
.wk-confirm-cancel:hover { background: #e4e9f0; transform: none; box-shadow: none; }
.wk-confirm-ok { background: linear-gradient(135deg, #f43f5e, #dc2626); }

.wk-table { font-size: .82rem; }
.wk-table thead th { background: #f8fafd; text-align: center; }
.wk-table thead tr:first-child th { border-bottom: 1px solid var(--line); }
.wk-in { width: 100%; font-family: inherit; font-size: .82rem; padding: .35rem .45rem;
  border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); }
.wk-in:hover { border-color: var(--line); }
.wk-in:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.15);
  background: #fff; }
.wk-title { font-weight: 500; }
/* Task title wraps and shows in full (auto-grown textarea). */
textarea.wk-title { resize: none; overflow: hidden; white-space: pre-wrap; word-break: break-word;
  line-height: 1.3; min-height: 1.9rem; font-family: inherit;
  field-sizing: content; }   /* auto-grow to fit wrapped content (no JS) */
/* Center every column from Task Type (2) onward; keep the Task column left. */
.wk-table td:nth-child(n+2), .wk-table thead th { text-align: center; }
.wk-table td:nth-child(n+2) .wk-in { text-align: center; }
.wk-table td.wk-task { text-align: left; vertical-align: top; }
.wk-status { border-radius: var(--r-pill); font-weight: 500; text-align: center; }
.wk-actions { text-align: center; }
.wk-del { background: transparent; color: var(--muted); box-shadow: none; padding: .3rem .45rem;
  border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease; }
.wk-del svg { display: block; }
.wk-del:hover { background: #fde8e8; color: #b91c1c; transform: none; box-shadow: none; }
.wk-del:hover svg { animation: wkTrashWiggle .4s ease; }
@keyframes wkTrashWiggle {
  0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

/* Row "dissolve" animation on delete: flash red, fade, and collapse before removal. */
.wk-row-deleting > td {
  overflow: hidden; pointer-events: none;
  animation: wkRowOut .4s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes wkRowOut {
  0%   { background-color: #fecaca; opacity: 1; }
  30%  { background-color: #fca5a5; opacity: 1; }
  100% { background-color: #fca5a5; opacity: 0; padding-top: 0; padding-bottom: 0; }
}
:root[data-theme="dark"] .wk-row-deleting > td { animation-name: wkRowOutDark; }
@keyframes wkRowOutDark {
  0%   { background-color: #4c1d1d; opacity: 1; }
  30%  { background-color: #7f1d1d; opacity: 1; }
  100% { background-color: #7f1d1d; opacity: 0; padding-top: 0; padding-bottom: 0; }
}
.wk-add { margin-top: .4rem; background: transparent; color: var(--primary); box-shadow: none;
  border: 1px dashed var(--line); border-radius: 8px; padding: .35rem .8rem; font-size: .8rem; }
.wk-add:hover { background: var(--primary-soft); transform: none; box-shadow: none; }

/* Add-tasks modal */
.wk-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center;
  justify-content: center; background: rgba(15,23,42,.45);
  backdrop-filter: blur(4px); }
.wk-modal[hidden] { display: none; }
/* Teleported (body-child) modals — e.g. the Overview weekly drill-down — are moved
   out to <body>, so the overlay's own backdrop-filter can't sample the page (the
   content sits inside a transformed ancestor / separate backdrop root). When such a
   modal is open, app.js adds .modal-open-blur to <body> and we blur + disable the
   shell directly. Inline modals keep using the overlay's backdrop-filter above. */
body.modal-open-blur > header.topbar,
body.modal-open-blur > main,
body.modal-open-blur > footer {
  filter: blur(3px); pointer-events: none; user-select: none; }
.wk-modal-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); width: min(900px, 94vw); max-height: 86vh; display: flex;
  flex-direction: column; overflow: hidden; }
/* Import Jira Stories modal — larger to fit the extra columns. */
.wk-import-card { width: min(1600px, 98vw); height: 94vh; max-height: 94vh; }
.wk-import-card .wk-modal-body { flex: 1; min-height: 0; grid-template-columns: 380px 1fr; }
.wk-import-card .wk-jira-list { flex: 1; min-height: 0; max-height: none; }
.wk-import-card .wk-pane { min-height: 0; display: flex; flex-direction: column; }
/* Kanboard status sync modal. */
.wk-sync-card { width: min(880px, 94vw); }
.wk-sync-card .wk-modal-body { overflow-y: auto; }
.wk-sync-table th, .wk-sync-table td { vertical-align: middle; }
/* Assigned-QA drill-down modal (project status). */
.qa-drill-card { width: min(720px, 92vw); }
.qa-drill-card .wk-modal-body { max-height: 70vh; overflow-y: auto; }
/* Per-member drill-down: keep short columns (Module, Task Type, Week, Weekly Status)
   on one line and sized to content; let the Task column take the remaining width. */
.member-drill-card table.grid th { white-space: nowrap; }
.member-drill-card table.grid td:nth-child(1),
.member-drill-card table.grid td:nth-child(3),
.member-drill-card table.grid td:nth-child(4),
.member-drill-card table.grid td:nth-child(5) { white-space: nowrap; width: 1%; }
.member-drill-card table.grid td:nth-child(2) { width: auto; }
.wk-kb-h { display: flex; align-items: center; gap: .4rem; margin: 1rem 0 .4rem; font-size: .95rem; }
.wk-kb-h:first-of-type { margin-top: .2rem; }
.wk-modal-head { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--line); }
.wk-modal-head strong { margin-right: auto; }
.wk-modal-save { font-size: .82rem; padding: .45rem .95rem; }
.wk-modal-close { background: transparent; color: var(--muted); box-shadow: none; }
.wk-modal-close:hover { background: rgba(100,116,139,.14); transform: none; box-shadow: none; }
.wk-modal-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem;
  overflow: auto; }
.wk-pane h4 { margin: 0 0 .6rem; font-size: .9rem; }
.wk-drop { border: 1px dashed var(--line); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .5rem;
  display: flex; flex-direction: column; gap: .4rem;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease, transform .12s ease; }
.wk-drop-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.wk-drop.has-items { border-style: solid; }
/* While a story is being dragged, the whole left pane lifts to signal drop targets. */
.wk-pane.drag-active { background: var(--primary-soft); border-radius: 12px; }
.wk-pane.drag-active .wk-drop { border-color: var(--primary); border-style: dashed; }
.wk-pane.drag-active .wk-drop-hint { color: var(--primary); opacity: .9; }
.wk-drop.over { border-color: var(--primary); border-style: solid; background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(37,99,235,.35) inset; transform: translateY(-1px); }
.wk-drop.over .wk-drop-label, .wk-drop.over .wk-drop-hint { color: var(--primary); opacity: 1; }
/* Staged (unsaved) stories shown under each module. */
.wk-stage-chip { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: var(--primary-soft); border-radius: 8px; padding: .35rem .5rem; font-size: .78rem; }
.wk-stage-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wk-stage-x { border: none; background: transparent; cursor: pointer; color: var(--muted);
  font-size: .78rem; line-height: 1; padding: .1rem .25rem; border-radius: 6px; flex: none; }
.wk-stage-x:hover { color: #dc2626; background: rgba(220,38,38,.1); }
.wk-stage-note { font-size: .75rem; margin: .5rem 0 0; }
.wk-drop-label { font-weight: 600; font-size: .85rem; }
.wk-drop-hint { font-size: .75rem; }
.wk-drop-chip { font-size: .72rem; background: #e4f6ea; color: #15803d; border-radius: var(--r-pill);
  padding: .1rem .5rem; }
.wk-jira-controls { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; flex-wrap: wrap; }
.wk-search { position: relative; flex: 1; min-width: 160px; }
.wk-search input { width: 100%; font-family: inherit; font-size: .88rem;
  padding: .5rem .8rem .5rem 2.1rem; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: #fff; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: .7rem center; background-size: 15px; }
.wk-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.wk-scope { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--muted);
  white-space: nowrap; cursor: pointer; }
/* Scope toggle button: This Quarter / All Year. */
.wk-scope-btn { font-size: .8rem; font-weight: 600; padding: .4rem .8rem; border-radius: var(--r-pill);
  border: 1px solid var(--primary); background: var(--grad); color: #fff; cursor: pointer;
  box-shadow: none; white-space: nowrap; }
.wk-scope-btn:hover { filter: brightness(1.05); transform: none; box-shadow: none; background: var(--grad); }
.wk-scope-btn.all-year { background: var(--card); color: var(--ink); border-color: var(--line); }
.wk-scope-btn.all-year:hover { background: var(--primary-soft); border-color: var(--primary); }
.wk-proj-filter { font-size: .8rem; font-weight: 600; padding: .4rem .8rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; }
.wk-nodash { margin: 0 0 .6rem; font-size: .8rem; }
/* On-brand loading overlay over any Livewire-updated table/list (uses the brand loader). */
.wk-loading, .tbl-loading { position: absolute; inset: 0; z-index: 5; display: none; align-items: center;
  justify-content: center; background: rgba(255,255,255,.72); border-radius: inherit; }
:root[data-theme="dark"] .wk-loading, :root[data-theme="dark"] .tbl-loading { background: rgba(15,23,42,.6); }
.wk-loading .qa-loader, .tbl-loading .qa-loader { width: 40px; height: 40px; }
.wk-jira-list { max-height: 48vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.wk-jira-row { cursor: grab; }
.wk-jira-row:hover { background: var(--primary-soft); }
.wk-jira-row.wk-prio { background: #fff8e6; }
.wk-jira-row.wk-prio:hover { background: #fdefc8; }
/* Project-target stories, prioritised at the top of the import list. */
.wk-jira-row.wk-target { background: #eaf3ff; }
.wk-jira-row.wk-target:hover { background: #dcebfd; }
.wk-target-tag { display: inline-block; font-size: .6rem; font-weight: 700; letter-spacing: .04em;
  background: var(--primary); color: #fff; border-radius: 4px; padding: .05rem .3rem; margin-right: .35rem; vertical-align: middle; }
:root[data-theme="dark"] .wk-jira-row.wk-target { background: #16263f; }
:root[data-theme="dark"] .wk-jira-row.wk-target:hover { background: #1b2f4d; }
.wk-prio-tag { color: #d97706; font-weight: 700; margin-right: .2rem; }
/* Source-origin badges in the import list (same shape as TARGET). */
.wk-src-tag { display: inline-block; font-size: .6rem; font-weight: 700; letter-spacing: .04em;
  color: #fff; border-radius: 4px; padding: .05rem .3rem; margin-right: .35rem; vertical-align: middle; }
.wk-src-reported { background: #7f1d1d; }   /* maroon — Reported Issues */
.wk-src-automation { background: #0f766e; } /* teal — Automation For Jira */
.wk-drop-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem;
  background: #e4f6ea; color: #15803d; border-radius: var(--r-pill); padding: .1rem .3rem .1rem .55rem; }
.wk-chip-x { background: transparent; color: inherit; box-shadow: none; padding: 0 .25rem;
  font-size: .85rem; line-height: 1; border-radius: 50%; }
.wk-chip-x:hover { background: rgba(0,0,0,.12); transform: none; box-shadow: none; }
:root[data-theme="dark"] .wk-search input { background-color: #0f1830; }
:root[data-theme="dark"] .wk-jira-row.wk-prio { background: #2a2410; }
:root[data-theme="dark"] .wk-jira-row.wk-prio:hover { background: #352c12; }

/* Reporter/creator shown under each Jira story title in the import list. */
.wk-jira-title { line-height: 1.35; overflow-wrap: anywhere; }
.wk-jira-creator { font-size: .72rem; color: var(--muted); margin-top: .12rem; }

/* Import list column sizing: the Story cell wraps and absorbs slack; the short
   Project/Type/Status columns stay on one line so nothing breaks mid-word. */
.wk-jira-list table { width: 100%; }
.wk-jira-list th:nth-child(1), .wk-jira-list td:nth-child(1) { overflow-wrap: anywhere; }
.wk-jira-list th:nth-child(n+2), .wk-jira-list td:nth-child(n+2) { white-space: nowrap; }

/* Linked-issues picker dialog */
.wk-linked-modal { z-index: 260; }
.wk-linked-card { width: min(560px, 94vw); }
.wk-linked-sub { padding: .6rem 1.1rem 0; font-size: .85rem; }
.wk-linked-list { padding: .6rem 1.1rem; max-height: 46vh; overflow: auto; display: flex;
  flex-direction: column; gap: .4rem; }
.wk-linked-item { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center;
  gap: .55rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; }
.wk-linked-item:hover { background: var(--primary-soft); }
.wk-linked-key { font-weight: 600; font-size: .8rem; color: var(--primary); }
.wk-linked-summary { font-size: .82rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.wk-linked-type, .wk-linked-rel { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.wk-linked-rel { grid-column: 3; justify-self: start; }

/* Transient confirmation toast */
.wk-toast { position: fixed; left: 50%; bottom: 1.6rem; transform: translate(-50%, 1.5rem);
  background: rgba(15,23,42,.94); color: #fff; padding: .7rem 1.1rem; border-radius: 10px;
  font-size: .85rem; box-shadow: var(--shadow-lg); z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; max-width: 90vw; }
.wk-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Full-page loading overlay ─────────────────────────────────────────────── */
#qa-loading { position: fixed; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center;
  background: rgba(15,23,42,.35); backdrop-filter: blur(2px); }
#qa-loading.active { display: flex; }
/* On-brand morphing loader: a gradient tile that rotates and shifts between a
   rounded square and a circle. */
.qa-loader { width: 52px; height: 52px; background: var(--grad);
  box-shadow: 0 12px 34px rgba(37,99,235,.45); animation: qamorph 1.4s ease-in-out infinite; }
@keyframes qamorph {
  0%   { border-radius: 14px; transform: rotate(0deg)   scale(1);   }
  35%  { border-radius: 50%;  transform: rotate(160deg) scale(.72); }
  65%  { border-radius: 18px; transform: rotate(200deg) scale(.72); }
  100% { border-radius: 14px; transform: rotate(360deg) scale(1);   }
}
:root[data-theme="dark"] #qa-loading { background: rgba(2,6,15,.55); }

/* ── Per-button loading spinner ────────────────────────────────────────────── */
/* Injected by app.js when a button starts a server round-trip (Livewire action
   or form submit). The text stays visible; a small spinner (currentColor, so it
   matches the button's text) is prepended and the button is soft-disabled. */
.is-loading { pointer-events: none; opacity: .72; cursor: progress; }
.btn-spinner { display: inline-block; width: .8em; height: .8em; margin-right: .45em;
  vertical-align: -.1em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: btn-spin .6s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── Motion ──────────────────────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* The loading indicators must keep animating even under reduced-motion. */
.qa-loader { animation: qamorph 1.4s ease-in-out infinite !important; }
.btn-spinner { animation: btn-spin .6s linear infinite !important; }

@media (max-width: 640px) {
  .topbar-inner, main { padding-left: 1rem; padding-right: 1rem; }
  .period { margin-left: 0; }
  .big-number strong { font-size: 2.2rem; }
}

/* ── Dark theme ───────────────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  --ink: #e6edf6; --muted: #93a4bb; --line: #26334a;
  --card: #161f31; --bg1: #0b1220; --bg2: #0e1626; --primary-soft: #1b2942;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.55);
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 15% -10%, #12244a 0%, transparent 55%),
    radial-gradient(1000px 500px at 100% 0%, #0c2b34 0%, transparent 45%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
}
:root[data-theme="dark"] .topbar { background: var(--card);
  border-bottom-color: rgba(38,51,74,.9); }
:root[data-theme="dark"] nav > a,
:root[data-theme="dark"] .dropdown-toggle { color: #b7c4d6; }
:root[data-theme="dark"] select,
:root[data-theme="dark"] .filter-select,
:root[data-theme="dark"] .toolbar input[type=search],
:root[data-theme="dark"] .login-card input,
:root[data-theme="dark"] .account-form input { background-color: #0f1830; color: var(--ink); }
:root[data-theme="dark"] table.grid thead th { background: #101a2e; }
:root[data-theme="dark"] table.grid tbody tr:hover { background: #14213b; }
:root[data-theme="dark"] .card.at-risk { border-color: #6b4a1e; }
:root[data-theme="dark"] .chip { background: #1b2942; color: #cdd8e8; }
:root[data-theme="dark"] .type-card .bar,
:root[data-theme="dark"] .bar { background: #26334a; }
/* Controls that hardcode a light background need dark equivalents. */
:root[data-theme="dark"] .colmenu > summary,
:root[data-theme="dark"] .pager-nav button { background: #0f1830; color: var(--ink); }
:root[data-theme="dark"] .pager-nav button:hover:not(:disabled) { background: #1b2942; }
:root[data-theme="dark"] .colmenu-body label:hover { background: #1b2942; }
:root[data-theme="dark"] .toggle-pill { background: #1b2942; color: #cdd8e8; border-color: #26334a; }
:root[data-theme="dark"] .toggle-pill:hover { background: #223250; }
:root[data-theme="dark"] .toggle-pill.active { background: var(--grad); color: #fff; }
:root[data-theme="dark"] .wk-table thead th { background: #101a2e; }
:root[data-theme="dark"] .wk-in:focus { background: #0f1830; }
:root[data-theme="dark"] .wk-del:hover { background: #3a1720; color: #fca5a5; }
:root[data-theme="dark"] .wk-week-head { background: #12203a; }
:root[data-theme="dark"] .wk-week-head:hover { background: #17284a; }
:root[data-theme="dark"] .wk-week.wk-current > .wk-week-head { background: var(--grad); color: #fff; }
:root[data-theme="dark"] .wk-mrow > td { background: #16233c; }
:root[data-theme="dark"] .wk-mrow:hover > td { background: #1c2c49; }
:root[data-theme="dark"] .wk-mrow .wk-count { background: #0b1220; }
:root[data-theme="dark"] .wk-confirm-cancel { background: #1b2942; color: var(--ink); }
