/* HA Team Hub — dark neutral, restrained HA red, dense monitor layout */

:root {
  --bg: #0c0e10;
  --bg-2: #101316;
  --panel: #14181b;
  --panel-2: #191e22;
  --line: #262c31;
  --line-soft: #1e2429;
  --text: #e7eaec;
  --text-2: #b9c1c7;
  --muted: #98a2aa;
  --red: #d5232e;
  --red-dim: #a81b24;
  --red-soft: rgba(213, 35, 46, 0.12);
  --amber: #d9a441;
  --amber-soft: rgba(217, 164, 65, 0.12);
  --green: #4f9d69;
  --green-soft: rgba(79, 157, 105, 0.12);
  --blue: #5b8fb9;
  --blue-soft: rgba(91, 143, 185, 0.12);
  --radius: 6px;
  --sidebar-w: 208px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 19px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-2); }
p { margin: 0; }
a { color: var(--text); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -40px; z-index: 100;
  background: var(--red); color: #fff; padding: 8px 12px; border-radius: var(--radius);
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 8px; }

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

.muted { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.tiny { font-size: 11px; line-height: 1.4; }

/* ---------------------------------------------------------------- layout */

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

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; border-bottom: 1px solid var(--line-soft); }

.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 4px;
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 13px; }
.brand-text small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 10px;
  background: transparent; border: 0; border-radius: 4px;
  color: var(--text-2); font: inherit; font-size: 13px; text-align: left;
  cursor: pointer;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--red-soft); color: #fff; box-shadow: inset 2px 0 0 var(--red); }
.nav-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.nav-item[aria-current="page"] .nav-dot { opacity: 1; background: var(--red); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px 4px 0; border-top: 1px solid var(--line-soft); }
.tz { font-family: var(--mono); font-size: 11px; color: var(--text-2); }

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

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 14, 16, 0.9);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(6px);
}
.topbar-title { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.topbar-meta { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }

.menu-btn {
  display: none; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 4px; padding: 6px 10px; font: inherit; font-size: 12px; cursor: pointer;
}
.menu-bars, .menu-bars::before, .menu-bars::after {
  display: block; width: 12px; height: 1.5px; background: currentColor; content: "";
}
.menu-bars { position: relative; }
.menu-bars::before { position: absolute; top: -4px; }
.menu-bars::after { position: absolute; top: 4px; }

main { padding: 18px 20px 40px; min-width: 0; }
main:focus { outline: none; }

.view { display: flex; flex-direction: column; gap: 14px; }
.view[hidden] { display: none; }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-head .sub { color: var(--muted); font-size: 12px; margin-top: 3px; max-width: 70ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- grid */

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.resources-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  min-height: 38px;
}
.panel-body { padding: 10px 12px; min-width: 0; }
.panel-body:empty { display: none; }

.pill {
  font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 10px;
  background: var(--red-soft); color: #f0a3a8; border: 1px solid rgba(213, 35, 46, 0.3);
}
.muted-pill { background: var(--panel-2); color: var(--muted); border-color: var(--line); }

.tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 3px;
  background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(217, 164, 65, 0.3);
}
.muted-tag { background: var(--panel-2); color: var(--muted); border-color: var(--line); }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--red); color: #fff; border: 1px solid var(--red);
  border-radius: 4px; padding: 7px 12px;
  font: inherit; font-size: 12px; font-weight: 600; text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--red-dim); border-color: var(--red-dim); }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { background: #7d1a20; border-color: #7d1a20; }
.btn.danger:hover { background: #96202a; }
.btn.tiny { padding: 4px 8px; font-size: 11px; font-weight: 500; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  background: transparent; border: 1px solid var(--line); border-radius: 4px;
  color: var(--text-2); font: inherit; font-size: 15px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

.link-btn {
  background: none; border: 0; padding: 0; color: var(--text-2);
  font: inherit; font-size: 11px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-btn:hover { color: var(--text); }
.link-btn.danger { color: #e08a90; }

/* ---------------------------------------------------------------- lists */

.row-list { display: flex; flex-direction: column; gap: 1px; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 10px;
  width: 100%;
  padding: 7px 8px;
  background: transparent; border: 0; border-radius: 4px;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.row:hover { background: var(--panel-2); }
.row + .row { border-top: 1px solid var(--line-soft); }

.row-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }

.avatar {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 10px; font-weight: 600; color: var(--text-2); flex: none;
}
.row-with-avatar { display: flex; align-items: center; gap: 8px; min-width: 0; }

.empty {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 10px; text-align: center;
  color: var(--muted); font-size: 12px;
  border: 1px solid var(--line-soft); border-radius: 4px;
  background: rgba(255, 255, 255, 0.012);
}
.empty strong { color: var(--text-2); font-weight: 500; }

.error-box {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  padding: 12px; border: 1px solid rgba(213, 35, 46, 0.4); background: var(--red-soft);
  border-radius: 4px; color: #f0b6ba; font-size: 12px;
}

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 12px; border-radius: 4px;
  background: var(--amber-soft); border: 1px solid rgba(217, 164, 65, 0.35);
  color: #e8c98c; font-size: 12px;
}
.banner[hidden] { display: none; }
.banner strong { color: #f2d9a8; }
.banner ul { margin: 4px 0 0; padding-left: 16px; }

/* --------------------------------------------------------------- status */

.status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 3px; white-space: nowrap;
  border: 1px solid transparent;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pending { color: var(--amber); background: var(--amber-soft); border-color: rgba(217, 164, 65, 0.28); }
.status-approved { color: #7fc294; background: var(--green-soft); border-color: rgba(79, 157, 105, 0.3); }
.status-declined { color: #d98b91; background: var(--red-soft); border-color: rgba(213, 35, 46, 0.28); }
.status-cancelled { color: var(--muted); background: var(--panel-2); border-color: var(--line); }
.status-draft { color: var(--muted); background: var(--panel-2); border-color: var(--line); }
.status-review { color: var(--amber); background: var(--amber-soft); border-color: rgba(217, 164, 65, 0.28); }
.status-scheduled { color: #8fb6d6; background: var(--blue-soft); border-color: rgba(91, 143, 185, 0.3); }
.status-live { color: #7fc294; background: var(--green-soft); border-color: rgba(79, 157, 105, 0.3); }
.status-complete { color: var(--text-2); background: var(--panel-2); border-color: var(--line); }

/* --------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; max-width: 100%; contain: paint; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  text-align: left; font-weight: 500; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
  padding: 7px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table .num { text-align: right; font-family: var(--mono); }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions .link-btn + .link-btn { margin-left: 10px; }
.cell-strong { font-weight: 500; }
.cell-muted { color: var(--muted); }
.cell-note { max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-dates { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }

/* ------------------------------------------------------------- calendar */

.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-label { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); min-width: 12ch; text-align: center; }

.legend { display: flex; gap: 14px; list-style: none; margin: 0 0 8px; padding: 0; font-size: 11px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 5px; }
.swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.swatch.approved { background: var(--green); }
.swatch.pending { background: var(--amber); }
.swatch.declined { background: #4a5157; }

.cal-wrap { min-width: 0; }
.cal-head, .calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.cal-head { margin-bottom: 1px; }
.cal-head span {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); padding: 4px 6px; text-align: left;
}

.cal-cell {
  min-height: 74px; min-width: 0;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 4px 5px;
  display: flex; flex-direction: column; gap: 3px;
  overflow: hidden;
}
.cal-cell.out { opacity: 0.42; }
.cal-cell.today { border-color: var(--red); box-shadow: inset 0 0 0 1px rgba(213, 35, 46, 0.35); }
.cal-day {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
}
.cal-cell.today .cal-day { color: #f0a3a8; }
.cal-add {
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px;
  line-height: 1; cursor: pointer; padding: 0 2px; border-radius: 2px; opacity: 0;
}
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { color: var(--text); background: var(--panel-2); }

.chip {
  display: block; width: 100%;
  border: 0; border-left: 2px solid var(--green);
  background: var(--green-soft); color: #cfe6d6;
  border-radius: 2px; padding: 1px 4px;
  font: inherit; font-size: 10.5px; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.chip:hover { filter: brightness(1.25); }
.chip.pending { border-left-color: var(--amber); background: var(--amber-soft); color: #ecd6a8; }
.chip.declined, .chip.cancelled { border-left-color: #4a5157; background: rgba(74, 81, 87, 0.18); color: var(--muted); text-decoration: line-through; }
.chip-more { font-size: 10px; color: var(--muted); padding-left: 4px; }

/* ---------------------------------------------------------------- forms */

dialog {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 0;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
dialog::backdrop { background: rgba(4, 6, 8, 0.72); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }

.dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: 15px; }
.dialog-body { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg-2);
}

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 10.5px; color: var(--muted); }

input[type="text"], select, textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  padding: 7px 9px;
  min-height: 32px;
}
textarea { resize: vertical; min-height: 60px; }
input[type="text"]:focus, select:focus, textarea:focus {
  border-color: var(--red); outline: none; box-shadow: 0 0 0 2px rgba(213, 35, 46, 0.18);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--red); background: rgba(213, 35, 46, 0.06);
}
.field-error { font-size: 10.5px; color: #f0a3a8; }

.form-error {
  padding: 8px 10px; border-radius: 4px; font-size: 12px;
  background: var(--red-soft); border: 1px solid rgba(213, 35, 46, 0.4); color: #f0b6ba;
}
.form-error[hidden] { display: none; }

.filters select { min-height: 28px; padding: 3px 8px; font-size: 11.5px; width: auto; }

/* ------------------------------------------------------------- resources */

.link-card .panel-body { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.link-card .btn { margin-top: 2px; }
.suggestions { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.suggestions strong { color: var(--text); font-weight: 500; }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed; right: 20px; bottom: 20px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  color: var(--text); padding: 9px 14px; border-radius: 4px;
  font-size: 12px; z-index: 60; max-width: min(380px, calc(100vw - 32px));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast[hidden] { display: none; }
.toast.warn { border-left-color: var(--amber); }
.toast.error { border-left-color: var(--red); }

/* ------------------------------------------------------------ responsive */

.nav-scrim { display: none; }

@media (min-width: 1200px) {
  .today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-grid .span-2 { grid-column: span 2; }
}

@media (max-width: 1080px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .today-grid .span-2 { grid-column: span 1; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    visibility: hidden;
    width: 240px; transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  }
  body.nav-open .sidebar { transform: translateX(0); visibility: visible; }
  body.nav-open .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(4, 6, 8, 0.6);
  }
  .menu-btn { display: inline-flex; }
  main { padding: 14px 12px 32px; }
  .topbar { padding: 8px 12px; }
  .topbar-meta { font-size: 10px; }
  .grid, .resources-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: span 1; }
  .view-head { align-items: flex-start; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .cal-cell { min-height: 58px; padding: 3px; }
  .chip { font-size: 9.5px; padding: 1px 3px; }
  .cal-head span { font-size: 9px; padding: 3px; }
  .data-table th, .data-table td { padding: 7px 8px; }
  .cell-note { max-width: 16ch; }
  dialog { width: calc(100vw - 16px); }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

/* On phones, drop secondary columns so the row actions stay reachable
   without horizontal scrolling. The hidden values remain in the edit dialog. */
@media (max-width: 600px) {
  #leaveTable th:nth-child(3), #leaveTable td:nth-child(3),
  #leaveTable th:nth-child(5), #leaveTable td:nth-child(5) { display: none; }
  #campaignTable th:nth-child(3), #campaignTable td:nth-child(3),
  #campaignTable th:nth-child(6), #campaignTable td:nth-child(6) { display: none; }
  #campaignTable td:first-child { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .data-table .actions .link-btn { display: block; min-height: 44px; margin-left: auto; }
  .data-table .actions .link-btn + .link-btn { margin-left: auto; }
  .data-table th, .data-table td { padding: 7px 6px; }
  .cell-dates { white-space: normal; font-size: 10.5px; line-height: 1.3; }
}

@media (max-width: 480px) {
  .cal-cell { min-height: 50px; }
  .cal-day { font-size: 9.5px; }
  .chip { font-size: 9px; }
  .topbar-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
/* ------------------------------------------------------------- auth gate */

.app[hidden], .auth-gate[hidden] { display: none; }

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(213, 35, 46, 0.10), transparent 60%),
    var(--bg);
}

.auth-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.auth-card h1 { font-size: 22px; }
.auth-card p { color: var(--text-2); font-size: 13px; }
.auth-card .btn { align-self: flex-start; margin-top: 4px; }
.auth-missing {
  margin: 0; padding: 10px 10px 10px 26px;
  background: var(--amber-soft); border: 1px solid rgba(217, 164, 65, 0.35);
  border-radius: 4px; color: #e8c98c; font-size: 12px;
}
.auth-missing[hidden] { display: none; }

body.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
body.auth-page .auth-card { width: min(520px, 100%); }
body.auth-page ul { color: var(--text-2); font-size: 12px; padding-left: 20px; }

/* ------------------------------------------------------------- user chip */

.user-chip {
  display: flex; align-items: center; gap: 8px;
  margin-left: 14px; padding-left: 14px;
  border-left: 1px solid var(--line);
}
.user-chip[hidden] { display: none; }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta strong { font-size: 12px; font-weight: 600; }
.user-meta small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.user-chip .avatar { width: 26px; height: 26px; font-size: 10px; }

.role-note {
  margin-top: 6px; font-size: 11.5px; color: var(--text-2);
  border-left: 2px solid var(--line); padding-left: 8px; max-width: 80ch;
}

/* --------------------------------------------------------- form additions */

.check-inline {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-2); cursor: pointer;
}
.check-inline input { accent-color: var(--red); width: 14px; height: 14px; }

.attest-block {
  display: flex; flex-direction: column; gap: 5px;
  padding: 10px; border-radius: 4px;
  background: var(--amber-soft); border: 1px solid rgba(217, 164, 65, 0.35);
}
.attest-block[hidden] { display: none; }
.attest-block .check-inline { color: #f2d9a8; font-weight: 600; }
.attest-block .hint { color: #d9bd8a; }

.conflict-box {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 10px; border-radius: 4px;
  background: var(--red-soft); border: 1px solid rgba(213, 35, 46, 0.4);
  color: #f0b6ba; font-size: 12px;
}
.conflict-box[hidden] { display: none; }
.conflict-box strong { color: #ffd0d3; }

/* --------------------------------------------------------------- history */

.history-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
  max-height: 52vh; overflow-y: auto;
}
.history-list li {
  border-left: 2px solid var(--line);
  padding: 2px 0 2px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.history-head strong { font-size: 12px; }
.history-meta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); overflow-wrap: anywhere; }
.history-detail { font-size: 11.5px; color: var(--text-2); }

/* -------------------------------------------------------------- archived */

.status-archived { color: var(--muted); background: var(--panel-2); border-color: var(--line); }
.archived-row td { opacity: 0.72; }
.archived-row:hover td { opacity: 1; }

@media (max-width: 860px) {
  .user-chip { margin-left: auto; padding-left: 0; border-left: 0; }
  .user-meta { display: none; }
  .user-chip .btn { padding: 4px 8px; }
}
