:root {
  --bg: #0f1115;
  --card: #171a21;
  --card-border: #262b36;
  --text: #eef0f4;
  --muted: #9aa3b2;
  --accent: #4f8dfd;
  --accent-text: #ffffff;
  --danger: #e5566d;
  --success: #3fbf7f;
  --warn: #e0a83e;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: hidden; /* a wide table or tab row scrolls inside its own box, never the page */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

.wrap.wide { max-width: 900px; }

header.topbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--card-border);
  z-index: 5;
}

header.topbar .topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

header.topbar .brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
header.topbar .brand-logo { height: 32px; width: auto; display: block; }
header.topbar .who { font-size: 13px; color: var(--muted); text-align: right; }
header.topbar a.logout { color: var(--muted); font-size: 13px; text-decoration: none; }

header.topbar .topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 10px;
  overflow-x: auto;
  font-size: 13px;
  white-space: nowrap;
}
header.topbar .topnav .crumb-link {
  color: var(--muted);
  text-decoration: none;
}
header.topbar .topnav .crumb-link:hover { color: var(--text); }
header.topbar .topnav .crumb-sep { color: var(--card-border); }
header.topbar .topnav .crumb-current { color: var(--text); font-weight: 600; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.card h2 { margin-top: 0; font-size: 16px; }
.card h1 { margin-top: 0; font-size: 20px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
label:first-child { margin-top: 0; }

input, select, textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: #0c0e13;
  color: var(--text);
  font-size: 16px;
}

button {
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button.primary { background: var(--accent); color: var(--accent-text); width: 100%; margin-top: 16px; }
button.primary:disabled { opacity: 0.5; cursor: default; }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); width: 100%; margin-top: 10px; }
button.danger { background: var(--danger); color: #fff; }
button.small { padding: 8px 12px; font-size: 13px; width: auto; margin: 0; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--card-border); }

/* Tab rows scroll sideways on their own when they don't fit (Scotto, Oct
   2026) instead of pushing the whole page off to the right. */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
/* A thin bar under a tab row that doesn't fit, so people see there is
   more to the right (phones hide their own scrollbars). Drawn by
   common.js; its thumb follows the row as it scrolls. */
.tabs-scroll { height: 4px; border-radius: 2px; background: #262b36; margin: -12px 4px 14px; position: relative; overflow: hidden; }
.tabs-scroll .thumb { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 2px; background: var(--accent); opacity: .85; }
.tabs button {
  flex: 1 0 auto;
  white-space: nowrap;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--card-border);
}
.tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.msg { padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.msg.error { background: rgba(229,86,109,0.15); color: #ff8a9a; border: 1px solid rgba(229,86,109,0.4); }
.msg.success { background: rgba(63,191,127,0.15); color: #6be3a4; border: 1px solid rgba(63,191,127,0.4); }
.msg.info { background: rgba(79,141,253,0.15); color: #8fb6ff; border: 1px solid rgba(79,141,253,0.4); }

.page-title { font-size: 22px; margin: 4px 0 16px; }

.app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 8px; }
.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 14px 18px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
}
.app-tile.disabled { opacity: 0.4; }
.tile-icon-wrap { position: relative; display: inline-flex; margin-bottom: 10px; }
.tile-icon-chip {
  display: flex;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
}
.tile-icon-chip img { width: 56px; height: 56px; display: block; }
.tile-label { font-size: 14px; font-weight: 600; }
.tile-note { margin-top: 4px; font-size: 12px; }
.tile-badge {
  position: absolute;
  top: -7px;
  right: -12px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--card);
}


.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
  gap: 10px;
}
.list-row:last-child { border-bottom: none; }
.list-row .name { font-weight: 600; }
.list-row .sub { font-size: 13px; color: var(--muted); }

.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.on { background: rgba(63,191,127,0.18); color: #6be3a4; }
.badge.off { background: rgba(154,163,178,0.15); color: var(--muted); }
.badge.stale { background: rgba(224,168,62,0.18); color: #f0c265; }
.badge.danger { background: rgba(229,86,109,0.18); color: #ff8a9a; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.toggle-row .label { font-size: 14px; }

/* 2-up app-access grid (Employees page) — switch on top, label centered
   underneath, so a manager scanning ~50 employees can read the column of
   toggles straight down instead of hunting through a wrapped row of
   label+switch pairs. */
.toggle-grid-2col {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
}
.toggle-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}
.toggle-col .label { font-size: 12px; text-align: center; color: var(--muted); }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background-color: var(--card-border); border-radius: 999px; transition: 0.15s;
}
.switch .slider:before {
  position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background-color: white; border-radius: 50%; transition: 0.15s;
}
.switch input:checked + .slider { background-color: var(--success); }
.switch input:checked + .slider:before { transform: translateX(18px); }

.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.stack-actions { display: flex; gap: 8px; margin-top: 10px; }
.stack-actions button { flex: 1; }

a { color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th, table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--card-border); }
table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.credential-box {
  background: #0c0e13; border: 1px dashed var(--accent); border-radius: 8px;
  padding: 12px; font-size: 14px; margin-top: 10px; line-height: 1.7;
}
.credential-box b { color: var(--accent); }

/* ---- Systems Monitoring — Status tab (card-grid dashboard) ---- */
.alert-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(229,86,109,0.12); border: 1px solid rgba(229,86,109,0.4);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 14px;
}
.alert-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
.alert-banner b { color: #ff8a9a; }
.alert-banner .sp { flex: 1; }
.alert-banner .alert-more { color: var(--muted); }
.alert-banner .link { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; cursor: pointer; }

.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 14px 16px; }
.stat-tile .n { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-tile .l { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.stat-tile .l .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* Site scorecard (all-locations dashboard) — collapsed-by-default per-
   location card: a segmented status bar across the top, an issue-count
   badge, and one monogram chip per category. Click the header to expand
   into the same .sys-grid used below (see monitoring.js's
   siteScoreCardHtml/toggleLocationCard). Chip/bar colors are set inline
   from STATUS_META in monitoring.js, not fixed classes here, so this
   app's brighter red/yellow/green status language stays in one place. */
.site-scorecard { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.site-scorecard .top-bar { display: flex; width: 100%; height: 15px; }
.site-scorecard .score-body { padding: 16px 18px 17px; cursor: pointer; }
.site-scorecard .score-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.site-scorecard .score-nm { font-size: 16px; font-weight: 700; }
.site-scorecard .score-frac { font-size: 12px; color: var(--muted); margin-top: 2px; }
.site-scorecard .score-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(255,23,68,.16); color: #ff1744; border: 1px solid rgba(255,23,68,.4); white-space: nowrap; }
.site-scorecard .cat-row { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.site-scorecard .mono-chip { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; letter-spacing: .01em; border-width: 2px; border-style: solid; flex-shrink: 0; }
.site-scorecard .score-expand { max-height: 0; overflow: hidden; transition: max-height .2s ease; }
.site-scorecard.open .score-expand { max-height: 3000px; }

.sys-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.sys-tile { background: #0c0e13; border: 1px solid var(--card-border); border-left: 3px solid var(--card-border); border-radius: 10px; }
.sys-tile-head { padding: 12px; cursor: pointer; }
.sys-icon { width: 26px; height: 26px; border-radius: 7px; background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.top-row { display: flex; align-items: center; gap: 8px; }
.sys-name { font-size: 13px; font-weight: 600; }
.sys-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.status-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.status-row .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-row .label { font-size: 12px; font-weight: 600; }
.sys-checked { font-size: 11px; color: var(--muted); margin-top: 8px; }
.sys-speed { font-size: 12px; margin-top: 8px; }
.sys-speed .sys-testnow { margin: 0 0 0 6px; padding: 2px 8px; font-size: 11px; vertical-align: middle; }
.sys-hist { padding: 0 12px 12px; }
/* Silencing controls (patch_032): under a tile, and a bar per expanded location */
.sys-silence { padding: 0 12px 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11px; }
.silence-menu { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.group-silence { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 18px 12px; align-items: center; }
.prefs-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.prefs-table td { padding: 6px 0; border-bottom: 1px solid var(--card-border); font-size: 14px; }
.prefs-table td:last-child { width: 46%; }
.prefs-table select { margin: 0; }
.group-silence-item { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sys-equip { font-size: 11px; color: var(--muted); margin: 4px 0 10px; }

.roadmap-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px; }
.roadmap-card .title { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.roadmap-card .sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.roadmap-row { display: flex; gap: 10px; flex-wrap: wrap; }
.roadmap-item { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px; opacity: 0.55; }
.roadmap-icon { width: 38px; height: 38px; border-radius: 10px; background: #0c0e13; border: 1px solid var(--card-border); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.roadmap-item .rl { font-size: 11.5px; text-align: center; }

@media (max-width: 640px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sys-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 420px) {
  .sys-grid { grid-template-columns: 1fr; }
}

/* ---- Service Calls — pending/closed divider, notes, destination pickers ---- */
.sc-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 12px; color: var(--muted); font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.sc-divider:first-child { margin-top: 0; }
.sc-divider span { flex: 1; height: 1px; background: var(--card-border); }

.sc-closed { opacity: 0.55; }

.sc-note { padding: 10px 0; border-bottom: 1px solid var(--card-border); font-size: 14px; }
.sc-note:last-child { border-bottom: none; }
.sc-note-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }

.sc-checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; margin-top: 4px; }
.sc-checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin: 0; }
.sc-checkbox input { width: auto; padding: 0; }

@media (max-width: 480px) {
  .sc-checkbox-grid { grid-template-columns: 1fr; }
}
/* ---- Service Calls — New/Working/Closed sub-tabs + tile grid ---- */
.sc-subtabs {
  display: flex; gap: 6px; margin-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}
.sc-subtab {
  display: flex; align-items: center; gap: 8px; padding: 10px 4px; margin-right: 22px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer;
}
.sc-subtab.active { color: var(--text); border-bottom-color: var(--accent); }
.sc-subtab-cnt {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(154,163,178,0.15); color: var(--muted);
}
.sc-subtab.active .sc-subtab-cnt { background: rgba(79,141,253,0.2); color: var(--accent); }
.sc-subtab-new.active .sc-subtab-cnt { background: rgba(224,168,62,0.2); color: #f0c265; }

.sc-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.sc-tile { display: flex; flex-direction: column; gap: 10px; }
.sc-tile-note {
  background: #0c0e13; border: 1px solid var(--card-border); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
}
.sc-tile-note-lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}
.sc-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.sc-tile-actions { display: flex; gap: 8px; flex-shrink: 0; }
/* ---- Employees — tab counters, roster rows, employee data card ---- */
.tab-badge {
  display: inline-block; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
  margin-left: 6px; vertical-align: middle;
}

.roster-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.loc-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.loc-filter {
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--card-border); background: transparent; color: var(--muted); cursor: pointer;
}
.loc-filter.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.roster-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.roster-sort, .roster-status { display: flex; align-items: center; gap: 8px; }
.roster-sort label, .roster-status label { margin: 0; white-space: nowrap; }
.roster-sort select, .roster-status select { width: auto; min-width: 170px; padding: 9px 10px; }
.roster-status select { min-width: 120px; }

.emp-row {
  display: flex; align-items: center; gap: 16px; padding: 13px 4px;
  border-bottom: 1px solid var(--card-border); cursor: pointer;
}
.emp-row:last-child { border-bottom: none; }
.emp-row:hover { background: rgba(255,255,255,0.02); }
.emp-row { flex-direction: column; align-items: stretch; gap: 6px; }
.emp-row .emp-l1, .emp-row .emp-l2 { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.emp-row .emp-l2 { align-items: center; }
.emp-row .emp-who { flex: 1; min-width: 0; }
.emp-row .emp-name { font-weight: 600; font-size: 14px; }
.emp-row .emp-roleinfo { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.emp-row .emp-locs { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 4px; vertical-align: middle; }
.emp-row .emp-toggles { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
/* The apps a person has: three beside the name, then five to a row under it. */
.emp-row .emp-apps { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; min-width: 0; max-width: 204px; flex-shrink: 0; }
.emp-row .emp-apps .emp-tgl { width: 36px; }
.emp-row .emp-apps .emp-tgl .ic { width: 26px; height: 26px; border-radius: 7px; }
.emp-row .emp-l2:empty { display: none; }

.emp-tgl { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 42px; flex-shrink: 0; }
.emp-tgl .ic { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.emp-tgl.on .ic { background: rgba(63,191,127,0.16); color: #6be3a4; }
.emp-tgl.off .ic { background: #1a1e27; color: #3a4152; }
.emp-tgl .lbl { font-size: 8px; font-weight: 700; color: var(--muted); }
.emp-tgl.off .lbl { color: #454c5b; }

/* Active/Inactive per-row switch (owner only) — a thin divider then the
   existing generic .switch pill component, reused rather than another
   bespoke toggle. See empStatusToggleHtml() in employees.js. */
.emp-noapps { font-size: 11px; color: #454c5b; align-self: center; padding: 0 4px; }
.detail-apps { display: flex; flex-wrap: wrap; gap: 10px 6px; }
.detail-apps .emp-tgl { width: 56px; cursor: pointer; }
.detail-apps .emp-tgl .ic { width: 40px; height: 40px; border-radius: 10px; }
.detail-apps .emp-tgl .lbl { font-size: 10px; }
.emp-status-divider { width: 1px; align-self: stretch; background: var(--card-border); margin: 0 2px; flex-shrink: 0; }
.emp-status-tgl { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 46px; flex-shrink: 0; }
.emp-status-tgl .lbl { font-size: 8px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); text-transform: uppercase; }
.switch.is-disabled .slider { opacity: 0.45; cursor: not-allowed; }

.confirm-popover {
  position: fixed;
  z-index: 50;
  width: 240px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
.confirm-popover #confirmPopoverText { font-size: 13px; line-height: 1.4; margin-bottom: 10px; }
.confirm-popover-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .emp-row .emp-apps { max-width: 204px; }
}

/* Employee data card — the popup opened by clicking a roster row */
.detail-card { text-align: center; }
.detail-close {
  position: absolute; top: 18px; right: 18px; width: 32px; height: 32px;
  border-radius: 9px; border: 1px solid var(--card-border); background: transparent;
  color: var(--muted); font-size: 20px; line-height: 1; padding: 0;
}
.detail-avatar {
  width: 84px; height: 84px; border-radius: 999px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 28px; background: rgba(79,141,253,0.18); color: #8fb6ff;
}
.detail-avatar.has-photo { background-size: cover; background-position: center; color: transparent; }
/* Applicant thumbnail in the Employees pending list, and the Apply page's picker */
.pending-thumb {
  width: 44px; height: 44px; border-radius: 999px; flex-shrink: 0;
  background: rgba(79,141,253,0.18) center/cover no-repeat;
}
.photo-pick { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.photo-preview {
  width: 72px; height: 72px; border-radius: 999px; flex-shrink: 0;
  border: 1px dashed var(--card-border); background: rgba(79,141,253,0.10) center/cover no-repeat;
}
.photo-pick input[type=file] { margin-bottom: 0; }
.loc-check-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; }
.loc-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.loc-check input { width: auto; margin: 0; }
.detail-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; text-align: left; }
.detail-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--card-border); text-align: left; }
.detail-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted);
  text-transform: uppercase; margin-bottom: 10px;
}
.detail-contact { display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.detail-contact-row { display: flex; align-items: flex-start; gap: 10px; }
.detail-contact-row .ic { color: var(--muted); flex-shrink: 0; margin-top: 2px; }
.detail-jotform-btn {
  margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px; border-radius: 9px; background: var(--accent); color: #fff;
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.cert-row {
  background: #0c0e13; border: 1px solid var(--card-border); border-radius: 9px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 8px;
}
.cert-row:last-child { margin-bottom: 0; }
.cert-row .check { color: var(--success); flex-shrink: 0; display: flex; }
.cert-row .cert-name { font-weight: 600; }
.cert-row .cert-date { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.cert-row .cert-remove { color: var(--muted); cursor: pointer; flex-shrink: 0; }

/* Small pill labels — currently used for the roster row / detail card
   location chips (locChipsHtml() in employees.js). .warn is for a chip that
   should stand out (e.g. a location that isn't this person's primary). */
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1.6;
  background: rgba(79, 141, 253, 0.15); color: #8fb6ff;
}
.chip.warn { background: rgba(224, 168, 62, 0.18); color: #f0c265; }

/* Scheduling: Print / multi-week view — hidden on screen, shown only inside
   the browser's print dialog (mirrors the old Apps Script system's approach:
   render into a hidden block, then window.print()). */
.print-view { display: none; }
@media print {
  body > *:not(.print-view) { display: none !important; }
  .print-view { display: block !important; }
  .print-week-block { margin-bottom: 24px; }
  .print-week-block.print-new-page { page-break-before: always; }
  .print-week-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
  .print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .print-table th, .print-table td { border: 1px solid #999; padding: 4px 6px; text-align: left; vertical-align: top; }
  .print-table th { background: #eee; }
  .print-emp-name { font-weight: 700; white-space: nowrap; }
}

/* Home screen (Oct 2026): one block per bar above the app tiles. */
.hm-alerts { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; margin: 0 0 12px; border-radius: 12px; border: 1px solid var(--card-border); background: var(--card); color: var(--text); font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; box-sizing: border-box; }
.hm-alerts.bad { border-color: #7a2a30; background: #2a1416; color: #ffd0d2; }
.hm-alerts.open { border-radius: 12px 12px 0 0; margin-bottom: 0; }
.hm-alerts .n { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; background: #e5566d; color: #fff; font-size: 13px; }
.hm-alerts.ok .n { background: #2f7a26; }
.hm-alertlist { border: 1px solid #7a2a30; border-top: 0; border-radius: 0 0 12px 12px; background: #1d161a; padding: 6px 12px 10px; margin-bottom: 12px; }
.hm-alertrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #3a2226; font-size: 13px; }
.hm-alertrow:first-child { border-top: 0; }
.hm-kick { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
.hm-block { border: 2px solid #3b8f2f; border-radius: 12px; padding: 6px 10px; margin-bottom: 10px; background: #121419; }
.hm-block.warn { border-color: #c9770f; } .hm-block.bad { border-color: #c91f26; } .hm-block.none { border-color: #3a4152; }
.hm-top { display: flex; align-items: center; gap: 10px; padding: 4px 0 8px; }
.hm-code { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-style: italic; font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -.04em; width: 52px; color: #8ee37a; text-decoration: none; }
.hm-block.warn .hm-code { color: #ffb454; } .hm-block.bad .hm-code { color: #ff8a8f; } .hm-block.none .hm-code { color: #9aa3b2; }
.hm-obtn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 40px; min-width: 72px; padding: 3px 10px; border-radius: 9px; border: 2px solid #5b606b; background: #171a21; font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 800; font-size: 19px; line-height: 1.05; letter-spacing: .02em; color: #c4c8d0; text-decoration: none; }
.hm-obtn .s { font-size: 12px; font-weight: 700; }
.hm-obtn.ok { border-color: #3fbf7f; color: #c9f5dc; } .hm-obtn.warn { border-color: #e8931c; color: #ffe3b8; } .hm-obtn.bad { border-color: #e3242b; color: #ffd0d2; background: #2a1416; }
.hm-net { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 800; font-size: 15px; line-height: 1.15; text-align: center; }
.hm-line { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid #2a2f3a; }
.hm-area { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 800; font-size: 22px; width: 60px; letter-spacing: -.01em; }
.hm-stat { display: flex; flex-direction: column; align-items: center; flex: 1; line-height: 1.05; text-decoration: none; color: var(--text); }
.hm-stat .k { font-size: 10px; color: var(--muted); } .hm-stat .v { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 800; font-size: 17px; }
.hm-stat .v.warn { color: #ffb454; }
.hm-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); padding: 6px 0 2px; border-top: 1px solid #2a2f3a; flex-wrap: wrap; }
.hm-needs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.hm-need { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-border); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; }
.hm-need .b { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: #e5566d; color: #fff; font-size: 12px; font-weight: 700; }
.hm-need .b.warn { background: #e0a83e; color: #1b1400; } .hm-need .b.dim { background: #2f3542; }
.hm-pull { height: 0; overflow: hidden; text-align: center; font-size: 12px; color: var(--muted); line-height: 56px; transition: height .15s; }
.hm-stamp { text-align: right; font-size: 11px; margin: -4px 0 10px; }
.hm-stamp a { color: var(--muted); text-decoration: none; }

/* Segmented choice rows (morning summary settings) */
.seg-row { display: inline-flex; border: 1px solid var(--card-border); border-radius: 10px; overflow: hidden; margin: 2px 0 10px; }
.seg-row .seg { padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--muted); background: transparent; border: 0; border-right: 1px solid var(--card-border); cursor: pointer; margin: 0; width: auto; }
.seg-row .seg:last-child { border-right: 0; }
.seg-row .seg.on { background: var(--accent); color: #fff; }
