/* FluxERP: design system and page styles (UI overhaul, 2026-10).
   Clean light style, one accent colour, Inter, Lucide line icons. Mobile first.
   No inline styles anywhere: the Content-Security-Policy allows only this file. */

/* ------------------------------------------------------------------ fonts (local files) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------ tokens */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;

  --brand: #0b6e99;
  --brand-hover: #095b7f;
  --brand-soft: #e9f3f8;
  --brand-ring: rgba(11, 110, 153, 0.22);

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --subtle: #98a2b3;

  --success: #067647;
  --success-soft: #ecfdf3;
  --success-line: #abefc6;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --warning-line: #fedf89;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-line: #fecdca;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --info-line: #b2ddff;
  --violet: #5925dc;
  --violet-soft: #f4f3ff;
  --violet-line: #d9d6fe;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 16px 32px -8px rgba(16, 24, 40, 0.16), 0 4px 8px -4px rgba(16, 24, 40, 0.06);

  --sidebar-w: 264px;
  --topbar-h: 56px;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 32px; font-weight: 650; }
h2 { font-size: 17px; line-height: 26px; font-weight: 600; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
[hidden], .hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 719px) { .hide-sm { display: none !important; } }

/* Lucide line icons from the sprite: presentation attributes do not cross <use>, so set them here */
.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ app shell */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}
.shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(16, 24, 40, 0.35); }
.shell:not(.nav-open) .scrim { display: none; }

.brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text); font-weight: 700; letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: var(--radius);
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 700;
}
.brand-name span { color: var(--muted); font-weight: 500; }

.nav { flex: 1; overflow-y: auto; padding: 16px 12px; display: grid; align-content: start; gap: 2px; }
.nav-label {
  margin: 16px 12px 6px; font-size: 12px; font-weight: 600; color: var(--subtle);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.nav-label:first-child { margin-top: 0; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--radius);
  color: var(--text-2); font-size: 14.5px; font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.nav a .icon { color: var(--subtle); }
.nav a[aria-current="page"] .icon { color: var(--brand); }
.nav .count-badge { margin-left: auto; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.sidebar-user .who { min-width: 0; flex: 1; }
.sidebar-user .who strong { display: block; font-size: 14px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .who span { display: block; font-size: 12px; color: var(--muted); }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600;
}

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 600; color: var(--text); min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.topbar-title .crumb { color: var(--muted); font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-button { display: inline-flex; }

.content { padding: 20px 16px 48px; max-width: 1200px; margin: 0 auto; }
.content.wide { max-width: 1320px; }

@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .scrim, .menu-button { display: none !important; }
  .main { margin-left: var(--sidebar-w); }
  .topbar { padding: 0 32px; }
  .content { padding: 28px 32px 64px; }
}

/* ------------------------------------------------------------------ language switch */
.segmented {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.segmented button, .segmented a {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 6px;
}
.segmented [aria-pressed="true"], .segmented [aria-current="page"] {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------ page header */
.page-header {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px 24px; margin-bottom: 24px;
}
.page-header p { color: var(--muted); margin-top: 4px; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  cursor: pointer; box-shadow: var(--shadow-sm); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-danger { color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #912018; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 38px; padding: 0; }
.btn-block { width: 100%; }
.link-button {
  border: 0; background: none; padding: 0; color: var(--brand); font: inherit; font-weight: 500;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ cards, stats */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); }
.stack { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 3fr 2fr; align-items: start; } }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }
.stat {
  display: block; padding: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.stat:hover { border-color: var(--border-strong); text-decoration: none; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted);
  font-weight: 500; }
.stat-value { margin-top: 6px; font-size: 28px; line-height: 34px; font-weight: 650; }
@media (max-width: 719px) {
  .stats { gap: 8px; }
  .stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
  .stat-value { margin: 0; font-size: 20px; line-height: 26px; }
  .stat .status { font-size: 12px; padding: 1px 8px 1px 6px; }
}

/* ------------------------------------------------------------------ action list (overview) */
.action-list { list-style: none; margin: 0; padding: 0; }
.action-list li + li { border-top: 1px solid var(--border); }
.action-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px 20px; color: var(--text);
}
.action-item:hover { background: var(--surface-2); text-decoration: none; }
.action-icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius);
}
.action-icon.danger { background: var(--danger-soft); color: var(--danger); }
.action-icon.info { background: var(--info-soft); color: var(--info); }
.action-icon.warning { background: var(--warning-soft); color: var(--warning); }
.action-title, .action-meta { display: block; }
.action-title { font-weight: 600; }
.action-title .mono { color: var(--muted); font-weight: 500; margin-right: 6px; }
.action-meta { font-size: 13px; color: var(--muted); }
.action-meta.danger { color: var(--danger); }
.action-item .chevron { color: var(--subtle); }

/* ------------------------------------------------------------------ status badges */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px 2px 8px; border-radius: 999px; border: 1px solid;
  font-size: 12.5px; font-weight: 600; line-height: 20px; white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.draft { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.status.submitted { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
.status.in_review { color: var(--violet); background: var(--violet-soft); border-color: var(--violet-line); }
.status.awaiting_director { color: var(--warning); background: var(--warning-soft); border-color: var(--warning-line); }
.status.approved { color: var(--success); background: var(--success-soft); border-color: var(--success-line); }
.status.rejected { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; line-height: 20px; background: var(--brand-soft); color: var(--brand);
}
.count-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px; font-weight: 600;
}
.count-badge.attention { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ------------------------------------------------------------------ progress */
.progress-cell { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.progress-cell span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums;
  min-width: 44px; white-space: nowrap; }
progress {
  -webkit-appearance: none; appearance: none; width: 100%; max-width: 120px; height: 6px;
  border: 0; border-radius: 999px; background: var(--border); overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
progress.complete::-webkit-progress-value { background: var(--success); }
progress.complete::-moz-progress-bar { background: var(--success); }

/* ------------------------------------------------------------------ toolbar, tabs */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; }
.toolbar .search { position: relative; flex: 1 1 260px; }
.toolbar .search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--subtle); }
.toolbar .search input { padding-left: 36px; }
.toolbar select { flex: 1 1 200px; }
@media (min-width: 720px) { .toolbar select { flex: 0 1 220px; } }
.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 0 16px; border-bottom: 1px solid var(--border);
}
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 8px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--brand); border-color: var(--brand); }

/* ------------------------------------------------------------------ forms (inputs) */
label { font-weight: 500; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="url"], input[type="tel"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: not-allowed;
}
input::placeholder, textarea::placeholder { color: var(--subtle); }
@media (max-width: 720px) {
  /* 16 px avoids the automatic zoom of phones when an input gets focus */
  input, select, textarea { font-size: 16px; }
}
.form-row { display: grid; gap: 6px; }
.form-row + .form-row { margin-top: 16px; }
.form-row .hint { font-size: 13px; color: var(--muted); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  font-weight: 500; color: var(--text-2); cursor: pointer;
}
.choice:hover { border-color: var(--brand); }
.choice input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); box-shadow: none; min-height: 0; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.choice:has(input:disabled) { cursor: not-allowed; background: var(--surface-2); color: var(--muted); }
.choice:has(input:disabled):hover { border-color: var(--border-strong); }
.inline-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-fields > * { flex: 1 1 140px; }
.inline-fields > .dial-code { flex: 0 1 150px; min-width: 120px; }
.inline-fields > .dial-code + * { flex-basis: 120px; }

/* ------------------------------------------------------------------ tables (cards on phones) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 10px 16px; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .code { font-family: var(--mono); font-weight: 600; color: var(--text); }
.table .primary { font-weight: 600; color: var(--text); }
.table .secondary { display: block; font-size: 13px; color: var(--muted); }
.table .row-actions { text-align: right; white-space: nowrap; }

@media (max-width: 760px) {
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody { display: block; }
  .table.responsive tr {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
  }
  .table.responsive td { display: block; padding: 0; border: 0; }
  .table.responsive td[data-cell="code"] { grid-column: 1; }
  .table.responsive td[data-cell="status"] { grid-column: 2; grid-row: 1; justify-self: end; }
  .table.responsive td[data-cell="client"], .table.responsive td[data-cell="owner"],
  .table.responsive td[data-cell="progress"] { grid-column: 1 / -1; }
  .table.responsive td[data-cell="changed"] { grid-column: 1; font-size: 13px; color: var(--muted); }
  .table.responsive td[data-cell="actions"] { grid-column: 2; justify-self: end; }
}

.pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted);
}
.pagination .buttons { display: flex; gap: 8px; }

.empty {
  display: grid; justify-items: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--muted);
}
.empty .icon { width: 28px; height: 28px; color: var(--subtle); }
.empty strong { color: var(--text); }

/* ------------------------------------------------------------------ alerts, toasts, banners */
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid; font-size: 14px;
}
.alert .icon { margin-top: 2px; }
.alert.info { background: var(--info-soft); border-color: var(--info-line); color: #1849a9; }
.alert.warning { background: var(--warning-soft); border-color: var(--warning-line); color: #93370d; }
.alert.danger { background: var(--danger-soft); border-color: var(--danger-line); color: #912018; }
.alert.success { background: var(--success-soft); border-color: var(--success-line); color: #085d3a; }
.alert strong { display: block; }

.toasts {
  position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px;
  display: grid; gap: 8px; justify-items: center; pointer-events: none;
}
@media (min-width: 720px) { .toasts { left: auto; right: 24px; bottom: 24px; justify-items: end; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  max-width: 420px; padding: 12px 14px; border-radius: var(--radius-lg);
  background: var(--text); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  animation: toast-in 0.2s ease-out;
}
.toast .icon { color: #75e0a7; }
.toast.error { background: var(--danger); }
.toast.error .icon { color: #fff; }
.toast .close { margin-left: 4px; border: 0; background: none; color: rgba(255, 255, 255, 0.7); cursor: pointer; padding: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.banner {
  position: sticky; top: var(--topbar-h); z-index: 15;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px;
  padding: 10px 16px; font-size: 14px; border-bottom: 1px solid;
}
.banner.warning { background: var(--warning-soft); border-color: var(--warning-line); color: #93370d; }
.banner.offline { background: var(--danger-soft); border-color: var(--danger-line); color: #912018; }

/* ------------------------------------------------------------------ auth pages */
.auth {
  min-height: 100vh; display: grid; align-content: center; justify-items: center; gap: 24px;
  padding: 48px 16px;
}
.auth-top { position: fixed; top: 16px; right: 16px; }
.auth .brand { border: 0; height: auto; padding: 0; font-size: 18px; }
.auth .brand-mark { width: 36px; height: 36px; font-size: 17px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card-body { padding: 28px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 24px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.auth-tabs a { padding: 8px; text-align: center; border-radius: 6px; color: var(--muted); font-weight: 600; font-size: 14px; }
.auth-tabs a:hover { text-decoration: none; color: var(--text); }
.auth-tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.auth-foot { font-size: 13px; color: var(--muted); text-align: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ------------------------------------------------------------------ assessment form page */
.form-bar {
  position: sticky; top: var(--topbar-h); z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin: -20px -16px 20px; padding: 12px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
@media (min-width: 1024px) { .form-bar { margin: -28px -32px 24px; padding: 12px 32px; } }
.form-bar .title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.form-bar .title strong { font-family: var(--mono); font-size: 15px; }
.form-bar .title .client { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-bar .progress-cell progress { width: 140px; max-width: none; }
.form-bar .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 719px) {
  /* phones: code, status and the main action on the first line; progress and save state below */
  .form-bar .actions { order: 1; }
  .form-bar .progress-cell { order: 2; flex: 1; }
  .form-bar .progress-cell progress { width: 100%; }
  .form-bar .save-state { order: 3; }
}
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.save-state .icon { width: 16px; height: 16px; color: var(--success); }
.save-state.error { color: var(--danger); font-weight: 600; }
.save-state.error .icon { color: var(--danger); }

.form-layout { display: grid; gap: 20px; }
@media (min-width: 1100px) { .form-layout { grid-template-columns: 232px minmax(0, 1fr); align-items: start; } }
.section-nav {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px;
}
.section-nav a {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 13px; font-weight: 500;
}
.section-nav a:hover { text-decoration: none; border-color: var(--border-strong); }
.section-nav .state { flex: none; font-size: 12px; font-weight: 600; white-space: nowrap; }
.section-nav a.complete .state { color: var(--success); }
.section-nav a.missing .state { color: var(--danger); }
@media (min-width: 1100px) {
  .section-nav {
    position: sticky; top: calc(var(--topbar-h) + 84px);
    display: grid; gap: 2px; margin: 0; padding: 8px; overflow: visible;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  }
  .section-nav a { justify-content: space-between; border: 0; border-radius: var(--radius); padding: 8px 10px; background: none; }
  .section-nav a:hover { background: var(--surface-2); }
  .section-nav a[aria-current="true"] { background: var(--brand-soft); color: var(--brand); }
}

.form-section { scroll-margin-top: calc(var(--topbar-h) + 84px); }
.form-section + .form-section { margin-top: 16px; }
.section-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.section-letter {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius);
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 14px;
}
.section-head h2 { flex: 1; min-width: 0; }
.section-head .meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.section-body { padding: 4px 20px 20px; }

.field { position: relative; padding: 16px 0 16px 16px; border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--topbar-h) + 84px); }
.field:last-child { border-bottom: 0; }
.field::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px;
  background: transparent;
}
.field.required.is-empty::before { background: var(--danger-line); }
.field.required.is-filled::before { background: var(--success-line); }
.field-label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text); }
.field-number { display: inline-block; margin-right: 8px; font-family: var(--mono); font-size: 12.5px;
  font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 0 5px; vertical-align: 1px; }
.field-flag { margin-left: 4px; color: var(--danger); font-weight: 700; }
.field-help { margin-top: 8px; font-size: 13px; color: var(--muted); }
.field-note {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 2px 10px;
  border-radius: 999px; background: var(--violet-soft); color: var(--violet);
  font-size: 12.5px; font-weight: 600;
}

/* Each section: what must be filled before the first submit, then what can come later. */
.field-group { margin-top: 16px; padding: 0 16px 4px; border-radius: var(--radius); border: 1px solid; }
.field-group.intro { margin-top: 12px; padding: 0; border: 0; }
.field-group.required { border-color: var(--danger-line); background: linear-gradient(180deg, #fff8f7, var(--surface) 64px); }
.field-group.later { border-color: var(--info-line); background: linear-gradient(180deg, #f5faff, var(--surface) 64px); }
.group-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  margin: 0 -16px; padding: 10px 16px; border-bottom: 1px solid;
  border-radius: var(--radius) var(--radius) 0 0;
}
.group-head h3 { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.group-head span { font-size: 13px; }
.group-head.required { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.group-head.required h3 { color: var(--danger); }
.group-head.later { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.group-head.later h3 { color: var(--info); }
.field-group .field:last-child { border-bottom: 0; }
.field-error { margin-top: 6px; font-size: 13px; color: var(--danger); font-weight: 500; }
.field.highlight { background: var(--danger-soft); border-radius: var(--radius); padding-right: 12px;
  border-bottom-color: transparent; margin: 4px 0; }
.field.highlight::before, .field.required.highlight::before { background: var(--danger); }
.reserved-tag {
  display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 600;
  color: var(--violet); background: var(--violet-soft); border-radius: 6px; padding: 0 8px;
}

.info-box {
  display: flex; gap: 12px; margin: 16px 0 4px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; color: var(--text-2);
}
.info-box .icon { color: var(--muted); margin-top: 2px; }
.info-box.warning { background: var(--warning-soft); border-color: var(--warning-line); color: #93370d; }
.info-box.warning .icon { color: var(--warning); }
.info-box.danger { background: var(--danger-soft); border-color: var(--danger-line); color: #912018; }
.info-box.danger .icon { color: var(--danger); }
.info-box strong { display: block; margin-bottom: 2px; }

.comment {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--radius); font-size: 14px;
  background: var(--warning-soft); border: 1px solid var(--warning-line);
}
.comment .by { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.comment.director { background: var(--info-soft); border-color: var(--info-line); }
.comment.rejection { background: var(--danger-soft); border-color: var(--danger-line); }

.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.media-item { width: 132px; }
.media-item img, .media-item .file {
  width: 132px; height: 96px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2);
}
.media-item .file { display: grid; place-items: center; color: var(--muted); }
.media-item .name { margin-top: 4px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.upload-slot {
  display: grid; place-items: center; gap: 4px; width: 132px; height: 96px; border-radius: var(--radius);
  border: 1px dashed var(--border-strong); color: var(--muted); font-size: 12.5px; font-weight: 500; text-align: center;
}

.role-banner { margin-bottom: 16px; }

/* ------------------------------------------------------------------ dialogs */
dialog {
  width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); color: var(--text);
}
dialog::backdrop { background: rgba(16, 24, 40, 0.4); }
.dialog-head { padding: 20px 24px 0; }
.dialog-body { padding: 16px 24px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.dialog-note { margin-top: 12px; }
.missing-list { margin: 8px 0 0; padding: 0; list-style: none; max-height: 40vh; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius); }
.missing-list li + li { border-top: 1px solid var(--border); }
.missing-list:empty { display: none; }
.missing-list a { display: flex; gap: 10px; padding: 8px 12px; color: var(--text-2); }
.missing-list a:hover { background: var(--surface-2); text-decoration: none; }

/* ================================================================== application additions */

/* toasts close themselves (app.js) */
.toast.leaving { opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; }

/* save indicator of the form page: a coloured dot shows the state (form.js sets the text) */
.save-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.save-state.busy::before { background: var(--warning); }
.save-state.error::before { background: var(--danger); }

/* page header extras */
.page-header .eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.back-link:hover { color: var(--text); text-decoration: none; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 28px 0 12px; }
.section-title:first-child { margin-top: 0; }

/* simple vertical forms */
.form { display: grid; gap: 16px; }
.form .form-row + .form-row { margin-top: 0; }
.form-row > label, .form-row > .label { font-weight: 500; }
.form-row .label-note { font-weight: 400; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); min-height: 0; box-shadow: none; }
select[multiple] { background-image: none; padding: 6px; min-height: 96px; }
select[multiple] option { padding: 4px 8px; border-radius: 4px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline-form .form-row { flex: 1 1 200px; }
.inline-form + .inline-form { margin-top: 12px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* definition list on the account page */
.facts { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 10px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-weight: 500; }

/* ------------------------------------------------------------------ administration page */
.status.active { color: var(--success); background: var(--success-soft); border-color: var(--success-line); }
.status.disabled, .status.neutral {
  color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.status.pending_approval { color: var(--warning); background: var(--warning-soft); border-color: var(--warning-line); }
.status.role { color: var(--brand); background: var(--brand-soft); border-color: #cfe4ee; }
.status.role::before, .status.neutral::before { display: none; }

/* summary tiles */
.adm-stats { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.adm-stat {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.adm-stat:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.adm-stat.is-pending { border-color: var(--warning-line); background: linear-gradient(180deg, var(--warning-soft), var(--surface) 70%); }
.adm-stat-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 10px; }
.adm-stat-icon.warning { background: var(--warning-soft); color: var(--warning); }
.adm-stat-icon.success { background: var(--success-soft); color: var(--success); }
.adm-stat-icon.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.adm-stat-value { display: block; font-size: 26px; line-height: 30px; font-weight: 650; font-variant-numeric: tabular-nums; }
.adm-stat-label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
@media (max-width: 719px) {
  .adm-stats { gap: 8px; }
  .adm-stat { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .adm-stat-icon { width: 34px; height: 34px; }
  .adm-stat-value { font-size: 20px; line-height: 24px; }
  .adm-stat-label { font-size: 12px; }
}

/* segmented tabs */
.adm-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; overflow-x: auto;
  background: #eef0f3; border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: max-content; max-width: 100%;
}

.adm-tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius);
  color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.adm-tabs a:hover { color: var(--text); text-decoration: none; }
.adm-tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.adm-tabs a[aria-current="page"] .icon { color: var(--brand); }
@media (max-width: 599px) {
  .adm-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .adm-tabs a { justify-content: center; gap: 6px; padding: 8px 6px; font-size: 13px; line-height: 1.25;
    white-space: normal; text-align: center; }
  .adm-tabs a .icon { display: none; }
}
/* avatar and name */
.adm-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.adm-person .who { min-width: 0; }
.adm-person .who strong { display: block; font-weight: 600; color: var(--text); }
.adm-person .who span { display: block; font-size: 13px; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.adm-avatar {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
}
.adm-avatar.tone-0 { background: #e0f2fe; color: #075985; }
.adm-avatar.tone-1 { background: #ede9fe; color: #5b21b6; }
.adm-avatar.tone-2 { background: #dcfce7; color: #166534; }
.adm-avatar.tone-3 { background: #ffedd5; color: #9a3412; }
.adm-avatar.tone-4 { background: #fce7f3; color: #9d174d; }
.adm-avatar.tone-5 { background: #e0e7ff; color: #3730a3; }
.is-disabled .adm-avatar { background: var(--surface-2); color: var(--subtle); }
.is-disabled .adm-person .who strong { color: var(--muted); }

/* role select + mentor chips; mentors appear only while "Project Manager" is chosen */
.adm-assign { display: grid; gap: 14px; }
.adm-mentors { display: none; margin: 0; padding: 0; border: 0; min-width: 0; }
.adm-assign:has(.adm-role-select option[value="project_manager"]:checked) .adm-mentors { display: grid; gap: 8px; }
.adm-mentors legend { padding: 0; margin-bottom: 8px; font-weight: 500; }
.adm-mentors .choice { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.adm-mentors .hint, .adm-panel .hint { font-size: 13px; color: var(--muted); }

/* pending requests: one card each */
.adm-requests { display: grid; gap: 16px; }
@media (min-width: 1100px) { .adm-requests { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.adm-request { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.adm-request-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; padding: 18px 20px 0; }
.adm-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 20px 0; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.adm-facts div { min-width: 0; }
.adm-facts dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--subtle); }
.adm-facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; color: var(--text-2); overflow-wrap: anywhere; }
.adm-request .adm-assign { padding: 16px 20px; }
.adm-request-foot {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.adm-reject > summary { list-style: none; box-shadow: none; border-color: transparent; background: transparent; }
.adm-reject > summary::-webkit-details-marker { display: none; }
.adm-reject[open] { flex-basis: 100%; order: 2; }
.adm-reject[open] > summary { display: none; }
.adm-reject-form { display: grid; gap: 6px; }
.adm-reject-form label { font-size: 14px; }
.adm-inline { display: flex; gap: 8px; }
.adm-inline input { flex: 1; }
.adm-reject[open] ~ .btn-primary { display: none; }

/* users list */
.adm-toolbar { border-bottom: 1px solid var(--border); }
.adm-users { list-style: none; margin: 0; padding: 0; }
.adm-users > li + li { border-top: 1px solid var(--border); }
.adm-user-row, .adm-users-head {
  display: grid; align-items: center; gap: 8px 16px; padding: 12px 20px;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.6fr) minmax(0, 0.9fr) 96px;
}
.adm-users-head {
  padding-top: 10px; padding-bottom: 10px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
.adm-manage > summary { list-style: none; cursor: pointer; transition: background 0.12s; }
.adm-manage > summary::-webkit-details-marker { display: none; }
.adm-manage > summary:hover, .adm-manage[open] > summary { background: var(--surface-2); }
.adm-company { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-role { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.adm-links { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.adm-manage-label {
  justify-self: end; display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--brand);
}
.adm-manage-label .icon { transition: transform 0.15s; }
.adm-manage[open] .adm-manage-label .icon { transform: rotate(180deg); }
.adm-manage-label.is-you { color: var(--subtle); font-weight: 500; }
.adm-panel {
  display: grid; gap: 16px; padding: 4px 20px 20px 70px; background: var(--surface-2);
}
@media (min-width: 900px) { .adm-panel { grid-template-columns: 3fr 2fr; } }
.adm-panel-block {
  display: grid; align-content: start; gap: 12px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.adm-panel-block h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
@media (max-width: 899px) {
  .adm-users-head { display: none; }
  .adm-user-row { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
  .adm-user-row .adm-person { grid-column: 1 / -1; }
  .adm-company { grid-column: 1; font-size: 13px; color: var(--muted); }
  .adm-role { grid-column: 1; grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; }
  .adm-role + span { grid-column: 2; grid-row: 2 / span 2; justify-self: end; align-self: start; }
  .adm-manage-label { grid-column: 1 / -1; justify-self: start; }
  .adm-panel { padding: 4px 16px 16px; }
}

/* activity timeline */
.adm-timeline { list-style: none; margin: 0; padding: 8px 0; }
.adm-timeline li {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px;
  padding: 12px 20px;
}
.adm-timeline li + li::before {
  content: ""; position: absolute; left: 35px; top: -12px; height: 24px; width: 2px; background: var(--border);
}
.adm-event-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; position: relative; z-index: 1; }
.adm-event-icon.success { background: var(--success-soft); color: var(--success); box-shadow: 0 0 0 1px var(--success-line); }
.adm-event-icon.danger { background: var(--danger-soft); color: var(--danger); box-shadow: 0 0 0 1px var(--danger-line); }
.adm-event-icon.brand { background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 1px #cfe4ee; }
.adm-event-icon.info { background: var(--info-soft); color: var(--info); box-shadow: 0 0 0 1px var(--info-line); }
.adm-event-icon.neutral { background: var(--surface-2); color: var(--muted); box-shadow: 0 0 0 1px var(--border); }
.adm-event p:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 32px; }
.adm-event-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.adm-event-reason { margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--border-strong);
  background: var(--surface-2); border-radius: 0 6px 6px 0; font-size: 13px; color: var(--text-2); }
.adm-event-time { font-size: 13px; color: var(--muted); white-space: nowrap; line-height: 32px; }
@media (max-width: 599px) {
  .adm-timeline li { grid-template-columns: auto minmax(0, 1fr); padding: 12px 16px; }
  .adm-timeline li + li::before { left: 31px; }
  .adm-event-time { grid-column: 2; line-height: 1.4; }
}

/* overview */
.action-list .action-meta .reason { color: var(--danger); }
.card-footer a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.quick-links { display: grid; gap: 8px; }

/* list page: cells */
.table .owner-company { display: block; font-size: 13px; color: var(--muted); }
.table .missing, .progress-cell .missing { color: var(--danger); font-weight: 600; font-size: 13px; white-space: nowrap; }
.table .reason-text { color: var(--danger); }
.table .row-actions form { display: inline; }
.attention { margin-bottom: 16px; }
.attention .action-item { grid-template-columns: auto 1fr auto; }

/* form page */
.form-bar .missing { font-size: 13px; font-weight: 600; color: var(--danger); white-space: nowrap; }
.form-bar .missing:hover { text-decoration: underline; }
.form-bar form { display: contents; }
.owner-line { margin: -8px 0 16px; font-size: 14px; color: var(--muted); }
.subhead { margin: 20px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.section-comments { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.comment-form { margin-top: 10px; }
.comment-form > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--brand);
}
.comment-form > summary::-webkit-details-marker { display: none; }
.comment-form form { display: grid; gap: 8px; margin-top: 8px; }
.comment-form textarea { min-height: 72px; }
.comment-form .btn { justify-self: start; }
.comment.section { background: var(--surface-2); border-color: var(--border); }
.director-comments { margin-bottom: 16px; }
.director-comments .card-body { display: grid; gap: 8px; }
.director-comments .comment { margin-top: 0; }

.choices .choice.hidden { display: none; }
.empty-label { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.no-options { margin-top: 6px; font-size: 13px; color: var(--muted); }
.date-range label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }

.no-media { font-size: 13px; color: var(--muted); }
.media-item { position: relative; }
.media-item > a { display: block; color: var(--text-2); }
.media-item > a:hover { text-decoration: none; }
.media-item .file { gap: 4px; padding: 8px; text-align: center; font-size: 12px; overflow: hidden; }
.media-item .remove {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 26px; height: 26px;
  border: 0; border-radius: 50%; background: rgba(16, 24, 40, 0.65); color: #fff; cursor: pointer;
}
.media-item .remove:hover { background: var(--danger); }
.media-controls .btn input[type="file"] { display: none; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.link-row input { flex: 1 1 220px; }
.media-status { margin-top: 8px; font-size: 13px; color: var(--muted); }
.media-status:empty { display: none; }

/* history */
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list > li { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; padding: 14px 20px; }
.history-list > li + li { border-top: 1px solid var(--border); }
.history-icon { grid-row: span 3; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.history-icon.status { background: var(--brand-soft); color: var(--brand); border-color: #cfe4ee; padding: 0; }
.history-icon.status::before { display: none; }
.history-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.history-head .who { font-weight: 600; }
.history-head .when { font-size: 13px; color: var(--muted); }
.history-what { font-size: 14px; color: var(--text-2); }
.history-change { font-size: 14px; overflow-wrap: anywhere; }
.history-change .old { color: var(--muted); text-decoration: line-through; }
.history-change .quote { display: block; margin-top: 4px; padding-left: 10px; border-left: 3px solid var(--border); color: var(--text-2); }
.export-list { list-style: none; margin: 0; padding: 0; }
.export-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 20px; font-size: 14px; }
.export-list li + li { border-top: 1px solid var(--border); }
.export-list .grow { flex: 1; min-width: 0; }

/* account-awaiting-approval and message pages */
.auth-card .card-body > .stack > p { color: var(--text-2); }
.auth-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.auth-icon .icon { width: 22px; height: 22px; }
.auth-icon.success { background: var(--success-soft); color: var(--success); }
.auth-icon.warning { background: var(--warning-soft); color: var(--warning); }
.auth-signout { margin-top: 4px; }
.auth-signout .btn { width: 100%; }
