
:root {
  color-scheme: light;
  --brand: #0f7a6e;
  --brand-dark: #0a5249;
  --brand-soft: #e3f3f0;
  --brand-light: #2fbfab;
  --brand-line: #a9d9d1;
  --red: #c62828;
  --red-dark: #8c1318;
  --red-soft: #f1dcd9;
  --black: #15181b;
  --ink: #1c1d1f;
  --gray-900: #24262a;
  --gray-700: #474b50;
  --gray-500: #72777c;
  --gray-400: #9aa0a4;
  --gray-300: #c3c8cb;
  --gray-200: #dadee0;
  --gray-100: #e7e9ea;
  --gray-50:  #f0f1f2;
  --backdrop: #aeb3b3;
  --plate: #f1f1ee;
  --safety-yellow: #f3c100;
  --caution: #e0791a;
  --ok: #2f6b46;
  --hazard: repeating-linear-gradient(135deg, var(--safety-yellow) 0 14px, var(--black) 14px 28px);
  --brushed: repeating-linear-gradient(115deg, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 6px);
  --shadow-sm: 0 1px 2px rgba(10,10,10,0.18);
  --shadow-md: 0 8px 20px rgba(10,10,10,0.22);
  --shadow-lg: 0 26px 60px rgba(8,8,8,0.40);
  font-family: var(--ui);
  color: var(--ink);
  background: var(--black);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--backdrop);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  font-family: var(--head);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}
a { color: var(--brand); }

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: var(--brushed), var(--black);
  border-bottom: 2px solid var(--brand);
  position: relative;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.brand { font-weight: 800; color: #fff; text-decoration: none; }
.brand-logo img {
  display: block;
  width: 200px;
  max-width: 52vw;
  height: auto;
  background: #ffffff;
  border-radius: 6px;
  padding: 6px 10px;
}
nav { display: flex; gap: 6px; flex-wrap: wrap; }
nav a, .button-secondary {
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  transition: background .15s, border-color .15s, color .15s;
}
nav a:hover, nav a:focus {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.nav-accent {
  border: 1px solid transparent;
  font-weight: 700;
}
.nav-accent--yellow {
  background: var(--safety-yellow);
  color: var(--black);
  border-color: var(--safety-yellow);
}
.nav-accent--yellow:hover, .nav-accent--yellow:focus {
  background: #d9ab00;
  border-color: #d9ab00;
  color: var(--black);
}
.nav-accent--orange {
  background: var(--caution);
  color: #fff;
  border-color: var(--caution);
}
.nav-accent--orange:hover, .nav-accent--orange:focus {
  background: #b85f14;
  border-color: #b85f14;
  color: #fff;
}
.nav-accent--green {
  background: #4ea86f;
  color: #fff;
  border-color: #4ea86f;
}
.nav-accent--green:hover, .nav-accent--green:focus {
  background: #3c8657;
  border-color: #3c8657;
  color: #fff;
}
.nav-accent--red {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.nav-accent--red:hover, .nav-accent--red:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
.nav-accent--blue {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.nav-accent--blue:hover, .nav-accent--blue:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

/* LAYOUT */
main {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 64px;
}
main.main-full {
  width: 100%;
  margin: 0;
  padding: 24px clamp(20px, 2.5vw, 56px) 64px;
}
.home-wrap {
  width: min(1680px, calc(100% - 48px));
  margin: 40px auto 0;
}
.main-full > .home-hero {
  margin: -24px calc(-1 * clamp(20px, 2.5vw, 56px)) 0;
}
.panel {
  position: relative;
  background: var(--plate);
  border: 1px solid var(--gray-200);
  border-top: 4px solid var(--brand);
  border-radius: 2px;
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--gray-200);
}
h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.15; }
h2 { font-size: 20px; }
p { margin: 0; color: var(--gray-700); line-height: 1.55; }

/* HERO */
.home-hero {
  position: relative;
  min-height: 460px;
  display: grid;
  align-items: center;
  background:
    var(--brushed),
    linear-gradient(125deg, rgba(14,16,14,0.95) 0%, rgba(14,16,14,0.86) 50%, rgba(10,82,73,0.78) 100%),
    url("/loto-solutions-background.png") center / cover no-repeat;
  border: none;
  border-radius: 0;
  padding: clamp(32px, 5vw, 60px) max(24px, calc((100% - 1680px) / 2));
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.home-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--brand);
}
.home-hero::after {
  content: "";
  position: absolute;
  right: -40px; bottom: -40px;
  width: 280px; height: 280px;
  background: repeating-linear-gradient(135deg, rgba(15,122,110,0.16) 0 14px, transparent 14px 28px);
  pointer-events: none;
}
.home-hero > div { position: relative; z-index: 1; max-width: 860px; }
.eyebrow, .portal-kicker {
  margin: 0 0 16px;
  display: inline-block;
  color: #fff;
  background: var(--brand);
  font-family: var(--head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 2px;
}
.home-hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.04;
  font-weight: 700;
  color: #fff;
  max-width: 880px;
  letter-spacing: -0.005em;
}
.home-hero .lead { color: rgba(255,255,255,0.84); font-size: 18px; }
.lead { font-size: 18px; line-height: 1.55; max-width: 720px; }
.home-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.home-summary span {
  padding: 8px 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-left: 3px solid var(--brand);
  border-radius: 2px;
  color: #fff;
  font-family: var(--head);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* PORTAL CARDS */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 26px;
}
.admin-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.manager-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.single-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-card {
  display: block;
  position: relative;
  min-height: 200px;
  padding: 26px 24px 24px;
  background: var(--plate);
  border: 1px solid var(--gray-200);
  border-left: 8px solid var(--brand);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.portal-card:hover, .portal-card:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--black);
}
.portal-card h2 { margin: 0 0 8px; font-size: 22px; }
.portal-card p { line-height: 1.5; color: var(--gray-700); }
.admin-card { border-left-color: var(--black); }
.manager-card { border-left-color: var(--brand); }

.solution-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.solution-item {
  position: relative;
  min-height: 220px;
  padding: 22px 20px;
  background: var(--plate);
  border: 1px solid var(--gray-200);
  border-top: 6px solid var(--black);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
}
.solution-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  background: var(--brand);
  color: #fff;
  border-radius: 2px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--brand-dark);
}
.solution-item h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.solution-item p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--gray-700);
}

.home-purpose {
  margin-top: 26px;
  padding: 24px 26px;
  background: var(--plate);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--black);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.home-purpose h2 { margin: 0 0 8px; font-size: 22px; }
.home-purpose p { max-width: 980px; line-height: 1.65; color: var(--gray-700); }

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 18px;
  background: var(--brushed), var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-left: 4px solid var(--brand);
  border-radius: 2px;
}
.stat-card strong {
  display: block;
  font-family: var(--head);
  font-size: 34px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card span {
  color: var(--gray-400);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* FILTER FORM */
.filter-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr 0.8fr auto auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 20px;
  padding: 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
}
.subpanel {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 2px solid var(--gray-200);
}
.subpanel h2 { margin: 0 0 14px; font-size: 20px; }

/* COLLAPSIBLE JOB PROFILE SECTIONS */
details.subpanel { margin-top: 12px; padding-top: 0; border-top: 1px solid var(--gray-200); }
details.subpanel summary {
  cursor: pointer;
  padding: 14px 0;
  list-style: none;
  display: block;
}
details.subpanel summary::-webkit-details-marker { display: none; }
details.subpanel summary h2 {
  display: inline-block;
  margin: 0;
  font-size: 17px;
}
details.subpanel summary h2::before {
  content: "▸";
  display: inline-block;
  width: 18px;
  color: var(--brand);
  transition: transform 0.15s ease;
}
details.subpanel[open] summary h2::before { transform: rotate(90deg); }
details.subpanel .subpanel-body { padding-bottom: 22px; }
details.subpanel summary:hover h2 { color: var(--brand); }

/* LISTS */
.portal-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.portal-list li { margin: 0; }
.portal-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--gray-300);
  border-radius: 2px;
  color: var(--ink);
  background: var(--plate);
  font-weight: 700;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.portal-list a::after {
  content: "OPEN 92";
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.portal-list a:hover, .portal-list a:focus {
  border-left-color: var(--brand);
  border-color: var(--gray-300);
  background: var(--brand-soft);
}

.form-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.form-list a {
  display: grid;
  gap: 6px;
  padding: 18px;
  background: var(--plate);
  border: 1px solid var(--gray-200);
  border-left: 5px solid var(--brand);
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  transition: background .15s, transform .15s;
}
.form-list a:hover, .form-list a:focus {
  background: var(--brand-soft);
  transform: translateX(2px);
}
.form-list span { color: var(--gray-500); }

.section-divider {
  margin: 24px 0 12px;
  padding-top: 18px;
  border-top: 1px dashed var(--gray-300);
  font-family: var(--head);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.qr-code-line {
  display: grid;
  gap: 14px;
}
.qr-download-card {
  margin-top: 20px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  background: var(--plate);
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--black);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.qr-code-line .qr-download-card { margin-top: 0; }
.qr-download-card h2 { margin: 0 0 6px; font-size: 20px; }
.qr-small { width: 112px; height: 112px; margin: 0; border: 1px solid var(--gray-200); }

/* ADMIN ACCESS */
.admin-access {
  width: min(560px, 100%);
  margin: 32px auto 0;
  padding: 14px 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: var(--plate);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 13px;
  color: var(--gray-500);
  box-shadow: var(--shadow-sm);
}
.admin-access a { color: var(--ink); font-weight: 800; text-decoration: none; }
.admin-access a:hover { color: var(--brand); }
.admin-access span { color: var(--gray-500); }

/* NOTICES */
.notice {
  padding: 14px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-weight: 600;
  border-left: 4px solid;
}
.success { background: #e3ecdf; color: #1f4f33; border-color: var(--ok); }
.warning { background: #f5e6c4; color: #5a3d05; border-color: var(--caution); }
.confirmation-panel {
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
  padding: 48px 32px;
}
.confirmation-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 30px;
  font-weight: 700;
}
.confirmation-panel h1 { margin-bottom: 10px; }
.confirmation-panel .lead { margin: 0 auto 24px; }
.confirmation-panel .actions-row {
  justify-content: center;
  padding-bottom: 0;
  border-bottom: none;
  margin-bottom: 0;
}
.helper {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--gray-400);
  border-radius: 4px;
  padding: 14px;
}
.helper p { line-height: 1.5; }

/* FORMS */
.request-form, .review-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.key-tracking-form {
  grid-template-columns: 1fr;
}
.key-lines {
  display: grid;
  gap: 18px;
}
.key-line {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: 5px solid var(--brand);
  border-radius: 4px;
}
.key-line-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}
.key-line-header h2 {
  margin: 0;
  font-size: 18px;
}
.key-line-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.key-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.field { display: grid; gap: 8px; }
.field-wide { grid-column: 1 / -1; }
.field span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-700);
}
.field small { color: var(--gray-500); font-size: 12px; line-height: 1.4; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: 2px;
  padding: 11px 12px;
  font: inherit;
  font-family: var(--ui);
  background: var(--plate);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,122,110,0.18);
}
textarea { resize: vertical; min-height: 96px; }
.trap-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
button {
  grid-column: 1 / -1;
  justify-self: start;
  border: 1px solid var(--brand-dark);
  border-radius: 2px;
  background: var(--brand);
  color: #fff;
  font-family: var(--head);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 22px;
  cursor: pointer;
  transition: background .15s, transform .05s;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.18);
}
button:hover, button:focus { background: var(--brand-dark); }
button:active { transform: translateY(1px); box-shadow: var(--shadow-sm); }

.inline-form { margin: 0; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; white-space: nowrap; }
.row-actions form, .inline-delete-form { display: inline; margin: 0; }
.inline-reset-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.inline-reset-form input { min-width: 140px; padding: 8px; }
.inline-reset-form button { grid-column: auto; padding: 9px 12px; }
.job-assignment-form { display: grid; gap: 10px; min-width: 260px; margin: 0; }
.checkbox-line {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--gray-700);
}
.checkbox-line input { width: auto; }
.muted { color: var(--gray-500); font-weight: 700; font-size: 13px; }

.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-700);
}
.empty-inline { color: var(--gray-500); font-size: 13px; }

.inline-form button, .button-danger { grid-column: auto; }
.button-danger { background: var(--ink); color: #fff; }
.button-danger:hover, .button-danger:focus { background: var(--red-dark); }
.delete-detail-form { margin-top: 16px; }

.panel .button-secondary,
.key-line-actions .button-secondary,
.actions-row .button-secondary,
.qr-download-card .button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: var(--ink);
  background: var(--plate);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  color: #fff;
  background: var(--brand);
  font-family: var(--head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid var(--brand-dark);
}
.lang-toggle:hover, .lang-toggle:focus { background: var(--brand-dark); }
.panel .button-secondary:hover,
.panel .button-secondary:focus,
.key-line-actions .button-secondary:hover,
.key-line-actions .button-secondary:focus,
.actions-row .button-secondary:hover,
.actions-row .button-secondary:focus,
.qr-download-card .button-secondary:hover,
.qr-download-card .button-secondary:focus {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

/* DATA TABLE */
.data-panel { width: min(100%, calc(100vw - 32px)); }
.table-wrap { overflow-x: auto; }
.scroll-mirror-top {
  overflow-x: auto;
  overflow-y: hidden;
  height: 16px;
  margin-bottom: 6px;
  border: 1px solid var(--gray-200);
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  background: var(--gray-50);
}
.scroll-mirror-top > div {
  height: 1px;
}
.data-wrap {
  max-height: calc(100vh - 210px);
  border: 1px solid var(--gray-200);
  border-radius: 2px;
  overflow-x: auto;
  overflow-y: auto;
  background: var(--plate);
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
th {
  font-family: var(--head);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--brushed), var(--ink);
  color: #fff;
}
.job-group td {
  background: var(--brushed), var(--ink);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 3px solid var(--brand);
}
.data-table { min-width: 1180px; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--brushed), var(--ink);
  color: #fff;
}
.data-table td { vertical-align: top; background: transparent; }
.request-row td { border-bottom-color: var(--gray-200); }
.request-white  { background: var(--plate); }
.request-white td  { background: var(--plate); }
.request-yellow { background: #f7e7ab; }
.request-yellow td { background: #f7e7ab; }
.request-red    { background: #ecd0cc; }
.request-red td    { background: #ecd0cc; }
.request-orange { background: #f0dcc1; }
.request-orange td { background: #f0dcc1; }
.request-darkred { background: #e3b3b3; }
.request-darkred td { background: #e3b3b3; }
.request-green  { background: #d8e6d3; }
.request-green td  { background: #d8e6d3; }
.request-gray   { background: #dcdcdc; }
.request-gray td   { background: #dcdcdc; }
.key-active td { background: #ecd0cc; }
.key-closed td { background: #d8e6d3; }

.data-table input, .data-table select, .data-table textarea {
  min-width: 150px;
  border-radius: 3px;
  padding: 8px;
  font-size: 13px;
}
.data-table textarea { min-width: 240px; }
.data-table button {
  grid-column: auto;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.record-search {
  display: grid;
  gap: 8px;
  max-width: 620px;
  margin: 0 0 18px;
}
.record-search label {
  font-family: var(--head);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.record-count {
  margin: 0;
  font-size: 13px;
  color: var(--gray-600);
}

/* LOCKBOX CANVAS */
.dash-hero {
  background: var(--brushed), linear-gradient(160deg, var(--ink) 0%, var(--black) 100%);
  border-radius: 10px;
  border-top: 4px solid var(--brand);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-md);
}
.dash-hero-head h1 {
  color: #fff;
  margin: 0 0 4px;
}
.dash-hero-head p {
  color: var(--gray-300);
  margin: 0 0 20px;
}
.dash-gauges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.dash-gauge {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-left: 5px solid var(--gray-400);
  border-radius: 6px;
  padding: 14px 22px;
  min-width: 130px;
}
.dash-gauge strong {
  display: block;
  font-family: var(--head);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.dash-gauge span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dash-gauge--review { border-left-color: var(--safety-yellow); }
.dash-gauge--review strong { color: var(--safety-yellow); }
.dash-gauge--progress { border-left-color: #4ea86f; }
.dash-gauge--progress strong { color: #4ea86f; }
.dash-gauge--expired { border-left-color: var(--red); }
.dash-gauge--expired strong { color: #ff6b6f; }
.dash-gauge--closed { border-left-color: var(--gray-400); }
.dash-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dash-action-btn {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 5px;
  border: 1px solid var(--brand-dark);
  transition: background .15s;
}
.dash-action-btn:hover { background: var(--brand-dark); }
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.dash-card {
  background: var(--plate);
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--gray-300);
  border-radius: 8px;
  padding: 18px 20px;
}
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.dash-card-head h2 {
  margin: 0;
  font-size: 17px;
}
.dash-more {
  margin: 8px 0 0;
}
.dash-more a {
  font-size: 12px;
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
}
.dash-more a:hover {
  text-decoration: underline;
}
.dash-tools-section {
  margin-top: 24px;
}
.dash-tools-section h2 {
  color: var(--ink);
  margin-bottom: 12px;
}
.dash-count-badge {
  background: var(--gray-700);
  color: #fff;
  font-family: var(--head);
  font-size: 13px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.dash-card--attention {
  border-top-color: var(--caution);
}
.dash-card--attention .dash-count-badge {
  background: var(--caution);
}
.dash-card--attention .dash-list-item {
  border-left-color: var(--caution);
}
.dash-card--expiring {
  border-top: none;
  padding-top: 0;
  overflow: hidden;
}
.dash-card-head--hazard {
  background: var(--hazard);
  margin: 0 -20px 14px;
  padding: 10px 20px;
}
.dash-card-head--hazard h2 {
  background: var(--black);
  color: var(--safety-yellow);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 15px;
}
.dash-card-head--hazard .dash-count-badge {
  background: var(--black);
  color: var(--safety-yellow);
}
.dash-card--expiring .dash-list-item {
  border-left-color: var(--safety-yellow);
}
.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-list-item {
  border-left: 3px solid var(--gray-300);
  background: #fff;
  border-radius: 0 5px 5px 0;
}
.dash-list-item a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--ink);
}
.dash-list-item a:hover {
  background: var(--gray-50);
}
.dash-list-item strong {
  display: block;
  font-size: 13px;
}
.dash-list-item span {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}
.dash-empty {
  color: var(--gray-500);
  font-size: 13px;
  margin: 0;
}
.dash-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.dash-tool {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--brushed), linear-gradient(160deg, var(--ink) 0%, var(--black) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.dash-tool:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.dash-tool-mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--head);
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
}
.dash-tool--yellow .dash-tool-mark { background: var(--safety-yellow); }
.dash-tool--green .dash-tool-mark { background: #4ea86f; color: #fff; }
.dash-tool--red .dash-tool-mark { background: var(--brand); color: #fff; }
.dash-tool--gray .dash-tool-mark { background: var(--gray-300); }
.dash-tool--orange .dash-tool-mark { background: var(--caution); color: #fff; }
.dash-tool-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-tool-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
}
.dash-tool-body strong {
  color: #fff;
  font-size: 15px;
  margin: 2px 0;
}
.dash-tool-desc {
  font-size: 12px;
  color: var(--gray-300);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-row .field-wide {
  flex: 1 1 300px;
}
.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.canvas-hint {
  font-size: 13px;
  color: var(--gray-600);
  font-style: italic;
}
.button-active {
  background: var(--brand) !important;
  color: #fff !important;
  border-color: var(--brand-dark) !important;
}
.lockbox-canvas {
  position: relative;
  width: 100%;
  height: 640px;
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  overflow: hidden;
}
.canvas-edges-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.canvas-edge {
  stroke: var(--gray-500);
  stroke-width: 2;
  pointer-events: none;
}
.canvas-edge-hit {
  stroke: transparent;
  stroke-width: 18;
  pointer-events: stroke;
  cursor: pointer;
}
.canvas-edge-hit:hover + .canvas-edge {
  stroke: var(--brand);
  stroke-width: 3;
}
.canvas-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  user-select: none;
  z-index: 2;
}
.canvas-shape {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}
.canvas-shape-square {
  background: #fff;
  border: 2.5px solid var(--gray-500);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  filter: none;
}
.canvas-shape-octagon polygon {
  fill: #fff;
  stroke: var(--gray-500);
  stroke-width: 3.5;
}
.canvas-node-occupied .canvas-shape-square { border-color: var(--red); }
.canvas-node-occupied .canvas-shape-octagon polygon { stroke: var(--red); }
.canvas-node-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.canvas-node-label {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-900);
  background: rgba(255,255,255,0.9);
  padding: 2px 7px;
  border-radius: 3px;
  max-width: 130px;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: break-word;
}
.canvas-panel {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: #fff;
}
.canvas-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.canvas-panel-header h2 { margin: 0; }
.scan-input-row {
  display: flex;
  gap: 8px;
}
.scan-input-row input { flex: 1; }
.scan-status {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-600);
}
.scan-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.scan-modal:not([hidden]) {
  display: flex;
}
.scan-modal-inner {
  position: relative;
  width: min(92vw, 640px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.scan-modal-inner video {
  width: 100%;
  border-radius: 8px;
  background: #000;
}
.scan-guide-box {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 22%;
  border: 3px dashed #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.scan-guide-label {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  background: rgba(0,0,0,0.6);
  padding: 2px 8px;
  border-radius: 3px;
  transform: translateY(130%);
  white-space: nowrap;
}
.scan-modal-controls {
  display: flex;
  gap: 12px;
}

.record-search-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.record-search-row input[type="search"] {
  flex: 1;
  min-width: 240px;
}
.record-date-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--gray-600);
}
.record-date-label input[type="date"] {
  padding: 9px 10px;
}
.record-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--gray-300);
  border-radius: 2px;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--plate);
}
.record-search input:focus {
  outline: 3px solid rgba(15,122,110,0.20);
  border-color: var(--brand);
}
.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: inherit !important;
  font-weight: 700;
}

/* STATUS PILLS */
.status {
  display: inline-block;
  border-radius: 2px;
  background: var(--gray-100);
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px dashed var(--gray-300);
}
.status-under-review { background: var(--plate); color: var(--gray-700); border-color: var(--gray-300); }
.status-pending      { background: #f0b429; color: #3a2a05; border-color: #caa000; }
.status-in-progress  { background: var(--red-dark); color: #fff; border-color: #5c0d10; }
.status-expired      { background: #9a9a9a; color: #fff; border-color: #6e6e6e; }
.status-not-started  { background: var(--plate); color: var(--gray-700); border-color: var(--gray-300); }
.status-passed       { background: var(--ok); color: #fff; border-color: #1f4f33; }
.status-failed       { background: var(--red); color: #fff; border-color: var(--red-dark); }
.approved-dot {
  color: var(--ok);
  font-size: 10px;
  vertical-align: middle;
  margin-left: 2px;
}
.oneline-canvas-wrap {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #f3f3f3;
}
.oneline-canvas {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 420px;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.oneline-canvas.oneline-panning { cursor: grabbing; }
.oneline-viewport {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  width: 1400px;
}
.oneline-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}
.oneline-zoom-controls {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.oneline-zoom-controls button {
  min-width: 36px;
}
.oneline-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: 8px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--plate);
  transition: border-color 0.15s, background 0.15s;
}
.oneline-dropzone p { margin: 0 0 8px; color: var(--gray-600); }
.oneline-dropzone-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.oneline-upload-progress {
  margin-top: 10px;
}
.oneline-upload-progress progress {
  width: 100%;
  height: 10px;
  accent-color: var(--brand);
}
.oneline-upload-progress p {
  margin: 6px 0 0;
  font-size: 13px;
}
.oneline-dropzone input[type="file"] {
  display: block;
  margin: 0 auto;
}
.oneline-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}
.oneline-nav-row .button-secondary {
  flex: 0 0 auto;
  white-space: nowrap;
  max-width: 32%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oneline-jump-field {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.test-question-block {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.test-question-block ul { margin: 6px 0 0; padding-left: 20px; }
.test-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
}
.test-option input { margin: 0; }
.status-closed       { background: var(--ok); color: #fff; border-color: #1f4f33; }

.empty { color: var(--gray-500); text-align: center; padding: 24px; }

/* DETAILS */
.details {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px 20px;
  margin: 0 0 24px;
  padding: 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 2px;
}
dt {
  font-family: var(--head);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-700);
}
dd { margin: 0; white-space: pre-wrap; color: var(--ink); }

/* QR */
.qr-panel { text-align: center; }
.qr {
  width: 280px;
  height: 280px;
  margin: 24px auto 14px;
  display: block;
  border: 4px solid var(--ink);
  border-radius: 2px;
  padding: 8px;
  background: var(--plate);
}
.url { word-break: break-all; color: var(--gray-700); font-family: var(--mono); font-size: 13px; }

/* RESPONSIVE */
@media (max-width: 720px) {
  .topbar, .heading-row { flex-direction: column; align-items: flex-start; }
  .request-form, .review-form, .details, .portal-grid, .admin-grid,
  .stats-grid, .filter-form, .qr-download-card, .solution-grid, .key-line-fields {
    grid-template-columns: 1fr;
  }
  .qr-small { margin: 0 auto; }
  .home-hero::after { width: 100%; height: 32%; right: 0; bottom: 0; }
  main { margin-top: 20px; }
  .panel { padding: 20px; }
}

/* Multi-select electric room picker */
details.room-multi { position: relative; border: 1px solid var(--gray-300); border-radius: 6px; background: #fff; }
details.room-multi > summary {
  list-style: none; cursor: pointer; padding: 10px 34px 10px 12px; min-height: 44px; box-sizing: border-box;
  display: flex; align-items: center; font-size: 15px; line-height: 1.3; position: relative; user-select: none; color: var(--ink);
}
details.room-multi > summary::-webkit-details-marker { display: none; }
details.room-multi > summary::after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-500); }
details.room-multi.room-multi-empty > summary { color: var(--gray-500); }
details.room-multi.room-multi-invalid { border-color: var(--red); box-shadow: 0 0 0 2px rgba(200, 29, 37, 0.15); }
.room-multi-list {
  position: absolute; z-index: 20; left: -1px; right: -1px; top: 100%; max-height: 320px; overflow-y: auto;
  background: #fff; border: 1px solid var(--gray-300); border-radius: 0 0 6px 6px; box-shadow: var(--shadow-md); padding: 4px 0;
}
.room-multi-option { display: flex; align-items: center; gap: 10px; padding: 9px 12px; min-height: 40px; box-sizing: border-box; cursor: pointer; font-size: 15px; color: var(--ink); }
.room-multi-option:hover { background: var(--gray-50); }
.room-multi-option input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }

/* Several electric rooms in a list cell: one line ("CSB +2") that opens to show them all */
details.room-cell { display: block; min-width: 96px; }
details.room-cell > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; user-select: none;
  /* Bigger tap area without moving the text: padding grows the target, the negative margin cancels it out. */
  padding: 10px 0; margin: -10px 0;
}
details.room-cell > summary::-webkit-details-marker { display: none; }
details.room-cell > summary::after { content: "▾"; color: var(--gray-500); font-size: 12px; }
details.room-cell[open] > summary::after { content: "▴"; }
details.room-cell .room-cell-more {
  background: var(--gray-200); color: var(--ink); border-radius: 999px; padding: 1px 8px;
  font-size: 12px; font-weight: 700; line-height: 1.5;
}
details.room-cell > ul { margin: 14px 0 4px; padding: 6px 10px; list-style: none; display: grid; gap: 3px;
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--gray-300); border-radius: 6px; }
details.room-cell > ul li { white-space: nowrap; font-size: 13px; font-weight: 600; }

.key-active td { background: #ffd6d6; }
.key-closed td { background: #d7f5df; }
.sign-document-panel {
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--brand);
  border-radius: 2px;
  background: var(--gray-50);
  padding: 16px;
}
.sign-document-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.sign-document-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.sign-document-controls .field {
  margin: 0;
}
.signature-button-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.eraser-signature-button {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.eraser-signature-button:hover,
.eraser-signature-button:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
.active-eraser {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
.signature-pad {
  width: 100%;
  height: 180px;
  display: block;
  margin-top: 14px;
  border: 1px solid var(--gray-300);
  border-radius: 2px;
  background: var(--plate);
  touch-action: none;
}
.signature-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.signature-preview-card {
  border: 1px solid var(--gray-200);
  border-radius: 2px;
  background: var(--plate);
  padding: 10px;
}
.signature-preview-card span {
  display: block;
  font-weight: 800;
  font-size: 12px;
  color: var(--gray-700);
  margin-bottom: 8px;
}
.signature-preview-card img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--gray-200);
  border-radius: 2px;
  background: var(--plate);
}
.signature-preview-card.is-empty {
  background: var(--gray-50);
}
.signature-preview-card.is-empty small {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--gray-300);
  border-radius: 2px;
  color: var(--gray-500);
  background: var(--plate);
  margin-top: 0;
}
.signature-preview-card small {
  display: block;
  margin-top: 6px;
  color: var(--gray-500);
}
.signature-delete-button {
  margin-top: 8px;
  color: var(--red);
  border-color: var(--gray-300);
  background: var(--plate);
}
.permit-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.permit-photo-card {
  display: block;
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 2px;
  background: var(--plate);
  color: var(--ink);
  text-decoration: none;
}
.permit-photo-card img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  border: 1px solid var(--gray-200);
  border-radius: 2px;
  background: var(--gray-50);
}
.permit-photo-card span {
  display: block;
  margin-top: 8px;
  font-weight: 800;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.permit-photo-card small {
  display: block;
  margin-top: 4px;
  color: var(--gray-500);
}
.compact-upload-form {
  margin-top: 0;
}
.compact-upload-form button {
  width: fit-content;
}
@media (max-width: 760px) {
  .sign-document-controls, .signature-preview-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   THEME LAYER - matches the public homepage (dark header, white cards,
   Inter type, soft status pills). Loaded last so it overrides the
   base rules above without touching any page markup.
   ========================================================================== */
:root {
  --brand: #0f7a6e;
  --brand-dark: #0a5249;
  --brand-soft: #e3f3f0;
  --brand-light: #2fbfab;
  --brand-line: #a9d9d1;
  --red: #c62828;
  --red-dark: #a3131c;
  --red-soft: #fdf0f0;
  --black: #0e1116;
  --ink: #15181c;
  --gray-900: #1f2329;
  --gray-700: #3d434b;
  --gray-600: #5d636b;
  --gray-500: #6b7179;
  --gray-400: #9aa0a6;
  --gray-300: #d4d6d2;
  --gray-200: #e4e5e1;
  --gray-100: #eeeeeb;
  --gray-50:  #f7f7f5;
  --backdrop: #f4f4f1;
  --plate: #ffffff;
  --ok: #1e8a4c;
  --caution: #d98a0b;
  --brushed: linear-gradient(transparent, transparent);
  --hazard: linear-gradient(#fff6e0, #fff6e0);
  --shadow-sm: 0 1px 2px rgba(16,18,22,0.05);
  --shadow-md: 0 1px 2px rgba(16,18,22,0.04), 0 12px 32px -18px rgba(16,18,22,0.22);
  --shadow-lg: 0 30px 70px -30px rgba(10,12,16,0.55);
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --head: var(--ui);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --radius: 16px;
  background: var(--backdrop);
}
body { background: var(--backdrop); font-size: 15.5px; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.028em; line-height: 1.12; }
h2 { font-size: 19px; }
p { color: var(--gray-600); }
a { color: var(--brand); text-underline-offset: 3px; }
::selection { background: rgba(15,122,110,0.18); }
:focus-visible { outline: 2px solid #f2b01e; outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: block; padding: 0;
  background: rgba(14,17,22,0.92);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar::after { display: none; }
.topbar-inner {
  width: min(1320px, calc(100% - 40px)); margin: 0 auto;
  height: 64px; display: flex; align-items: center; gap: 22px;
}
.brand-logo { display: flex; align-items: center; flex: none; text-decoration: none; }
.logo-text { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; }
.logo-svg { width: 30px; height: 30px; flex: none; display: block; }
.logo-word { font: 800 19px var(--head); letter-spacing: -0.02em; color: #fff; white-space: nowrap; }
.logo-word span { font-weight: 500; color: #8fd9cd; }
.app-nav { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.app-nav::-webkit-scrollbar { display: none; }
.topbar nav a, .topbar .topbar-right a {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  color: rgba(255,255,255,0.7); background: none; border: 0; border-radius: 8px;
  padding: 8px 12px; font: 500 14.5px var(--ui);
  letter-spacing: 0; text-transform: none; text-decoration: none;
  transition: color .15s, background .15s;
}
.topbar nav a:hover, .topbar nav a:focus-visible, .topbar .topbar-right a:hover { color: #fff; background: rgba(255,255,255,0.06); border-color: transparent; }
.topbar nav a.is-active { color: #fff; background: rgba(255,255,255,0.1); }
.topbar .nav-accent::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.topbar .nav-accent--yellow::before { background: #f2b01e; }
.topbar .nav-accent--orange::before { background: #f08a2c; }
.topbar .nav-accent--green::before { background: #34c27a; }
.topbar .nav-accent--red::before { background: #2fbfab; }
.topbar .nav-accent--blue::before { background: #8fd9cd; }
.topbar .nav-accent, .topbar .nav-accent:hover { background: none; border-color: transparent; }
.topbar .nav-accent.is-active { background: rgba(255,255,255,0.1); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.topbar .topbar-right .topbar-logout { color: #fff; border: 1px solid rgba(255,255,255,0.22); padding: 7px 14px; }
.topbar .topbar-right .topbar-logout:hover { border-color: rgba(255,255,255,0.5); }
.topbar a.topbar-back {
  display: inline-flex; align-items: center; justify-content: center; gap: 0;
  width: 36px; height: 36px; padding: 0; margin-right: -6px; flex: none;
  color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.14); border-radius: 9px;
  font: inherit; text-decoration: none; text-transform: none;
}
.topbar a.topbar-back:hover { color: #fff; background: rgba(255,255,255,0.06); }
.topbar-back svg { width: 16px; height: 16px; }
.topbar-back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nav-toggle {
  display: none; grid-column: auto; width: 40px; height: 40px; padding: 0; margin: 0;
  background: none; border: 1px solid rgba(255,255,255,0.18); border-radius: 9px; box-shadow: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle:hover, .nav-toggle:focus { background: rgba(255,255,255,0.06); }
.nav-toggle span { display: block; width: 16px; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s, opacity .2s; }
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.app-nav a.mobile-logout { display: none; }

/* ---------- layout ---------- */
main { width: min(1240px, calc(100% - 40px)); margin: 36px auto 80px; }
main.main-full { width: min(1320px, calc(100% - 40px)); margin: 32px auto 80px; padding: 0; }
.panel {
  background: #fff; border: 1px solid var(--gray-200); border-top: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-md);
}
.panel + .panel, .panel + section, section + .panel { margin-top: 22px; }
.heading-row { align-items: center; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--gray-200); }
.heading-row p { font-size: 15.5px; margin-top: 4px; }
.heading-row h1 + p { margin-top: 6px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lead { font-size: 17px; color: var(--gray-600); }
.eyebrow, .portal-kicker {
  background: none; color: var(--brand); padding: 0; border-radius: 0;
  font: 600 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
}
.muted { color: var(--gray-500); font-weight: 500; font-size: 13.5px; }
.section-divider {
  display: flex; align-items: center; gap: 12px; margin: 32px 0 16px; padding: 0; border: 0;
  font: 600 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-500);
}
.section-divider::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }
.subpanel { border-top: 1px solid var(--gray-200); }
.subpanel h2 { font-size: 19px; }
details.subpanel summary { padding: 18px 0; }
details.subpanel summary h2 { font-size: 17px; display: inline-flex; align-items: center; gap: 10px; }
details.subpanel summary h2::before {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--gray-400); border-bottom: 2px solid var(--gray-400);
  transform: rotate(-45deg); transition: transform .15s; margin-right: 2px;
}
details.subpanel[open] summary h2::before { transform: rotate(45deg); }
details.subpanel summary:hover h2 { color: var(--ink); }
details.subpanel summary:hover h2::before { border-color: var(--brand); }

/* ---------- buttons ---------- */
button {
  border: 1px solid transparent; border-radius: 10px; background: var(--brand); color: #fff;
  font: 600 14.5px var(--head); letter-spacing: 0; text-transform: none;
  padding: 12px 20px; box-shadow: 0 6px 18px -10px rgba(15,122,110,0.8);
  transition: background .15s, box-shadow .15s, transform .15s;
}
button:hover, button:focus { background: var(--brand-dark); }
button:active { transform: translateY(1px); box-shadow: none; }
.button-secondary,
.panel .button-secondary, .key-line-actions .button-secondary, .actions-row .button-secondary, .qr-download-card .button-secondary,
.lang-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  padding: 0 16px; border-radius: 10px; border: 1px solid var(--gray-300);
  background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
  font: 600 14px var(--head); letter-spacing: 0; text-transform: none; text-decoration: none;
  transition: background .15s, border-color .15s;
}
button.button-secondary { padding: 0 16px; }
.button-secondary:hover, .button-secondary:focus,
.panel .button-secondary:hover, .panel .button-secondary:focus,
.key-line-actions .button-secondary:hover, .key-line-actions .button-secondary:focus,
.actions-row .button-secondary:hover, .actions-row .button-secondary:focus,
.qr-download-card .button-secondary:hover, .qr-download-card .button-secondary:focus,
.lang-toggle:hover, .lang-toggle:focus {
  background: var(--gray-50); color: var(--ink); border-color: var(--gray-400);
}
.button-danger { background: #fff; color: var(--red); border: 1px solid #efc6c8; box-shadow: none; }
.button-danger:hover, .button-danger:focus { background: var(--red); color: #fff; border-color: var(--red); }
.button-active { background: var(--ink) !important; color: #fff !important; border-color: var(--ink) !important; }
.data-table button { padding: 7px 12px; font-size: 13px; border-radius: 8px; box-shadow: none; }

/* ---------- forms ---------- */
.request-form, .review-form { gap: 20px 22px; }
.field { gap: 7px; }
.field span, .record-search label {
  font: 600 13.5px var(--ui); letter-spacing: 0; text-transform: none; color: var(--gray-900);
}
.field small { color: var(--gray-500); font-size: 12.5px; }
input, select, textarea {
  background: #fff; border: 1px solid var(--gray-300); border-radius: 10px;
  padding: 11px 13px; font: 15px var(--ui); color: var(--ink);
}
select {
  -webkit-appearance: none; appearance: none; padding-right: 38px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7179' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
}
select[multiple] { background-image: none; padding-right: 13px; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
input[type="file"] { padding: 9px; background: var(--gray-50); border-style: dashed; }
input::placeholder, textarea::placeholder { color: #a3a8ae; }
input:hover, select:hover, textarea:hover { border-color: #c2c5c0; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15,122,110,0.12); }
.checkbox-line { font-weight: 500; color: var(--gray-900); }
.helper {
  background: var(--gray-50); border: 1px solid var(--gray-200); border-left: 1px solid var(--gray-200);
  border-radius: 12px; padding: 16px 18px;
}
.helper p { color: var(--gray-700); font-weight: 500; font-size: 14.5px; }
.filter-form {
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 14px; padding: 18px; gap: 12px 14px;
}
.filter-form button { padding: 11px 18px; }
.check-pill { border-radius: 999px; background: var(--gray-50); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }

/* ---------- notices ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 10px; border: 1px solid; border-left-width: 1px;
  border-radius: 12px; padding: 13px 16px; font-weight: 500; font-size: 14.5px;
}
.notice::before { content: ""; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: currentColor; flex: none; }
.success { background: #eefaf3; color: #14532d; border-color: #c4e8d2; }
.warning { background: #fff8e8; color: #6b4703; border-color: #f2dba8; }
.notice.error, .error.notice { background: #fdf0f0; color: #8f1119; border-color: #f3c9cc; }

/* ---------- lists & cards ---------- */
.form-list, .portal-list { gap: 10px; }
.form-list a, .portal-list a {
  background: #fff; border: 1px solid var(--gray-200); border-left: 1px solid var(--gray-200);
  border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.form-list a { grid-template-columns: 1fr auto; column-gap: 16px; }
.form-list a > * { grid-column: 1; }
.form-list a::after {
  content: ""; grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 9px; height: 9px;
  border-top: 2px solid var(--gray-400); border-right: 2px solid var(--gray-400); transform: rotate(45deg); transition: border-color .15s, transform .15s;
}
.form-list a strong { font: 700 16.5px var(--head); letter-spacing: -0.01em; color: var(--ink); }
.form-list span { color: var(--gray-600); font-size: 14.5px; }
.form-list a:hover, .form-list a:focus, .portal-list a:hover, .portal-list a:focus {
  background: #fff; border-color: var(--brand-line); box-shadow: var(--shadow-md); transform: translateY(-1px);
}
.form-list a:hover::after { border-color: var(--brand); transform: translateX(2px) rotate(45deg); }
.portal-list a::after { content: "Open \2192"; font: 600 13px var(--head); letter-spacing: 0; }
.portal-card {
  background: #fff; border: 1px solid var(--gray-200); border-left: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 28px 26px; min-height: 0; box-shadow: var(--shadow-sm);
}
.portal-card:hover, .portal-card:focus { border-color: var(--brand-line); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.portal-card h2 { font-size: 21px; margin: 10px 0 8px; }
.stats-grid { gap: 14px; }
.stat-card {
  background: #fff; color: var(--ink); border: 1px solid var(--gray-200); border-left: 1px solid var(--gray-200);
  border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stat-card strong { font: 800 32px var(--head); color: var(--ink); letter-spacing: -0.03em; }
.stat-card span { color: var(--gray-500); font: 600 11.5px var(--mono); letter-spacing: 0.08em; }
.qr-download-card { background: #fff; border: 1px solid var(--gray-200); border-top: 1px solid var(--gray-200); border-radius: 14px; box-shadow: var(--shadow-sm); }
.qr, .qr-small { border: 1px solid var(--gray-200); border-radius: 12px; }
.admin-access { border-radius: 12px; }
.confirmation-icon { background: #e6f6ec; color: var(--ok); }

/* ---------- detail lists ---------- */
.details {
  grid-template-columns: 240px minmax(0, 1fr); gap: 0; padding: 4px 22px;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 14px;
}
.details dt, .details dd { padding: 13px 0; border-bottom: 1px solid var(--gray-100); }
.details dt:nth-last-of-type(1), .details dd:last-of-type { border-bottom: 0; }
dt { font: 500 13.5px var(--ui); letter-spacing: 0; text-transform: none; color: var(--gray-500); }
dd { font-size: 15px; color: var(--ink); }

/* ---------- tables ---------- */
.data-wrap, .table-wrap { border: 1px solid var(--gray-200); border-radius: 14px; background: #fff; }
.table-wrap { overflow-x: auto; }
.scroll-mirror-top { border-radius: 10px 10px 0 0; background: var(--gray-50); }
th, .data-table th {
  background: var(--gray-50); color: var(--gray-500);
  font: 600 11.5px var(--mono); letter-spacing: 0.07em; text-transform: uppercase;
  padding: 12px 14px; border-bottom: 1px solid var(--gray-200);
}
td { padding: 13px 14px; border-bottom: 1px solid var(--gray-100); font-size: 14.5px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fafaf8; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
.job-group td {
  background: var(--gray-900); color: #fff; border-top: 0; font: 700 13px var(--head);
  letter-spacing: 0.02em; text-transform: none; padding: 10px 14px;
}
.sticky-col { font-family: var(--mono); font-weight: 600; font-size: 13.5px; color: var(--gray-600); }
/* row tints: keep the meaning, soften the colour, add an edge marker */
.request-white, .request-white td { background: #fff; }
.request-yellow, .request-yellow td { background: #fffbeb; }
.request-red, .request-red td { background: #fff4f4; }
.request-orange, .request-orange td { background: #fff7ee; }
.request-darkred, .request-darkred td { background: #fdeceb; }
.request-green, .request-green td { background: #f1faf4; }
.request-gray, .request-gray td { background: #f5f5f4; }
.key-active td { background: #fff4f4; }
.key-closed td { background: #f1faf4; }
.request-yellow td:first-child { box-shadow: inset 3px 0 0 #f2b01e; }
.request-red td:first-child, .key-active td:first-child { box-shadow: inset 3px 0 0 #ff4d57; }
.request-orange td:first-child { box-shadow: inset 3px 0 0 #f08a2c; }
.request-darkred td:first-child { box-shadow: inset 3px 0 0 var(--red-dark); }
.request-green td:first-child, .key-closed td:first-child { box-shadow: inset 3px 0 0 #34c27a; }
.request-gray td:first-child { box-shadow: inset 3px 0 0 #b8bcc0; }
.data-table input, .data-table select, .data-table textarea { border-radius: 8px; font-size: 13.5px; padding: 7px 10px; }
.data-table select { padding-right: 32px; background-position: right 10px center; }
.empty { color: var(--gray-500); padding: 40px 24px; }

/* ---------- status pills ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px;
  padding: 4px 10px 4px 9px; font: 600 12.5px var(--ui); letter-spacing: 0; text-transform: none;
  background: #eef0f2; color: #3d434b;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.status-under-review, .status-not-started { background: #eef1f5; color: #3b4654; }
.status-pending      { background: #fff4d6; color: #7a5300; }
.status-in-progress  { background: #fde8e9; color: #a3131c; }
.status-expired      { background: #eceef0; color: #5d636b; }
.status-closed, .status-passed { background: #e6f6ec; color: #17663a; }
.status-failed       { background: var(--red); color: #fff; }

/* ---------- signatures / photos / key lines ---------- */
.sign-document-panel, .key-line { border: 1px solid var(--gray-200); border-left: 1px solid var(--gray-200); border-radius: 14px; background: var(--gray-50); }
.signature-pad, .signature-preview-card, .signature-preview-card img, .permit-photo-card, .permit-photo-card img { border-radius: 10px; }
.signature-pad { background: #fff; }
.permit-photo-card { background: #fff; box-shadow: var(--shadow-sm); }

/* ---------- dashboard ---------- */
.dash-hero {
  position: relative; overflow: hidden; background: var(--black); color: #fff;
  border: 0; border-radius: 20px; padding: 36px 36px 32px; box-shadow: var(--shadow-lg); margin-bottom: 22px;
}
.dash-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px 300px at 88% 10%, rgba(15,122,110,0.30), transparent 70%),
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 44px 44px;
}
.dash-hero > * { position: relative; }
.dash-hero-head h1 { color: #fff; font-size: clamp(30px, 3.4vw, 40px); font-weight: 800; letter-spacing: -0.035em; margin: 0; }
.dash-hero-head p { color: rgba(255,255,255,0.66); font-size: 16.5px; margin-top: 8px; }
.dash-gauges { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.dash-gauge {
  min-width: 150px; padding: 16px 18px; border: 1px solid rgba(255,255,255,0.1); border-left: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; background: rgba(255,255,255,0.045);
}
.dash-gauge strong { display: block; font: 800 34px var(--head); letter-spacing: -0.03em; line-height: 1; color: #fff; }
.dash-gauge span { display: flex; align-items: center; gap: 7px; margin-top: 8px; font: 500 13.5px var(--ui); text-transform: none; letter-spacing: 0; color: rgba(255,255,255,0.7); }
.dash-gauge span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa0a6; }
.dash-gauge--review strong, .dash-gauge--progress strong, .dash-gauge--expired strong, .dash-gauge--closed strong { color: #fff; }
.dash-gauge--review span::before { background: #f2b01e; }
.dash-gauge--progress span::before { background: #2fbfab; }
.dash-gauge--expired span::before { background: #9aa0a6; }
.dash-gauge--closed span::before { background: #34c27a; }
.dash-hero .dash-empty { color: rgba(255,255,255,0.55); margin-top: 20px; }
.dash-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08); }
.dash-action-btn {
  display: inline-flex; align-items: center; height: 42px; padding: 0 16px; border-radius: 10px;
  background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.16);
  font: 600 14px var(--head); letter-spacing: 0; text-transform: none; text-decoration: none; box-shadow: none;
  transition: background .15s, border-color .15s;
}
.dash-action-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.35); }
.dash-action-btn:first-child { background: var(--brand); border-color: var(--brand); box-shadow: 0 8px 24px -10px rgba(15,122,110,0.9); }
.dash-action-btn:first-child:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.dash-card {
  background: #fff; border: 1px solid var(--gray-200); border-top: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: var(--shadow-sm);
}
.dash-card-head, .dash-card-head--hazard {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 14px; padding: 0; background: none; border: 0;
}
.dash-card-head h2, .dash-card-head--hazard h2 {
  display: flex; align-items: center; gap: 9px; margin: 0; padding: 0; background: none; color: var(--ink);
  font: 700 16.5px var(--head); letter-spacing: -0.01em; text-transform: none;
}
.dash-card-head h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gray-400); }
.dash-card--attention .dash-card-head h2::before { background: var(--brand); box-shadow: 0 0 0 4px rgba(15,122,110,0.12); }
.dash-card--expiring .dash-card-head h2::before { background: #f2b01e; box-shadow: 0 0 0 4px rgba(242,176,30,0.16); }
.dash-card--attention, .dash-card--expiring { border-top: 1px solid var(--gray-200); }
.dash-count-badge, .dash-card-head--hazard .dash-count-badge, .dash-card--attention .dash-count-badge {
  min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--gray-100); color: var(--gray-700); font: 700 12.5px var(--head); border: 0;
}
.dash-card--attention .dash-count-badge { background: #e3f3f0; color: var(--brand-dark); }
.dash-card--expiring .dash-count-badge { background: #fff4d6; color: #7a5300; }
.dash-list { gap: 6px; margin: 0; }
.dash-list-item { border: 0; border-left: 0; background: none; padding: 0; }
.dash-card--attention .dash-list-item, .dash-card--expiring .dash-list-item { border-left: 0; }
.dash-list-item a {
  display: block; padding: 11px 13px; border-radius: 10px; background: var(--gray-50); border: 1px solid transparent;
  color: var(--ink); text-decoration: none; transition: background .12s, border-color .12s;
}
.dash-list-item a:hover { background: #fff; border-color: var(--gray-200); box-shadow: var(--shadow-sm); }
.dash-list-item strong { display: block; font: 600 14.5px var(--ui); color: var(--ink); }
.dash-list-item span { display: block; margin-top: 2px; font-size: 13px; color: var(--gray-500); }
.dash-empty { color: var(--gray-500); font-size: 14px; padding: 18px 0 8px; }
.dash-more a { color: var(--brand); font: 600 14px var(--head); }
.dash-tools-section { margin-top: 36px; }
.dash-tools-section h2 { font: 800 22px var(--head); letter-spacing: -0.02em; margin: 0 0 16px; }
.dash-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.dash-tool {
  display: flex; align-items: flex-start; gap: 14px; padding: 20px; border-radius: 14px;
  background: #fff; border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dash-tool:hover { border-color: var(--brand-line); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-tool-mark {
  flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font: 800 16px var(--head); background: #e3f3f0; color: var(--brand); border: 0;
}
.dash-tool--yellow .dash-tool-mark { background: #fff4d6; color: #9a6700; }
.dash-tool--green .dash-tool-mark { background: #e6f6ec; color: #17663a; }
.dash-tool--orange .dash-tool-mark { background: #fff0e2; color: #b45309; }
.dash-tool--gray .dash-tool-mark { background: #eef0f2; color: #3d434b; }
.dash-tool-body { display: grid; gap: 3px; min-width: 0; }
.dash-tool-kicker { font: 600 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-500); }
.dash-tool strong { font: 700 16.5px var(--head); letter-spacing: -0.01em; color: var(--ink); }
.dash-tool-desc { font-size: 13.5px; color: var(--gray-600); line-height: 1.45; white-space: normal; overflow: visible; text-overflow: clip; display: block; }

/* ---------- canvases & one-line diagram viewer ---------- */
.oneline-canvas-wrap, .canvas-panel { border-radius: 14px; overflow: hidden; background: var(--gray-50); }
.oneline-dropzone { border-radius: 14px; background: var(--gray-50); border-color: var(--gray-300); }
.oneline-dropzone-active { background: var(--brand-soft); border-color: var(--brand); }

/* ---------- fixes after first pass ---------- */
.field { align-content: start; }
.notice.privacy-notice { background: var(--gray-50); color: var(--gray-600); border-color: var(--gray-200); font-size: 13.5px; line-height: 1.5; align-self: start; }
.notice.privacy-notice::before { background: var(--gray-400); }
.filter-form { display: flex; flex-wrap: wrap; align-items: flex-end; }
.filter-form > .field, .filter-form > label { flex: 1 1 150px; min-width: 0; }
.filter-form > .field:first-child, .filter-form > label:first-child { flex: 2 1 220px; }
.filter-form > button, .filter-form > .button-secondary { flex: none; grid-column: auto; min-height: 44px; margin: 0; }
th.sticky-col, .data-table th.sticky-col { background: var(--gray-50) !important; }

/* ---------- sign-in card ---------- */
.panel.login-panel { max-width: 460px; margin: 56px auto 0; padding: 36px 34px 30px; }
.login-panel::before {
  content: ""; display: block; width: 44px; height: 44px; margin-bottom: 20px; border-radius: 12px;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") no-repeat center / 22px;
  box-shadow: 0 10px 24px -12px rgba(15,122,110,0.9);
}
.login-panel .heading-row { border-bottom: 0; padding-bottom: 0; margin-bottom: 22px; }
.login-panel .request-form { grid-template-columns: 1fr; gap: 16px; }
.login-panel .request-form button { justify-self: stretch; width: 100%; padding: 13px 20px; margin-top: 4px; }
.login-panel .form-footer { margin-top: 18px; text-align: center; font-size: 14px; }
.login-panel .form-footer a { color: var(--gray-600); }
.login-panel .form-footer a:hover { color: var(--brand); }

/* ---------- dashboard welcome + arc animation ---------- */
.dash-hero-head { position: relative; z-index: 2; max-width: 640px; }
.dash-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font: 600 12px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.6);
}
.dash-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2fbfab; box-shadow: 0 0 0 4px rgba(47,191,171,0.18); }
.dash-gauges, .dash-quick-actions, .dash-hero .dash-empty { position: relative; z-index: 2; }
/* the arc lives in the panel's right half and fades out toward the text, so it reads as part of the background */
.dash-arc { position: absolute; z-index: 1; left: 0; right: 0; top: 0; bottom: 70px; pointer-events: none; }
.dash-arc svg { position: relative; width: 100%; height: 100%; overflow: visible; --arc-o: .8; }
.dash-arc-glow {
  position: absolute; right: 4%; top: 22%; width: 40%; height: 56%;
  background: radial-gradient(closest-side, rgba(47,191,171,0.42), rgba(47,191,171,0.1) 60%, transparent 80%);
  filter: blur(10px); opacity: .5; transition: opacity .07s linear;
}
.arc-wire { fill: none; stroke-width: 3; stroke-linecap: round; }
.arc-wire-r, .arc-wire-drop { stroke: #c9d1db; opacity: .75; }
.arc-wire-drop { stroke-width: 2; opacity: .35; }
.arc-node { fill: #c9d1db; opacity: .7; }
.arc-contact { fill: #0e1116; stroke: #c9d1db; stroke-width: 2.5; }
.arc-bolt { fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: var(--arc-o); }
.arc-bolt-core { stroke: #fff; stroke-width: 2.6; }
.arc-bolt-1 { stroke: #bff0e8; stroke-width: 1.6; opacity: calc(var(--arc-o) * .8); }
.arc-bolt-2 { stroke: #5fd4c3; stroke-width: 1.1; opacity: calc(var(--arc-o) * .6); }
.arc-bolt-glow { stroke: #2fbfab; stroke-width: 12; opacity: calc(var(--arc-o) * .3); }
.arc-tip { opacity: var(--arc-o); }
.arc-spark { fill: #ffd27a; filter: drop-shadow(0 0 2px #ff9a3c); }
.dash-arc.is-flash .dash-arc-glow { opacity: 1 !important; filter: blur(14px); }
.dash-arc.is-flash .arc-bolt-core { stroke-width: 3.6; }
/* move the panel's red glow onto the arc so the two read as one light source */
.dash-hero::before { background:
    radial-gradient(520px 320px at 82% 44%, rgba(15,122,110,0.26), transparent 70%),
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 44px 44px; transition: background .1s; }
.dash-hero:has(.dash-arc.is-flash)::before { background:
    radial-gradient(620px 380px at 82% 44%, rgba(47,191,171,0.40), transparent 70%),
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 44px 44px; }
@media (max-width: 900px) {
  .dash-arc { opacity: .55; }
}
@media (max-width: 560px) {
  .dash-arc { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: calc(100% + 40px); height: 120px; margin: -26px -20px 0; opacity: 1;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); }
  .dash-arc-glow { right: 10%; top: 0; width: 80%; height: 100%; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .app-nav a { padding: 8px 10px; font-size: 14px; }
}
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .app-nav {
    position: fixed; top: 64px; left: 0; right: 0; z-index: 59; display: none;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 14px 16px;
    background: #0e1116; border-bottom: 1px solid rgba(255,255,255,0.08); box-shadow: 0 30px 50px -20px rgba(0,0,0,.6);
  }
  body.nav-open .app-nav { display: flex; }
  .topbar nav a { padding: 12px 12px; font-size: 16px; }
}
@media (max-width: 720px) {
  .topbar, .topbar-inner { flex-direction: row; align-items: center; }
  .topbar-inner { width: calc(100% - 28px); gap: 12px; }
  .topbar .topbar-right .topbar-logout { display: none; }
  .topbar .app-nav a.mobile-logout { display: flex; margin-top: 6px; border-top: 1px solid rgba(255,255,255,0.08); border-radius: 0; padding-top: 16px; }
  main, main.main-full { width: calc(100% - 28px); margin: 20px auto 56px; }
  .panel { padding: 22px 18px; border-radius: 14px; }
  .heading-row { align-items: flex-start; }
  h1 { font-size: 26px; }
  .dash-hero { padding: 26px 20px; border-radius: 16px; }
  .dash-gauge { min-width: 0; flex: 1 1 130px; }
  .details { grid-template-columns: 1fr; padding: 4px 16px; }
  .details dt { padding-bottom: 0; border-bottom: 0; }
  .details dd { padding-top: 4px; }
  .form-list a { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Sign in with Microsoft (Supervisor Portal login) - Microsoft's light button style */
.ms-signin { margin: 6px 0 4px; }
.ms-button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; padding: 0 18px;
  background: #fff; color: #5e5e5e; border: 1px solid #8c8c8c; border-radius: 6px; font: 600 15px "Segoe UI", system-ui, sans-serif;
  text-decoration: none; }
.ms-button:hover { background: #f3f3f3; color: #2b2b2b; }
.ms-button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ms-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; color: var(--muted, #5d636b); font-size: 13px; }
.ms-or::before, .ms-or::after { content: ""; flex: 1; height: 1px; background: #e4e5e1; }

/* LOTO permit: room or equipment, and the LiveLine equipment search */
.permit-scope { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.permit-scope legend { font-weight: 700; font-size: 13px; padding: 0; margin-bottom: 6px; width: 100%; }
.permit-scope label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-height: 44px; cursor: pointer; }
.eq-picker { display: grid; gap: 8px; }
.eq-picker[hidden], .eq-picker [hidden] { display: none !important; }
.eq-chosen { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.eq-chosen li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 10px; background: var(--brand-soft); border: 1px solid var(--brand-line); font-size: 14px; }
.eq-remove { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 8px; min-height: 0; color: var(--brand-dark); }
.eq-results { list-style: none; margin: 0; padding: 4px; border: 1px solid #e4e5e1; border-radius: 10px; background: #fff; max-height: 320px; overflow: auto; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.eq-results li > button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; color: inherit; font: inherit; cursor: pointer; min-height: 44px; }
.eq-results li > button:hover, .eq-results li > button:focus { background: var(--brand-soft); }
.eq-results li.muted { padding: 10px 12px; }
/* ==========================================================================
   TYPE - one typeface, Inter, served by the app (no Google Fonts call from a
   job site). Counters use fixed-width digits.
   ========================================================================== */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/inter-var.woff2') format('woff2');
}
:root { font-family: var(--ui); font-feature-settings: 'cv11', 'ss03'; }
body, button, input, select, textarea { font-family: var(--ui); }
h1, h2, h3, h4 { font-family: var(--head); letter-spacing: -0.022em; }
h1 { font-weight: 750; letter-spacing: -0.03em; }
/* fixed-width digits only on counters - elsewhere they would also widen the hyphens in IDs like FB-PDC-1.2A1 */
.dash-gauge strong, .dash-count-badge, .ro-count, .count { font-variant-numeric: tabular-nums; }
/* ==========================================================================
   DESIGN SYSTEM - icons, one button system, one badge system. Loaded last.
   Page-specific styles that sit inside a page's own <style> are matched with
   "body ..." selectors so these win without editing every page.
   ========================================================================== */
[hidden] { display: none !important; }

/* ---------- icons ---------- */
.i {
  width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.i-lg { width: 22px; height: 22px; }
.i-xl { width: 32px; height: 32px; stroke-width: 1.6; }

/* menu: icons instead of coloured dots */
.topbar .nav-accent::before { display: none !important; }
.topbar nav a, .topbar .topbar-right a { gap: 8px; }
.topbar nav a .i { width: 17px; height: 17px; opacity: .75; }
.topbar nav a.is-active .i, .topbar nav a:hover .i { opacity: 1; color: #8fd9cd; }

/* ---------- buttons: primary / secondary / danger / quiet ---------- */
:root {
  --btn-h: 42px; --btn-h-sm: 34px; --btn-r: 10px;
}
button, .button, .button-secondary, .button-danger, .button-quiet, a.dash-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--btn-h); border-radius: var(--btn-r);
  font: 600 14.5px var(--ui); letter-spacing: -0.005em; text-transform: none; white-space: nowrap;
}
button > span, .button-secondary > span { white-space: normal; text-align: center; }
button .i, .button-secondary .i, .button-danger .i, .button-quiet .i { width: 17px; height: 17px; }
/* primary: solid teal, quieter shadow */
button:not(.button-secondary):not(.button-danger):not(.button-quiet):not(.nav-toggle) { box-shadow: 0 1px 2px rgba(10,82,73,.25), inset 0 1px 0 rgba(255,255,255,.12); }
/* quiet: text-only */
.button-quiet, button.button-quiet {
  background: transparent; color: var(--brand-dark); border: 1px solid transparent; box-shadow: none; padding: 0 10px; text-decoration: none;
}
.button-quiet:hover, button.button-quiet:hover { background: var(--brand-soft); color: var(--brand-dark); }
/* compact buttons inside tables and lists */
.data-table button, .data-table .button-secondary, .dash-list button, .dash-list .button-secondary { min-height: var(--btn-h-sm); font-size: 13.5px; padding: 0 12px; }
/* the black "Open" on dashboard items becomes the standard primary */
body .dash-action-btn:first-child { background: var(--brand); border-color: var(--brand); color: #fff; }
body .dash-action-btn:first-child:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
body .dash-action-btn { border-radius: var(--btn-r); font: 600 13.5px var(--ui); min-height: var(--btn-h-sm); }
body .dash-mini { display: inline-flex; align-items: center; gap: 6px; min-height: var(--btn-h-sm); border-radius: 8px; font: 600 13px var(--ui); box-shadow: none; padding: 0 11px; }
body .dash-mini .i { width: 15px; height: 15px; }
body .dash-mini.go { background: var(--brand); border-color: var(--brand); color: #fff; }
body .dash-mini.go:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
button:disabled, .button-secondary[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* ---------- badges: one shape, one set of colours ---------- */
:root {
  --b-neutral-bg: #eef0f2;  --b-neutral: #3d434b;
  --b-info-bg: #e8f0fb;     --b-info: #1f4f8f;
  --b-ok-bg: #e6f4ea;       --b-ok: #17663a;
  --b-warn-bg: #fff3d6;     --b-warn: #7a5300;
  --b-bad-bg: #fde8e9;      --b-bad: #a3131c;
  --b-brand-bg: #e3f3f0;    --b-brand: #0a5249;
  --b-lock-bg: #f1ebfe;     --b-lock: #5b21b6;
}
.status, body .ep-pill, body .ps-pill, body .so-badge, body .afl-badge, body .lb-badge {
  display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px;
  padding: 3px 10px 3px 9px; font: 600 12.5px/1.4 var(--ui); letter-spacing: 0; text-transform: none; white-space: nowrap;
  background: var(--b-neutral-bg); color: var(--b-neutral);
}
.status::before, body .ep-pill::before, body .ps-pill::before, body .so-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex: none;
}
/* permit status colours stay as the theme sets them (In progress is red on purpose: work is live) */
body .ep-pill.run { background: var(--b-brand-bg); color: var(--b-brand); }
body .ep-pill.done { background: var(--b-ok-bg); color: var(--b-ok); }
body .ep-pill.stop { background: var(--b-bad-bg); color: var(--b-bad); }
body .ps-pill.fv { background: var(--b-brand-bg); color: var(--b-brand); }
body .ps-pill.lk { background: var(--b-lock-bg); color: var(--b-lock); }
body .ps-pill.warn { background: var(--b-warn-bg); color: var(--b-warn); }

/* ---------- small polish ---------- */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.panel { border-radius: 16px; }
h1 .i, h2 .i { color: var(--brand); margin-right: 6px; }

/* ---------- error pages ---------- */
.err-page { max-width: 560px; margin: 40px auto; text-align: center; padding: 44px 32px; }
.err-ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.err-code { margin: 0; font: 700 12.5px var(--ui); letter-spacing: .12em; color: var(--gray-500); }
.err-page h1 { margin: 6px 0 8px; font-size: 26px; }
.err-detail { font-size: 13.5px; color: var(--gray-500); }
a.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 0 18px; border-radius: var(--btn-r);
  background: var(--brand); color: #fff; font: 600 14.5px var(--ui); text-decoration: none; }
a.button:hover { background: var(--brand-dark); color: #fff; }

/* ---------- sign-in ---------- */
.login-panel::before { display: none !important; }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo { width: 46px; height: 46px; display: block; margin: 0 auto 14px; }
.login-brand h1 { font-size: 24px; margin: 0 0 6px; }
.login-brand p { margin: 0; font-size: 14.5px; color: var(--gray-500); }

/* ---------- loading placeholders ---------- */
.skel { display: grid; gap: 10px; padding: 6px 0; }
.skel span { display: block; height: 44px; border-radius: 12px;
  background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-50) 45%, var(--gray-100) 90%); background-size: 220% 100%;
  animation: skel 1.3s ease-in-out infinite; }
.skel span:nth-child(2) { width: 86%; } .skel span:nth-child(3) { width: 64%; }
@keyframes skel { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .skel span { animation: none; } }

/* ---------- empty states ---------- */
.empty { text-align: center; color: var(--gray-500); font-size: 14px; padding: 36px 24px !important; }
.empty::before {
  content: ""; display: block; width: 34px; height: 34px; margin: 0 auto 10px; background: var(--gray-400);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.err-page .actions-row { margin-top: 22px; gap: 10px; flex-wrap: wrap; }

/* notices: text flows normally (as a flex box, any <b> or <a> inside became its own column); the dot stays on the first line */
.notice { display: block; position: relative; padding-left: 34px; }
.notice::before { position: absolute; left: 16px; top: 13px; margin-top: 7px; }
/* buttons beside a page title keep their label on one line */
.heading-row .actions-row > a, .heading-row .actions-row > button, .heading-row .actions-row > a > span, .heading-row .actions-row > button > span { white-space: nowrap; }

/* ---------- review forms: signatures and the approval decision together at the bottom ---------- */
.review-finish { grid-column: 1 / -1; display: grid; gap: 16px; padding: 18px; border: 1px solid var(--gray-200); border-radius: 16px;
  background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 32, .06); scroll-margin-top: 84px; }
.review-finish-title { margin: 0; font-size: 20px; }
.review-finish .sign-document-panel { margin: 0; }
.review-finish .sign-document-panel > h2 { display: none; }
.review-decision { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; align-items: end; padding-top: 14px; border-top: 1px solid var(--gray-200); }
.review-decision .field { margin: 0; }
.review-decision .field-wide { grid-column: 1 / -1; }
.review-decision > button[type="submit"] { grid-column: 1 / -1; justify-self: start; min-width: 240px; min-height: 48px; font-size: 15.5px; }
@media (max-width: 760px) {
  .review-decision { grid-template-columns: 1fr; }
  .review-decision > button[type="submit"] { justify-self: stretch; }
}
/* "Sign & approve" shortcut while the box is off screen */
.jump-approve { position: fixed; right: 18px; bottom: 18px; z-index: 40; box-shadow: 0 6px 18px rgba(10, 82, 73, .28) !important; }
.jump-approve[hidden] { display: none !important; }
/* "Saved" note after a form saves */
.save-toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 8px); z-index: 60; background: #12312d; color: #fff; padding: 10px 18px;
  border-radius: 999px; font: 600 14px var(--ui); box-shadow: 0 8px 24px rgba(0, 0, 0, .22); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.save-toast.show { opacity: 1; transform: translate(-50%, 0); }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }

/* ---------- training registrations: company filter, print by company, possible duplicates ---------- */
.tr-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 18px; margin: 0 0 14px; }
.tr-company { display: grid; gap: 5px; min-width: 240px; flex: 0 1 320px; }
.tr-company > span { font-size: 13px; font-weight: 700; color: var(--gray-600, #4b5563); }
.tr-company select { min-height: 44px; }
.tr-dupes-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; cursor: pointer; }
.tr-dupes-toggle input { width: 18px; height: 18px; margin: 0; }
.tr-dupes-toggle input:disabled + span { color: var(--gray-400); }
.tr-print { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.tr-print a[hidden] { display: none; }
.dup-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #fde8e9; color: #a3131c;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; vertical-align: 1px; cursor: help; }
.dup-also { display: block; margin-top: 2px; font-size: 12px; color: var(--gray-500); }
tr.dup-row > td { background: #fff7f7; }
tr.dup-row > td:first-child { box-shadow: inset 3px 0 0 #d9363e; }
.dup-summary .dup-badge { margin-left: 0; cursor: default; }
@media (max-width: 720px) { .tr-print { margin-left: 0; width: 100%; } .tr-company { flex: 1 1 100%; } }
.tr-table td.row-actions { display: table-cell !important; white-space: nowrap; }
.tr-table td.c-job, .tr-table td.c-company, .tr-table td.c-name { white-space: normal; }
.tr-table td.c-job { min-width: 150px; }
.tr-table td.c-submitted small { display: block; color: var(--gray-500); font-size: 12px; }
.tr-table td.c-name { min-width: 170px; }
.tr-table .row-actions > * { display: inline-flex; width: auto; margin: 0 6px 0 0; min-height: 36px; padding: 0 12px; vertical-align: middle; }
.tr-table td { padding-top: 10px; padding-bottom: 10px; vertical-align: middle; }
.tr-table tbody tr[hidden] { display: none; }
.tr-table tbody tr.tr-flash > td { animation: tr-flash 1.6s ease-out; }
@keyframes tr-flash { 0% { background: #d9f2ec; } 100% { background: transparent; } }
.save-toast.save-toast-bad { background: #a3131c; }
.tr-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); border: 0; border-radius: 16px; padding: 0;
  box-shadow: 0 30px 80px -20px rgba(16, 24, 32, .45); }
.tr-dialog::backdrop { background: rgba(11, 15, 20, .45); }
.tr-edit-form { padding: 22px 24px 20px; display: grid; gap: 14px; }
.tr-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tr-dialog-head h2 { margin: 0; font-size: 20px; }
.tr-dialog-x { border: 0; background: transparent; font-size: 28px; line-height: 1; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; color: var(--gray-500); padding: 0; }
.tr-dialog-x:hover { background: var(--gray-100, #f1f2f0); color: var(--ink); }
.tr-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.tr-edit-grid label { display: grid; gap: 5px; margin: 0; }
.tr-edit-grid label > span { font-size: 13px; font-weight: 700; color: var(--gray-600, #4b5563); }
.tr-edit-grid .wide { grid-column: 1 / -1; }
.tr-edit-grid input, .tr-edit-grid select { width: 100%; min-height: 44px; }
.tr-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.tr-edit-form .notice { margin: 0; }
@media (max-width: 560px) { .tr-edit-grid { grid-template-columns: 1fr; } .tr-dialog-actions > * { flex: 1; } }

/* ---------- fix company names ---------- */
.cf-pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #a3131c; color: #fff; font-size: 11.5px; font-weight: 800; }
.cf-h { margin: 26px 0 10px; font-size: 18px; }
.cf-h .cf-count { color: var(--gray-500); font-weight: 600; }
.cf-help { margin: -4px 0 10px; }
.cf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cf-card { border: 1px solid var(--gray-200); border-radius: 14px; padding: 16px; background: #fff; display: grid; gap: 10px; align-content: start; }
.cf-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cf-card-head b { font-size: 16px; }
.cf-card-head span { color: var(--gray-500); font-size: 13px; }
.cf-q { margin: 0; font-size: 13px; font-weight: 700; color: var(--gray-600, #4b5563); }
.cf-options { display: grid; gap: 6px; }
.cf-opt { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--gray-200); border-radius: 10px; cursor: pointer; margin: 0; }
.cf-opt:has(input[type=radio]:checked) { border-color: var(--brand, #0f7a6e); background: #eef8f6; }
.cf-opt input[type=radio] { width: 18px; height: 18px; margin: 0; }
.cf-opt .cf-name { font-weight: 600; word-break: break-word; }
.cf-opt .cf-n { color: var(--gray-500); font-size: 13px; white-space: nowrap; }
.cf-other { grid-template-columns: 20px auto 1fr; }
.cf-other .cf-name { font-weight: 500; color: var(--gray-600, #4b5563); }
.cf-other-input { min-height: 38px; width: 100%; }
.cf-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-empty { padding: 18px; border: 1px dashed var(--gray-300, #d5d7d2); border-radius: 14px; color: var(--gray-600, #4b5563); }
.cf-search { margin-bottom: 10px; max-width: 420px; }
.cf-search input { width: 100%; }
.cf-table td { vertical-align: middle; }
.cf-table td.cf-name { font-weight: 600; white-space: normal; }
.cf-rename { display: flex; gap: 8px; margin: 0; }
.cf-rename input { min-width: 220px; flex: 1; min-height: 38px; }
.cf-rename button { white-space: nowrap; }

/* file inputs: what was picked; a required field Safari skipped over */
.upload-picked { display: none; margin-top: 6px; color: #17663a; font-weight: 600; font-size: 13.5px; word-break: break-word; }
.field-missing { outline: 3px solid #d9363e; outline-offset: 4px; border-radius: 8px; transition: outline-color .3s; }

/* admin: change a permit's linked equipment */
.eqfix-link { display: inline-block; margin-left: 10px; padding: 2px 10px; border: 1px solid var(--gray-300, #d5d7d2); border-radius: 999px; font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.eqfix-link:hover { border-color: var(--brand, #0f7a6e); color: var(--brand, #0f7a6e); }
.eqfix .notice { margin: 12px 0; }
.eqfix-now { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 6px 0 18px; }
.eqfix-now dt { font-weight: 700; color: var(--gray-600, #4b5563); }
.eqfix-now dd { margin: 0; white-space: pre-wrap; }
.eqfix-check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; grid-column: 1 / -1; cursor: pointer; }
.eqfix-check input { width: 20px; height: 20px; margin: 2px 0 0; }
.eqfix-check small { display: block; color: var(--gray-500); margin-top: 2px; }
.eqfix-preview { grid-column: 1 / -1; display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--gray-50, #f7f7f5); }
.eqfix-preview label { display: grid; gap: 4px; margin: 0; }
.eqfix-preview label > span { font-size: 12.5px; font-weight: 700; color: var(--gray-600, #4b5563); }
.eqfix-preview textarea { background: #fff; resize: vertical; }
@media (max-width: 640px) { .eqfix-now { grid-template-columns: 1fr; } }
.eqfix-preview[hidden] { display: none; }

/* ---------- account security: two-factor, sessions ---------- */
.account-security .subpanel { margin-top: 22px; }
.account-security .pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--gray-100, #f1f2f0); color: var(--gray-600, #4b5563);
  font-size: 12px; font-weight: 700; white-space: nowrap; }
.account-security .pill.ok { background: #e3f3ec; color: #17663a; }
.account-security .pill.bad { background: #fde8e9; color: #a3131c; }
.account-security .inline-form { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 8px 6px 0; }
.account-security .inline-form input { max-width: 190px; min-height: 40px; }
.account-security .row-actions { white-space: nowrap; }
.mfa-status.on b { color: #17663a; }
.mfa-status.off b { color: #a3131c; }
.mfa-enroll { display: grid; grid-template-columns: 220px 1fr; gap: 10px 28px; align-items: start; }
.mfa-qr { background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; padding: 10px; }
.mfa-qr svg { display: block; width: 100%; height: auto; }
.mfa-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.mfa-key { display: inline-block; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--gray-50, #f7f7f5); font-size: 15px; letter-spacing: .06em; user-select: all; }
.mfa-confirm { grid-column: 2; max-width: 360px; }
.mfa-code-input { font-size: 22px !important; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.mfa-recovery h3 { margin: 0 0 6px; }
.mfa-codes { columns: 2; max-width: 420px; margin: 12px 0; padding-left: 22px; }
.mfa-codes code { font-size: 15px; letter-spacing: .05em; }
.topbar-account { display: inline-flex; align-items: center; justify-content: center; padding-left: 10px !important; padding-right: 10px !important; }
.topbar-account svg { width: 17px; height: 17px; }
@media (max-width: 720px) { .mfa-enroll { grid-template-columns: 1fr; } .mfa-qr { max-width: 240px; } .mfa-confirm { grid-column: 1; } }
@media print { .mfa-recovery button { display: none; } }

/* ---------- FTE tracker ---------- */
.ft-totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 14px 0 8px; }
.ft-totals > div { border: 1px solid var(--gray-200); border-radius: 12px; padding: 12px 14px; background: #fff; display: grid; gap: 2px; }
.ft-totals b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ft-totals span { color: var(--gray-500); font-size: 13px; }
.ft-totals .late b { color: #b3121b; } .ft-totals .soon b { color: #a15c00; } .ft-totals .done b { color: #0f7a6e; }
.ft-legend { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 12.5px; margin: 4px 0 12px; }
.ft-legend .ft-seg { display: inline-block; width: 12px; height: 8px; border-radius: 3px; }
.ft-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ft-card { display: grid; gap: 7px; padding: 14px; border: 1px solid var(--gray-200); border-radius: 14px; background: #fff; color: inherit; text-decoration: none;
  transition: border-color .15s, box-shadow .15s; }
.ft-card:hover { border-color: var(--brand, #0f7a6e); }
.ft-card.is-selected { border-color: var(--brand, #0f7a6e); box-shadow: 0 0 0 3px rgba(15, 122, 110, .14); }
.ft-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ft-card-head b { font-size: 17px; }
.ft-card-sub { font-size: 12.5px; color: var(--gray-500); min-height: 32px; }
.ft-card-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--gray-600, #4b5563); }
.ft-card-nums b { color: var(--ink, #12161b); font-size: 15px; }
.ft-card-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.ft-bar { display: flex; height: 8px; border-radius: 6px; background: var(--gray-100, #eef0ee); overflow: hidden; }
.ft-seg.done { background: #0f7a6e; } .ft-seg.ok { background: #5cc3a8; } .ft-seg.sub { background: #8fb3e8; } .ft-seg.late { background: #d9363e; }
.ft-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: 12px; background: var(--gray-100, #eef0ee); }
.ft-pill.late { background: #fde8e9; color: #a3131c; } .ft-pill.soon { background: #fff2d6; color: #8a5300; }
.ft-pill.ok { background: #e3f3ec; color: #17663a; } .ft-pill.done { background: #0f7a6e; color: #fff; }
.ft-list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ft-list-head h2 { margin: 0; }
.ft-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.ft-filters button { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--gray-300, #d5d7d2); background: #fff !important;
  color: var(--ink, #12161b) !important; font-weight: 650; box-shadow: none; }
.ft-filters button.is-on { background: var(--ink, #12161b) !important; color: #fff !important; border-color: var(--ink, #12161b); }
.ft-filters input { margin-left: auto; min-height: 38px; max-width: 260px; }
.ft-table td { vertical-align: top; }
.ft-table tr[hidden] { display: none; }
.ft-row.f-late > td { background: #fff6f6; } .ft-row.f-late > td:first-child { box-shadow: inset 3px 0 0 #d9363e; }
.ft-row.f-soon > td:first-child { box-shadow: inset 3px 0 0 #e0a100; }
.ft-flag { display: inline-block; padding: 2px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 700; background: var(--gray-100, #eef0ee); }
.ft-table td:nth-child(n+2):nth-child(-n+5) { white-space: nowrap; }
.ft-table td:nth-child(6), .ft-table td:nth-child(7) { white-space: normal; min-width: 130px; }
.ft-flag.late { background: #fde8e9; color: #a3131c; } .ft-flag.soon { background: #fff2d6; color: #8a5300; }
.ft-flag.ok { background: #e3f3ec; color: #17663a; } .ft-flag.done { background: #0f7a6e; color: #fff; }
.ft-blocker { margin-top: 3px; font-size: 12px; color: #8a5300; }
.ft-moved { font-size: 11.5px; color: #8a5300; font-weight: 700; white-space: nowrap; }
.ft-nolink { font-size: 11px; color: var(--gray-500); border: 1px dashed var(--gray-300, #d5d7d2); border-radius: 6px; padding: 0 5px; white-space: nowrap; }
.ft-start { min-height: 32px !important; padding: 0 10px !important; font-size: 13px; white-space: nowrap; }
.ft-upload { margin-top: 22px; border: 1px dashed var(--gray-300, #d5d7d2); border-radius: 12px; padding: 12px 14px; }
.ft-upload summary { cursor: pointer; display: flex; gap: 10px; flex-wrap: wrap; }
.ft-upload-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0 6px; }
.ft-diff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin: 14px 0; }
.ft-diff-grid h2 { font-size: 16px; }
.ft-diff { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
@media (max-width: 760px) { .ft-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ft-filters input { margin-left: 0; max-width: none; flex: 1 1 100%; } }

/* ---- Seasonal look (signed-in portal pages only; see loto/season.py) ---- */
.season .brand-logo { position: relative; }
.season-hat { position: absolute; width: 25px; height: 20px; left: -7px; top: -9px; transform: rotate(-22deg); z-index: 2; pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.season-leaf { position: absolute; width: 18px; height: 18px; left: 18px; top: 15px; transform: rotate(24deg); z-index: 2; pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.season-lights { position: absolute; left: 0; right: 0; top: 100%; height: 24px; display: flex; overflow: hidden; pointer-events: none; z-index: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='14'%3E%3Cpath d='M0 1.5Q22 13 44 1.5' fill='none' stroke='%232a2f37' stroke-width='1.6'/%3E%3C/svg%3E") repeat-x 0 0 / 44px 14px; }
.season-lights i { flex: 0 0 44px; position: relative; }
.season-lights i::before { content: ""; position: absolute; left: 18.5px; top: 7px; width: 7px; height: 11px; border-radius: 50% 50% 46% 46% / 40% 40% 60% 60%;
  background: var(--b, #e9b949); box-shadow: 0 0 7px 1px var(--b, #e9b949); animation: season-twinkle 2.6s ease-in-out infinite; }
.season-lights i::after { content: ""; position: absolute; left: 19.5px; top: 5.5px; width: 5px; height: 3px; border-radius: 1px; background: #4a4f57; }
.season-lights-christmas i:nth-child(4n+1) { --b: #ff4b4b; }
.season-lights-christmas i:nth-child(4n+2) { --b: #46d37a; }
.season-lights-christmas i:nth-child(4n+3) { --b: #ffd34d; }
.season-lights-christmas i:nth-child(4n) { --b: #59a8ff; }
.season-lights i:nth-child(3n)::before { animation-delay: -.9s; }
.season-lights i:nth-child(3n+1)::before { animation-delay: -1.7s; }
.season-lights i:nth-child(5n)::before { animation-duration: 3.4s; }
@keyframes season-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .45; box-shadow: 0 0 2px 0 var(--b, #e9b949); } }
/* Thanksgiving: leaves on twine instead of bulbs */
.season-lights-thanksgiving { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='14'%3E%3Cpath d='M0 1.5Q22 13 44 1.5' fill='none' stroke='%23a07a4c' stroke-width='1.5'/%3E%3C/svg%3E"); }
.season-lights-thanksgiving i::after { display: none; }
.season-lights-thanksgiving i::before { left: 16px; top: 6px; width: 12px; height: 12px; border-radius: 0 85% 0 85%; box-shadow: none;
  transform-origin: 50% 0; transform: rotate(45deg); animation: season-sway 3.2s ease-in-out infinite; }
.season-lights-thanksgiving i:nth-child(4n+1) { --b: #e2731d; }
.season-lights-thanksgiving i:nth-child(4n+2) { --b: #b8401c; }
.season-lights-thanksgiving i:nth-child(4n+3) { --b: #e3a82b; }
.season-lights-thanksgiving i:nth-child(4n) { --b: #9a5a24; }
@keyframes season-sway { 0%, 100% { transform: rotate(37deg); } 50% { transform: rotate(53deg); } }
@media (prefers-reduced-motion: reduce) { .season-lights i::before { animation: none !important; } }
@media print { .season-lights, .season-hat, .season-leaf, .season-toggle, .season-card { display: none !important; } }
/* the personal on/off switch on the top bar */
.season-toggle { display: inline-flex; margin: 0; }
.season-toggle button { width: 34px; height: 34px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: transparent; color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.season-toggle button:hover { background: rgba(255,255,255,.08); }
.season-toggle.is-off button { filter: grayscale(1); opacity: .5; }
/* festive "Saved" note */
.season-thanksgiving .save-toast:not(.save-toast-bad) { background: #7a3510; }
.season-thanksgiving .save-toast:not(.save-toast-bad)::before { content: "\1F342\00a0"; }
.season-christmas .save-toast:not(.save-toast-bad) { background: #1d5a38; }
.season-christmas .save-toast:not(.save-toast-bad)::before { content: "\1F384\00a0"; }
/* dashboard: before the break */
.season-card { margin: 14px 0 0; padding: 16px 18px; border-radius: 18px; border: 1px solid #f0cfa6; background: linear-gradient(135deg, #fff8ef, #fdebd8); }
.season-card-christmas { border-color: #cfe2d4; background: linear-gradient(135deg, #f2f9f4, #fdf0f0); }
.season-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.season-card-head h2 { margin: 0; font-size: 18px; }
.season-card-head p { margin: 2px 0 0; color: #6b6259; font-size: 14px; }
.season-count { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px 10px; border-radius: 12px; background: #fff; border: 1px solid rgba(0,0,0,.07); }
.season-count strong { font-size: 24px; line-height: 1; color: #b4501a; }
.season-card-christmas .season-count strong { color: #b42323; }
.season-count small { font-size: 11px; color: #6b6259; text-transform: uppercase; letter-spacing: .04em; }
.season-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.season-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid rgba(0,0,0,.07);
  color: inherit; text-decoration: none; }
.season-row:hover { border-color: rgba(0,0,0,.18); }
.season-row strong { font-size: 24px; min-width: 30px; text-align: center; color: #b4501a; }
.season-card-christmas .season-row strong { color: #b42323; }
.season-row.is-zero strong { color: #2d8a5b; }
.season-row span { display: flex; flex-direction: column; min-width: 0; }
.season-row small { color: #6b6259; font-size: 12px; }
.season-due { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.season-due li { padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.7); font-size: 13px; display: flex; flex-direction: column; }
.season-due li span { color: #6b6259; font-size: 12px; }
.season-due li.more { justify-content: center; }
/* dancing corner friend */
.season-mascot { position: fixed; right: 14px; bottom: 10px; width: 64px; height: 72px; z-index: 40; pointer-events: none;
  transform-origin: 50% 100%; animation: season-dance 1.1s ease-in-out infinite; filter: drop-shadow(0 3px 4px rgba(0,0,0,.18)); }
.season-mascot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.season-mascot .m-tail { transform-origin: 40px 52px; animation: season-fan 1.1s ease-in-out infinite; }
.season-mascot .m-leg-l { transform-origin: 33px 72px; animation: season-kick 0.55s ease-in-out infinite alternate; }
.season-mascot .m-leg-r { transform-origin: 47px 72px; animation: season-kick 0.55s ease-in-out infinite alternate-reverse; }
.season-mascot-snowman .m-leg-l { transform-origin: 26px 50px; animation: season-wave 0.55s ease-in-out infinite alternate; }
.season-mascot-snowman .m-leg-r { transform-origin: 54px 50px; animation: season-wave 0.55s ease-in-out infinite alternate-reverse; }
@keyframes season-dance { 0%, 100% { transform: translateY(0) rotate(-8deg); } 25% { transform: translateY(-7px) rotate(0); }
  50% { transform: translateY(0) rotate(8deg); } 75% { transform: translateY(-7px) rotate(0); } }
@keyframes season-fan { 0%, 100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.08) rotate(4deg); } }
@keyframes season-kick { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
@keyframes season-wave { from { transform: rotate(-25deg); } to { transform: rotate(20deg); } }
@media (max-width: 640px) { .season-mascot { width: 46px; height: 52px; right: 8px; bottom: 8px; } }
@media (prefers-reduced-motion: reduce) { .season-mascot, .season-mascot * { animation: none !important; } }
@media print { .season-mascot { display: none !important; } }

/* staging server banner (LOTO_ENVIRONMENT=staging) */
.env-banner { position: sticky; top: 0; z-index: 60; background: repeating-linear-gradient(135deg, #b45309 0 14px, #92400e 14px 28px);
  color: #fff; font-weight: 700; text-align: center; font-size: 13px; padding: 6px 12px; letter-spacing: .02em; }
