/* =========================================================
   Lifecycle — design system
   ========================================================= */
:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e6e8ef;
  --border-strong: #d5d9e4;
  --text: #14161f;
  --text-2: #5b6271;
  --text-3: #8b91a0;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-soft-text: #4338ca;
  --green: #0d9f6e;
  --green-soft: #e6f7f1;
  --amber: #b45309;
  --amber-soft: #fef3e2;
  --red: #dc2626;
  --red-soft: #fdeaea;
  --blue: #2563eb;
  --blue-soft: #e8f0fe;
  --purple: #7c3aed;
  --purple-soft: #f3ecfe;
  --sidebar-bg: #101322;
  --sidebar-text: #9ba1b3;
  --sidebar-active: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 19, 34, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 19, 34, 0.08);
  --shadow-lg: 0 16px 48px rgba(16, 19, 34, 0.18);
  --hover: #fafbfe;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

/* dark theme — applied via Settings → Branding */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1016;
  --surface: #161922;
  --surface-2: #1d212c;
  --border: #262b38;
  --border-strong: #394052;
  --text: #e9ebf3;
  --text-2: #a7aebf;
  --text-3: #6f7890;
  --hover: #1b1f2a;
  --green: #10b981;
  --green-soft: rgba(52, 211, 153, 0.13);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.13);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.13);
  --purple: #c4b5fd;
  --purple-soft: rgba(196, 181, 253, 0.13);
  --sidebar-bg: #0a0c12;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .toast { border: 1px solid var(--border-strong); }

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

/* the hidden attribute always wins, regardless of a class's display rule */
[hidden] { display: none !important; }

html, body { height: 100%; }

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

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }

.app { display: flex; min-height: 100vh; }

/* =========================================================
   Sidebar
   ========================================================= */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
  overflow: hidden;
}
.brand-mark.has-logo { box-shadow: var(--shadow-sm); background: var(--surface); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { color: var(--sidebar-text); font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label {
  color: #5d6477; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  padding: 8px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  background: none; border: none;
  color: var(--sidebar-text);
  font-size: 13.5px; font-weight: 500;
  padding: 9px 10px;
  border-radius: 9px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 17px; height: 17px; fill: currentColor; opacity: 0.85; flex-shrink: 0; }
.nav-item:hover { color: #e8eaf0; background: rgba(255, 255, 255, 0.05); }
.nav-item.active { color: var(--sidebar-active); background: rgba(99, 102, 241, 0.18); }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: rgba(99, 102, 241, 0.9);
  color: #fff; font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: none; align-items: center; justify-content: center;
  padding: 0 5px;
}
.nav-badge.show { display: inline-flex; }

.sidebar-footer { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.role-hint { color: #6a7184; font-size: 11px; padding: 6px 8px 0; line-height: 1.45; }

/* signed-in user card */
.user-card { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.user-card .uc-text { flex: 1; min-width: 0; }
.user-card .uc-text b { color: #fff; font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .uc-text span { color: var(--sidebar-text); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.user-card .avatar { width: 32px; height: 32px; font-size: 11.5px; }
.signout-btn {
  border: none; background: rgba(255, 255, 255, 0.07);
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--sidebar-text);
  flex-shrink: 0;
}
.signout-btn svg { width: 15px; height: 15px; fill: currentColor; }
.signout-btn:hover { background: var(--red); color: #fff; }

/* =========================================================
   Main / topbar
   ========================================================= */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 22px 32px 0;
}
.topbar-titles h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.topbar-titles p { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.topbar-actions { display: flex; gap: 10px; }

.content { padding: 22px 32px 48px; max-width: 1240px; width: 100%; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px; font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: #c3c8d6; }
.btn svg { width: 15px; height: 15px; fill: currentColor; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #0b8a5f; border-color: #0b8a5f; }

.btn-danger-soft { background: var(--red-soft); border-color: #f5c6c6; color: var(--red); box-shadow: none; }
.btn-danger-soft:hover { background: #fbdddd; }

.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* =========================================================
   Cards & stats
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }

.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.card-head .sub { color: var(--text-3); font-size: 12px; font-weight: 500; margin-top: 1px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.stat:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.stat-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat-foot { color: var(--text-3); font-size: 11.5px; }

/* =========================================================
   Tables / list rows
   ========================================================= */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-3);
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.table td { padding: 13px 20px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { cursor: pointer; transition: background 0.12s, box-shadow 0.12s; }
.table tbody tr:hover { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }

.person { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 12.5px;
  flex-shrink: 0;
}
.person-name { font-weight: 600; }
.person-meta { color: var(--text-3); font-size: 12px; }

.empty {
  padding: 44px 20px; text-align: center; color: var(--text-3);
}
.empty .empty-icon { font-size: 30px; margin-bottom: 8px; }
.empty p { font-size: 13.5px; }

/* =========================================================
   Pills / badges
   ========================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-gray { background: #eef0f4; color: #555c6b; }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-purple { background: var(--purple-soft); color: var(--purple); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-indigo { background: var(--accent-soft); color: var(--accent-soft-text); }
.pill-teal { background: rgba(20,184,166,0.14); color: #0d9488; }

.tag {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px; font-weight: 500;
  padding: 3px 9px; border-radius: 6px;
  margin: 2px 4px 2px 0;
}

.mono { font-family: var(--mono); font-size: 12.5px; }

/* =========================================================
   Forms
   ========================================================= */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px;
}
.field label .req { color: var(--red); }
/* All text-like inputs (incl. bare <input> with no type), selects and textareas. */
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select, .field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 9px 12px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent),
              0 4px 18px color-mix(in srgb, var(--accent) 14%, transparent);
}
.field textarea { resize: vertical; min-height: 76px; }

/* Themed dropdowns — replace the native arrow with a matching chevron, and make
   the popup list follow light/dark via color-scheme. */
.field select, .company-sel, select.ti {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%238b91a0'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 32px; cursor: pointer;
}
[data-theme="dark"] .field select, [data-theme="dark"] .company-sel, [data-theme="dark"] select.ti {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236f7890'><path d='M7 10l5 5 5-5z'/></svg>");
}
.field select option, .company-sel option, select option { color: var(--text); background: var(--surface); }
.field .help { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }

/* automated off-site backups — a little more breathing room than the dense forms */
.backup-card .seg { gap: 6px; padding: 5px; row-gap: 6px; }
.backup-card .seg button { padding: 8px 18px; }
.backup-card .dest-fields { margin-top: 20px; }
.backup-card .form-grid { gap: 20px 24px; }
.backup-card .field label { margin-bottom: 7px; }
.backup-card .field .help { margin-top: 7px; line-height: 1.45; }

.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700;
  margin: 26px 0 14px;
  color: var(--text);
}
.section-title:first-child { margin-top: 0; }
.section-title .num {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent-soft-text);
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 800;
}
.section-title .line { flex: 1; height: 1px; background: var(--border); }

/* checkbox chips */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 0.13s;
}
.chip input { display: none; }
.chip .box {
  width: 16px; height: 16px; border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center;
  transition: all 0.13s;
  flex-shrink: 0;
}
.chip .box svg { width: 10px; height: 10px; fill: #fff; opacity: 0; }
.chip:hover { border-color: var(--accent); }
.chip.checked { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-text); }
.chip.checked .box { background: var(--accent); border-color: var(--accent); }
.chip.checked .box svg { opacity: 1; }
.chip .price { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.chip.checked .price { color: var(--accent-soft-text); opacity: 0.75; }

/* generic text input (outside .field wrappers) */
.ti {
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 8px 12px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ti:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), 0 4px 18px color-mix(in srgb, var(--accent) 14%, transparent); }

/* "+ Add custom item" rows under chip groups */
.custom-add { display: flex; gap: 8px; margin-top: 10px; max-width: 560px; }
.custom-add .ca-name { flex: 1; min-width: 0; }
.custom-add .ca-cost { width: 120px; flex-shrink: 0; }

/* IT adjustment rows on case detail */
.adjust-row { display: flex; gap: 8px; margin-top: 8px; max-width: 460px; }
.adjust-row .ti { flex: 1; min-width: 0; }

/* themed autocomplete (replaces native <datalist>) */
.combo { position: relative; flex: 1; min-width: 0; }
.combo .ti { width: 100%; }
.combo-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  max-height: 240px; overflow-y: auto; padding: 4px;
}
.combo-opt {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 8px 12px; border-radius: 7px; font: inherit; font-size: 13.5px;
  color: var(--text); cursor: pointer;
}
.combo-opt:hover { background: var(--hover); }

/* removable tag (×) */
.tag .x {
  cursor: pointer;
  margin-left: 7px;
  color: var(--text-3);
  font-weight: 700;
  display: inline-block;
}
.tag .x:hover { color: var(--red); }

/* toggle row (policy signed etc.) */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  background: var(--surface-2);
}
.switch-row .sw-text b { font-size: 13.5px; display: block; }
.switch-row .sw-text span { font-size: 12px; color: var(--text-2); }
.switch {
  position: relative; width: 40px; height: 23px; flex-shrink: 0;
  cursor: pointer;
}
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0;
  background: #cdd2dd; border-radius: 999px;
  transition: background 0.18s;
}
.switch .thumb {
  position: absolute; top: 2.5px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.18s;
}
.switch input:checked ~ .track { background: var(--green); }
.switch input:checked ~ .thumb { transform: translateX(16px); }

/* =========================================================
   Workflow stepper
   ========================================================= */
.stepper {
  display: flex; align-items: flex-start;
  padding: 18px 8px 14px;
}
.step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; min-width: 0; }
.step::before, .step::after {
  content: ""; position: absolute; top: 14px; height: 2px;
  background: var(--border-strong); width: 50%;
}
.step::before { left: 0; }
.step::after { right: 0; }
.step:first-child::before, .step:last-child::after { display: none; }
.step.done::before, .step.done::after,
.step.current::before { background: var(--accent); }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--border-strong);
  color: var(--text-3); font-size: 11.5px; font-weight: 700;
  position: relative; z-index: 1;
  transition: all 0.2s;
}
.step-dot svg { width: 13px; height: 13px; fill: #fff; }
.step.done .step-dot { background: var(--accent); border-color: var(--accent); }
.step.current .step-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step.rejected .step-dot { background: var(--red); border-color: var(--red); }
.step-label { font-size: 11.5px; font-weight: 600; color: var(--text-3); margin-top: 8px; text-align: center; padding: 0 4px; }
.step.done .step-label, .step.current .step-label { color: var(--text); }

/* =========================================================
   Detail layout
   ========================================================= */
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
@media (max-width: 1080px) { .detail-grid { grid-template-columns: 1fr; } }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); font-weight: 500; }
.kv dd { font-weight: 500; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 13px; font-weight: 600;
  background: none; border: none; padding: 0 0 14px;
}
.back-link:hover { color: var(--accent); }
.back-link svg { width: 15px; height: 15px; fill: currentColor; }

/* checklist */
.check-group + .check-group { border-top: 1px solid var(--border); }
.check-group-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 20px 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3);
}
.check-group-head .muted { font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 11.5px; }
.check-list { display: flex; flex-direction: column; }
.check-item {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.check-item:last-child { border-bottom: none; }
.check-item:hover { background: var(--hover); }
.check-box {
  width: 21px; height: 21px; border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0;
  transition: all 0.15s;
}
.check-box svg { width: 12px; height: 12px; fill: #fff; opacity: 0; transition: opacity 0.15s; }
.check-box:hover { border-color: var(--green); }
.check-item.done .check-box { background: var(--green); border-color: var(--green); }
.check-item.done .check-box svg { opacity: 1; }
.check-item.locked .check-box { cursor: not-allowed; opacity: 0.6; }
.check-text { flex: 1; min-width: 0; }
.check-text b { font-size: 13.5px; font-weight: 600; display: block; }
.check-item.done .check-text b { text-decoration: line-through; color: var(--text-3); }
.check-text span { font-size: 12px; color: var(--text-3); }

.progress-wrap { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.progress { flex: 1; height: 7px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #4f46e5); border-radius: 999px; transition: width 0.3s; }
.progress.green i { background: linear-gradient(90deg, #34d399, #0d9f6e); }
.progress-num { font-size: 12px; font-weight: 700; color: var(--text-2); }

/* activity feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-top: 6px; flex-shrink: 0;
}
.feed-text { font-size: 12.5px; }
.feed-text b { font-weight: 600; }
.feed-time { color: var(--text-3); font-size: 11.5px; margin-top: 1px; }

/* action panel callouts */
.panel-note {
  display: flex; gap: 11px;
  background: var(--accent-soft);
  border: 1px solid #dfe3fb;
  color: var(--accent-soft-text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.panel-note.amber { background: var(--amber-soft); border-color: #f5e0bd; color: var(--amber); }
.panel-note.green { background: var(--green-soft); border-color: #c4ead9; color: var(--green); }
.panel-note.red { background: var(--red-soft); border-color: #f5c6c6; color: var(--red); }
.panel-note svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; margin-top: 1px; }

/* cost summary */
.cost-list { display: flex; flex-direction: column; gap: 7px; }
.cost-row { display: flex; justify-content: space-between; font-size: 13px; }
.cost-row span:first-child { color: var(--text-2); }
.cost-row.total {
  border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px;
  font-weight: 700; font-size: 14px;
}
.cost-row.total span:first-child { color: var(--text); }

/* =========================================================
   Modal
   ========================================================= */
.modal-overlay[hidden] { display: none; }
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(13, 16, 28, 0.55);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  z-index: 60;
  padding: 24px;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
  animation: modalIn 0.18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 0;
}
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  border: none; background: var(--surface-2);
  width: 30px; height: 30px; border-radius: 8px;
  font-size: 15px; color: var(--text-2);
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 16px 22px 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* =========================================================
   Toasts
   ========================================================= */
.toast-stack {
  position: fixed; bottom: 22px; right: 22px;
  display: flex; flex-direction: column; gap: 9px;
  z-index: 80;
}
.toast {
  background: #14161f; color: #fff;
  font-size: 13px; font-weight: 500;
  padding: 12px 17px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.22s ease;
  max-width: 380px;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateY(6px); transition: all 0.25s; }
.toast .t-icon { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.toast .t-icon svg { width: 11px; height: 11px; fill: #fff; }
.toast.success .t-icon { background: var(--green); }
.toast.info .t-icon { background: var(--accent); }
.toast.warn .t-icon { background: var(--amber); }

/* =========================================================
   Login screen (SSO placeholder)
   ========================================================= */
.login {
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(99, 102, 241, 0.35), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, rgba(124, 58, 237, 0.25), transparent 60%),
    var(--sidebar-bg);
  display: grid; place-items: center;
  z-index: 100;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 30px 30px 26px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.user-tiles { display: flex; flex-direction: column; gap: 9px; }
.user-tile {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.14s;
}
.user-tile:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.user-tile .ut-text { flex: 1; min-width: 0; }
.user-tile .ut-text b { font-size: 13.5px; display: block; }
.user-tile .ut-text span { font-size: 11.5px; color: var(--text-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sso-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-3); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 18px 0 12px;
}
.sso-divider::before, .sso-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sso-row { display: flex; gap: 10px; }
.sso-btn { flex: 1; justify-content: center; opacity: 0.55; cursor: not-allowed; }
.sso-btn svg { width: 16px; height: 16px; }

/* =========================================================
   Multi-select picker (dropdown + removable tags)
   ========================================================= */
.mp { margin-bottom: 4px; }
.mp-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; min-height: 22px; align-items: center; }
.mp-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px; font-weight: 600;
  animation: fadeIn 0.18s ease;
}
.mp-tag .price { font-size: 11px; opacity: 0.7; }
.mp-tag .x { cursor: pointer; font-weight: 800; opacity: 0.55; padding: 0 1px; }
.mp-tag .x:hover { opacity: 1; }
.mp-select { width: 100%; max-width: 460px; display: block; }

/* =========================================================
   Settings — tabs, swatches, segmented controls
   ========================================================= */
.tabs {
  display: flex; gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 5px;
  width: fit-content;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.tab {
  border: none; background: none;
  padding: 8px 18px; border-radius: 8px;
  font-weight: 600; font-size: 13px;
  color: var(--text-2);
  transition: all 0.14s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }

.seg {
  display: inline-flex; gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.seg button {
  border: none; background: none;
  padding: 7px 16px; border-radius: 7px;
  font-weight: 600; font-size: 13px;
  color: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px;
}
.seg button.active { background: var(--accent); color: #fff; }
.seg button svg { width: 14px; height: 14px; fill: currentColor; }

.swatches { display: flex; gap: 11px; flex-wrap: wrap; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  box-shadow: inset 0 0 0 2px var(--surface);
  transition: transform 0.13s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--text); }

/* admin star indicator */
.admin-dot {
  color: #f59e0b;
  font-size: 11px;
  margin-left: 3px;
}

/* role chips — used for user multi-role editing */
.role-chip-group { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.role-chip {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-3);
  transition: all 0.13s;
  user-select: none;
}
.role-chip:hover { border-color: var(--accent); color: var(--text); }
.role-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-text); }
.role-chip.ro { cursor: default; opacity: 0.85; }
.role-chip.ro:hover { border-color: var(--border-strong); color: var(--text-3); }
.role-chip.ro.on:hover { color: var(--accent-soft-text); }

/* toggle switch — used for roles & the admin flag */
.role-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.role-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 34px; height: 20px; border-radius: 999px;
  background: var(--border-strong); position: relative; flex-shrink: 0;
  transition: background 0.15s;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: transform 0.15s;
}
.role-switch input:checked + .switch-track { background: var(--accent); }
.role-switch input:checked + .switch-track .switch-thumb { transform: translateX(14px); }
.role-switch.admin input:checked + .switch-track { background: #f59e0b; }
.role-switch input:disabled + .switch-track { opacity: 0.5; }
.role-switch input:disabled ~ .switch-label { opacity: 0.55; cursor: not-allowed; }
.switch-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); transition: color 0.15s; }
.role-switch input:checked ~ .switch-label { color: var(--text); }
.role-switch-group { display: inline-flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* avatar colour picker */
.swatch-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.avatar-swatch {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; box-shadow: 0 0 0 1px var(--border) inset;
  transition: transform 0.1s, border-color 0.1s;
}
.avatar-swatch:hover { transform: scale(1.08); }
.avatar-swatch.sel { border-color: var(--text); }
.avatar.clickable { cursor: pointer; }
.avatar.clickable:hover { filter: brightness(1.08); box-shadow: 0 0 0 2px var(--accent); }

/* topbar appearance controls (per-user theme + accent) */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-prefs { display: flex; align-items: center; gap: 8px; }
.pref-btn {
  border: none; background: var(--surface-2);
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.13s; flex-shrink: 0;
}
.pref-btn svg { width: 18px; height: 18px; fill: var(--text-2); transition: fill 0.13s; }
.pref-btn:hover { background: var(--border); }
.pref-btn:hover svg { fill: var(--accent); }
.accent-dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border) inset; }
/* inside a .field (Add-user modal) the global `.field label{display:block}` would
   collapse the switches — keep them inline. */
.field .role-switch { display: inline-flex; margin-bottom: 0; }

.role-pills { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* user edit row (settings → user control) */
.user-edit-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 0;
}
.user-edit-row .ti { flex: 1; min-width: 0; }

/* security row — combined account + roles + admin layout */
.sec-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.sec-row:last-child { border-bottom: none; }
.sec-text { flex: 1; min-width: 0; }
.sec-text b { font-size: 13.5px; display: block; }
.sec-text span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.sec-row-full { flex-wrap: wrap; padding: 14px 0; }
.sec-row-full + .sec-row-full { border-top: 1px solid var(--border); }
.sec-inputs {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(170px, 1.5fr) minmax(120px, 1fr);
  gap: 8px;
  flex: 1; min-width: 240px;
}
.sec-roles { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* admin toggle pill */
.admin-switch { cursor: pointer; display: inline-flex; }
.admin-switch input { display: none; }
.admin-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-3);
  transition: all 0.13s;
  user-select: none;
}
.admin-pill .dot { font-size: 10px; }
.admin-switch:hover .admin-pill { border-color: #f59e0b; color: #b45309; }
.admin-switch input:checked + .admin-pill {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #b45309;
}
.admin-switch input:disabled + .admin-pill { opacity: 0.55; }
.admin-switch input:disabled ~ * { cursor: not-allowed; }

/* logo upload */
.logo-row { display: flex; align-items: center; gap: 18px; }
.logo-preview {
  width: 64px; height: 64px; border-radius: 14px;
  font-size: 28px;
  flex-shrink: 0;
}
.logo-actions { flex: 1; min-width: 0; }

/* =========================================================
   Settings — catalog & user rows
   ========================================================= */
.cat-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.cat-row .ti { flex: 1; min-width: 0; }
.cat-row .ti.num { width: 130px; flex: none; }
.cat-row.cat-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-3);
  padding-bottom: 2px;
}
.icon-btn {
  border: none; background: var(--surface-2);
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--text-3); font-size: 13px;
  flex-shrink: 0;
  transition: all 0.13s;
}
.icon-btn:hover:not(:disabled) { background: var(--red-soft); color: var(--red); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* small round info button — opens an explanatory modal */
.info-btn {
  border: none; background: var(--surface-2);
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; transition: background 0.13s;
}
.info-btn svg { width: 17px; height: 17px; fill: var(--text-3); transition: fill 0.13s; }
.info-btn:hover { background: var(--border); }
.info-btn:hover svg { fill: var(--accent); }

/* =========================================================
   Misc / utilities
   ========================================================= */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.muted { color: var(--text-3); font-size: 12.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

/* Dashboard: give the table the room it needs, keep the activity rail compact,
   both cards top-aligned. minmax(0,…) stops the table's min-content from blowing
   the columns out of proportion, and the table scrolls within its own card rather
   than spilling under the rail. */
/* Open cases (full width) stacked above Recent activity. Full width gives the table
   all the room it needs, so it no longer side-scrolls. */
.dash-stack { display: flex; flex-direction: column; gap: 18px; }
.dash-stack .card { min-width: 0; }
/* Recent activity uses the full width as two columns. */
.feed-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@media (max-width: 760px) { .feed-cols { grid-template-columns: 1fr; } }
.dash-cases { overflow-x: auto; }
.dash-cases .table th, .dash-cases .table td { padding-left: 14px; padding-right: 14px; }
.dash-cases .table td { padding-top: 11px; padding-bottom: 11px; }
.co-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.co-cell > span { overflow: hidden; text-overflow: ellipsis; }

.search-input {
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 8px 13px 8px 34px;
  width: 250px;
  background: var(--surface) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%238b91a0"><path d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 1 0-.7.7l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z"/></svg>') 11px center / 15px no-repeat;
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.13); }

.fade-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 880px) {
  .sidebar { width: 70px; padding: 18px 9px; }
  .brand-text, .nav-label, .role-hint { display: none; }
  .nav-item { justify-content: center; }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-item { font-size: 0; gap: 0; }
  .nav-badge { position: absolute; transform: translate(14px, -10px); }
  .nav-item { position: relative; }
  .user-card .uc-text, .role-hint { display: none; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ----- Role permission matrix (Settings → Security) ----- */
.perm-scroll { overflow-x: auto; margin: 2px -2px; padding: 2px; }
.perm-grid {
  display: grid;
  grid-template-columns: minmax(92px, 150px) repeat(var(--cols, 6), minmax(128px, 1fr));
  gap: 9px 10px;
  min-width: 600px;
  align-items: center;
}
.perm-row { display: contents; }
.perm-colh { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-align: center; }
.perm-role { font-size: 13px; }
.perm-userchip { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; }
.perm-userchip .avatar { color: #fff; }
.perm-admin-note { font-size: 12px; color: var(--text-3); font-weight: 600; align-self: center; padding-left: 2px; }
.perm-cell { display: flex; justify-content: center; }
.perm-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.perm-opt {
  appearance: none; border: 0; border-right: 1px solid var(--border);
  background: transparent; color: var(--text-3);
  padding: 5px 9px; font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1;
  cursor: pointer; transition: background .12s, color .12s;
}
.perm-opt:last-child { border-right: 0; }
.perm-opt:hover { background: rgba(0,0,0,0.04); }
.perm-opt.active.perm-none  { background: #eef0f4; color: #555c6b; }
.perm-opt.active.perm-read  { background: var(--blue-soft); color: var(--blue); }
.perm-opt.active.perm-write { background: var(--green-soft); color: var(--green); }

/* Segmented control — shadcn-style: muted track, white pill on the active option.
   Scoped to the per-user access panel + add-user picker so the legacy grid keeps
   its look. */
.ua-perms .perm-seg, #auPerms .perm-seg {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 3px; gap: 2px; overflow: visible; flex-shrink: 0;
}
.ua-perms .perm-opt, #auPerms .perm-opt {
  border: 0; background: transparent; border-radius: 6px; padding: 5px 13px;
  color: var(--text-3); font-weight: 600; transition: color .12s, background .12s, box-shadow .12s;
}
.ua-perms .perm-opt:hover:not(.active), #auPerms .perm-opt:hover:not(.active) { color: var(--text-2); background: transparent; }
.ua-perms .perm-opt.active, #auPerms .perm-opt.active {
  background: var(--surface); box-shadow: 0 1px 2px rgba(16,19,34,0.12);
}
.ua-perms .perm-opt.active.perm-none,  #auPerms .perm-opt.active.perm-none  { color: var(--text); }
.ua-perms .perm-opt.active.perm-read,  #auPerms .perm-opt.active.perm-read  { color: var(--blue); }
.ua-perms .perm-opt.active.perm-write, #auPerms .perm-opt.active.perm-write { color: var(--green); }

/* Access-per-step settings list */
.ua-perms { border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: var(--surface); max-width: 580px; }
.ua-perm-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 15px; }
.ua-perm-row + .ua-perm-row { border-top: 1px solid var(--border); }
.ua-perm-name { display: flex; flex-direction: column; gap: 2px; font-size: 13px; font-weight: 600; min-width: 0; }
.ua-perm-name span { font-size: 11.5px; font-weight: 400; color: var(--text-3); }

/* Admin "full access" note */
.ua-admin-note { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; max-width: 580px; }
.ua-admin-star { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: rgba(245,158,11,0.15); color: #b45309; display: grid; place-items: center; font-size: 15px; }
.ua-admin-note > div { display: flex; flex-direction: column; }
.ua-admin-note b { font-size: 13.5px; }
.ua-admin-note span { font-size: 12px; color: var(--text-3); }

/* ----- Starter requests ----- */
.req-list { display: grid; gap: 14px; }
.req-grid { display: flex; flex-wrap: wrap; gap: 22px 28px; margin-top: 14px; font-size: 13px; }
.req-grid .k, .req-notes .k { display: block; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.req-notes { margin-top: 14px; font-size: 13px; line-height: 1.5; }
.req-thread { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; display: grid; gap: 10px; }
.req-msg { font-size: 12.5px; background: var(--surface-2); border-radius: 8px; padding: 8px 11px; line-height: 1.5; }
.req-by { font-weight: 600; margin-right: 8px; }
.req-when { color: var(--text-3); font-size: 11px; }

/* ----- company switcher (topbar) ----- */
.company-switcher { display: flex; align-items: center; }
.company-sel {
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 10px; cursor: pointer; max-width: 220px;
}
.company-pill {
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
  color: var(--text-2); font-size: 12.5px; font-weight: 600; padding: 6px 11px;
}
.catalog-scope-note {
  background: var(--accent-soft); color: var(--accent-soft-text);
  border-radius: var(--radius-sm); padding: 9px 13px; font-size: 12.5px; margin-bottom: 16px;
}
.catalog-company-pick { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.catalog-company-pick label { font-size: 12.5px; font-weight: 600; }
.catalog-company-pick select { max-width: 260px; }
.catalog-company-pick .muted { font-size: 12px; }
/* ----- user management: list + slide-over drawer ----- */
.user-list { display: grid; }
.user-row {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 10px; padding: 11px 13px; cursor: pointer; transition: background .12s;
}
.user-row:hover { background: var(--surface-2); }
.user-row + .user-row { border-top: 1px solid var(--border); }
.user-row-main { flex: 1; min-width: 0; }
.user-row-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.user-row-email { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.you-tag { font-size: 10px; font-weight: 700; color: var(--accent-soft-text); background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; text-transform: uppercase; letter-spacing: .03em; }
.user-row-access { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; text-align: right; }
.access-badge { font-size: 12px; font-weight: 600; color: var(--text-2); }
.access-badge.admin { color: #b45309; }
.access-badge.muted-badge { color: var(--text-3); font-weight: 500; }
.access-sub { font-size: 11px; color: var(--text-3); }
.user-row-arrow { width: 18px; height: 18px; fill: var(--text-3); flex-shrink: 0; }

.drawer-overlay { position: fixed; inset: 0; background: rgba(16,19,34,0.34); z-index: 55; display: flex; justify-content: flex-end; opacity: 0; transition: opacity .2s; }
.drawer-overlay[hidden] { display: none; }
.drawer-overlay.open { opacity: 1; }
.drawer {
  width: 470px; max-width: 92vw; height: 100%; background: var(--surface);
  display: flex; flex-direction: column; box-shadow: -10px 0 44px rgba(0,0,0,0.20);
  transform: translateX(100%); transition: transform .22s ease;
}
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.drawer-name { font-weight: 700; font-size: 15px; }
.drawer-email { font-size: 12.5px; color: var(--text-3); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 22px; }
.drawer-section { display: grid; gap: 10px; }
.drawer-admin-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--border); border-radius: 11px; padding: 13px 15px; }
.dar-text { display: flex; flex-direction: column; }
.dar-text b { font-size: 13.5px; }
.dar-text span { font-size: 12px; color: var(--text-3); }
.drawer-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.drawer .ua-perms { max-width: none; }

/* ----- (legacy) expandable user blocks ----- */
.user-block { border-bottom: 1px solid var(--border); }
.user-block:last-of-type { border-bottom: none; }
.user-block.open { background: var(--surface-2); border-radius: var(--radius-sm); }
.user-expand { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 4px; display: flex; align-items: center; flex-shrink: 0; }
.user-expand svg { width: 18px; height: 18px; fill: currentColor; transition: transform .15s; }
.user-block.open .user-expand svg { transform: rotate(90deg); }
.user-access { padding: 4px 10px 18px 52px; display: grid; gap: 16px; }
.ua-section { display: grid; gap: 8px; }
.ua-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.ua-grid { grid-template-columns: repeat(var(--cols, 6), minmax(124px, 1fr)); min-width: 560px; }

.company-grants { display: flex; flex-wrap: wrap; gap: 8px; }
.grant-chip {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none;
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 13px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface);
  transition: border-color .12s, background .12s, color .12s;
}
.grant-chip:hover { border-color: var(--border-strong); }
.grant-chip input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.grant-chip::before {
  content: "✓"; width: 17px; height: 17px; flex-shrink: 0; border-radius: 5px;
  border: 1.5px solid var(--border-strong); display: grid; place-items: center;
  font-size: 11px; line-height: 1; color: transparent; transition: all .12s;
}
.grant-chip.on { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.grant-chip.on::before { background: var(--green); border-color: var(--green); color: #fff; }

/* ----- notifications ----- */
.notif-btn {
  position: relative; border: 1px solid var(--border); background: var(--surface);
  border-radius: 9px; width: 38px; height: 38px; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--text-2);
}
.notif-btn:hover { background: var(--surface-2); color: var(--text); }
.notif-btn svg { width: 18px; height: 18px; fill: currentColor; }
.notif-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}
.notif-list { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.notif-item {
  border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-size: 13px;
  display: flex; flex-direction: column; gap: 3px;
}
.notif-item.unread { border-color: var(--accent); background: var(--accent-soft); }
.notif-item[data-notif-go] { cursor: pointer; }
.notif-when { color: var(--text-3); font-size: 11px; }

/* =========================================================
   Interface style picker (Settings → Branding)
   ========================================================= */
.skin-options { display: grid; gap: 12px; max-width: 640px; }
.skin-option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.skin-option:hover { border-color: var(--border-strong); }
.skin-option.active { border-color: var(--accent); background: var(--accent-soft); }
.skin-meta { display: flex; flex-direction: column; gap: 2px; }
.skin-meta b { font-size: 13.5px; }
.skin-meta span { font-size: 12px; color: var(--text-3); }
.skin-check { margin-left: auto; color: var(--accent); font-weight: 800; font-size: 15px; }
.skin-swatch { display: flex; gap: 3px; padding: 7px; border-radius: 9px; flex-shrink: 0; }
.skin-swatch i { width: 9px; height: 26px; border-radius: 3px; display: block; }
.skin-swatch-lifecycle { background: #101322; }
.skin-swatch-lifecycle i:nth-child(1) { background: #4f46e5; }
.skin-swatch-lifecycle i:nth-child(2) { background: #ffffff; }
.skin-swatch-lifecycle i:nth-child(3) { background: #8b91a0; }
.skin-swatch-procuretrack { background: #fafafa; border: 1px solid rgba(0,0,0,0.10); }
.skin-swatch-procuretrack i:nth-child(1) { background: #030213; }
.skin-swatch-procuretrack i:nth-child(2) { background: #ececf0; }
.skin-swatch-procuretrack i:nth-child(3) { background: #dbeafe; }

/* =========================================================
   Skin: ProcureTrack — near-black on near-white, light sidebar,
   flat bordered cards (no shadow), pastel rounded chips.
   Token overrides scoped by theme; structural overrides below.
   ========================================================= */
[data-skin="procuretrack"]:not([data-theme="dark"]) {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f3f3f5;
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.17);
  --text: #030213;
  --text-2: #56565f;
  --text-3: #797986;
  --accent: #030213;
  --accent-hover: #22223a;
  --accent-soft: #ececf0;
  --accent-soft-text: #030213;
  --sidebar-bg: #fafafa;
  --sidebar-text: #55555f;
  --sidebar-active: #030213;
  --hover: #f5f5f7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.14);
}
[data-skin="procuretrack"][data-theme="dark"] {
  --bg: #0b0b0c;
  --surface: #161617;
  --surface-2: #202022;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.20);
  --text: #fafafa;
  --text-2: #b6b6bd;
  --text-3: #8a8a93;
  --accent: #fafafa;
  --accent-hover: #e6e6e6;
  --accent-soft: #262629;
  --accent-soft-text: #fafafa;
  --sidebar-bg: #161617;
  --sidebar-text: #a2a2aa;
  --sidebar-active: #fafafa;
  --hover: #1e1e20;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
}

/* structural — flat, border-led elevation */
[data-skin="procuretrack"] .sidebar { border-right: 1px solid var(--border); }
[data-skin="procuretrack"] .brand-name { color: var(--text); }
[data-skin="procuretrack"] .brand-mark { box-shadow: none; }
[data-skin="procuretrack"] .nav-item:hover { color: var(--text); background: rgba(0, 0, 0, 0.05); }
[data-skin="procuretrack"][data-theme="dark"] .nav-item:hover { background: rgba(255, 255, 255, 0.06); }
[data-skin="procuretrack"] .nav-item.active { color: var(--sidebar-active); background: rgba(0, 0, 0, 0.07); font-weight: 600; }
[data-skin="procuretrack"][data-theme="dark"] .nav-item.active { background: rgba(255, 255, 255, 0.09); }
[data-skin="procuretrack"] .nav-badge { background: var(--accent); color: var(--surface); }
[data-skin="procuretrack"] .sidebar-footer { border-top: 1px solid var(--border); }
[data-skin="procuretrack"] .btn-primary { box-shadow: none; color: var(--surface); }
[data-skin="procuretrack"] .btn { box-shadow: none; }
[data-skin="procuretrack"] .btn:hover { border-color: var(--border-strong); }
[data-skin="procuretrack"] .stat:hover { box-shadow: none; transform: none; border-color: var(--border-strong); }

/* pastel rounded chips (light only — dark keeps the translucent tints) */
[data-skin="procuretrack"] .pill { border-radius: 999px; }
[data-skin="procuretrack"]:not([data-theme="dark"]) .pill-gray   { background: #f3f4f6; color: #374151; }
[data-skin="procuretrack"]:not([data-theme="dark"]) .pill-blue   { background: #dbeafe; color: #1d4ed8; }
[data-skin="procuretrack"]:not([data-theme="dark"]) .pill-amber  { background: #fef3c7; color: #b45309; }
[data-skin="procuretrack"]:not([data-theme="dark"]) .pill-purple { background: #f3e8ff; color: #7e22ce; }
[data-skin="procuretrack"]:not([data-theme="dark"]) .pill-green  { background: #dcfce7; color: #15803d; }
[data-skin="procuretrack"]:not([data-theme="dark"]) .pill-red    { background: #fee2e2; color: #b91c1c; }
[data-skin="procuretrack"]:not([data-theme="dark"]) .pill-indigo { background: #e0e7ff; color: #4338ca; }
[data-skin="procuretrack"]:not([data-theme="dark"]) .pill-teal   { background: #ccfbf1; color: #0f766e; }

/* =========================================================
   High-end UI: company logos, switcher, dashboard summary
   ========================================================= */
.co-mark { display: inline-grid; place-items: center; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); }
.co-mark img { width: 100%; height: 100%; object-fit: contain; }
.co-mark.co-initial { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color: #fff; font-weight: 700; border: none; }

/* company chip on case rows */
.co-chip { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 1px 8px 1px 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; font-weight: 600; color: var(--text-2); vertical-align: middle; white-space: nowrap; max-width: 100%; }
.person-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; }
.co-chip .co-mark { border-radius: 4px; }

/* company switcher (topbar): logo + name button + dropdown */
.company-switcher { position: relative; }
.company-cur { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 10px; cursor: pointer; max-width: 230px; }
.company-cur:hover { background: var(--surface-2); }
.company-cur-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-cur-chev { width: 16px; height: 16px; fill: var(--text-3); flex-shrink: 0; }
.company-pill.company-cur { cursor: default; }
.company-pill.company-cur:hover { background: var(--surface); }
.company-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 224px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 45; display: grid; gap: 2px; }
.company-menu[hidden] { display: none; }
.company-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }
.company-opt:hover { background: var(--surface-2); }
.company-opt.active { font-weight: 600; }
.company-opt > span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-check { width: 16px; height: 16px; fill: var(--green); flex-shrink: 0; }

/* dashboard: per-company open-case summary */
.co-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.co-summary-card { display: flex; align-items: center; gap: 13px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s; }
.co-summary-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.co-summary-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.co-summary-text { min-width: 0; }
.co-summary-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-summary-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.co-summary-sub b { color: var(--text); font-weight: 700; }

/* Clickable request cards + request detail */
.req-card-click { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.req-card-click:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.req-card-click:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.req-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.req-card-foot .muted { font-size: 12.5px; }
.req-view-link { font-size: 12.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.req-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.req-pass-hint { font-size: 12.5px; color: var(--text-3); background: var(--accent-soft); color: var(--accent-soft-text); border-radius: var(--radius-sm); padding: 9px 12px; margin-top: 16px; }

.list-section-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: 26px 0 12px; }
.list-section-head span { background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; letter-spacing: 0; }

/* Per-step notification preferences (notification modal) */
.notif-prefs { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.notif-prefs-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 8px; }
.notif-prefs .switch-row { padding: 7px 0; }

/* Grouped settings forms (email, ssl, etc.) */
.form-section-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: 22px 0 12px; }
.form-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.test-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.test-row-text { flex: 1 1 220px; min-width: 0; }
.test-row-text b { font-size: 14px; }
.test-row input { flex: 0 1 240px; min-width: 160px; }

/* Personal details / employee documents */
.sec-opt { font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin-left: 8px; }
.doc-slot { padding: 11px 0; border-bottom: 1px solid var(--border); }
.doc-slot:last-child { border-bottom: none; }
.doc-slot-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.doc-slot-label { font-size: 13px; font-weight: 600; }
.doc-empty { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); margin-top: 6px; }
.doc-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); flex-shrink: 0; }
.doc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; font-size: 13px; }
.doc-size { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; }
.doc-act { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--border); flex-shrink: 0; background: none; font-family: inherit; line-height: 1.5; cursor: pointer; }
.doc-act:hover { background: var(--surface); border-color: var(--accent); }
.doc-del { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 5px; border-radius: 6px; }
.doc-del:hover { background: var(--red-soft); color: var(--red); }
.doc-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.doc-upload select { max-width: 200px; }

/* Backup runs list + restore */
.panel-note.red { background: var(--red-soft); border-color: #f3c9c9; color: var(--red); }
.backup-runs { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.backup-run { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.backup-run:last-child { border-bottom: none; }
.backup-run-main { flex: 1; min-width: 0; font-size: 13px; }
.backup-run-main .notif-when { margin-top: 2px; }

/* Analytics */
.an-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.an-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.an-tile-label { font-size: 12px; color: var(--text-3); font-weight: 600; }
.an-tile-value { font-size: 25px; font-weight: 700; margin: 4px 0 2px; letter-spacing: -.01em; }
.an-tile-sub { font-size: 12px; color: var(--text-3); }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.bar-chart { display: flex; align-items: stretch; gap: 10px; height: 160px; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bar-track { flex: 1; width: 100%; max-width: 38px; margin: 0 auto; display: flex; align-items: flex-end; }
.bar { width: 100%; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, transparent)); border-radius: 6px 6px 0 0; min-height: 3px; transition: height .35s ease; }
.bar-label { font-size: 11px; color: var(--text-3); }
.bar-val { font-size: 11px; font-weight: 600; color: var(--text-2); }
.an-foot { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }
.an-foot b { color: var(--text); font-weight: 700; }

/* In-content page action bar (New starter / New request) */
.page-actions { display: flex; justify-content: flex-end; margin-bottom: 16px; }


/* Analytics v2: filter, two-up rows, horizontal bars, headcount pairs */
.an-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 22px; }
.an-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.an-chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 7px 15px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color .12s, background .12s; }
.an-chip:hover { border-color: var(--accent); }
.an-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Period = compact segmented control, visually distinct from the company filter */
.an-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.an-period { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.an-period-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: 0 6px 0 8px; }
.an-period .an-chip { border: none; background: transparent; padding: 5px 13px; }
.an-period .an-chip:hover { color: var(--text); }
.an-period .an-chip.active { background: var(--accent); color: #fff; }
/* Side-by-side cards are equal height (stretch) with content anchored at the TOP
   (no centering/space-evenly). A shorter card just has normal padding below — never a
   top gap, floating content, or mismatched heights. */
.an-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; align-items: stretch; }
@media (max-width: 860px) { .an-row2 { grid-template-columns: 1fr; } }
.an-row2 > .card { display: flex; flex-direction: column; }
.an-row2 > .card .card-body { flex: 1; }
.hbars { display: flex; flex-direction: column; gap: 13px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hbar-track { background: var(--surface-2); border-radius: 6px; height: 10px; overflow: hidden; }
.hbar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, transparent)); border-radius: 6px; }
.hbar-val { font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.bar-track-pair { display: flex; align-items: flex-end; justify-content: center; gap: 5px; max-width: 48px; }
.bar-track-pair .bar { width: 42%; }
.bar-red { background: linear-gradient(180deg, var(--red), color-mix(in srgb, var(--red) 55%, transparent)) !important; }
.an-legend { display: flex; gap: 16px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-acc::before { background: var(--accent); }
.lg-red::before { background: var(--red); }

/* Companies tab */
.co-list { display: flex; flex-direction: column; }
.co-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.co-row:last-child { border-bottom: none; }
.co-logo { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color: #fff; font-weight: 700; font-size: 16px; }
.co-logo img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.co-main { flex: 1; min-width: 160px; }
.co-name-input { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; margin-left: -8px; font: inherit; font-size: 14.5px; font-weight: 600; transition: border-color .15s, box-shadow .15s; }
.co-name-input:hover { border-color: var(--border-strong); }
.co-name-input:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.co-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; padding-left: 1px; }
.co-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

/* Company comparison bars */
.cmp-cell { display: flex; align-items: center; gap: 10px; }
.cmp-bar { flex: 1; max-width: 110px; min-width: 40px; height: 8px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.cmp-bar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }

/* In-page document preview modal */
.modal-doc-preview { max-width: min(960px, 94vw); }
.modal-doc-preview .doc-preview-head { padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--border); }
.modal-doc-preview .doc-preview-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 58vw; }
.doc-preview-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.modal-doc-preview .doc-preview-body { padding: 0; }
.doc-preview-stage { display: flex; align-items: center; justify-content: center; background: var(--surface-2); min-height: 60vh; max-height: 76vh; overflow: auto; padding: 18px; border-radius: 0 0 16px 16px; }
.doc-preview-stage img { max-width: 100%; max-height: 74vh; object-fit: contain; border-radius: 6px; box-shadow: var(--shadow-lg); }
.doc-preview-frame { width: 100%; height: 76vh; border: 0; display: block; background: var(--surface-2); border-radius: 0 0 16px 16px; }
.doc-preview-none { color: var(--text-3); font-size: 13.5px; }

/* Company filter bar above list views */
.list-filter { margin-bottom: 16px; }

/* Backup row actions (Restore + delete) */
.backup-run-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Explicit save button in the user profile drawer */
.drawer-save-row { display: flex; justify-content: flex-end; margin-top: 12px; }

/* HR/IT owner chips on the onboarding checklist */
.owner-chip { display: inline-flex; align-items: center; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; margin-right: 8px; vertical-align: middle; color: #fff; }
.owner-hr { background: var(--accent); }
.owner-it { background: #0d9488; } /* teal — distinct from the accent */
.check-group-head .cgh-title { display: inline-flex; align-items: center; min-width: 0; }
.check-legend { font-size: 12px; color: var(--text-2); display: flex; align-items: center; flex-wrap: wrap; line-height: 1.8; }

/* v2 Companies — sections & tags config */
.cfg-section { padding: 14px 0; border-bottom: 1px solid var(--border); }
.cfg-section:last-of-type { border-bottom: none; }
.cfg-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cfg-section-name { font-size: 13.5px; font-weight: 700; }
.cfg-section-name-input { font-size: 13.5px; font-weight: 700; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 4px 8px; margin-left: -8px; }
.cfg-section-name-input:hover { border-color: var(--border-strong); }
.cfg-section-name-input:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.cfg-builtin { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); padding: 2px 7px; border-radius: 5px; }
.cfg-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cfg-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; background: var(--accent-soft); color: var(--accent-soft-text); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 999px; padding: 4px 12px; }
/* When the chip carries a ✕ delete button (Companies config), tighten the right side. */
.cfg-tag:has(button) { padding-right: 6px; }
.cfg-tag button { border: none; background: none; color: inherit; cursor: pointer; opacity: .55; font-size: 13px; line-height: 1; padding: 0 2px; }
.cfg-tag button:hover { opacity: 1; }
.cfg-tag-input { font: inherit; font-size: 12.5px; border: 1px dashed var(--border-strong); background: transparent; border-radius: 999px; padding: 5px 12px; min-width: 130px; }
.cfg-tag-input:focus { outline: none; border-style: solid; border-color: var(--accent); }

/* v2 New Request — multi-select tag pickers */
.req-section { margin-bottom: 16px; }
.req-section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 8px; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-opt { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.tag-opt:hover { border-color: var(--accent); }
.tag-opt.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* v2 record detail + approvals */
.callout-warn {
  margin: 16px 0;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--warn, #d97706) 32%, var(--border));
  border-left: 3px solid var(--warn, #d97706);
  background: color-mix(in srgb, var(--warn, #d97706) 9%, var(--surface));
}
.callout-warn b { display: block; color: var(--warn, #b45309); font-size: 12.5px; margin-bottom: 3px; }
.callout-warn p { margin: 0; font-size: 13px; white-space: pre-wrap; color: var(--text-2); }
.doc-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.doc-meta b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta .muted { font-size: 12px; }
.doc-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.dl { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.dl-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-soft, var(--border)); }
.dl-row:last-child { border-bottom: 0; }
.dl-row dt { color: var(--text-3); font-size: 12.5px; margin: 0; }
.dl-row dd { margin: 0; font-size: 13.5px; }
.dl-subhead { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 12px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 3px; flex: none; z-index: 1; }
.tl-body { font-size: 13.5px; }
.tl-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.approval-card { border: 1px solid var(--accent); }
.dec-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-soft, var(--border)); }
.dec-row:last-of-type { border-bottom: 0; }
.dec-main { flex: 1; min-width: 0; }
.dec-row .seg { flex: none; margin-top: 2px; }
.dec-label { font-size: 13.5px; font-weight: 600; }
.seg button.on { background: var(--accent); color: #fff; }
.seg button[data-v="rejected"].on { background: var(--danger, #dc2626); color: #fff; }

/* v2 onboarding / offboarding tick-offs */
.ob-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ob-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ob-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.ob-count { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.ob-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-tag { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 14px 6px 10px; font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; transition: background .12s, border-color .12s, color .12s; }
.ob-tag:hover { border-color: var(--accent); }
.ob-tag input { position: absolute; opacity: 0; width: 0; height: 0; }
.ob-check { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong, #c7c9d1); display: inline-flex; align-items: center; justify-content: center; flex: none; transition: background .12s, border-color .12s; }
.ob-tag.done { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: var(--accent); color: var(--text); }
.ob-tag.done .ob-check { background: var(--accent); border-color: var(--accent); }
.ob-tag.done .ob-check::after { content: ""; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -2px; }
.cfg-tag.done { border-color: var(--accent); color: var(--text); }

/* v2 request form — type-to-add custom tag */
.tag-type { border: 1px dashed var(--border-strong, #c7c9d1); background: transparent; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; color: var(--text); min-width: 90px; width: 90px; transition: width .15s, border-color .12s; }
.tag-type:focus { outline: none; border-color: var(--accent); width: 160px; }
.tag-type::placeholder { color: var(--text-3); }

/* v2 request form — queued documents */
.doc-queue { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2, var(--surface)); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px 6px 12px; font-size: 12.5px; }
.doc-chip-x { border: 0; background: transparent; cursor: pointer; color: var(--text-3); font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.doc-chip-x:hover { color: var(--red, #dc2626); background: color-mix(in srgb, #dc2626 12%, transparent); }

/* v2 admin search */
.search-bar { display: flex; gap: 10px; align-items: center; }
.search-bar #searchInput { flex: 1; }

/* account button in sidebar footer */
.user-card .uc-text { background: transparent; border: 0; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; text-align: left; min-width: 0; display: flex; flex-direction: column; }
.user-card .uc-text:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }

/* account modal */
.account-modal .acct-id { display: flex; align-items: center; gap: 12px; }
.account-modal .acct-id .avatar { width: 40px; height: 40px; font-size: 14px; flex: none; }
.acct-id-text { display: flex; flex-direction: column; min-width: 0; }
.acct-id-text b { font-size: 14px; }
.acct-section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.acct-head { font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.acct-section .field { margin-bottom: 8px; }

/* search tag suggestions */
.search-combo { position: relative; flex: 1; }
.search-combo #searchInput { width: 100%; }
.search-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.20); padding: 4px; }
.suggest-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.suggest-item:hover { background: var(--accent-soft); color: var(--accent-soft-text); }

/* record avatar photos */
.avatar.rec-photo { padding: 0; overflow: hidden; }
.avatar.rec-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-person .avatar { flex: none; }
.avatar-btn { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; line-height: 0; }
.avatar-btn .avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface); }
.avatar-btn .avatar-cam svg { width: 11px; height: 11px; fill: #fff; }
/* new-request photo picker */
.req-photo { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.req-photo-preview { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex: none; border: 1px solid var(--border); }
.req-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.req-photo-ph { width: 34px; height: 34px; fill: var(--text-3); }

.req-photo-preview { cursor: pointer; }

/* avatar cropper */
.cropper { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.crop-stage { position: relative; border-radius: 12px; overflow: hidden; background: #111; touch-action: none; }
.crop-stage canvas { display: block; cursor: grab; touch-action: none; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-ring { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.crop-controls { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 300px; }
.crop-controls input[type=range] { flex: 1; }
.crop-zoom-ic { color: var(--text-3); font-weight: 700; width: 12px; text-align: center; font-size: 16px; }

.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* controls relocated from the topbar into the sidebar (above the profile) */
.sidebar-controls { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 4px; }
.sidebar-controls .topbar-prefs { display: flex; align-items: center; gap: 6px; }
/* recolour to the sidebar palette so the icons don't read as harsh white boxes */
.sidebar-controls .notif-btn,
.sidebar-controls .pref-btn { background: transparent; border: 0; color: var(--sidebar-text); }
.sidebar-controls .pref-btn svg { fill: var(--sidebar-text); }
.sidebar-controls .notif-btn:hover,
.sidebar-controls .pref-btn:hover { background: color-mix(in srgb, var(--sidebar-text) 16%, transparent); color: var(--sidebar-active); }
.sidebar-controls .pref-btn:hover svg { fill: var(--sidebar-active); }

.dash-cofilter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.cofilter-chip { display: inline-flex; align-items: center; gap: 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 24px 8px 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.cofilter-chip:hover { border-color: var(--accent); }
.cofilter-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-soft-text); box-shadow: 0 0 0 1px var(--accent); }
.dchip-logo { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; background: var(--accent-soft); color: var(--accent-soft-text); font-size: 22px; font-weight: 700; flex: none; }
.dchip-logo img { width: 100%; height: 100%; object-fit: cover; }
.dchip-all { width: 60px; height: 60px; background: var(--border); }
.dchip-all svg { width: 26px; height: 26px; fill: var(--text-2); }

.avatar-modal-preview { display: inline-flex; }
.avatar-modal-preview .avatar { width: 96px; height: 96px; font-size: 34px; }

/* sortable table headers (Employees) */
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--text); }
.th-sort.active { color: var(--accent); }
