:root {
  --navy-950: #071426;
  --navy-900: #0b1d34;
  --navy-850: #102641;
  --ink: #15223a;
  --muted: #66758d;
  --muted-2: #8a97aa;
  --blue: #2869ed;
  --blue-600: #1e57d2;
  --blue-100: #dfeaff;
  --blue-50: #f0f5ff;
  --cyan: #0ca6c8;
  --purple: #7857db;
  --orange: #ef8f2f;
  --green: #17a673;
  --red: #d84656;
  --amber: #f0aa2c;
  --line: #e1e7f0;
  --line-strong: #cdd6e3;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --page: #f3f6fb;
  --sidebar-width: 260px;
  --topbar-height: 76px;
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(19, 34, 58, .05);
  --shadow: 0 12px 34px rgba(23, 42, 76, .09);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 6%, rgba(40, 105, 237, .05), transparent 24rem),
    var(--page);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #d8e3f3;
  background:
    radial-gradient(circle at 15% 0, rgba(54, 112, 219, .22), transparent 18rem),
    linear-gradient(180deg, var(--navy-850), var(--navy-950));
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 8px 0 30px rgba(6, 18, 35, .12);
}

.brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand:hover { color: #fff; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #3d84ff, #6c55e8);
  box-shadow: 0 8px 22px rgba(62, 114, 238, .34);
  font-size: 19px;
  font-weight: 850;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.12; }
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; color: #91a5c2; font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  overflow: auto;
  padding: 16px 13px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
}
.nav-section + .nav-section { margin-top: 20px; }
.nav-label {
  padding: 0 12px 7px;
  color: #7187a5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-item {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 9px 12px;
  color: #b9c7da;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 680;
  transition: .16s ease;
}
.nav-item svg, .public-link svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(51, 118, 245, .33), rgba(62, 107, 210, .14));
  box-shadow: inset 0 0 0 1px rgba(103, 155, 255, .15);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #4e8cff;
  box-shadow: 0 0 15px rgba(78, 140, 255, .75);
}
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.public-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  color: #dce7f5;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}
.public-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.public-link span { display: flex; min-width: 0; flex: 1; flex-direction: column; line-height: 1.2; }
.public-link strong { font-size: 12px; }
.public-link small { margin-top: 3px; color: #8196b2; font-size: 10px; }
.public-link .trailing { width: 15px; height: 15px; flex-basis: 15px; }

.app-main { width: calc(100% - var(--sidebar-width)); min-width: 0; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  gap: 18px;
  padding: 0 26px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(215, 223, 234, .9);
  box-shadow: 0 4px 20px rgba(23, 40, 70, .035);
  backdrop-filter: blur(14px);
}
.menu-button { display: none; }
.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.top-search {
  display: flex;
  width: min(520px, 48vw);
  height: 43px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  transition: .16s ease;
}
.top-search:focus-within { border-color: #9cbaf6; background: #fff; box-shadow: 0 0 0 4px rgba(40,105,237,.08); }
.top-search svg { width: 18px; height: 18px; fill: none; stroke: #8391a5; stroke-width: 2; }
.top-search input { min-width: 0; flex: 1; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.top-search input::placeholder { color: #8a97aa; }
.top-search kbd { padding: 2px 7px; color: #8490a2; border: 1px solid #d9e0e8; border-bottom-width: 2px; border-radius: 6px; background: #fff; font: 10px/1.4 ui-monospace, monospace; }
.topbar-actions { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 12px; }
.environment-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: #526078;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}
.environment-pill > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(23,166,115,.12); }
.quick-add {
  display: inline-flex;
  height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  color: #fff;
  border-radius: 11px;
  background: linear-gradient(135deg, #2e72ef, #5d63e6);
  box-shadow: 0 8px 18px rgba(40,105,237,.2);
  font-size: 12px;
  font-weight: 760;
}
.quick-add:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(40,105,237,.25); }
.quick-add svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 6px; }
.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, #14a7bd, #3773e8);
  font-weight: 800;
}
.user-copy { display: flex; flex-direction: column; line-height: 1.2; }
.user-copy strong { max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.user-copy small { margin-top: 3px; color: var(--muted-2); font-size: 10px; }
.topbar-title { color: var(--muted); font-weight: 700; }

.page-content { max-width: 1540px; margin: 0 auto; padding: 30px 30px 50px; }
.messages { margin-bottom: 18px; }
.alert-card {
  padding: 12px 15px;
  color: #24563f;
  border: 1px solid #bde6d2;
  border-radius: 12px;
  background: #eefaf4;
  box-shadow: var(--shadow-sm);
  font-weight: 650;
}

h1, h2, h3 { color: var(--ink); letter-spacing: -.025em; }
h1 { margin: 0 0 22px; font-size: clamp(25px, 2.2vw, 34px); line-height: 1.18; }
h2 { margin: 0 0 14px; font-size: 18px; }
h3 { margin: 20px 0 8px; font-size: 15px; }
p:first-child { margin-top: 0; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 23px;
}
.page-eyebrow { margin-bottom: 5px; color: var(--blue); font-size: 11px; font-weight: 820; letter-spacing: .13em; text-transform: uppercase; }
.page-header h1 { margin: 0; }
.page-subtitle { max-width: 660px; margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 9px; }

.card, .stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card { margin-bottom: 18px; padding: 20px; }
.stat { padding: 18px; }
.card:hover { border-color: #d6deea; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 15px;
}
.card-header h2 { margin: 0; }
.card-kicker { color: var(--muted); font-size: 11px; }
.card-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 760; }
.card-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .85fr); gap: 18px; }
.stack { display: grid; align-content: start; gap: 18px; }
.stack > .card { margin-bottom: 0; }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  color: #fff;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #4f63df);
  box-shadow: 0 6px 14px rgba(40,105,237,.15);
  cursor: pointer;
  font-weight: 740;
  transition: .15s ease;
}
.button:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(40,105,237,.2); }
.button.secondary { color: #44526a; border: 1px solid var(--line-strong); background: #fff; box-shadow: none; }
.button.secondary:hover { color: var(--ink); background: var(--surface-soft); }
.button.danger, .danger { background: linear-gradient(135deg, #d64152, #b82e45); }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }

.table-wrap { max-width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { padding: 12px 11px; text-align: left; vertical-align: top; border-bottom: 1px solid #edf0f5; }
.table th { color: #6e7c91; background: #f8fafd; font-size: 10px; font-weight: 820; letter-spacing: .075em; text-transform: uppercase; }
.table th:first-child { border-radius: 9px 0 0 9px; }
.table th:last-child { border-radius: 0 9px 9px 0; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: #f9fbff; }
.table a { font-weight: 720; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 1px;
  padding: 4px 8px;
  color: #245cc7;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: #edf4ff;
  font-size: 10px;
  font-weight: 780;
}
.badge.red, .red { color: #a82e3c; border-color: #f4ccd2; background: #fff0f2; }
.badge.green, .green { color: #08714b; border-color: #bfe7d6; background: #ecfbf4; }
.badge.amber, .amber { color: #925e0e; border-color: #f2ddb4; background: #fff8e8; }
.num { color: var(--blue); font-size: 30px; font-weight: 840; line-height: 1; letter-spacing: -.04em; }
.small { color: var(--muted); font-size: 11px; }
.muted { color: var(--muted); }

.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filters label { color: #39465c; font-size: 12px; font-weight: 740; }
.filters input, .filters select, .top-search input {
  appearance: none;
}
.filters input, .filters select {
  min-height: 40px;
  padding: 8px 11px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  outline: 0;
}
.filters input:focus, .filters select:focus { border-color: #91aff0; box-shadow: 0 0 0 4px rgba(40,105,237,.08); }

.structured-form { display: grid; gap: 18px; }
.form-shell { max-width: 1100px; }
.form-section { min-width: 0; margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.form-section legend { padding: 0 8px; margin-left: -8px; color: var(--ink); font-size: 17px; font-weight: 800; }
.section-description { max-width: 760px; margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field label { color: #354158; font-size: 11px; font-weight: 780; letter-spacing: .02em; }
.field input:not([type=checkbox]), .field textarea, .field select, .login-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid #c8d2df;
  border-radius: 10px;
  background: #fff;
  outline: 0;
}
.field textarea { min-height: 96px; resize: vertical; }
.field select[multiple] { min-height: 140px; }
.field input:focus, .field textarea:focus, .field select:focus, .login-form input:focus { border-color: #8faff2; box-shadow: 0 0 0 4px rgba(40,105,237,.09); }
.field input[type=file] { padding: 9px; background: #f8fafc; }
.checkbox-label { display: flex !important; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; font-weight: 650 !important; }
.checkbox-label input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.45; }
.field-errors, .errorlist { margin: 0; padding-left: 18px; color: #b91c1c; font-size: 12px; }
.field-error input, .field-error select, .field-error textarea { border-color: #dc5262; }
.required-mark { color: #c93547; }
.form-alert { padding: 12px 14px; color: #991b1b; border: 1px solid #fecaca; border-radius: 10px; background: #fff1f2; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 0; }
.form-actions .button { min-width: 120px; }

.household-members { display: grid; gap: 16px; margin: 18px 0; }
.household-member-card { overflow: hidden; border: 1px solid #d8e1ec; border-radius: 14px; background: #fbfcfe; }
.member-card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border-bottom: 1px solid #dfe6ef; background: #f3f7fc; }
.member-card-head > div:first-child { display: grid; gap: 2px; }
.member-card-head strong { color: var(--ink); font-size: 15px; }
.member-card-head span { color: var(--muted); font-size: 11px; }
.member-card-head .field { min-width: 190px; }
.member-card-head .checkbox-label { background: #fff; }
.member-field-group { padding: 16px; border-bottom: 1px solid #e5eaf1; }
.member-field-group:last-child { border-bottom: 0; }
.member-field-group h3 { margin: 0 0 12px; color: #526076; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.add-household-member { justify-self: start; }

.mono { overflow: auto; padding: 14px; color: #dbe9fa; border: 1px solid #203755; border-radius: 11px; background: #0b172a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.65; }
.timeline { padding: 0; list-style: none; }
.timeline li { margin-left: 5px; padding: 0 0 16px 14px; border-left: 3px solid #c6d9ff; }
.note { margin: 0 0 16px 5px; padding: 2px 0 2px 13px; border-left: 3px solid #69a0ff; }
.management-note { border-color: #d94758; }
.modal { width: calc(100% - 32px); max-width: 560px; padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 70px rgba(15,23,42,.33); }
.modal::backdrop { background: rgba(7,20,38,.72); }
.modal-body { padding: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Dashboard */
.dashboard-hero {
  position: relative;
  display: flex;
  min-height: 158px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 25px 28px;
  color: #fff;
  border: 0;
  border-radius: 19px;
  background:
    radial-gradient(circle at 77% 20%, rgba(127, 205, 255, .24), transparent 12rem),
    linear-gradient(120deg, #15345e, #1d5ab4 58%, #5264d8);
  box-shadow: 0 18px 42px rgba(28, 70, 143, .18);
}
.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -85px;
  width: 280px;
  height: 280px;
  border: 40px solid rgba(255,255,255,.055);
  border-radius: 50%;
}
.dashboard-hero-copy { position: relative; z-index: 1; max-width: 610px; }
.dashboard-hero .page-eyebrow { color: #9cc9ff; }
.dashboard-hero h1 { margin: 0 0 7px; color: #fff; font-size: clamp(25px, 2.5vw, 36px); }
.dashboard-hero p { margin: 0; color: #cbdcf3; font-size: 13px; }
.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; }
.hero-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: #17355f;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(9,25,48,.15);
  font-size: 12px;
  font-weight: 780;
}
.hero-action:hover { color: var(--blue); transform: translateY(-1px); }
.hero-action.secondary { color: #fff; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); box-shadow: none; }
.hero-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }

.command-search {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
}
.command-search-label { display: flex; min-width: 155px; align-items: center; gap: 9px; padding-left: 4px; color: #35435a; font-size: 12px; font-weight: 780; }
.command-search-label svg { width: 18px; height: 18px; fill: none; stroke: var(--blue); stroke-width: 2; }
.command-search input { min-width: 160px; height: 42px; flex: 1; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; }
.command-search input:focus { border-color: #8aaaf0; box-shadow: 0 0 0 4px rgba(40,105,237,.08); }

.metrics-grid { display: grid; grid-template-columns: repeat(6, minmax(145px, 1fr)); gap: 13px; margin-bottom: 18px; }
.metric-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.metric-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -26px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--metric-soft, var(--blue-50));
}
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.metric-icon { display: grid; width: 36px; height: 36px; place-items: center; color: var(--metric, var(--blue)); border-radius: 11px; background: var(--metric-soft, var(--blue-50)); }
.metric-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.metric-trend { color: var(--muted-2); font-size: 9px; font-weight: 760; }
.metric-number { position: relative; z-index: 1; margin-bottom: 4px; color: var(--ink); font-size: 28px; font-weight: 850; line-height: 1; letter-spacing: -.045em; }
.metric-label { position: relative; z-index: 1; color: var(--muted); font-size: 11px; font-weight: 680; line-height: 1.3; }
.metric-card.red-tone { --metric: var(--red); --metric-soft: #fff0f2; }
.metric-card.purple-tone { --metric: var(--purple); --metric-soft: #f2efff; }
.metric-card.orange-tone { --metric: var(--orange); --metric-soft: #fff4e9; }
.metric-card.green-tone { --metric: var(--green); --metric-soft: #eaf9f3; }
.metric-card.cyan-tone { --metric: var(--cyan); --metric-soft: #e9f9fc; }

.queue-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.queue-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  transition: .14s ease;
}
.queue-card:hover { color: var(--ink); border-color: #bdd0f6; background: #f5f8ff; transform: translateY(-1px); }
.queue-count { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; color: var(--blue); border-radius: 11px; background: var(--blue-50); font-size: 17px; font-weight: 830; }
.queue-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.queue-copy strong { font-size: 11px; }
.queue-copy small { margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.queue-arrow { width: 16px; height: 16px; fill: none; stroke: #9aa7b9; stroke-width: 2; }

.workflow-card {
  position: relative;
  overflow: hidden;
  color: #dce8f7;
  border: 0;
  background: linear-gradient(145deg, #112d4e, #173a62);
}
.workflow-card h2 { color: #fff; }
.workflow-card p { color: #aebfd4; font-size: 12px; }
.workflow-line { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.workflow-node { padding: 6px 8px; color: #cfe0f6; border: 1px solid rgba(255,255,255,.11); border-radius: 8px; background: rgba(255,255,255,.05); font-size: 9px; font-weight: 740; }
.workflow-arrow { color: #6599df; }

.priority-list { display: grid; gap: 9px; }
.priority-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.priority-item:last-child { padding-bottom: 0; border-bottom: 0; }
.priority-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px #fff0f2; }
.priority-copy { min-width: 0; flex: 1; }
.priority-copy a, .priority-copy strong { color: var(--ink); font-size: 11px; font-weight: 750; }
.priority-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }

.login-form { display: grid; gap: 14px; }
.login-form p { display: grid; gap: 5px; margin: 0; }
.user-chip { color: inherit; text-decoration: none; }
.mfa-shell { max-width: 900px; margin: 32px auto; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.mfa-shell > h1, .mfa-verify-card h1 { margin: 6px 0 8px; }
.mfa-shell > p, .mfa-verify-card > p { color: var(--muted); }
.mfa-setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 25px; }
.mfa-step { display: flex; align-items: flex-start; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.mfa-step-number { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; color: #fff; border-radius: 50%; background: var(--blue); font-size: 12px; font-weight: 850; }
.mfa-step h2 { margin: 2px 0 5px; font-size: 18px; }
.mfa-step p { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.mfa-qr { display: block; width: min(240px, 100%); margin: 10px auto 16px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mfa-step details, .mfa-recovery-help { margin-top: 14px; color: var(--muted); font-size: 12px; }
.mfa-step summary, .mfa-recovery-help summary { cursor: pointer; font-weight: 750; }
.mfa-secret { display: block; margin-top: 8px; padding: 10px; overflow-wrap: anywhere; color: var(--ink); border-radius: 8px; background: #fff; font-size: 13px; letter-spacing: .08em; }
.mfa-form { margin-top: 14px; }
.mfa-verify-card { max-width: 480px; margin: 48px auto; padding: 28px; }
.mfa-icon { display: grid; width: 48px; height: 48px; margin-bottom: 14px; place-items: center; border-radius: 50%; font-size: 22px; font-weight: 900; }
.mfa-icon-success { color: #087754; background: #e4f7ef; }
.mfa-status-card { display: flex; max-width: 360px; align-items: center; justify-content: space-between; gap: 20px; margin: 22px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.mfa-status-card span { display: grid; min-width: 30px; height: 30px; place-items: center; color: #fff; border-radius: 50%; background: var(--blue); font-weight: 850; }
.mfa-recovery-codes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; max-width: 520px; margin: 24px 0; }
.mfa-recovery-codes code { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); text-align: center; font-size: 15px; letter-spacing: .08em; }
.mfa-recovery-actions { max-width: 520px; justify-content: space-between; }
.guest-header { display: flex; height: 76px; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1140px) / 2)); background: var(--navy-900); }
.guest-brand { min-height: 0; padding: 0; border: 0; }
.guest-public-link { color: #c7d6e9; font-size: 12px; font-weight: 700; }
.guest-content { max-width: 1120px; margin: 0 auto; padding: 40px 24px; }
.guest-content > .card[style] { border: 0; box-shadow: var(--shadow); }

.sidebar-scrim { display: none; }

@media (max-width: 1280px) {
  .metrics-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .dashboard-columns { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .75fr); }
}

@media (max-width: 1020px) {
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 55; display: block; visibility: hidden; background: rgba(5, 15, 29, .58); opacity: 0; transition: .2s ease; }
  .sidebar-open .sidebar-scrim { visibility: visible; opacity: 1; }
  .app-main { width: 100%; margin-left: 0; }
  .menu-button { display: grid; flex: 0 0 40px; place-items: center; }
  .dashboard-columns { grid-template-columns: 1fr; }
  .top-search { width: min(480px, 52vw); }
}

@media (max-width: 760px) {
  :root { --topbar-height: 66px; }
  .topbar { gap: 10px; padding: 0 14px; }
  .top-search { flex: 1; width: auto; }
  .top-search kbd, .environment-pill, .user-copy, .quick-add span { display: none; }
  .quick-add { width: 40px; padding: 0; justify-content: center; }
  .user-chip { padding: 0; }
  .page-content { padding: 22px 15px 38px; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(135px, 1fr)); }
  .page-header { align-items: flex-start; flex-direction: column; }
  .command-search { align-items: stretch; flex-direction: column; }
  .command-search-label { min-width: 0; }
  .command-search .button { width: 100%; }
  .two, .field-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .table { min-width: 720px; }
  .form-section { padding: 16px; }
  .form-actions { justify-content: stretch; }
  .form-actions .button { flex: 1; text-align: center; }
  .mfa-setup-grid { grid-template-columns: 1fr; }
  .mfa-shell { margin: 12px auto; padding: 20px; }
  .mfa-recovery-codes { grid-template-columns: 1fr; }
}

@media print {
  .guest-header, .sidebar, .topbar, .mfa-recovery-actions { display: none !important; }
  .mfa-shell { margin: 0; border: 0; box-shadow: none; }
}

@media (max-width: 460px) {
  .top-search input::placeholder { color: transparent; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 14px; }
  .queue-grid { grid-template-columns: 1fr; }
  .hero-actions { width: 100%; }
  .hero-action { flex: 1; justify-content: center; }
  .guest-header { padding: 0 15px; }
  .guest-public-link { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
