/* Hydra identity, carried over from the original Hydra Live:
   logo-wave green, cyan, Myriad Pro, black text and generous white space. */
:root {
  --hydra-green: #67c18c;
  --hydra-blue: #3fb6df;
  --hydra-cyan: #00aeef;
  --ink: #231f20;
  --muted: #626366;
  --line: #dedfe0;
  --link: #096887;
  --wash: #f6faf7;
  --ok: #268359;
  --warn: #c9861a;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "myriad-pro", "Myriad Pro", "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

[hidden] { display: none !important; }

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3, strong { font-weight: 700; color: var(--ink); }
h1 { font-size: 38px; line-height: 1.15; letter-spacing: -0.015em; }
h2 { font-size: 24px; line-height: 1.3; }
a { color: var(--link); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted, .small { color: var(--muted); }
.small { font-size: 14px; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.6; cursor: default; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

.secondary {
  color: var(--ink);
  border: 1px solid #c9cbcc;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  padding: 11px 16px;
  min-height: 40px;
}
.secondary:hover { border-color: var(--hydra-blue); background: #f1faff; }

.primary {
  color: #101010;
  background: var(--hydra-cyan);
  border: 1px solid var(--hydra-cyan);
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 16px;
  min-height: 40px;
}
.primary:hover { background: var(--hydra-blue); border-color: var(--hydra-blue); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
  padding: 14px 20px;
  border-radius: 4px;
  z-index: 50;
}
.orders-panel { margin-top: 12px; }
.orders-panel p { font-size: 16px; margin-top: 12px; }

select,
input {
  color: var(--ink);
  font-size: 16px;
  border: 1px solid #c9cbcc;
  border-radius: 4px;
  background: #fff;
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #535457;
}

.badge {
  display: inline-block;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.green { background: #ecf7f0; color: #28643f; }
.orange { background: #fff3df; color: #875408; }
.red { background: #fbe7e9; color: #a42533; }
.grey { background: #f0f1f1; color: #5d5d60; }

/* Entrance: sign-in and message screens */

.gate {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--hydra-green);
}
.entrance {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(1100px, 100%);
  margin: auto;
  padding: 70px 7% 40px;
}
.entrance .logo { width: min(440px, 76%); height: auto; margin-bottom: 55px; }
.entrance h1 {
  font-size: clamp(40px, 7vw, 86px);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 55px;
}
.entrance form { max-width: 430px; width: 100%; }
.entrance label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.035em;
  color: #535457;
  margin-bottom: 12px;
}
.entry-field {
  display: flex;
  background: #fff;
  border: 1px solid #c9cbcc;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}
.entry-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  padding: 15px 18px;
  min-height: 56px;
}
.entry-field input:focus-visible { outline: 3px solid #30aad7; outline-offset: -3px; }
.entry-field button {
  border: 0;
  min-height: 56px;
  padding: 14px 22px;
  font-weight: 600;
  color: #111;
  background: var(--hydra-cyan);
}
.entry-field button:hover { background: var(--hydra-blue); }
.form-error { font-size: 14px; line-height: 1.5; color: #a42533; margin-bottom: 10px; }
.login-help, .entrance-note { font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 520px; }
.entrance-note { font-size: 16px; margin: -25px 0 24px; }
.entrance code { background: #f0f1f1; padding: 1px 5px; border-radius: 3px; font-size: 0.95em; }
.gate footer,
#view-live > footer {
  padding: 23px 7%;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
#view-live > footer { padding: 23px 4%; margin-top: 30px; }

/* Header */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 4%;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand { display: flex; align-items: center; gap: 30px; min-width: 0; }
.brand img { width: 195px; height: auto; display: block; }
.brand span { font-size: 16px; color: var(--ink); border-left: 1px solid #d7dede; padding-left: 28px; }
.client-logo { display: block; height: 42px; width: auto; max-width: 180px; object-fit: contain; }

/* Board */

.board { max-width: 1360px; margin: auto; padding: 40px 4% 36px; }

.title-row .division-label { font-size: 12px; color: #438a60; line-height: 1.5; margin-bottom: 8px; }
.title-row .muted { font-size: 16px; margin-top: 6px; }

.client-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--hydra-green);
  border-radius: 4px;
  background: #fff;
}
.client-current { display: grid; gap: 2px; min-width: 110px; }
.client-current strong { font-weight: 700; font-size: 19px; line-height: 1.3; }
.client-bar select { background: #f5f7f6; padding: 10px 12px; min-height: 44px; max-width: 280px; }
.identity { margin-left: auto; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* Tabs */

.customer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 20px 0 0;
  border-bottom: 1px solid var(--line);
}
.customer-tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 44px;
  padding: 12px 17px;
  font-size: 16px;
  color: var(--muted);
}
.customer-tabs button:hover { color: var(--ink); }
.customer-tabs button[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--hydra-cyan); }

.notice {
  margin-top: 16px;
  background: #fff3df;
  color: #875408;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 4px;
}
.data-status { margin-top: 14px; font-size: 13px; color: var(--muted); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 18px 0 0;
}
.summary-title { font-size: 24px; margin-right: auto; }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px;
}
.panel h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel h2 .badge { font-size: 11px; }
.panel > .small { font-size: 16px; margin-top: 12px; }
#attention-section { margin: 12px 0 24px; }

.attention-item { margin-top: 18px; }
.attention-item strong { display: block; font-size: 16px; }
.attention-item p { font-size: 16px; margin-top: 12px; }
.attention-item button { margin-top: 14px; padding: 11px 16px; }
.attention-none { margin-top: 14px; }

.headline { font-size: 16px; font-weight: 600; margin: 0 0 12px; }

/* Headline numbers */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--hydra-green);
  border-radius: 4px;
}
.metric { padding: 24px; border-right: 1px solid var(--line); min-width: 0; }
.metric:nth-child(4) { border-right: 0; }
.metric-label { color: var(--muted); font-size: 15px; }
.metric-number { font-size: 46px; font-weight: 600; line-height: 1.05; margin: 13px 0 9px; }
.metric-note { color: var(--muted); font-size: 14px; line-height: 1.5; }
.delivery-score {
  grid-column: 1 / -1;
  border-right: 0;
  border-top: 1px solid var(--line);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 24px;
  align-items: center;
}
.delivery-score .metric-label { color: var(--ink); font-size: 16px; }
.delivery-score .metric-number { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 44px; }
.delivery-score.score-complete .metric-number { color: var(--ok); }

/* Quick figures under the tiles */

.summary-extras {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  font-size: 14px;
  color: #5b646a;
}
.summary-extras strong { font-weight: 600; color: var(--ink); }
.summary-extras button { font-size: 14px; padding: 9px 12px; min-height: 0; }
.summary-extras > span { margin-left: auto; }
.summary-extras > span + button { margin-left: 0; }

/* Roles */

.roles { margin-bottom: 20px; }
.roles h2 { font-size: 20px; }
.role-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.role {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: var(--wash);
  border: 1px solid #e2e9e4;
  border-radius: 4px;
  padding: 8px 14px;
}
.role-count { font-size: 22px; font-weight: 600; }
.role-name { font-size: 14px; color: var(--muted); }
.role-unset { background: #fff; border-style: dashed; }

/* Store coverage */

.summary-scope { font-size: 13px; margin-top: 14px; }
.coverage-head { align-items: flex-end; margin-top: 32px; }
.coverage-head > div:first-child { flex: 1 1 360px; }
.coverage-head p { font-size: 16px; line-height: 1.6; margin-top: 6px; max-width: 640px; }
.store-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.store-controls label,
.store-search { display: block; font-size: 14px; color: var(--muted); }
.store-controls select { display: block; margin-top: 6px; min-height: 46px; padding: 10px 12px; min-width: 190px; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; }
.legend .badge { font-size: 13px; font-weight: 500; background: transparent; padding: 4px 8px 4px 0; }

.store-search { margin: 20px 0 10px; }
.store-search input { display: block; width: 100%; margin-top: 6px; min-height: 50px; padding: 14px 16px; }
#store-results { margin: 12px 0 16px; }

.store {
  --status: #8293a5;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--status);
  border-radius: 4px;
  margin: 16px 0;
  scroll-margin-top: 16px;
}
.store-ok { --status: var(--ok); }
.store-warn { --status: #dd942a; }
.store.covered { border-left-width: 5px; background: #f1faf4; }
.store-flash { outline: 2px solid var(--hydra-cyan); outline-offset: 2px; }

.store-top {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 24px;
  align-items: start;
  padding: 24px;
}
.store-top > div { min-width: 0; }
.store-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 12px; }
.store-info .badge { font-size: 14px; border-radius: 5px; padding: 5px 9px; }
.shift-label { font-size: 13px; color: #63777e; }
.store h3 { font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
.store-groups { font-size: 14px; color: var(--muted); margin: 8px 0; }
.address { font-size: 14px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.address-line { display: block; }

.store .metric-label { font-size: 14px; color: var(--muted); }
.coverage-number { font-size: 38px; font-weight: 600; line-height: 1.2; margin: 10px 0 12px; }
.delivery-count { font-size: 14px; color: var(--muted); }
.store-warn .delivery-count { color: #875408; }
.track { height: 5px; background: #eceeed; border-radius: 4px; overflow: hidden; margin: 12px 0; }
.track-fill { height: 100%; background: var(--status); border-radius: 4px; }
.on-site-line { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.action-column { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 10px; }
.action-column .small { font-size: 14px; }

.response {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 24px;
  background: #f6faf7;
  border-top: 1px solid #e2e9e4;
  font-size: 14px;
  line-height: 1.6;
}
.response strong { color: #32734b; font-weight: 600; white-space: nowrap; }
.response span { overflow-wrap: anywhere; }
.store.covered .response { background: #e4f3e8; }

.detail-toggle {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-top: 1px solid #e8eef0;
  background: none;
  min-height: 44px;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--link);
}
.detail-toggle:hover { background: #fafbfb; }
.details { padding: 0 24px 22px; }
.people-title { font-size: 13px; font-weight: 600; color: #32734b; margin: 16px 0 6px; }
.people-title-alert { color: #875408; }
.person {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(110px, 0.8fr) minmax(160px, 1.6fr);
  gap: 2px 20px;
  padding: 9px 0;
  border-bottom: 1px solid #e2e9e4;
  font-size: 15px;
}
.person-name { font-weight: 600; overflow-wrap: anywhere; }
.person-role { color: var(--muted); }
.person-role-unset { font-style: italic; }
.person-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--muted); }
.person-meta .badge { font-size: 12px; padding: 3px 7px; }
.store-finished { font-size: 14px; color: var(--muted); margin-top: 12px; }

.empty { padding: 24px 0; color: var(--muted); }

/* Narrow screens */

@media (max-width: 850px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { border-bottom: 1px solid var(--line); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(n+3) { border-bottom: 0; }
  .store-top { grid-template-columns: 1fr 1fr; gap: 20px; }
  .store-top > div:first-child { grid-column: 1 / -1; }
  .summary-extras > span { margin-left: 0; }
}

@media (max-width: 600px) {
  h1 { font-size: 30px; }
  .top { padding: 20px; }
  .brand img { width: 145px; }
  .brand span { display: none; }
  .client-logo { height: 33px; max-width: 115px; }
  .board { padding: 28px 18px 28px; }
  .title-row .muted { font-size: 15px; }
  .client-bar { padding: 12px; margin-top: 22px; gap: 10px; }
  .client-bar select { flex: 1 1 100%; max-width: none; }
  .identity { margin-left: 0; flex: 1 1 100%; }
  .customer-tabs { gap: 0; margin-top: 14px; }
  .customer-tabs button { flex: 1; font-size: 15px; padding: 11px 7px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .coverage-head > div:first-child { flex: 0 0 auto; }
  .coverage-head { margin-top: 24px; }
  .summary-title { font-size: 22px; }
  .panel { padding: 18px; }
  .panel > .small, .attention-item p, .coverage-head p { font-size: 15px; }
  .metric { padding: 20px 16px; }
  .metric-label { font-size: 14px; }
  .metric-note { font-size: 13px; }
  .metric-number { font-size: 40px; }
  .delivery-score { padding: 18px 16px; grid-template-columns: 1fr; }
  .delivery-score .metric-number { grid-column: 1; grid-row: auto; font-size: 38px; margin: 6px 0; }
  .summary-extras { gap: 7px; margin-bottom: 20px; }
  .summary-extras button { flex: 1 1 100%; text-align: left; }
  .summary-extras > span { width: 100%; padding: 2px 0; }
  .store-controls, .store-controls label, .store-controls select { width: 100%; }
  .store-top { padding: 18px; gap: 14px; grid-template-columns: 1fr; }
  .store h3 { font-size: 22px; }
  .coverage-number { font-size: 34px; margin: 8px 0 10px; }
  .action-column { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; }
  .action-column .small { flex-basis: 100%; order: 9; }
  .response { padding: 14px 18px; flex-direction: column; gap: 4px; }
  .detail-toggle { padding: 12px 18px; }
  .details { padding: 0 18px 18px; }
  .person { grid-template-columns: 1fr 1fr; }
  .person-meta { grid-column: 1 / -1; }
  .entrance { padding: 48px 24px 24px; }
  .entrance .logo { width: 78%; max-width: 320px; margin-bottom: 42px; }
  .entrance h1 { margin-bottom: 42px; }
  .gate footer, #view-live > footer { padding: 20px 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Print / save as PDF: the summary and the listed stores, without the controls */

@media print {
  .client-bar button, .customer-tabs, .section-head button, .store-controls, .store-search,
  #load-more, .detail-toggle, .attention-item button, .summary-extras button, .action-column, .toast, #notice { display: none !important; }
  .board { padding: 0; max-width: none; }
  .top { padding: 0 0 12px; }
  .store, .panel, .metrics { break-inside: avoid; }
  .store.covered, .response, .store.covered .response { background: #fff; }
  .store-flash { outline: 0; }
}
