:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --line: #dce4ee;
  --line-strong: #b9c6d6;
  --text: #111827;
  --muted: #65758b;
  --accent: #155eef;
  --accent-dark: #0f3f9f;
  --accent-soft: #eef4ff;
  --success: #087443;
  --success-soft: #e8f7ef;
  --warning: #925400;
  --warning-soft: #fff4db;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --shadow: 0 12px 32px rgba(17, 24, 39, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(21, 94, 239, 0.08), rgba(8, 116, 67, 0.06)),
    var(--bg);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.login-shell {
  width: min(100%, 440px);
}

.login-panel {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 70px rgba(17, 24, 39, 0.12);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.login-copy h1 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: 0;
}

.login-copy p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-error {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid #f4aaa5;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.login-form button {
  min-height: 44px;
  margin-top: 4px;
}

.login-language {
  margin-top: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 12px 0;
  background: rgba(245, 247, 251, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.72) 0 9%, transparent 31%),
    conic-gradient(from 220deg, #0f3f9f, #155eef, #37b6ff, #155eef, #0f3f9f);
  box-shadow: 0 9px 22px rgba(21, 94, 239, 0.24);
  color: transparent;
  font-size: 0;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(21, 94, 239, 0.08);
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.brand-lockup small,
.portal-meta,
.status-pill,
.workspace-tab span,
.stat-label,
.summary-tile span,
.compact-row span,
.compact-row small,
.event-row span,
.event-row small,
.review-card span,
.review-card small,
.muted-text,
.empty-state p {
  color: var(--muted);
}

.brand-lockup small {
  margin-top: 1px;
  font-size: 0.78rem;
}

.bottom-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.bottom-nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.bottom-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.panel-action-link,
.review-open-link,
.review-dashboard-link {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  padding: 7px 11px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.panel-action-link:hover,
.review-open-link:hover,
.review-dashboard-link:hover {
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
}

.review-dashboard-link {
  margin-top: 0;
}

.topbar-stack,
.portal-meta,
.workspace-tabs,
.attendance-summary-row,
.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-stack {
  align-items: center;
  justify-content: flex-end;
}

.logout-form {
  margin: 0;
}

.logout-button {
  margin-top: 0;
}

.workspace-mobile-logout-form {
  display: none;
  margin: 0;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.language-switch a {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.language-switch a.is-active {
  background: var(--accent);
  color: #fff;
}

.status-pill,
.match-chip,
.status-dot {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill {
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
}

.status-pill strong,
.status-pill span {
  color: var(--text);
}

.status-pill-workspace {
  min-height: 34px;
}

.refresh-status-pill {
  position: relative;
  gap: 7px;
  cursor: default;
  outline: 0;
}

.refresh-status-light {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12), 0 0 14px rgba(239, 68, 68, 0.42);
}

.refresh-status-pill.is-fresh .refresh-status-light {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14), 0 0 15px rgba(34, 197, 94, 0.48);
}

.refresh-status-label {
  color: var(--text);
  font-weight: 800;
}

.refresh-status-pill::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 30;
  min-width: max-content;
  max-width: min(280px, 86vw);
  padding: 8px 10px;
  border: 1px solid rgba(185, 198, 214, 0.78);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
  color: #0b2a4a;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  visibility: hidden;
}

.refresh-status-pill:hover::after,
.refresh-status-pill:focus::after,
.refresh-status-pill:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.refresh-status-pill:focus-visible {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.company-logo {
  display: block;
  object-fit: contain;
}

.company-logo-pill {
  width: 108px;
  height: 18px;
}

.portal-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 12px;
}

.portal-intro h1,
.panel h2,
.panel h3,
.summary-tile strong,
.stat-value {
  margin: 0;
  letter-spacing: 0;
}

.portal-intro h1 {
  font-size: 2.1rem;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portal-meta {
  justify-content: flex-end;
}

.portal-meta span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 700;
}

.workspace-strip,
.stats-grid,
.summary-grid,
.dashboard-grid,
.banner {
  margin-top: 14px;
}

.workspace-tabs {
  overflow-x: auto;
  padding-bottom: 4px;
}

.workspace-tab {
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.workspace-tab strong {
  color: var(--text);
}

.workspace-company-name {
  display: flex;
  align-items: center;
  min-height: 24px;
}

.workspace-logo {
  width: 124px;
  height: 21px;
}

.workspace-tab span {
  font-size: 0.85rem;
}

.workspace-tab em {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  font-style: normal;
  text-align: center;
}

.workspace-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.section-tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 3px 0 6px;
}

.section-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(185, 198, 214, 0.74);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #486079;
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(15, 63, 159, 0.06);
}

.section-tabs a:hover {
  border-color: rgba(37, 99, 235, 0.3);
  background: #fff;
  color: var(--accent-dark);
}

.section-tabs a[href="#enroll"] {
  border-color: rgba(37, 99, 235, 0.28);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.06));
  color: var(--accent-dark);
}

.executive-console {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  scroll-margin-top: 82px;
}

.executive-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  align-items: stretch;
}

.executive-copy,
.executive-focus-card,
.executive-kpi-card,
.executive-ops-card {
  min-width: 0;
  border: 1px solid rgba(185, 198, 214, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 42px rgba(15, 63, 159, 0.08);
}

.executive-copy {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(21, 94, 239, 0.13), rgba(8, 116, 67, 0.1)),
    linear-gradient(180deg, #ffffff, #f7fbff);
}

.executive-copy::after {
  content: "";
  position: absolute;
  right: -72px;
  bottom: -92px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(21, 94, 239, 0.12);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.72) 0 34%, transparent 35%),
    conic-gradient(from 180deg, rgba(8, 116, 67, 0.22), rgba(21, 94, 239, 0.2), rgba(255, 184, 0, 0.16), rgba(8, 116, 67, 0.22));
  pointer-events: none;
}

.executive-copy > * {
  position: relative;
  z-index: 1;
}

.executive-copy h1 {
  margin: 0;
  font-size: 2.8rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.executive-copy p:not(.eyebrow) {
  max-width: 620px;
  margin: 10px 0 0;
  color: #486079;
  font-size: 1rem;
  line-height: 1.5;
}

.executive-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.executive-pills > span:not(.status-dot) {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid rgba(185, 198, 214, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-size: 0.84rem;
  font-weight: 800;
}

.executive-pills .executive-temp-pill {
  gap: 7px;
}

.executive-temp-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.executive-temp-pill.temp-warm::before {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.executive-temp-pill.temp-hot::before {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.16);
}

.executive-temp-pill.temp-offline::before {
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.16);
}

.executive-month-nav {
  display: inline-grid;
  grid-template-columns: 34px minmax(132px, auto) 34px;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  margin-top: 16px;
  padding: 3px;
  border: 1px solid rgba(185, 198, 214, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 28px rgba(15, 63, 159, 0.06);
}

.executive-month-nav a {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-dark);
  font-size: 1.2rem;
  font-weight: 900;
  text-decoration: none;
}

.executive-month-nav a:hover {
  background: var(--accent-soft);
}

.executive-month-nav a.is-disabled {
  color: #9aa7b8;
  pointer-events: none;
}

.executive-month-nav strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.executive-focus-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.executive-stream-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.executive-stream-card .executive-card-head {
  align-items: center;
}

.executive-stream-media {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border-radius: 8px;
  background: #0b1726;
}

.executive-stream-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
}

.executive-stream-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.executive-stream-footer strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.executive-stream-footer small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.executive-stream-empty {
  display: grid;
  min-height: 210px;
  place-items: center;
  padding: 20px;
  border-radius: 8px;
  background: linear-gradient(145deg, #0b1726, #17263d);
  color: #d8e5f4;
  text-align: center;
}

.executive-stream-empty small {
  max-width: 32ch;
  color: #aebed2;
  line-height: 1.45;
}

.executive-focus-card > span,
.executive-kpi-card span,
.executive-card-head span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.executive-event {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.executive-event img {
  width: 96px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: #e8eef7;
}

.executive-event strong,
.executive-empty-focus strong {
  display: block;
  font-size: 1rem;
}

.executive-event small,
.executive-empty-focus small,
.executive-event em,
.executive-kpi-card small,
.presence-rank-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.35;
}

.executive-event em {
  color: var(--accent-dark);
  font-weight: 900;
}

.executive-empty-focus {
  display: grid;
  align-content: center;
  min-height: 104px;
  padding: 14px;
  border: 1px dashed rgba(185, 198, 214, 0.86);
  border-radius: 8px;
  background: #f8fbff;
}

.executive-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.executive-kpi-card {
  padding: 16px;
}

.executive-kpi-card strong {
  display: block;
  margin-top: 7px;
  color: #0f172a;
  font-size: 1.9rem;
  line-height: 1;
}

.executive-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.85fr) minmax(240px, 0.85fr);
  gap: 12px;
}

.executive-ops-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.executive-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.executive-card-head strong {
  color: #334155;
  font-size: 0.86rem;
}

.week-flow-bars,
.month-flow-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 9px;
  min-height: 154px;
  align-items: end;
}

.month-flow-bars {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.week-flow-day,
.month-flow-period {
  display: grid;
  grid-template-rows: minmax(92px, 1fr) auto auto;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.week-flow-bar,
.month-flow-bar {
  display: flex;
  align-items: end;
  min-height: 92px;
  padding: 4px;
  border-radius: 8px;
  background: #eef4ff;
}

.week-flow-bar span,
.month-flow-bar span {
  display: block;
  width: 100%;
  height: max(8px, var(--flow));
  border-radius: 7px;
  background: linear-gradient(180deg, #48c7b5, #155eef);
  box-shadow: 0 10px 22px rgba(21, 94, 239, 0.14);
}

.week-flow-day small,
.month-flow-period small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-flow-day strong,
.month-flow-period strong {
  color: #0f172a;
  font-size: 0.9rem;
}

.month-day-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15px, 1fr));
  gap: 4px;
  align-items: center;
}

.month-day-heatmap span {
  display: block;
  min-height: 14px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(72, 199, 181, 0.96), rgba(21, 94, 239, 0.88)) 0 100% / 100% max(14%, var(--day-flow)) no-repeat,
    #eef4ff;
}

.month-day-heatmap span.is-weekend {
  background:
    linear-gradient(180deg, rgba(146, 84, 0, 0.55), rgba(21, 94, 239, 0.42)) 0 100% / 100% max(10%, var(--day-flow)) no-repeat,
    #f8f1e4;
}

.month-day-heatmap span.is-holiday {
  background:
    linear-gradient(180deg, rgba(146, 84, 0, 0.48), rgba(180, 35, 24, 0.42)) 0 100% / 100% max(10%, var(--day-flow)) no-repeat,
    #fff4db;
}

.loss-flow-bars .month-flow-bar {
  background: #fff5ea;
}

.loss-flow-bars .month-flow-bar span {
  background: linear-gradient(180deg, #f7b267, #c2410c);
  box-shadow: 0 10px 22px rgba(194, 65, 12, 0.16);
}

.loss-flow-bars .month-flow-period strong {
  min-height: 1.9em;
  color: #0f172a;
  font-size: 0.72rem;
  line-height: 1.05;
  white-space: normal;
}

.loss-day-heatmap span {
  background:
    linear-gradient(180deg, rgba(247, 178, 103, 0.96), rgba(194, 65, 12, 0.88)) 0 100% / 100% max(10%, var(--day-flow)) no-repeat,
    #fff5ea;
}

.loss-day-heatmap span:not(.has-loss) {
  background: #eef4ff;
}

.loss-day-heatmap span.is-weekend:not(.has-loss) {
  background: #f8f1e4;
}

.loss-day-heatmap span.is-holiday:not(.has-loss) {
  background: #fff4db;
}

.loss-assumption {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.presence-rank-list {
  display: grid;
  gap: 12px;
}

.presence-rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.presence-rank-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-meter,
.absence-meter,
.justified-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.presence-meter span {
  display: block;
  width: var(--presence);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #087443, #48c7b5);
}

.absence-meter span {
  display: block;
  width: var(--absence);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b42318, #f59e0b);
}

.justified-meter span {
  display: block;
  width: var(--justified);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #155eef, #48c7b5);
}

.review-preview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.review-preview-item {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  border-radius: 8px;
  background: #e8eef7;
  text-decoration: none;
}

.review-preview-item img {
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
}

.review-preview-item span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.executive-map-card {
  grid-column: 1 / -1;
}

.ops-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(260px, 0.58fr);
  gap: 14px;
  align-items: stretch;
}

.ops-map-canvas {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid rgba(185, 198, 214, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(135deg, rgba(232, 247, 239, 0.96), rgba(238, 244, 255, 0.98));
}

.ops-map-canvas::before {
  content: "";
  position: absolute;
  inset: -40px;
  background:
    linear-gradient(118deg, transparent 0 44%, rgba(255, 255, 255, 0.92) 45% 51%, transparent 52%),
    linear-gradient(24deg, transparent 0 40%, rgba(255, 255, 255, 0.82) 41% 46%, transparent 47%),
    linear-gradient(82deg, transparent 0 62%, rgba(255, 255, 255, 0.74) 63% 67%, transparent 68%);
  opacity: 0.96;
}

.ops-map-canvas.is-real-map {
  min-height: 360px;
  background: #d9e3ec;
}

.ops-map-canvas.is-real-map::before {
  display: none;
}

.ops-map-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.92) contrast(1.04);
}

.ops-map-zone {
  position: absolute;
  z-index: 2;
  padding: 6px 9px;
  border: 1px solid rgba(15, 63, 159, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #334155;
  font-size: 0.76rem;
  font-weight: 900;
}

.ops-map-zone-primary {
  left: 18px;
  top: 16px;
}

.ops-map-pin-caption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: grid;
  gap: 1px;
  max-width: min(260px, calc(100% - 28px));
  padding: 8px 10px;
  border: 1px solid rgba(185, 198, 214, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.ops-map-pin-caption strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-map-pin-caption small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.ops-map-route {
  position: absolute;
  z-index: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 63, 159, 0.16);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.44);
}

.ops-map-route-main {
  left: 21%;
  top: 48%;
  width: 58%;
  transform: rotate(-17deg);
}

.ops-map-route-cross {
  left: 44%;
  top: 34%;
  width: 31%;
  transform: rotate(61deg);
}

.ops-map-node {
  position: absolute;
  z-index: 3;
  left: var(--x);
  top: var(--y);
  display: grid;
  width: 112px;
  transform: translate(-50%, -50%);
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.ops-map-node > span {
  position: relative;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
}

.ops-map-node > span::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid currentColor;
  border-radius: inherit;
  opacity: 0.28;
}

.ops-map-node strong,
.ops-map-node small {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-map-node strong {
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 900;
}

.ops-map-node small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.ops-map-node.node-live,
.ops-map-node.node-online,
.ops-map-node.node-recent {
  color: var(--success);
}

.ops-map-node.node-stale,
.ops-map-node.node-idle {
  color: var(--warning);
}

.ops-map-node.node-attention,
.ops-map-node.node-offline {
  color: var(--danger);
}

.ops-map-node.node-live > span,
.ops-map-node.node-online > span,
.ops-map-node.node-recent > span {
  background: var(--success);
}

.ops-map-node.node-stale > span,
.ops-map-node.node-idle > span {
  background: var(--warning);
}

.ops-map-node.node-attention > span,
.ops-map-node.node-offline > span {
  background: var(--danger);
}

.ops-map-detail {
  display: grid;
  align-content: start;
  min-width: 0;
}

.ops-map-detail h3 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.1;
}

.ops-map-detail p:not(.eyebrow) {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.ops-map-detail dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.ops-map-detail dl div {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-top: 1px solid rgba(185, 198, 214, 0.62);
}

.ops-map-detail dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ops-map-detail dd {
  margin: 0;
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 900;
}

.ops-map-detail small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.stat-card,
.summary-tile,
.panel,
.banner {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 16px;
}

.stat-label,
.summary-tile span {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stat-value {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.summary-tile {
  padding: 14px 16px;
}

.summary-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(310px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.panel-full {
  grid-column: 1 / -1;
}

.panel {
  min-width: 0;
  padding: 18px;
  scroll-margin-top: 82px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h2 {
  font-size: 1.12rem;
}

.panel-note {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.banner {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
}

.error-banner {
  border-color: #f4aaa5;
  background: var(--danger-soft);
  color: var(--danger);
}

.success-banner {
  border-color: #a9e2bd;
  background: var(--success-soft);
  color: var(--success);
}

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(185, 198, 214, 0.7);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88)),
    var(--surface);
  box-shadow: 0 18px 44px rgba(15, 63, 159, 0.08);
}

.ops-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}

.ops-table th,
.ops-table td {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(220, 228, 238, 0.82);
  text-align: left;
  vertical-align: top;
}

.ops-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #f7fbff, #edf4ff);
  color: #476079;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ops-table tbody tr {
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ops-table tbody tr:hover td {
  background: rgba(238, 244, 255, 0.62);
}

.ops-table tr:last-child td {
  border-bottom: 0;
}

.attendance-week-table th:not(:first-child),
.attendance-week-table td:not(:first-child) {
  min-width: 124px;
}

.attendance-week-table th:first-child,
.attendance-week-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 210px;
  text-align: left;
}

.attendance-week-table td:first-child {
  background: rgba(255, 255, 255, 0.96);
  vertical-align: middle;
}

.attendance-week-table th:first-child {
  background: linear-gradient(180deg, #f7fbff, #edf4ff);
}

.attendance-week-table td:not(:first-child) {
  background: rgba(251, 253, 255, 0.8);
  vertical-align: middle;
}

.attendance-week-table tbody tr:hover td:first-child {
  background: #f8fbff;
}

.attendance-person-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-width: 0;
}

.attendance-person-cell strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.94rem;
  min-width: 0;
}

.attendance-person-cell strong::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(21, 94, 239, 0.12);
  flex: 0 0 auto;
}

.attendance-week-table td:has(.attendance-times) {
  background: linear-gradient(180deg, rgba(238, 244, 255, 0.82), rgba(255, 255, 255, 0.95));
}

.attendance-week-table td:has(.absence-pill) {
  text-align: center;
  vertical-align: middle;
}

.attendance-week-table .muted-text {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 28px;
  border: 1px dashed rgba(101, 117, 139, 0.28);
  border-radius: 999px;
  color: rgba(101, 117, 139, 0.62);
  background: rgba(248, 250, 252, 0.72);
}

.absence-pill {
  display: inline-grid;
  min-width: 112px;
  min-height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
}

.absence-justified {
  border-color: rgba(22, 163, 74, 0.2);
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}

.absence-unjustified {
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(239, 68, 68, 0.1);
  color: #b42318;
}

.ops-table small,
.table-cell-value,
.compact-row span,
.compact-row small,
.event-row span,
.event-row small,
.review-card span,
.review-card small,
.muted-text,
.empty-state p {
  display: block;
  line-height: 1.45;
}

.status-dot {
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status-online,
.status-live,
.status-recent,
.status-recognized,
.status-linked {
  background: var(--success-soft);
  color: var(--success);
}

.status-stale,
.status-uncertain,
.status-idle,
.status-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-offline,
.status-attention,
.status-unknown,
.status-dismissed {
  background: var(--danger-soft);
  color: var(--danger);
}

.compact-list,
.event-stack,
.review-list,
.attendance-stack {
  display: grid;
  gap: 10px;
}

[data-attendance-region],
.attendance-stack,
.attendance-view {
  min-width: 0;
}

.compact-row,
.event-row,
.review-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
}

.person-row {
  align-items: center;
}

.compact-row small {
  grid-column: 1 / -1;
}

.compact-row > .status-dot {
  align-self: start;
  justify-self: end;
}

.camera-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.camera-live-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.camera-live-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b1726;
}

.camera-live-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.camera-live-media .status-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 8px 20px rgba(4, 14, 27, 0.24);
}

.camera-live-empty {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 18px;
  color: #d7e3f1;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.camera-live-copy {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.camera-live-copy span,
.camera-live-copy small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.table-cell-value {
  min-width: 0;
}

.table-cell-value small {
  display: block;
}

.attendance-toolbar,
.attendance-period-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.attendance-toolbar {
  flex-wrap: wrap;
  padding-bottom: 4px;
}

.attendance-toolbar > div {
  min-width: 0;
}

.attendance-period-top h3 {
  margin: 0;
  font-size: 1rem;
}

.attendance-toolbar h3 {
  margin: 0;
  font-size: 1.18rem;
}

.attendance-note {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.attendance-averages-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(55, 182, 255, 0.24), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(21, 94, 239, 0.18), transparent 36%),
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 46%, #ffffff 100%);
  box-shadow:
    0 24px 70px rgba(15, 63, 159, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.attendance-averages-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.6), transparent 44%),
    repeating-linear-gradient(90deg, rgba(37, 99, 235, 0.04) 0 1px, transparent 1px 74px),
    repeating-linear-gradient(0deg, rgba(37, 99, 235, 0.035) 0 1px, transparent 1px 74px);
  pointer-events: none;
}

.attendance-averages-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -110px;
  z-index: 0;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  filter: blur(22px);
  pointer-events: none;
}

.attendance-averages-card > * {
  position: relative;
  z-index: 1;
}

.attendance-averages-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.attendance-averages-heading h3 {
  margin: 0;
  color: #0b2a4a;
  font-size: 1.05rem;
}

.attendance-averages-card .eyebrow {
  color: #0f3f9f;
}

.attendance-averages-card .attendance-note {
  color: #4b6380;
}

.attendance-averages-card .attendance-summary-row {
  justify-content: flex-start;
}

.attendance-averages-card .match-chip {
  border-color: rgba(21, 94, 239, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: #0f3f9f;
  box-shadow: 0 10px 26px rgba(15, 63, 159, 0.08);
  backdrop-filter: blur(10px);
}

.attendance-averages-card .table-wrap {
  border-color: rgba(21, 94, 239, 0.18);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 48px rgba(15, 63, 159, 0.12);
  backdrop-filter: blur(14px);
}

.attendance-averages-table {
  min-width: 700px;
}

.attendance-averages-card .ops-table th {
  background: linear-gradient(180deg, #edf6ff, #dfeeff);
  color: #244666;
}

.attendance-averages-card .ops-table td {
  background: rgba(255, 255, 255, 0.72);
}

.attendance-averages-card .ops-table tbody tr:hover td {
  background: rgba(238, 244, 255, 0.82);
}

.attendance-averages-table td:not(:first-child) {
  color: #0b2a4a;
  font-weight: 850;
  white-space: nowrap;
}

.attendance-averages-table td:nth-last-child(-n + 2) {
  color: var(--accent-dark);
}

.average-pair {
  display: grid;
  gap: 6px;
}

.average-pair span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(100%, 168px);
  padding: 6px 9px;
  border: 1px solid rgba(21, 94, 239, 0.13);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(238, 244, 255, 0.64));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.average-pair small {
  color: #547096;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.week-picker {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(185, 198, 214, 0.64);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 255, 0.9)),
    #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 34px rgba(15, 63, 159, 0.08);
}

.week-picker-field {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.week-picker-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.week-picker-display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  min-width: 190px;
  border: 1px solid rgba(185, 198, 214, 0.7);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  padding: 10px 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.week-picker-display::after {
  content: "";
  width: 16px;
  height: 16px;
  align-self: center;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-top-width: 4px;
  border-radius: 4px;
  color: #0b2a4a;
  opacity: 0.78;
}

.week-picker-native {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  min-width: 0;
  opacity: 0;
  cursor: pointer;
}

.week-picker-native:focus + .week-picker-display,
.week-picker-native:focus-visible + .week-picker-display {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(21, 94, 239, 0.12);
}

.week-picker-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px;
  border: 1px solid rgba(220, 228, 238, 0.75);
  border-radius: 14px;
  background: rgba(241, 246, 255, 0.72);
}

.week-picker button,
.week-nav-button,
.week-current-link {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  border-radius: 11px;
  text-decoration: none !important;
}

.week-picker button {
  padding: 9px 16px;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.2);
}

.week-nav-button,
.week-current-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 900;
}

.week-nav-button {
  width: 40px;
  background: #fff;
  border-color: rgba(185, 198, 214, 0.78);
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.week-current-link {
  padding: 0 12px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.week-nav-button:hover,
.week-current-link:hover {
  background: #fff;
  color: var(--accent);
}

.attendance-export-link {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.attendance-export-link:hover {
  background: rgba(37, 99, 235, 0.13);
}

.segmented-control {
  align-items: center;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.segmented-control button {
  min-width: 92px;
  border-radius: 6px;
  padding: 7px 11px;
  background: transparent;
  color: var(--muted);
}

.segmented-control button.is-active {
  background: var(--accent);
  color: #fff;
}

.segmented-control button:not(.is-active):hover {
  background: var(--surface);
  color: var(--text);
}

.attendance-view[hidden] {
  display: none;
}

.attendance-summary-row {
  justify-content: flex-end;
}

.match-chip {
  padding: 4px 9px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.month-summary {
  margin-top: 12px;
}

.attendance-times {
  display: grid;
  gap: 8px;
}

.attendance-time-row {
  display: grid;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 2px;
  padding: 7px 12px;
  border: 1px solid rgba(21, 94, 239, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  text-align: center;
}

.attendance-time-label {
  color: #6f84a0;
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.attendance-time-row strong {
  color: #0b2a4a;
  flex: 0 0 auto;
  font-size: 0.88rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.event-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.event-row > div {
  min-width: 0;
}

.event-row img,
.review-card img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f6;
}

.review-card img {
  width: 64px;
  height: 64px;
}

.event-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.review-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.review-gallery-body {
  background:
    linear-gradient(180deg, rgba(238, 244, 255, 0.82), rgba(245, 247, 251, 0.92) 260px),
    var(--bg);
}

.review-page-shell {
  width: min(1800px, calc(100% - 24px));
  margin: 0 auto;
  padding: 14px 0 40px;
}

.review-topbar {
  padding-inline: 0;
}

.review-gallery-page {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.review-gallery-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  min-width: 0;
  border: 1px solid rgba(185, 198, 214, 0.78);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 42px rgba(15, 63, 159, 0.08);
}

.review-gallery-hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.review-gallery-meta,
.review-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-gallery-meta {
  margin-top: 12px;
}

.review-gallery-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(185, 198, 214, 0.72);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(248, 250, 252, 0.82);
  color: #334155;
  font-size: 0.82rem;
  font-weight: 850;
}

.review-view-tabs {
  align-items: center;
  justify-content: flex-end;
  padding: 4px;
  border: 1px solid rgba(185, 198, 214, 0.72);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.88);
}

.review-view-tabs a {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border-radius: 7px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.review-view-tabs a.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.review-view-tabs a:not(.is-active):hover {
  background: #fff;
  color: var(--accent-dark);
}

.review-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  align-items: start;
}

.review-gallery-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(15, 63, 159, 0.08);
}

.review-gallery-media {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #101828;
}

.review-gallery-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.review-gallery-copy {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.review-gallery-copy strong,
.review-gallery-copy span,
.review-gallery-copy small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.review-gallery-copy strong {
  font-size: 0.98rem;
  line-height: 1.18;
}

.review-gallery-copy span,
.review-gallery-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.review-gallery-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.review-gallery-card-top .status-dot {
  flex: 0 0 auto;
}

.review-gallery-card-top small {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-gallery-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 4px;
}

.review-gallery-form input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.review-gallery-dismiss-form {
  margin: 0;
}

.review-gallery-dismiss-form .button-muted {
  width: 100%;
  margin-top: 0;
}

.review-gallery-empty {
  min-height: 280px;
  border: 1px dashed rgba(185, 198, 214, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.review-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.review-form input,
.login-form input[type="email"],
.login-form input[type="password"],
.person-form input[type="text"],
.person-form input[type="file"] {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

button {
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.button-muted {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.button-muted:hover {
  background: var(--surface);
  color: var(--text);
}

.button-danger {
  background: var(--danger);
}

.button-danger:hover {
  background: #8f1b13;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.icon-button:hover {
  border-color: rgba(180, 35, 24, 0.22);
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.person-remove-form {
  align-self: center;
  justify-self: end;
  margin: 0;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(8px);
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-card {
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.22);
}

.confirm-card h3 {
  margin: 0;
  font-size: 1.24rem;
}

.confirm-card p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.event-action-form {
  margin-top: 8px;
}

.event-train-button {
  margin-top: 0;
  padding: 6px 8px;
  font-size: 0.82rem;
}

.enrollment-panel {
  overflow: hidden;
  border-color: rgba(37, 99, 235, 0.2);
  background:
    radial-gradient(circle at 86% 0%, rgba(37, 99, 235, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
}

.person-form {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.enrollment-form {
  gap: 14px;
  max-width: 860px;
  padding: 0;
  margin: 0;
  border-bottom: 0;
}

.enrollment-fields,
.enrollment-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.photo-input-card {
  min-height: 112px;
  padding: 14px;
  border: 1px dashed rgba(37, 99, 235, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 244, 255, 0.74)),
    #fff;
}

.photo-input-card > span {
  color: #0b2a4a !important;
  font-size: 0.92rem !important;
}

.photo-input-card small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.photo-input-card input[type="file"] {
  margin-top: 4px;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.74);
}

.enrollment-form button[type="submit"] {
  justify-self: start;
  min-height: 42px;
  padding-inline: 18px;
  border-radius: 12px;
}

.enrollment-readonly {
  max-width: 720px;
}

.people-panel-body {
  display: block;
}

.people-panel .person-form {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.person-form label {
  display: grid;
  gap: 6px;
}

.person-form label > span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.person-form .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.person-form .check-row input {
  width: 16px;
  height: 16px;
}

.person-form .check-row span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.roster-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.people-panel .roster-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-muted);
}

.empty-state h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.empty-state p {
  margin: 0;
}

@media (max-width: 1040px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow-x: visible;
  }

  .bottom-nav a {
    padding: 8px 4px;
    text-align: center;
    font-size: 0.78rem;
  }

  .topbar-stack {
    justify-content: flex-start;
  }

  .executive-hero,
  .executive-ops-grid,
  .review-gallery-hero {
    grid-template-columns: 1fr;
  }

  .review-view-tabs {
    justify-content: flex-start;
  }

  .executive-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-grid,
  .dashboard-grid,
  .people-panel-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 8px;
  }

  .review-page-shell {
    width: min(100% - 16px, 1800px);
    padding-top: 8px;
  }

  .topbar {
    position: static;
    gap: 12px;
    padding: 10px 0 12px;
  }

  .brand-lockup {
    width: 100%;
  }

  .topbar-stack {
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .review-gallery-hero {
    padding: 14px;
  }

  .review-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 9px;
  }

  .review-gallery-form {
    grid-template-columns: 1fr;
  }

  .topbar-stack .status-pill,
  .topbar-stack .logout-form {
    display: none;
  }

  .language-switch,
  .workspace-mobile-logout-form {
    flex: 0 0 auto;
  }

  .executive-copy {
    padding: 18px;
  }

  .executive-copy h1 {
    font-size: 2rem;
  }

  .executive-kpi-grid,
  .review-preview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .executive-event {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .executive-event img {
    width: 74px;
  }

  .week-flow-bars,
  .month-flow-bars {
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 5px;
  }

  .month-flow-bars {
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  }

  .week-flow-day,
  .month-flow-period {
    grid-template-rows: minmax(78px, 1fr) auto auto;
  }

  .week-flow-bar,
  .month-flow-bar {
    min-height: 78px;
  }

  .ops-map-layout {
    grid-template-columns: 1fr;
  }

  .ops-map-canvas {
    min-height: 300px;
  }

  .status-pill {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 0.8rem;
  }

  .logout-button {
    min-height: 30px;
    padding: 5px 10px;
  }

  .company-logo-pill {
    width: 96px;
    height: 16px;
  }

  .workspace-strip {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .workspace-tabs {
    flex: 1 1 auto;
    min-width: 0;
    padding-bottom: 0;
  }

  .workspace-tab {
    width: 100%;
    min-width: 0;
  }

  .section-tabs {
    margin-top: 10px;
  }

  .section-tabs a {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .workspace-mobile-logout-form {
    display: flex;
    align-self: center;
  }

  .workspace-mobile-logout-form .logout-button {
    min-height: 44px;
    border-radius: 10px;
    padding-inline: 14px;
  }

  .portal-intro,
  .attendance-toolbar,
  .attendance-period-top {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-intro h1 {
    font-size: 1.65rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    padding: 14px;
  }

  .enrollment-fields,
  .enrollment-photo-grid {
    grid-template-columns: 1fr;
  }

  .photo-input-card {
    min-height: 104px;
  }

  .attendance-averages-card {
    gap: 14px;
    margin-top: 14px;
    padding: 14px;
    border-radius: 18px;
  }

  .attendance-averages-card::after {
    right: -130px;
    bottom: -130px;
  }

  .attendance-averages-card .table-wrap {
    border-radius: 14px;
  }

  .average-pair span {
    width: 150px;
  }

  .event-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .event-row img {
    width: 58px;
    height: 58px;
  }

  .event-row .status-dot,
  .event-row em {
    grid-column: 2;
    justify-self: start;
  }

  .attendance-week-table th:not(:first-child),
  .attendance-week-table td:not(:first-child) {
    width: 102px;
    min-width: 102px;
    max-width: 102px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .attendance-week-table {
    width: 836px;
    min-width: 836px;
    table-layout: fixed;
  }

  .attendance-week-table th:first-child,
  .attendance-week-table td:first-child {
    width: 122px;
    min-width: 122px;
    max-width: 122px;
    padding-left: 10px;
    padding-right: 8px;
  }

  .attendance-person-cell {
    display: block;
  }

  .attendance-person-cell strong {
    width: 100%;
    overflow: hidden;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .attendance-person-cell strong::before {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 4px rgba(21, 94, 239, 0.12);
  }

  .attendance-week-table .absence-pill {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 6px 5px;
    font-size: 0.58rem;
    line-height: 1.05;
    white-space: normal;
  }

  .week-picker {
    align-items: stretch;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .week-picker input[type="week"] {
    min-width: 0;
    width: 100%;
  }

  .week-picker-actions {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px minmax(0, 1fr);
  }

  .segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .segmented-control button,
  .attendance-export-link {
    width: 100%;
  }

  .confirm-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .confirm-actions button {
    width: 100%;
  }

  .attendance-time-row {
    justify-content: center;
    min-height: 48px;
    padding: 6px 5px;
    text-align: center;
  }

  .attendance-time-label {
    font-size: 0.45rem;
    letter-spacing: 0.06em;
  }

  .attendance-time-row strong {
    font-size: 0.8rem;
    line-height: 1;
    white-space: nowrap;
  }

  .device-table {
    min-width: 0;
  }

  .device-table thead {
    display: none;
  }

  .device-table,
  .device-table tbody,
  .device-table tr,
  .device-table td {
    display: block;
    width: 100%;
  }

  .device-table tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }

  .device-table tr:last-child {
    border-bottom: 0;
  }

  .device-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    border-bottom: 0;
    text-align: right;
  }

  .device-table td::before {
    content: attr(data-label);
    flex: 0 0 92px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0;
    text-align: left;
    text-transform: uppercase;
  }

  .device-table .table-cell-value {
    flex: 1;
    overflow-wrap: anywhere;
  }

  .device-table .status-dot {
    justify-content: center;
    max-width: 100%;
    white-space: normal;
  }

  .review-card,
  .review-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand-mark::after {
    inset: 8px;
  }

  .brand-lockup strong {
    font-size: 0.95rem;
  }

  .brand-lockup small {
    font-size: 0.74rem;
  }

  .executive-kpi-grid,
  .review-preview-strip {
    grid-template-columns: 1fr;
  }

  .ops-map-node {
    width: 96px;
  }

  .week-picker-actions {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .week-current-link {
    grid-column: 1 / -1;
    min-height: 34px;
  }
}
