/* ── Roster Atlas — shared styles ── */

:root {
  --bg: #f4f2ec;
  --panel: #ffffff;
  --ink: #15171a;
  --ink-2: #4a4d52;
  --ink-3: #8a8d92;
  --hair: #e4e1d8;
  --hair-strong: #cfcbbe;
  --chip: #f0ede4;
  --accent: #1f3a5f;
  --ok: #2f7d5b;
  --warn: #b87024;
  --bad: #b3322a;
  --bad-soft: #f5e1de;
  --bar-track: #efece4;
  --bar-neutral: #2c2f34;
  --bar-warn: #b87024;
  --bar-bad: #b3322a;
  --bar-new: #2f7d5b;
  --target-line: #1f3a5f;
}

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

body {
  background: var(--bg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Shell ── */
.shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: 52px; flex-shrink: 0;
  background: #fbfaf6;
  border-bottom: 1px solid var(--hair);
  display: flex; align-items: center;
  padding: 0 24px; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; letter-spacing: .02em; white-space: nowrap; cursor: pointer; }
.brand .glyph { width: 22px; height: 22px; border-radius: 5px; background: var(--accent); position: relative; flex-shrink: 0; }
.brand .glyph::before { content: ""; position: absolute; left: 5px; top: 5px; width: 12px; height: 12px; border: 2px solid #fff; border-right-color: transparent; border-top-color: transparent; border-radius: 50%; }
.crumb { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.crumb .sep { color: var(--hair-strong); }
.crumb b { color: var(--ink); font-weight: 500; }
.tenant-switcher {
  font: inherit; font-size: 12.5px; color: var(--ink-2);
  background: var(--chip); border: 1px solid var(--hair-strong);
  border-radius: 6px; padding: 3px 8px;
  cursor: pointer; max-width: 240px;
}
.tenant-switcher:hover { background: #e9e5da; }
.tenant-switcher:focus { outline: none; border-color: var(--accent); }

/* Collapsible slide-over sections (<details class="slideover-section">) */
details.slideover-section { padding: 14px 18px; border-bottom: 1px solid #f3f0e8; }
details.slideover-section:last-of-type { border-bottom: none; }
details.slideover-section > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .07em;
  margin: 0 0 8px 0;
}
details.slideover-section > summary::-webkit-details-marker { display: none; }
details.slideover-section > summary::after {
  content: "▾"; color: var(--ink-3); font-size: 10px; font-weight: 400;
  transition: transform .15s;
}
details.slideover-section:not([open]) > summary { margin-bottom: 0; }
details.slideover-section:not([open]) > summary::after { transform: rotate(-90deg); }
details.slideover-section .sec-meta {
  font-size: 10.5px; font-weight: 400; color: var(--ink-3); text-transform: none; letter-spacing: 0;
  margin-left: 8px;
}
.spec-kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; align-items: baseline; font-size: 12px; }
.spec-kv .k { color: var(--ink-3); }
.spec-kv .v { color: var(--ink); font-family: ui-monospace, monospace; word-break: break-all; }
.spec-kv .v.muted { color: var(--ink-3); font-style: italic; font-family: inherit; }
.spec-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 0; font-size: 12.5px;
}
.spec-toggle:not(:last-child) { border-bottom: 1px dashed var(--hair); }
.spec-source-table {
  width: 100%; font-size: 11px; border-collapse: collapse;
}
.spec-source-table th, .spec-source-table td {
  text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--hair);
  font-family: ui-monospace, monospace; color: var(--ink-2);
}
.spec-source-table th {
  font-family: inherit; font-size: 10.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
}
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill { font-size: 12px; padding: 4px 10px; background: var(--chip); border-radius: 999px; color: var(--ink-2); white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }

/* ── Nav strip ── */
.navstrip {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--hair);
  display: flex; align-items: center;
  padding: 0 24px; gap: 0;
  overflow-x: auto;
  height: 42px;
  scrollbar-width: thin;
}
.navstrip::-webkit-scrollbar { height: 4px; }
.navstrip::-webkit-scrollbar-thumb { background: var(--hair-strong); border-radius: 4px; }
.navstrip .nav-item {
  padding: 0 14px; height: 42px;
  display: flex; align-items: center;
  font-size: 13px; color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap; flex-shrink: 0;
}
.navstrip .nav-item:hover { color: var(--ink-2); }
.navstrip .nav-item.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }

/* ── Public (marketing) header ── */
.topbar.public { background: #fff; }
.public-nav { display: flex; align-items: center; gap: 4px; }
.public-link {
  padding: 6px 12px; font-size: 13px; color: var(--ink-3);
  cursor: pointer; border-radius: 6px; white-space: nowrap;
}
.public-link:hover { color: var(--ink-2); background: var(--chip); }
.public-link.active { color: var(--ink); font-weight: 500; }

/* ── Grouped app nav (dropdowns) ── */
.navstrip.grouped { overflow: visible; gap: 2px; }
.nav-group { position: relative; height: 42px; display: flex; align-items: center; }
.nav-group-btn {
  font: inherit; font-size: 13px; color: var(--ink-3);
  background: transparent; border: none; cursor: pointer;
  height: 42px; padding: 0 14px;
  display: flex; align-items: center; gap: 5px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav-group-btn:hover { color: var(--ink-2); }
.nav-group-btn .caret { font-size: 9px; color: var(--ink-3); }
.nav-group.active .nav-group-btn { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.nav-menu {
  position: absolute; top: 42px; left: 0; min-width: 180px;
  background: #fff; border: 1px solid var(--hair-strong);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.08);
  padding: 6px; display: none; z-index: 50;
}
.nav-group.open .nav-menu { display: block; }
.nav-menu-item {
  display: block; padding: 7px 10px; font-size: 13px;
  color: var(--ink-2); cursor: pointer; border-radius: 6px; white-space: nowrap;
}
.nav-menu-item:hover { background: var(--chip); color: var(--ink); }
.nav-menu-item.active { color: var(--accent); font-weight: 500; }

/* ── Avatar menu ── */
.avatar-menu { position: relative; }
.avatar-menu .avatar { cursor: pointer; }
.avatar-dropdown {
  position: absolute; top: 36px; right: 0; min-width: 140px;
  background: #fff; border: 1px solid var(--hair-strong);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.08);
  padding: 6px; display: none; z-index: 50;
}
.avatar-menu.open .avatar-dropdown { display: block; }
.avatar-dropdown-item {
  display: block; padding: 7px 10px; font-size: 13px;
  color: var(--ink-2); cursor: pointer; border-radius: 6px; white-space: nowrap;
}
.avatar-dropdown-item:hover { background: var(--chip); color: var(--ink); }

/* ── Fake login screen (login.html) ── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg, #f7f5f0); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px; background: #fff;
  border: 1px solid var(--hair); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.06); padding: 32px 28px;
}
.auth-card .auth-brand {
  display: flex; align-items: center; gap: 9px; justify-content: center;
  font-weight: 600; font-size: 16px; margin-bottom: 4px;
}
.auth-card .auth-brand .glyph {
  width: 24px; height: 24px; border-radius: 5px; background: var(--accent); position: relative;
}
.auth-card .auth-brand .glyph::before {
  content: ""; position: absolute; left: 6px; top: 6px; width: 12px; height: 12px;
  border: 2px solid #fff; border-right-color: transparent; border-top-color: transparent; border-radius: 50%;
}
.auth-sub { text-align: center; font-size: 13px; color: var(--ink-3); margin-bottom: 22px; }
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 5px; }
.auth-field input {
  width: 100%; height: 38px; padding: 0 11px; font: inherit; font-size: 13px;
  border: 1px solid var(--hair-strong); border-radius: 8px; background: #fff; color: var(--ink);
}
.auth-field input:focus { outline: none; border-color: var(--accent); }
.auth-card .btn.primary { width: 100%; justify-content: center; height: 38px; margin-top: 4px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 11px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.auth-sso { width: 100%; justify-content: center; height: 38px; }
.auth-note { text-align: center; font-size: 11px; color: var(--ink-3); margin-top: 18px; }
.auth-back { display: block; text-align: center; font-size: 12px; color: var(--accent); margin-top: 14px; cursor: pointer; text-decoration: none; }

/* ── Page shell ── */
.page { max-width: 1400px; margin: 0 auto; padding: 0 28px 40px; width: 100%; }

.pagehead { padding: 22px 0 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pagehead h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0; transition: color 0.2s; }
.pagehead h1.baseline { color: var(--ink-2); }
.pagehead .sub { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.pagehead-btns { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* ── Buttons ── */
.btn { height: 32px; padding: 0 12px; border: 1px solid var(--hair-strong); background: #fff; color: var(--ink); border-radius: 7px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--bad); border-color: var(--hair-strong); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn:active { opacity: .85; }
.btn:hover { background: #faf9f5; }
.btn.primary:hover { background: #2a4870; }
.btn.ghost:hover { background: var(--chip); }

/* ── Scenario bar (index.html) ── */
.scenario {
  background: #fbfaf6;
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.3fr auto;
  gap: 14px;
  align-items: end;
}

.field-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: 6px; }

.select-wrap { position: relative; }
.select-wrap select {
  width: 100%; height: 40px;
  border: 1px solid var(--hair-strong); border-radius: 7px;
  background: #fff; color: var(--ink);
  font-size: 13.5px; font-family: inherit;
  padding: 0 32px 0 12px;
  appearance: none; cursor: pointer;
  outline: none;
}
.select-wrap select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31,58,95,.12); }
.select-wrap::after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 10px; pointer-events: none; }
.select-wrap.departed select { color: var(--bad); }
.select-wrap.departed select option { color: var(--ink); }

.stepper-ctrl { height: 40px; border: 1px solid var(--hair-strong); border-radius: 7px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; gap: 8px; }
.stepper-ctrl .lbl-wrap .lbl-main { font-size: 13.5px; font-weight: 500; }
.stepper-ctrl .lbl-wrap .lbl-sub { font-size: 12px; color: var(--ink-3); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepbtn { width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--hair-strong); background: #fff; color: var(--ink-2); font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.stepbtn:active { background: var(--chip); }
.stepval { font-family: ui-monospace, monospace; font-weight: 500; min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.scenario-actions { display: flex; gap: 8px; align-items: flex-end; }

/* ── Metrics ── */
.metrics { margin: 18px 0 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.metric { border: 1px solid var(--hair); border-radius: 10px; background: #fff; padding: 16px 18px 14px; position: relative; transition: background 0.3s; }
.metric.bad { background: #fcf6f5; }
.metric .ml { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.metric .v { margin-top: 8px; font-size: 38px; font-weight: 600; letter-spacing: -0.02em; font-family: ui-monospace, monospace; display: flex; align-items: baseline; gap: 8px; transition: color 0.3s; }
.metric.bad .v { color: var(--bad); }
.metric .v .of { font-size: 16px; color: var(--ink-3); font-weight: 400; }
.metric .delta { font-size: 12px; margin-top: 4px; font-family: ui-monospace, monospace; color: var(--ink-3); }
.metric .msub { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.ribbon { position: absolute; top: 14px; right: 14px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; font-weight: 600; }
.ribbon.red { background: var(--bad); color: #fff; }
.ribbon.neutral { background: var(--chip); color: var(--ink-2); font-weight: 500; }

/* ── Main grid ── */
.main { margin: 18px 0 0; display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }

.panel { border: 1px solid var(--hair); border-radius: 10px; background: #fff; display: flex; flex-direction: column; overflow: hidden; }
.ph { padding: 14px 18px; border-bottom: 1px solid var(--hair); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 16px; }
.ph h3 { font-size: 14px; font-weight: 600; }
.ph .ph-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-3); align-items: center; flex-wrap: wrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }

/* ── Workload rows ── */
.workload { flex: 1; overflow-y: auto; }
.wrow { display: grid; grid-template-columns: 170px 1fr 1fr 80px; align-items: center; padding: 11px 18px; border-bottom: 1px solid #f3f0e8; gap: 14px; transition: opacity 0.3s; }
.wrow:last-child { border-bottom: none; }
.wrow.departed { opacity: .42; }
.wrow .wname { font-size: 13.5px; font-weight: 500; }
.wrow .wname .npre { font-weight: 400; color: var(--ink-3); margin-right: 2px; }
.wrow .wname .wsub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 10.5px; padding: 2px 7px; background: var(--chip); border-radius: 999px; color: var(--ink-2); white-space: nowrap; }
.tag.accent { background: #e9eef5; color: var(--accent); font-weight: 600; }
.tag.red { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.tag.green { background: #e3efe8; color: var(--ok); font-weight: 600; }

.bar { position: relative; height: 22px; background: var(--bar-track); border-radius: 4px; overflow: visible; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; transition: width 0.45s cubic-bezier(.4,0,.2,1), background-color 0.3s; min-width: 0; }
.bar .fill.neutral { background: var(--bar-neutral); border-radius: 4px 0 0 4px; }
.bar .fill.warn { background: var(--bar-warn); border-radius: 4px 0 0 4px; }
.bar .fill.over { background: var(--bar-bad); border-radius: 4px; }
.bar .fill.new-hire { background: var(--bar-new); border-radius: 4px 0 0 4px; }
.bar .fill.hatched { background: repeating-linear-gradient(45deg, #c9c6bc 0 6px, #d8d5cb 6px 12px); border-radius: 4px 0 0 4px; }
.bar .target-line { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--target-line); left: 50%; }
.bar .target-line::after { content: "target"; position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-size: 9px; color: var(--ink-3); font-family: ui-monospace, monospace; white-space: nowrap; }
.bar .chip { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 10px; color: #fff; background: rgba(0,0,0,.5); padding: 1px 5px; border-radius: 3px; font-family: ui-monospace, monospace; white-space: nowrap; pointer-events: none; transition: opacity 0.3s; }
.wrow .pct { font-size: 13.5px; font-weight: 600; font-family: ui-monospace, monospace; text-align: right; font-variant-numeric: tabular-nums; transition: color 0.3s; }
.pct.over { color: var(--bad); }
.pct.warn { color: var(--warn); }
.pct.ok { color: var(--ink); }
.pct.dim { color: var(--ink-3); }

.panel-foot { padding: 10px 18px; background: #fbfaf6; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); font-family: ui-monospace, monospace; flex-shrink: 0; gap: 8px; flex-wrap: wrap; }

/* ── Coverage panel ── */
.coverage { flex: 1; overflow-y: auto; }
.cov-row { display: grid; grid-template-columns: 100px 1fr 110px; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #f3f0e8; }
.cov-row:last-child { border-bottom: none; }
.cov-lbl { font-size: 13px; font-weight: 500; }
.cov-lbl .cov-sub { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; margin-top: 1px; }
.dots { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.dot { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 600; font-family: ui-monospace, monospace; flex-shrink: 0; transition: background 0.3s, color 0.3s, border-color 0.3s; }
.dot.active { background: var(--accent); color: #fff; }
.dot.solo { background: var(--bad); color: #fff; }
.dot.pair { background: var(--warn); color: #fff; }
.dot.gone { background: #fff; color: var(--bad); border: 1.5px dashed var(--bad); }
.dot.new { background: var(--ok); color: #fff; }
.count-badge { font-family: ui-monospace, monospace; font-size: 11.5px; font-weight: 600; white-space: nowrap; margin-left: 4px; }
.count-badge.ok { color: var(--ink-2); }
.count-badge.thin { color: var(--warn); }
.count-badge.spof { color: var(--bad); }
.cov-status { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-align: right; white-space: nowrap; }
.cov-status.ok { color: var(--ok); }
.cov-status.thin { color: var(--warn); }
.cov-status.spof { color: var(--bad); }
.cov-status.uncov { color: var(--bad); font-size: 10px; }

/* ── Slide-over panel ── */
.slideover-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 100; display: none; }
.slideover-backdrop.open { display: block; }
.slideover {
  position: fixed; right: 0; top: 0; bottom: 0; width: 400px;
  background: #fff;
  box-shadow: -8px 0 32px rgba(0,0,0,.12);
  z-index: 101;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.slideover.open { transform: translateX(0); }
.slideover-head { padding: 18px 20px; border-bottom: 1px solid var(--hair); display: flex; align-items: center; justify-content: space-between; }
.slideover-head h3 { font-size: 15px; font-weight: 600; margin: 0; }
.slideover-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.slideover-close { width: 28px; height: 28px; border: none; background: transparent; cursor: pointer; color: var(--ink-3); font-size: 18px; line-height: 1; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.slideover-close:hover { background: var(--chip); color: var(--ink); }
.slideover-body { flex: 1; overflow-y: auto; padding: 20px; }
.slideover-foot { padding: 14px 20px; border-top: 1px solid var(--hair); display: flex; gap: 8px; justify-content: flex-end; background: #fbfaf6; }
.slideover-section { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--hair); }
.slideover-section:last-child { border-bottom: none; margin-bottom: 0; }
.slideover-section-title { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 10px; }
.muted { color: var(--ink-3); font-size: 12.5px; }

/* ── Data tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--ink-3); padding: 10px 14px; border-bottom: 2px solid var(--hair); text-align: left; white-space: nowrap; background: #fbfaf6; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f3f0e8; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: #faf9f5; }
.data-table td .actions { display: flex; gap: 4px; }
.mono { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* ── Tooltip ── */
.tooltip-box {
  position: fixed; z-index: 200;
  background: #1e2126; color: #fff;
  font-size: 12px; line-height: 1.5;
  padding: 8px 12px; border-radius: 7px;
  max-width: 340px;
  pointer-events: none;
  opacity: 0; transition: opacity .15s;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  white-space: pre-line;
}
.tooltip-box.visible { opacity: 1; }

/* ── Status pills ── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
}
.status-pill.ok { background: #e3efe8; color: var(--ok); }
.status-pill.warn { background: #f4ead9; color: var(--warn); }
.status-pill.bad { background: var(--bad-soft); color: var(--bad); }
.status-pill.neutral { background: var(--chip); color: var(--ink-2); }
.status-pill.accent { background: var(--accent); color: #fff; }

/* ── Tabs ── */
.tabs { display: flex; border-bottom: 1px solid var(--hair); margin-bottom: 20px; }
.tab-btn { padding: 10px 18px; font-size: 13px; color: var(--ink-3); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit; }
.tab-btn:hover { color: var(--ink-2); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Form fields ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; margin-bottom: 5px; }
.form-input, .form-select {
  width: 100%; height: 36px;
  border: 1px solid var(--hair-strong); border-radius: 6px;
  padding: 0 10px; font-size: 13.5px; font-family: inherit;
  color: var(--ink); background: #fff; outline: none;
  box-sizing: border-box;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31,58,95,.1); }
.form-select {
  appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a8d92'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.form-textarea { width: 100%; min-height: 70px; border: 1px solid var(--hair-strong); border-radius: 6px; padding: 8px 10px; font-size: 13.5px; font-family: inherit; color: var(--ink); background: #fff; outline: none; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.checkbox-row input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); }

/* ── Quick-nav cards (overview) ── */
.qnav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.qnav-card {
  background: #fff; border: 1px solid var(--hair); border-radius: 10px;
  padding: 20px; min-height: 200px;
  display: flex; flex-direction: column;
  cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
  text-decoration: none; color: inherit;
}
.qnav-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); border-color: var(--hair-strong); }
.qnav-card .glyph-large { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); margin-bottom: 14px; position: relative; }
.qnav-card .glyph-large.green { background: var(--ok); }
.qnav-card .glyph-large.amber { background: var(--warn); }
.qnav-card .glyph-large.navy { background: var(--accent); }
.qnav-card .glyph-large.gray { background: var(--ink-2); }
.qnav-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.qnav-card p { font-size: 13px; color: var(--ink-2); line-height: 1.55; flex: 1; }
.qnav-card .open-link { font-size: 13px; color: var(--accent); margin-top: 12px; font-weight: 500; }

.welcome-hero {
  background: #fff; border: 1px solid var(--hair); border-radius: 10px;
  padding: 36px 32px; margin-bottom: 20px;
}
.welcome-hero h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 10px; }
.welcome-hero p { font-size: 15px; color: var(--ink-2); line-height: 1.55; max-width: 640px; }

.snapshot-row { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* ── Period page ── */
.period-section { margin-bottom: 18px; }

/* ── Rules page ── */
.rules-grid { display: grid; grid-template-columns: 58% 42%; gap: 24px; align-items: start; }
.rule-card {
  border: 1px solid var(--hair); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px;
}
.rule-card .rule-desc { flex: 1; min-width: 200px; color: var(--ink-2); }
.rule-card .rule-edit { font-size: 12px; color: var(--accent); cursor: pointer; }
.rule-card.clickable { cursor: pointer; transition: background .15s, border-color .15s; }
.rule-card.clickable:hover { background: #faf9f5; border-color: var(--hair-strong); }
.collapsible { padding: 16px 18px; }
.collapsible > summary { font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
.collapsible > summary::before { content: "▸"; font-size: 10px; color: var(--ink-3); transition: transform .15s; }
.collapsible[open] > summary::before { transform: rotate(90deg); }
.collapsible .section-body { padding: 12px 0 4px; }
.foot-note { font-size: 12px; color: var(--ink-3); padding: 12px 18px; background: #fbfaf6; border-top: 1px solid var(--hair); }

/* ── Schedule page ── */
.lifecycle-bar { display: flex; align-items: center; gap: 0; margin: 12px 0 20px; font-size: 12.5px; color: var(--ink-3); }
.lifecycle-step { display: flex; align-items: center; gap: 6px; }
.lifecycle-circle { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--hair-strong); background: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.lifecycle-circle.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.lifecycle-circle.current { background: #fff; border-color: var(--warn); }
.lifecycle-circle.current::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.lifecycle-line { flex: 0 0 56px; height: 1px; background: var(--hair-strong); margin: 0 8px; }
.lifecycle-step.done + .lifecycle-line { background: var(--accent); }

.schedule-grid { display: grid; grid-template-columns: 1fr 240px; gap: 18px; }
.cal-table { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; border-left: 1px solid var(--hair); border-top: 1px solid var(--hair); border-radius: 8px; overflow: hidden; background: #fff; }
.cal-head { padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); background: #fbfaf6; }
.cal-cell { min-height: 88px; padding: 6px 8px; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); font-size: 11px; background: #fff; }
.cal-cell.muted { background: #f9f7f1; color: var(--ink-3); }
.cal-cell .date { font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; font-family: ui-monospace, monospace; }
.cal-cell .date.weekend { color: var(--ink-3); }
.assign-chip { font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 4px; margin-bottom: 2px; font-family: ui-monospace, monospace; display: block; }
.assign-chip.generated { background: #e7ecf2; color: var(--accent); }
.assign-chip.accepted { background: #e3efe8; color: var(--ok); }
.assign-chip.edited { background: #f4ead9; color: var(--warn); }
.assign-chip.unfilled { background: var(--bad-soft); color: var(--bad); }
.assign-chip.deferred { background: var(--chip); color: var(--ink-3); }
.assign-chip.holiday { background: var(--chip); color: var(--ink-3); font-style: italic; }
.assign-chip.commitment {
  background: #ece8f4;
  color: #4a3d72;
  font-style: italic;
}
.unfilled-item { padding: 12px 14px; border-bottom: 1px solid var(--hair); font-size: 12.5px; line-height: 1.5; }
.unfilled-item:last-child { border-bottom: none; }
.unfilled-item small { font-size: 11.5px; color: var(--ink-3); display: block; margin-top: 4px; }
.unfilled-item a { font-size: 11px; color: var(--accent); display: inline-block; margin-top: 6px; cursor: pointer; }
.stamp { padding: 12px 14px; font-size: 11.5px; color: var(--ink-3); font-style: italic; text-align: center; }

/* ── Import / step indicator ── */
.steps-bar { display: flex; align-items: center; gap: 0; margin: 12px 0 24px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.step .step-num { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--hair-strong); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; font-family: ui-monospace, monospace; }
.step.done .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.done { color: var(--ink); }
.step.active .step-num { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 3px rgba(31,58,95,.15); }
.step.active { color: var(--ink); font-weight: 500; }
.step-line { flex: 0 0 60px; height: 1px; background: var(--hair-strong); margin: 0 14px; }
.step.done + .step-line { background: var(--accent); }

.upload-summary { padding: 10px 16px; background: #fbfaf6; border: 1px solid var(--hair); border-radius: 8px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.upload-summary .ok-mark { color: var(--ok); font-weight: 700; }
.muted-card { padding: 14px 18px; background: #fbfaf6; border: 1px dashed var(--hair-strong); border-radius: 8px; color: var(--ink-3); font-size: 13px; margin-bottom: 12px; }

/* ── Popover (Scenario Modeler add-shift) ── */
.popover { box-shadow: 0 8px 24px rgba(0,0,0,.12); }

/* ── Filter row ── */
.filter-chips { display: flex; gap: 6px; font-size: 13px; flex-wrap: wrap; align-items: center; }
.filter-chip {
  font-size: 11.5px;
  padding: 4px 10px;
  border: 1px solid var(--hair-strong);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-2);
  font-family: inherit;
}
.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-chip:hover:not(.active) { background: var(--chip); }

/* ── Combobox ── */
.combobox {
  position: relative;
  width: 100%;
}
.combobox-input {
  width: 100%; height: 40px; border: 1px solid var(--hair-strong); border-radius: 7px;
  background: #fff; padding: 0 32px 0 12px; font-size: 13.5px; font-family: inherit;
  outline: none; cursor: pointer;
  box-sizing: border-box;
  color: var(--ink);
}
.combobox-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31,58,95,.1); }
.combobox::after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 10px; pointer-events: none; }
.combobox.open::after { transform: translateY(-50%) rotate(180deg); }
.combobox-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--hair-strong); border-radius: 7px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08); z-index: 30;
  max-height: 280px; overflow-y: auto;
  display: none;
}
.combobox.open .combobox-list { display: block; }
.combobox-item {
  padding: 8px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f3f0e8;
}
.combobox-item:last-child { border-bottom: none; }
.combobox-item:hover, .combobox-item.highlighted { background: #f4f0e4; }
.combobox-item .ci-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }

/* ── Departed combobox (red text when set) ── */
.combobox.departed .combobox-input { color: var(--bad); }

/* ── Commitment chip (added to scenario) ── */
.added-chip.commitment {
  background: #ece8f4;
  color: #4a3d72;
}
.added-chip.commitment:hover {
  background: #ddd5ec;
}

/* ── Small initials chip (for commitments attendees) ── */
.dot-mini { width: 18px; height: 18px; border-radius: 4px; background: var(--chip); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 600; font-family: ui-monospace, monospace; margin-right: 2px; }

/* ── Summary chip row (above tables) ── */
.summary-chips { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.summary-chip { font-size: 12px; padding: 5px 11px; background: #fff; border: 1px solid var(--hair); border-radius: 999px; color: var(--ink-2); }
.summary-chip strong { color: var(--ink); font-weight: 600; }

/* ── KV layout (settings tenant tab) ── */
.kv-list { display: grid; grid-template-columns: 180px 1fr; gap: 14px 24px; padding: 8px 0; }
.kv-list .k { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; padding-top: 2px; }
.kv-list .v { font-size: 13.5px; color: var(--ink); }

/* ── Confidence colors ── */
.conf-good { color: var(--ok); font-weight: 600; }
.conf-warn { color: var(--warn); font-weight: 600; }
.conf-bad { color: var(--bad); font-weight: 600; }

/* ── Small bar (accrued YTD) ── */
.minibar { position: relative; height: 6px; background: var(--bar-track); border-radius: 3px; overflow: hidden; }
.minibar .minifill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar-neutral); border-radius: 3px; }

/* ── Added-shift chips (scenario) ── */
.added-chip { font-size: 11px; padding: 3px 8px; background: #e3efe8; color: var(--ok); border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.added-chip:hover { background: #d3e6db; }

/* ── Adjust shifts list (slide-over) ── */
.shift-adjust-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f3f0e8; gap: 12px; }
.shift-adjust-row:last-child { border-bottom: none; }
.shift-adjust-row .shift-name { font-size: 13px; font-weight: 500; flex: 1; }
.shift-adjust-row .shift-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .main { grid-template-columns: 1fr; }
  .scenario { grid-template-columns: 1fr 1fr; }
  .scenario-actions { grid-column: 1/-1; }
  .metrics { grid-template-columns: 1fr; }
  .wrow { grid-template-columns: 140px 1fr 1fr 64px; }
  .qnav-grid { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: 1fr; }
  .schedule-grid { grid-template-columns: 1fr; }
}
