/* HR Command UI kit shared styles */
@import url("/css/tokens.css");

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

html, body {
  min-height: 100%;
  background: var(--grad-app-bg);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
button:disabled, .btn:disabled, .icon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--ops-rail);
  border-right: 1px solid var(--ops-border);
  padding: 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 14px;
  border-bottom: 1px solid var(--ops-border-soft);
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--ops-red-soft);
  border: 1px solid var(--ops-red-line);
  color: var(--ops-red);
  font-size: 20px;
  font-weight: 800;
  flex: none;
}
.brand-logo {
  display: block;
  width: 156px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.08));
}
.brand .mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #4f6bff 0%, #22d3ee 100%);
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(34,211,238,0.30), inset 0 1px 0 rgba(255,255,255,0.35);
}
.brand .name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-name {
  font-size: 13px;
  line-height: 1.15;
  font-weight: 750;
  color: var(--fg-1);
}
.brand-sub {
  margin-top: 2px;
  color: var(--ops-red);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  min-height: 38px;
  padding: 8px 11px; border-radius: 8px;
  font-size: 13px; color: var(--fg-2); font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast);
}
.nav a:hover { background: var(--bg-3); color: var(--fg-1); }
.nav a.active {
  background: var(--ops-red-soft);
  color: var(--ops-red);
  border-color: var(--ops-red-line);
  box-shadow: none;
}
.nav a.active .dot {
  display: none;
}
.nav .group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-4);
  padding: 10px 12px 4px;
}

.sidebar-foot {
  border-top: 1px solid var(--ops-border-soft);
  padding: 14px 8px 0;
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: var(--fg-on-accent);
  letter-spacing: 0.02em;
}

/* ---------- Top bar ---------- */
.topbar {
  height: 68px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--ops-border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 {
  min-width: 220px;
  font-size: 22px; font-weight: 760; letter-spacing: 0;
}
.topbar .crumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--fg-3);
  background: var(--bg-3); border: 1px solid var(--border-1);
  padding: 4px 10px; border-radius: 999px;
}
.topbar .spacer { flex: 1; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  position: relative;
  width: min(470px, 38vw);
}
.topbar .search input[type="search"]:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]) {
  width: 100%;
  height: 40px;
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: 8px;
  padding: 0 42px 0 14px;
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.4;
  outline: none;
}
.topbar .search input[type="search"]:focus {
  border-color: var(--ops-red-line);
  box-shadow: 0 0 0 3px rgba(215,25,32,0.10);
}
.search svg {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--fg-3);
  pointer-events: none;
  z-index: 1;
}
.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 380px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 30;
}
.search-state {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--fg-3);
}
.search-error {
  color: var(--brand-500);
}
.search-group + .search-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-1);
}
.search-group-label {
  padding: 4px 8px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.search-result {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-1);
  text-decoration: none;
}
.search-result:hover,
.search-result:focus {
  background: var(--bg-4);
  outline: none;
}
.search-result-type {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.search-result-main {
  font-size: 13px;
  font-weight: 650;
}
.search-result-sub {
  font-size: 12px;
  color: var(--fg-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--ops-surface); border: 1px solid var(--ops-border);
  display: grid; place-items: center; color: var(--fg-2);
  position: relative;
  transition: all var(--dur-fast);
}
.icon-btn:hover { background: var(--bg-4); color: var(--fg-1); }
.icon-btn .badge {
  position: absolute; top: -3px; right: -3px;
  width: 16px; height: 16px; border-radius: 999px;
  background: var(--ops-red);
  font-size: 10px; font-weight: 700; color: #fff;
  display: grid; place-items: center;
  border: 2px solid var(--bg-1);
}

.notifications {
  position: relative;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, calc(100vw - 32px));
  max-height: 520px;
  overflow-y: auto;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 35;
}
.notification-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--border-1);
}
.notification-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-1);
}
.notification-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--fg-3);
}
.notification-mark {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-300);
  padding: 4px 0;
  white-space: nowrap;
}
.notification-mark:hover {
  color: var(--accent-200);
  text-decoration: underline;
}
.notification-state {
  padding: 16px 10px;
  font-size: 13px;
  color: var(--fg-3);
}
.notification-error {
  color: var(--brand-500);
}
.notification-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}
.notification-group + .notification-group {
  border-top: 1px solid var(--border-1);
  padding-top: 8px;
}
.notification-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: left;
}
.notification-item:hover,
.notification-item:focus {
  background: var(--bg-4);
  outline: none;
}
.notification-item.is-read {
  opacity: 0.62;
}
.notification-severity {
  align-self: start;
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.notification-severity.is-critical {
  background: rgba(239,68,68,0.14);
  color: var(--danger-400);
}
.notification-severity.is-warning {
  background: rgba(245,158,11,0.14);
  color: var(--warn-400);
}
.notification-severity.is-notice {
  background: rgba(59,130,246,0.14);
  color: var(--info-400);
}
.notification-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.notification-item-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--fg-1);
}
.notification-item-body {
  font-size: 12px;
  color: var(--fg-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: 8px;
}
.user-chip .name { font-size: 13px; font-weight: 600; }
.user-chip .email { font-size: 11px; color: var(--fg-3); }

/* ---------- Main ---------- */
.main {
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--ops-frame);
}

/* ---------- Cards ---------- */
.card-base {
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.06);
  position: relative;
  overflow: hidden;
}
.card-base h3 {
  font-size: 15px; font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.005em;
}
.card-soft {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* KPI card with gradient edge */
.kpi-card {
  position: relative;
  display: block;
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.05);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base);
}
.kpi-card::before { content: none; }
.kpi-card:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(23, 32, 42, 0.08); }
.kpi-card.kpi-link:focus-visible { outline: 3px solid rgba(215,25,32,0.18); outline-offset: 2px; }

.kpi-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kpi-label { font-size: 12px; font-weight: 700; letter-spacing: 0; color: var(--fg-2); }
.kpi-value { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1; margin-top: 8px; letter-spacing: 0; }
.kpi-sub { font-size: 11px; color: var(--fg-3); margin-top: 6px; }
.kpi-chip {
  width: 46px; height: 46px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--ops-red-soft);
  border: 1px solid var(--ops-red-line);
  color: var(--ops-red);
}
.kpi-card.good .kpi-chip { background: var(--ops-teal-soft); border-color: rgba(0,143,149,0.22); color: var(--ops-teal); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 700;
  border: 1px solid transparent;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 6px; }
.btn-primary {
  background: var(--ops-red);
  color: #fff;
  box-shadow: 0 6px 18px rgba(215,25,32,0.16);
}
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary {
  background: var(--bg-3); color: var(--fg-1); border-color: var(--border-2);
}
.btn-secondary:hover { background: var(--bg-4); border-color: var(--border-3); }
.btn-ghost { background: transparent; color: var(--fg-2); }
.btn-ghost:hover { color: var(--fg-1); background: var(--bg-3); }
.btn-danger {
  background: var(--brand-500); color: #fff;
  box-shadow: 0 0 0 1px rgba(214,59,45,0.35), 0 6px 18px rgba(214,59,45,0.20);
}
.btn-danger:hover { background: var(--brand-600); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.badge .dot { width: 6px; height: 6px; border-radius: 999px; }
.badge.ok   { background: rgba(16,185,129,0.14);  color: var(--success-400); }
.badge.warn { background: rgba(245,158,11,0.14);  color: var(--warn-400); }
.badge.bad  { background: rgba(239,68,68,0.14);   color: var(--danger-400); }
.badge.info { background: rgba(59,130,246,0.14);  color: var(--info-400); }
.badge.teal { background: rgba(34,211,238,0.14);  color: var(--accent-300); }
.badge.neutral { background: var(--bg-4); color: var(--fg-2); }
.badge.brand { background: rgba(214,59,45,0.14); color: var(--brand-300); }

/* ---------- Table ---------- */
.table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.table thead th {
  text-align: left; padding: 12px 14px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fg-3);
  background: var(--ops-surface-soft);
  border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
}
.table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border-1); color: var(--fg-2); vertical-align: middle; }
.table tbody tr:hover td { background: var(--ops-surface-soft); }
.table .name { display: flex; align-items: center; gap: 10px; color: var(--fg-1); font-weight: 500; }
.mono-num { font-family: var(--font-mono); color: var(--fg-2); font-size: 12px; }
.mono-dim { font-family: var(--font-mono); color: var(--fg-3); font-size: 12px; }
.tabular-nums {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- Micro label ---------- */
.eyebrow, .micro-lbl {
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fg-3);
}

/* ---------- Activity list ---------- */
.activity { display: flex; flex-direction: column; }
.activity-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-1);
}
.activity-row:last-child { border-bottom: none; }
.activity-row .icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
}
.activity-row .text { flex: 1; font-size: 13px; color: var(--fg-1); }
.activity-row .text b { color: var(--fg-1); font-weight: 600; }
.activity-row .time { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
.field input, .field select, .field textarea {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--fg-1);
  font-size: 13px;
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.18);
}
.field-help {
  font-size: 12px;
  color: var(--fg-3);
}
.field-error {
  font-size: 12px;
  color: var(--danger-400);
}
.field-control,
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]),
select,
textarea {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  color: var(--fg-1);
  outline: none;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]),
select,
textarea {
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.4;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):focus,
select:focus,
textarea:focus,
.field-control:focus {
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.18);
}
input::placeholder, textarea::placeholder {
  color: var(--fg-4);
}
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  color: var(--fg-2);
}
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent-400);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-2);
}
.checkbox-row a {
  color: var(--accent-300);
}

/* ---------- Alerts / Surfaces ---------- */
.flash-banner {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  border: 1px solid transparent;
}
.flash-success {
  background: var(--success-bg);
  border-color: rgba(16,185,129,0.25);
  color: var(--success-400);
}
.flash-error {
  background: var(--danger-bg);
  border-color: rgba(239,68,68,0.25);
  color: var(--danger-400);
}
.flash-warn {
  background: var(--warn-bg);
  border-color: rgba(245,158,11,0.25);
  color: var(--warn-400);
}
.flash-info {
  background: var(--info-bg);
  border-color: rgba(59,130,246,0.25);
  color: var(--info-400);
}
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}
.surface-muted {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
}
.surface-success {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md);
}
.surface-danger {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-md);
}
.surface-warn {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
}
.surface-info {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-md);
}
.progress-track {
  height: 6px;
  width: 100%;
  border-radius: 999px;
  background: var(--bg-5);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent-400);
  transition: width var(--dur-base) var(--ease-out);
}

/* ---------- Links / Copy ---------- */
.link-accent {
  color: var(--accent-300);
  transition: color var(--dur-fast) var(--ease-out);
}
.link-accent:hover { color: var(--accent-200); text-decoration: underline; }
.link-muted {
  color: var(--fg-3);
  transition: color var(--dur-fast) var(--ease-out);
}
.link-muted:hover { color: var(--fg-1); }
.copy-strong { color: var(--fg-1); font-weight: 600; }
.copy-muted { color: var(--fg-3); }
.copy-subtle { color: var(--fg-4); }
.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Auth ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-wrap {
  width: 100%;
  max-width: 420px;
}
.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.auth-brand img {
  width: 176px;
  max-width: 100%;
  height: auto;
}
.auth-card {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.auth-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.auth-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--fg-1);
}
.auth-subtitle {
  font-size: 13px;
  color: var(--fg-3);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.auth-footer-link {
  font-size: 12px;
  color: var(--accent-300);
}
.auth-footer-link:hover {
  color: var(--accent-200);
  text-decoration: underline;
}

/* ---------- Breeze Compatibility ---------- */
.dropdown-panel {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-lg);
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 13px;
  color: var(--fg-2);
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--bg-4);
  color: var(--fg-1);
  outline: none;
}
.inline-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-3);
}
.inline-nav-link:hover { color: var(--fg-1); border-bottom-color: var(--border-2); }
.inline-nav-link.active {
  color: var(--accent-300);
  border-bottom-color: var(--accent-400);
}
.responsive-nav-link {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-3);
}
.responsive-nav-link:hover {
  background: var(--bg-3);
  color: var(--fg-1);
  border-left-color: var(--border-2);
}
.responsive-nav-link.active {
  background: rgba(34,211,238,0.12);
  color: var(--accent-300);
  border-left-color: var(--accent-400);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Helpers ---------- */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.stack-xs { display: flex; flex-direction: column; gap: 8px; }
.dashboard-shell { display: flex; flex-direction: column; gap: 16px; }
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--ops-border);
  border-radius: 8px;
  background: var(--ops-surface);
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 700;
}
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ops-border-soft);
  margin: -2px -2px 14px;
}
.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--fg-1);
}
.panel-subtitle {
  margin-top: 2px;
  color: var(--fg-3);
  font-size: 12px;
}
.panel-link {
  color: var(--ops-teal);
  font-size: 12px;
  font-weight: 800;
}
.panel-link:hover { color: var(--ops-red); }
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ops-border-soft);
  margin-top: 16px;
}
.metric-strip > div {
  padding: 14px 12px 0;
  text-align: center;
  border-left: 1px solid var(--ops-border-soft);
}
.metric-strip > div:first-child { border-left: 0; }
.metric-value {
  color: var(--fg-1);
  font-size: 22px;
  font-weight: 800;
}
.metric-label {
  margin-top: 4px;
  color: var(--fg-3);
  font-size: 11px;
}
.dashboard-table-wrap {
  overflow-x: auto;
  margin: 0 -20px -18px;
}
.dashboard-table-wrap .table { min-width: 620px; }
.empty-panel {
  padding: 26px 0;
  color: var(--fg-3);
  font-size: 13px;
  text-align: center;
}
.alert-review-focus {
  border-color: var(--ops-red-line);
  box-shadow: 0 0 0 3px rgba(215,25,32,0.10), 0 14px 30px rgba(23, 32, 42, 0.08);
}

/* ---------- Calls Workspace ---------- */
.calls-shell {
  gap: 16px;
}
.calls-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.calls-page-header h2 {
  margin: 0;
  color: var(--fg-1);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}
.calls-page-header p {
  margin-top: 4px;
  color: var(--fg-3);
  font-size: 13px;
}
.calls-page-header p span {
  color: var(--fg-2);
  font-weight: 700;
}
.calls-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.calls-stat-card {
  padding: 16px;
}
.calls-stat-card .kpi-value {
  margin-top: 10px;
  color: var(--fg-1);
  font-size: 28px;
}
.calls-form-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.calls-form-card .panel-header {
  margin-bottom: 0;
}
.calls-form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
}
.calls-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.calls-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.calls-section-header.compact {
  margin-bottom: 8px;
}
.calls-section-header h3 {
  margin: 0;
  color: var(--fg-1);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}
.calls-section-header p {
  margin-top: 3px;
  color: var(--fg-3);
  font-size: 12px;
}
.calls-segmented,
.calls-report-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ops-border);
  border-radius: 8px;
  background: var(--ops-surface);
}
.calls-segment,
.calls-report-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.calls-segment:hover,
.calls-report-tabs a:hover {
  background: var(--ops-surface-soft);
  color: var(--fg-1);
}
.calls-segment.is-active,
.calls-report-tabs a.is-active {
  background: var(--ops-red-soft);
  color: var(--ops-red);
  box-shadow: inset 0 0 0 1px var(--ops-red-line);
}
.calls-report-tabs {
  justify-content: flex-start;
  width: fit-content;
}
.calls-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(2, minmax(150px, 0.8fr)) auto;
  gap: 14px;
  align-items: end;
}
.calls-filter-form .field {
  min-width: 0;
}
.calls-filter-form .field-control {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}
.calls-table-card {
  padding: 0;
  border-radius: 8px;
}
.calls-table-card .table {
  min-width: 720px;
}

/* ---------- Payroll Batches ---------- */
.payroll-batches-shell {
  gap: 18px;
}
.payroll-batches-upload,
.payroll-batches-card {
  padding: 16px;
}
.payroll-batches-card .table-wrap {
  margin: -4px -4px 0;
}
.payroll-batches-table {
  min-width: 780px;
}
.payroll-batches-table thead th {
  letter-spacing: 0;
}
.payroll-batches-table th,
.payroll-batches-table td {
  white-space: nowrap;
}
.payroll-batches-table .badge .dot {
  background: currentColor;
}
.batch-open-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--ops-red-line);
  border-radius: 6px;
  background: rgba(215, 25, 32, 0.06);
  color: var(--ops-red);
  font-weight: 800;
  text-decoration: none;
}
.batch-open-link span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.batch-open-link strong {
  font-family: var(--font-mono);
  font-size: 13px;
}
.batch-open-link:hover {
  background: rgba(215, 25, 32, 0.1);
  border-color: rgba(215, 25, 32, 0.35);
  color: var(--brand-700);
}
.batch-open-link:focus-visible {
  outline: 3px solid rgba(215, 25, 32, 0.18);
  outline-offset: 2px;
}

/* ---------- Payroll Batch Detail ---------- */
.payroll-batch-detail-shell {
  gap: 18px;
}
.payroll-review-card,
.payroll-adjustments-card,
.payroll-snapshot-card {
  padding: 16px;
}
.payroll-section-heading {
  align-items: flex-start;
  gap: 16px;
}
.payroll-section-copy {
  margin-top: 4px;
  max-width: 680px;
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.5;
}
.payroll-empty-copy {
  margin-top: 12px;
  color: var(--fg-3);
  font-size: 13px;
}
.payroll-detail-table-wrap {
  margin-top: 12px;
  border: 1px solid var(--border-1);
}
.payroll-review-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}
.payroll-review-table th:nth-child(1),
.payroll-review-table td:nth-child(1) {
  width: 12%;
}
.payroll-review-table th:nth-child(2),
.payroll-review-table td:nth-child(2),
.payroll-review-table th:nth-child(3),
.payroll-review-table td:nth-child(3) {
  width: 9%;
}
.payroll-review-table th:nth-child(4),
.payroll-review-table td:nth-child(4),
.payroll-review-table th:nth-child(5),
.payroll-review-table td:nth-child(5) {
  width: 26%;
}
.payroll-review-table th:nth-child(6),
.payroll-review-table td:nth-child(6) {
  width: 18%;
}
.payroll-review-table th,
.payroll-review-table td {
  white-space: normal;
  vertical-align: top;
}
.payroll-review-table .badge .dot {
  background: currentColor;
}
.review-value-list {
  display: block;
  margin: 0;
  list-style: none;
  max-width: 100%;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  border: 1px solid var(--border-1);
  border-radius: 6px;
  background: var(--ops-surface-soft);
  color: var(--fg-1);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
}
.review-value-list li + li {
  margin-top: 4px;
}
.payroll-review-actions {
  min-width: 0;
  text-align: left;
}
.payroll-inline-action {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  align-items: end;
}
.payroll-inline-action .field {
  min-width: min(180px, 100%);
  flex: 1 1 180px;
  text-align: left;
}
.payroll-create-action {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
  text-align: left;
}
.payroll-create-action .btn {
  width: fit-content;
}
.payroll-adjustments-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(520px, 1.4fr);
  gap: 18px;
  align-items: start;
}
.payroll-adjustments-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.payroll-adjustment-total {
  display: inline-flex;
  width: fit-content;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-1);
  border-radius: 6px;
  background: var(--ops-surface-soft);
  color: var(--fg-2);
  font-size: 13px;
}
.payroll-adjustment-total strong {
  color: var(--fg-1);
  font-size: 13px;
}
.payroll-adjustment-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(170px, 0.85fr) minmax(260px, 1.3fr) auto;
  gap: 10px;
  align-items: start;
}
.payroll-adjustment-form .btn,
.payroll-adjustment-edit-form .btn {
  margin-top: 22px;
}
.payroll-adjustment-note {
  min-width: 0;
}
.payroll-adjustments-table {
  min-width: 860px;
}
.payroll-adjustment-edit-form {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(130px, 160px) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.payroll-snapshot-table {
  min-width: 860px;
}
.payroll-snapshot-table th,
.payroll-snapshot-table td,
.payroll-adjustments-table th,
.payroll-adjustments-table td {
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .payroll-adjustments-layout,
  .payroll-adjustment-form,
  .payroll-adjustment-edit-form,
  .payroll-create-action {
    grid-template-columns: 1fr;
  }
  .payroll-adjustment-form .btn,
  .payroll-adjustment-edit-form .btn {
    margin-top: 0;
    width: fit-content;
  }
}

/* ---------- Placements Workspace ---------- */
.placements-shell {
  gap: 16px;
}
.placements-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.placements-page-header h2 {
  margin: 4px 0 0;
  color: var(--fg-1);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}
.placements-page-header p {
  margin-top: 4px;
  color: var(--fg-3);
  font-size: 13px;
}
.placements-page-header p span {
  color: var(--fg-2);
  font-weight: 700;
}
.placements-filter-card {
  padding: 16px;
}
.placements-filter-form {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(190px, 1fr) minmax(150px, 0.7fr);
  gap: 14px;
  align-items: end;
}
.placements-filter-form .field {
  min-width: 0;
}
.placements-filter-form .field-control {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}
.placements-table-card {
  padding: 0;
  border-radius: 8px;
}
.placements-table-scroll {
  overflow-x: auto;
}
.placements-table {
  min-width: 1120px;
}
.placements-table .badge .dot {
  background: currentColor;
}
.placements-actions-heading,
.placements-actions-cell {
  text-align: right;
}
.placements-consultant-cell {
  color: var(--fg-1);
  font-weight: 700;
}
.placements-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.placements-status-select {
  min-width: 112px;
  padding: 6px 10px;
  font-size: 12px;
}
.placements-empty-state {
  padding: 32px;
  text-align: center;
  color: var(--fg-3);
}
.placements-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-1);
  color: var(--fg-3);
  font-size: 13px;
  flex-wrap: wrap;
}
.placements-pagination-actions {
  display: flex;
  gap: 8px;
}
.placements-modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(23, 32, 42, 0.48);
}
.placements-modal {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
}
.placements-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.placements-modal-header h3 {
  margin: 4px 0 0;
  color: var(--fg-1);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}
.placements-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.placements-po-input {
  width: 100%;
  margin-top: 6px;
}
.placements-readonly-value {
  margin-top: 6px;
  color: var(--fg-3);
  font-size: 13px;
}
.placements-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

[hidden] { display: none !important; }

/* ---------- Legacy Tailwind Bridge ---------- */
.text-gray-900, .text-gray-800 { color: var(--fg-1) !important; }
.text-gray-700, .text-gray-600 { color: var(--fg-2) !important; }
.text-gray-500, .text-gray-400 { color: var(--fg-3) !important; }
.text-indigo-600, .text-indigo-500, .text-blue-700, .text-blue-600 { color: var(--accent-300) !important; }
.text-green-900, .text-green-800, .text-green-700, .text-green-600 { color: var(--success-400) !important; }
.text-red-900, .text-red-800, .text-red-700, .text-red-600 { color: var(--danger-400) !important; }
.text-amber-900, .text-amber-800, .text-amber-700, .text-yellow-800, .text-yellow-700, .text-yellow-600, .text-yellow-500, .text-orange-500 { color: var(--warn-400) !important; }
.bg-white, .bg-gray-50 { background: var(--bg-3) !important; }
.bg-gray-100, .bg-gray-200 { background: var(--bg-4) !important; }
.bg-green-50 { background: rgba(16,185,129,0.10) !important; }
.bg-red-50 { background: rgba(239,68,68,0.10) !important; }
.bg-yellow-50, .bg-amber-50 { background: rgba(245,158,11,0.10) !important; }
.bg-blue-50 { background: rgba(59,130,246,0.10) !important; }
.bg-green-100 { background: rgba(16,185,129,0.16) !important; }
.bg-red-100 { background: rgba(239,68,68,0.16) !important; }
.border-gray-100, .border-gray-200, .border-gray-300, .divide-gray-100 > :not([hidden]) ~ :not([hidden]), .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--border-2) !important;
}
.border-green-200 { border-color: rgba(16,185,129,0.22) !important; }
.border-red-200 { border-color: rgba(239,68,68,0.22) !important; }
.border-amber-200, .border-yellow-200 { border-color: rgba(245,158,11,0.22) !important; }
.border-blue-300 { border-color: rgba(59,130,246,0.28) !important; }
.hover\:bg-gray-50:hover, .hover\:bg-gray-100:hover, .hover\:bg-gray-900:hover, .hover\:bg-gray-800:hover {
  background: var(--bg-4) !important;
}
.hover\:text-gray-900:hover, .hover\:text-gray-800:hover, .hover\:text-gray-700:hover {
  color: var(--fg-1) !important;
}
.focus\:border-indigo-500:focus, .focus\:border-indigo-700:focus, .focus\:ring-indigo-500:focus, .focus\:ring-indigo-700:focus {
  border-color: var(--accent-400) !important;
  box-shadow: 0 0 0 3px rgba(34,211,238,0.18) !important;
}
.shadow-sm, .shadow-md, .shadow-lg, .shadow-xl {
  box-shadow: var(--shadow-md) !important;
}
.ring-black, .ring-opacity-5 {
  --tw-ring-color: transparent !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-1);
  }

  .brand {
    padding-bottom: 12px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav .group-label {
    width: 100%;
    padding-top: 10px;
  }

  .sidebar-foot {
    display: none;
  }

  .topbar {
    height: auto;
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .search {
    width: 100%;
    order: 3;
  }

  .search-panel {
    min-width: 0;
  }

  .main {
    padding: 20px 16px;
  }

  .grid-4,
  .grid-2,
  .dashboard-layout,
  .metric-strip,
  .calls-stat-grid,
  .calls-form-grid,
  .calls-filter-form,
  .placements-filter-form,
  .placements-form-grid {
    grid-template-columns: 1fr;
  }

  .calls-report-tabs,
  .calls-segmented {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .calls-report-tabs a,
  .calls-segment {
    flex: 0 0 auto;
  }

  .auth-shell {
    padding: 16px;
  }

  .auth-card {
    padding: 22px;
  }
}
