/* ============================================================
   Performance Alignment Intelligence — Stylesheet
   for L'AINE HR
   ============================================================ */

:root {
  /* Brand */
  --navy-900: #0F2A4A;
  --navy-700: #1B3F6E;
  --blue-500: #2F6FB0;
  --sky-100: #EAF1FA;
  --bg: #F6F8FB;
  --white: #FFFFFF;
  --ink-900: #1A2433;
  --ink-600: #5B6B82;
  --line: #E2E8F0;

  /* Status */
  --direct: #1F8A5C;        --direct-bg: #E7F6EE;
  --indirect: #2F6FB0;      --indirect-bg: #EAF1FA;
  --routine: #9C7A29;       --routine-bg: #FAF1DE;
  --misaligned: #B0473F;    --misaligned-bg: #FBEAE8;
  --unclear: #6B5B95;       --unclear-bg: #EFEAF7;
  --at-risk: #C9792E;       --at-risk-bg: #FBEEDF;
  --complete: #1F8A5C;      --complete-bg: #E7F6EE;

  /* Elevation / radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(15,42,74,0.06), 0 1px 8px rgba(15,42,74,0.05);
  --shadow-pop: 0 8px 24px rgba(15,42,74,0.16);

  --sidebar-w: 264px;
  --topbar-h: 64px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; }

table { font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

a { color: var(--blue-500); }

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================== LAYOUT ============================== */

#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--navy-900);
  color: #DCE6F2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-mark {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--blue-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.brand-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.brand-sub {
  font-size: 11px;
  color: #9FB3CC;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #B9C8DD;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }

.nav-item.active {
  background: var(--blue-500);
  color: #fff;
}

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; }
.nav-icon svg { width: 100%; height: 100%; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.install-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue-500);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
}
.install-btn:hover { background: #3a7dc2; }
.install-btn .nav-icon { width: 16px; height: 16px; }

.sidebar-footer-note {
  font-size: 10.5px;
  color: #7E92AC;
  text-align: center;
  letter-spacing: 0.02em;
}

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink-900);
}

.topbar-steps { display: flex; align-items: center; gap: 8px; flex: 1; overflow-x: auto; }

.step-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-600);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg);
  white-space: nowrap;
}
.step-pill .step-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-600);
}
.step-pill.done { color: var(--direct); background: var(--direct-bg); }
.step-pill.done .step-dot { background: var(--direct); }
.step-pill.current { color: var(--navy-700); background: var(--sky-100); }
.step-pill.current .step-dot { background: var(--blue-500); }
.step-arrow { color: var(--line); font-size: 12px; }

.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.role-select {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy-700);
  background: var(--sky-100);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
}

.org-mark {
  font-weight: 700;
  font-size: 13px;
  color: var(--navy-700);
  letter-spacing: 0.04em;
}

.content {
  padding: 26px 28px 60px;
  flex: 1;
  min-width: 0;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-title { font-size: 21px; font-weight: 700; color: var(--ink-900); }
.section-subtitle { font-size: 13px; color: var(--ink-600); margin-top: 4px; max-width: 640px; }

.section-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================== BUTTONS ============================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--navy-700); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #163459; }

.btn-secondary { background: var(--white); color: var(--navy-700); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { background: var(--sky-100); }

.btn-ghost { background: transparent; color: var(--blue-500); border-color: transparent; padding: 9px 10px; }
.btn-ghost:hover:not(:disabled) { background: var(--sky-100); }

.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn .nav-icon { width: 15px; height: 15px; }

/* ============================== CARDS / GRID ============================== */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-card);
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

.kpi-value.small { font-size: 20px; }

.kpi-sub { font-size: 11.5px; color: var(--ink-600); margin-top: 4px; }
.kpi-sub.accent-risk { color: var(--at-risk); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 980px) { .grid-2, .grid-2-even { grid-template-columns: 1fr; } }

.card-title { font-size: 14.5px; font-weight: 700; color: var(--ink-900); margin-bottom: 4px; }
.card-note { font-size: 12px; color: var(--ink-600); margin-bottom: 14px; }

/* ============================== TABLES ============================== */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 12.8px; }

table.data-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-600);
  background: var(--bg);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

table.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-900);
  vertical-align: top;
}

table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: #FAFBFD; }

.cell-muted { color: var(--ink-600); }
.cell-wrap { max-width: 260px; white-space: normal; }

/* ============================== STATUS CHIPS ============================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.4;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chip-direct { color: var(--direct); background: var(--direct-bg); }
.chip-indirect { color: var(--indirect); background: var(--indirect-bg); }
.chip-routine { color: var(--routine); background: var(--routine-bg); }
.chip-misaligned { color: var(--misaligned); background: var(--misaligned-bg); }
.chip-unclear { color: var(--unclear); background: var(--unclear-bg); }
.chip-at-risk { color: var(--at-risk); background: var(--at-risk-bg); }
.chip-complete { color: var(--complete); background: var(--complete-bg); }
.chip-neutral { color: var(--ink-600); background: var(--bg); }

/* ============================== FORMS / UPLOAD ============================== */

.upload-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 22px; }

.upload-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card); }

.upload-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.upload-card-title { font-size: 13.5px; font-weight: 700; }
.upload-card-desc { font-size: 12px; color: var(--ink-600); margin-bottom: 14px; }

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--blue-500); background: var(--sky-100); }
.dropzone-icon { width: 26px; height: 26px; margin: 0 auto 8px; color: var(--blue-500); }
.dropzone-text { font-size: 12.5px; color: var(--ink-600); }
.dropzone-text strong { color: var(--navy-700); }

.upload-status-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 12px; }
.upload-filename { font-weight: 600; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }

.field-required-list { font-size: 11px; color: var(--ink-600); margin-top: 10px; line-height: 1.6; }
.field-required-list code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 10.5px; }

input[type="file"] { display: none; }

select, input[type="text"], input[type="number"] {
  font-family: inherit;
  font-size: 12.5px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-900);
}

/* ============================== FILTER BAR ============================== */

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.filter-bar label { font-size: 11px; font-weight: 700; color: var(--ink-600); text-transform: uppercase; letter-spacing: 0.03em; margin-right: 4px; }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-reset { margin-left: auto; }

/* ============================== EMPTY STATES ============================== */

.empty-state {
  text-align: center;
  padding: 50px 24px;
  color: var(--ink-600);
}
.empty-state-icon { width: 42px; height: 42px; margin: 0 auto 14px; color: var(--blue-500); opacity: 0.7; }
.empty-state-title { font-size: 15px; font-weight: 700; color: var(--ink-900); margin-bottom: 6px; }
.empty-state-text { font-size: 13px; max-width: 420px; margin: 0 auto 18px; }

/* ============================== VALIDATION ============================== */

.validation-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-bottom: 20px; }

.issue-list { display: flex; flex-direction: column; gap: 8px; }

.issue-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.issue-row.error { background: var(--misaligned-bg); border-color: #F3CFC9; }
.issue-row.warning { background: var(--at-risk-bg); border-color: #F3D8B6; }
.issue-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; margin-top: 1px; }
.issue-row.error .issue-badge { color: var(--misaligned); background: rgba(255,255,255,0.6); }
.issue-row.warning .issue-badge { color: var(--at-risk); background: rgba(255,255,255,0.6); }
.issue-text strong { font-weight: 700; }
.issue-meta { color: var(--ink-600); font-size: 11.5px; margin-top: 2px; }

.accept-warnings-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--sky-100);
  border: 1px solid #CFE0F0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 18px;
}
.accept-warnings-text { font-size: 12.5px; color: var(--navy-900); max-width: 560px; }

/* ============================== LINKAGE CHAIN (signature element) ============================== */

.linkage-chain {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.chain-node {
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--sky-100);
  color: var(--navy-700);
  border: 1px solid #CFE0F0;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chain-node.broken { background: var(--bg); color: var(--ink-600); border-style: dashed; border-color: var(--line); }
.chain-link-line {
  width: 26px;
  height: 2px;
  background: var(--blue-500);
  flex-shrink: 0;
}
.chain-link-line.broken {
  background: none;
  border-top: 2px dashed var(--line);
  height: 0;
}

/* Goal mapping tree */
.tree-root { display: flex; flex-direction: column; gap: 10px; }
details.tree-node {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
}
details.tree-node > summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
}
details.tree-node > summary::-webkit-details-marker { display: none; }
details.tree-node > summary .chevron { transition: transform 0.15s; color: var(--ink-600); flex-shrink: 0; width: 16px; height: 16px; }
details.tree-node[open] > summary .chevron { transform: rotate(90deg); }
.tree-children { padding: 0 16px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
details.tree-node.level-dept { margin-left: 18px; }
details.tree-node.level-indiv { margin-left: 18px; }
.tree-summary-meta { font-size: 11.5px; font-weight: 500; color: var(--ink-600); }

/* ============================== MISSING DATA PANEL ============================== */

.missing-data-panel {
  border: 1px solid #E4D9F2;
  background: var(--unclear-bg);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 22px;
}
.missing-data-title { font-size: 13px; font-weight: 700; color: var(--unclear); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.missing-data-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-900); line-height: 1.7; }

/* ============================== REPORTS ============================== */

.report-block { margin-bottom: 26px; }
.report-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.report-block-title { font-size: 15px; font-weight: 700; }
.report-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.score-bar-track { width: 100%; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.score-bar-fill { height: 100%; border-radius: 999px; }

.recommend-box {
  background: var(--sky-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--navy-900);
  margin-top: 8px;
}
.recommend-box strong { color: var(--navy-700); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab-btn {
  background: none; border: none; cursor: pointer; padding: 10px 14px;
  font-size: 13px; font-weight: 600; color: var(--ink-600);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn.active { color: var(--navy-700); border-bottom-color: var(--blue-500); }

/* ============================== EXPORT CENTRE ============================== */

.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.export-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 10px; }
.export-card-icon { width: 30px; height: 30px; color: var(--blue-500); }
.export-card-title { font-size: 14px; font-weight: 700; }
.export-card-desc { font-size: 12px; color: var(--ink-600); flex: 1; }

/* ============================== TOASTS ============================== */

.toast-host { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; }
.toast {
  background: var(--navy-900); color: #fff; font-size: 12.5px; font-weight: 500;
  padding: 11px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
  max-width: 320px; animation: toast-in 0.2s ease-out;
}
.toast.toast-error { background: var(--misaligned); }
.toast.toast-success { background: var(--direct); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================== MISC ============================== */

.hr-divider { height: 1px; background: var(--line); margin: 22px 0; border: none; }
.muted-link { font-size: 12px; color: var(--blue-500); cursor: pointer; background: none; border: none; font-weight: 600; padding: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.small-caps-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-600); }

/* ============================== RESPONSIVE ============================== */

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform 0.2s ease-out; z-index: 100;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: block; }
  .content { padding: 18px 16px 50px; }
  .topbar { padding: 0 14px; }
}

/* ============================== AUTH OVERRIDE (critical: #app/.login-screen already set their
   own `display`, which beats the UA stylesheet's [hidden]{display:none} on specificity) ============================== */
#app[hidden], .login-screen[hidden] { display: none !important; }

/* ============================== LOGIN SCREEN ============================== */

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 24px;
}
.login-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 32px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
}
.login-brand-mark { width: 52px; height: 52px; font-size: 18px; border-radius: 13px; margin: 0 auto 16px; }
.login-title { font-size: 16px; font-weight: 700; color: var(--ink-900); text-align: center; }
.login-subtitle { font-size: 12px; color: var(--ink-600); text-align: center; margin-bottom: 6px; }
.login-label { font-size: 12px; font-weight: 600; color: var(--ink-900); margin-top: 14px; margin-bottom: 6px; }
.login-input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink-900);
  background: var(--white);
}
.login-input:focus { outline: 2px solid var(--blue-500); border-color: var(--blue-500); }
.login-error {
  font-size: 12px;
  color: var(--misaligned);
  background: var(--misaligned-bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 14px;
}
.login-submit { margin-top: 18px; width: 100%; justify-content: center; }

/* ============================== CURRENT USER CHIP (topbar) ============================== */

.current-user-chip { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.current-user-name { font-size: 12.5px; font-weight: 700; color: var(--ink-900); }
.current-user-role { font-size: 10.5px; color: var(--ink-600); text-transform: uppercase; letter-spacing: 0.03em; }

/* ============================== WORKFLOW TRACKING ============================== */

.workflow-panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  overflow: hidden;
}
.workflow-panel > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ink-600);
}
.workflow-panel > summary::-webkit-details-marker { display: none; }
.workflow-panel > summary .chevron { width: 14px; height: 14px; margin-left: auto; transition: transform 0.15s; flex-shrink: 0; }
.workflow-panel[open] > summary .chevron { transform: rotate(90deg); }
.workflow-assignee { color: var(--ink-600); }
.workflow-comment-count { color: var(--blue-500); font-weight: 600; }
.workflow-panel-body { padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.workflow-edit-row { display: flex; gap: 8px; flex-wrap: wrap; }
.workflow-status-select, .workflow-assignee-input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 12px;
  font-family: inherit;
  background: var(--white);
  color: var(--ink-900);
}
.workflow-assignee-input { flex: 1; min-width: 140px; }
.workflow-comments-list { display: flex; flex-direction: column; gap: 8px; }
.workflow-comment-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.workflow-comment-author { font-size: 11.5px; font-weight: 700; color: var(--ink-900); }
.workflow-comment-date { font-size: 10.5px; color: var(--ink-600); margin-left: 6px; }
.workflow-comment-body { font-size: 12px; color: var(--ink-900); margin-top: 2px; }
.workflow-comment-empty { font-size: 11.5px; color: var(--ink-600); }
.workflow-comment-row { display: flex; gap: 8px; align-items: flex-start; }
.workflow-comment-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--ink-900);
  resize: vertical;
  min-height: 38px;
}
.status-badge { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
.status-badge.status-open { color: var(--at-risk); background: var(--at-risk-bg); }
.status-badge.status-in_progress { color: var(--indirect); background: var(--indirect-bg); }
.status-badge.status-resolved { color: var(--direct); background: var(--direct-bg); }

/* ============================== TREND OVER TIME ============================== */

.trend-meta-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.trend-meta-item { font-size: 12px; color: var(--ink-600); }
.trend-meta-item strong { color: var(--ink-900); }

/* ============================== MANAGE USERS ============================== */

.add-user-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; margin-bottom: 18px; }
.add-user-form .form-field { display: flex; flex-direction: column; gap: 5px; }
.add-user-form label { font-size: 11px; font-weight: 600; color: var(--ink-600); }
.add-user-form input, .add-user-form select {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px;
  font-size: 12.5px; font-family: inherit; color: var(--ink-900); background: var(--white);
}
@media (max-width: 900px) { .add-user-form { grid-template-columns: 1fr 1fr; } }
