/* Backstage Technician Desk — edit the variables below to retheme the app. */
:root {
  --bg: #0b1016;
  --panel: #121a24;
  --panel2: #182331;
  --line: #2b3949;
  --text: #eef4fb;
  --muted: #a1afbf;
  --dim: #748396;
  --accent: #9bc2ff;
  --red: #ff7078;
  --amber: #ffd080;
  --green: #72ddb1;
  --shadow: 0 16px 40px #0003;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 85% -18%, #253a50 0, transparent 40%), var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

/* Main shell and sidebar navigation */
.app { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: #0e141cdd;
  border-right: 1px solid var(--line); padding: 24px 15px; display: flex; flex-direction: column; gap: 28px;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.brandmark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(145deg, #8bbaff, #4b70a2); display: grid; place-items: center; color: #081321; font-size: 22px; font-weight: 900; }
.brand b { font-size: 14px; letter-spacing: .1em; }
.brand small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .13em; margin-top: 2px; }
.navlabel { padding: 0 12px; color: var(--dim); font-size: 10px; letter-spacing: .15em; font-weight: 800; text-transform: uppercase; margin-bottom: 7px; }
.nav { display: grid; gap: 6px; }
.nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px; border: 1px solid transparent; border-radius: 10px; text-align: left; background: transparent; color: var(--muted); font-weight: 650; }
.nav button.active { color: var(--text); background: #202d3c; border-color: #3a4b60; }
.nav button:hover { background: #1b2633; color: var(--text); }
.navCount { margin-left: auto; color: var(--dim); font-size: 11px; }
.sideNote { margin-top: auto; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #141c26; color: var(--muted); font-size: 11px; }
.sideNote p { margin: 7px 0 0; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; }

/* Page heading, notices, and common buttons */
main { width: 100%; max-width: 1600px; min-width: 0; margin: 0 auto; padding: 28px clamp(16px, 3vw, 42px) 50px; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
.pageTitle { font-size: clamp(26px, 3vw, 35px); line-height: 1.12; letter-spacing: -.04em; margin: 5px 0 0; }
.sub { color: var(--muted); font-size: 13px; margin: 8px 0 0; max-width: 720px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn { border: 1px solid var(--line); background: #1a2634; color: var(--text); padding: 9px 12px; border-radius: 9px; font-size: 12px; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn:hover { background: #29394b; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #101c2c; }
.btn.danger { background: #341d24; border-color: #713b48; color: #ff9aa1; }
.btn.quiet { background: transparent; }
.btn.small { padding: 6px 9px; font-size: 11px; }
.notice { display: flex; gap: 11px; padding: 13px 15px; border: 1px solid #69532c; border-radius: 12px; background: #2a2317; color: #ffe3b3; font-size: 12px; margin-bottom: 18px; }
.notice strong { display: block; color: var(--amber); margin-bottom: 2px; }
.nicon { font-size: 18px; }
.view { display: none; }
.view.active { display: block; }

/* Shared cards and form controls */
.card { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(150deg, #17212d, #111821); padding: 18px; box-shadow: var(--shadow); }
.sectionhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 25px 0 13px; }
.sectionhead h2 { font-size: 16px; margin: 0; letter-spacing: -.02em; }
.sectionhead p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.innerHead, .eventHead { margin: 0 0 16px; }
.eventCard { margin-bottom: 18px; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.eventFields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.twoCols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fieldgroup { min-width: 0; }
.fieldgroup.wide { grid-column: span 2; }
.label { display: block; color: var(--muted); font-size: 11px; font-weight: 750; margin-bottom: 6px; }
.field, select, textarea { width: 100%; border: 1px solid var(--line); background: #0d141d; color: var(--text); border-radius: 9px; padding: 10px 11px; min-width: 0; }
.field::placeholder, textarea::placeholder { color: #76879a; }
textarea { min-height: 88px; resize: vertical; }
textarea.compactText { min-height: 65px; }
.metaLine { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 13px; font-size: 11px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; font-size: 10px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.pill.green { color: var(--green); border-color: #2c684f; background: #132a22; }
.pill.amber { color: var(--amber); border-color: #72582d; background: #2b2417; }
.pill.red { color: #ff9ba2; border-color: #783945; background: #301a21; }
.amberText { color: var(--amber); }
.redText { color: #ff9ba2; }

/* Shift handoff form and saved handoff history */
.handoffGrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; align-items: start; }
.cardTitle { margin: 0 0 14px; font-size: 14px; }
.formSpace { margin-top: 13px; }
.formFooter { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.helpText { color: var(--dim); font-size: 11px; max-width: 280px; }
.historyList { display: grid; gap: 12px; }
.historyCard { border: 1px solid var(--line); border-radius: 13px; background: #131c27; padding: 16px; }
.historyTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.historyWho { font-size: 13px; font-weight: 800; }
.historyMeta { color: var(--muted); font-size: 11px; margin-top: 4px; }
.historyBody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.historyField { min-width: 0; border-left: 2px solid #34485d; padding-left: 10px; }
.historyField strong { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.historyActions { display: flex; gap: 7px; flex-wrap: wrap; padding-top: 11px; border-top: 1px solid #293442; }
.ackStatus { font-size: 11px; color: var(--green); }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 24px; text-align: center; font-size: 12px; }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

/* Technician checklist */
.checkSummary { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); background: #131c27; border-radius: 12px; padding: 12px 15px; margin-bottom: 15px; }
.checkSummary strong { display: block; font-size: 18px; line-height: 1.15; }
.checkSummary span { color: var(--muted); font-size: 10px; }
.checkSummary .progress { flex: 1; margin: 0; }
.checkgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.checkCard h3 { font-size: 14px; margin: 0; }
.checkDesc { font-size: 11px; color: var(--muted); margin: 4px 0 0; }
.checkHeader { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.progress { height: 5px; background: #2a3645; border-radius: 7px; overflow: hidden; margin: 12px 0 5px; }
.progress span { height: 100%; width: 0; display: block; background: var(--green); transition: width .2s; }
.checkitem { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-bottom: 1px solid #293442; }
.checkitem:last-child { border-bottom: 0; }
.checkitem input { accent-color: #63d9a6; width: 16px; height: 16px; flex: none; margin: 3px 0 0; }
.checkitem span { min-width: 0; flex: 1; }
.checkitem b { display: block; font-size: 12px; font-weight: 700; }
.checkitem small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.checkitem.done b { text-decoration: line-through; color: #8a9b9b; }

/* Incident metrics, incident forms, and reports */
.summarybar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary { border: 1px solid var(--line); background: #131c27; border-radius: 12px; padding: 15px; }
.summary span { font-size: 11px; color: var(--muted); }
.summary strong { display: block; font-size: 24px; line-height: 1.1; margin-top: 7px; font-variant-numeric: tabular-nums; }
.incidentLayout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.4fr); align-items: start; gap: 16px; }
.formgrid { display: grid; gap: 12px; }
.formrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.formgrid input, .formgrid select, .formgrid textarea { width: 100%; }
.formgrid textarea { min-height: 90px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input { flex: 1; min-width: 160px; }
.incident { padding: 15px 0; border-bottom: 1px solid #293442; }
.incident:first-child { padding-top: 0; }
.incident:last-child { border-bottom: 0; }
.incidentTop { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.incidentTop strong { min-width: 120px; flex: 1; font-size: 13px; }
.incidentTime { color: var(--dim); font-size: 10px; }
.incidentDetails { margin: 10px 0; display: grid; gap: 7px; }
.incidentDetail { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.incidentDetail strong { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 2px; }
.incidentMeta { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.incidentActions { display: flex; gap: 6px; flex-wrap: wrap; }
footer { color: var(--dim); font-size: 10px; margin-top: 26px; }
.toast { position: fixed; bottom: 20px; right: 20px; max-width: min(400px, calc(100vw - 40px)); background: #26384a; border: 1px solid #4b6681; color: var(--text); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s, transform .18s; z-index: 10; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1150px) {
  .app { grid-template-columns: 205px minmax(0, 1fr); }
  .eventFields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incidentLayout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sideNote { display: none; }
  .nav { display: flex; flex-wrap: wrap; }
  .nav button { width: auto; flex: 1; min-width: 140px; }
  main { padding-top: 20px; }
  .topbar { flex-direction: column; }
  .actions { justify-content: flex-start; }
}
@media (max-width: 700px) {
  .handoffGrid, .checkgrid { grid-template-columns: 1fr; }
  .fields, .eventFields, .twoCols, .signrow { grid-template-columns: 1fr 1fr; }
  .fieldgroup.wide { grid-column: span 2; }
  .historyBody { grid-template-columns: 1fr; }
  .summarybar { grid-template-columns: 1fr 1fr; }
  .summarybar .summary:last-child { grid-column: span 2; }
}
@media (max-width: 460px) {
  .fields, .eventFields, .twoCols, .signrow { grid-template-columns: 1fr; }
  .fieldgroup.wide { grid-column: span 1; }
  .nav button { min-width: 100%; }
  .summarybar { grid-template-columns: 1fr; }
  .summarybar .summary:last-child { grid-column: auto; }
  .formFooter { align-items: stretch; }
  .formFooter .btn { width: 100%; }
}
@media print {
  :root { --bg: #fff; --panel: #fff; --panel2: #f5f5f5; --line: #bbb; --text: #111; --muted: #444; --dim: #666; --accent: #333; }
  body { background: white !important; color: black; font-size: 10pt; }
  .app { display: block; }
  .sidebar, .actions, .notice, .btn, .nav, .sideNote, .formFooter, .incidentActions, #incidentForm, .filters, .checklistHead button { display: none !important; }
  main { padding: 0; max-width: none; }
  .card, .historyCard, .summary { box-shadow: none; background: white; border-color: #aaa; break-inside: avoid; }
  .view { display: block !important; }
  .view:not(.active) { display: none !important; }
  .fields, .handoffGrid, .checkgrid, .incidentLayout { grid-template-columns: 1fr 1fr; }
  .field, select, textarea { border: 0; background: white; color: black; padding: 2px 0; }
  textarea { min-height: 36px; }
  .topbar { margin-bottom: 10px; }
  .pageTitle { font-size: 22pt; }
  footer { margin-top: 12px; }
}

/* In-app customization tools */
.settingsNotice { margin-top: 4px; }
.settingsStack { display: grid; gap: 14px; }
.settingsSection { padding: 16px; }
.settingsSectionHead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.settingsHint { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.settingsSectionFields { margin-bottom: 14px; }
.settingsTaskList { border-top: 1px solid var(--line); }
.settingsTask { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 14px 0; border-bottom: 1px solid #293442; align-items: start; }
.settingsTaskNumber { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: #253548; color: var(--accent); font-size: 11px; font-weight: 800; }
.settingsTaskFields { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.2fr); gap: 10px; min-width: 0; }
.settingsTaskFields textarea { min-height: 42px; }
.settingsRemoveTask { align-self: end; }
.addTaskForm { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.2fr) auto; gap: 9px; align-items: center; margin-top: 13px; }
.settingsAddCard { margin-top: 14px; }
.settingsListGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settingsListGrid .card { min-width: 0; }
.editableList { display: grid; gap: 8px; }
.editableOption { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.editableOption .field { padding: 8px 9px; }
.addOptionForm { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.settingsListGrid h3 { margin: 0; font-size: 14px; }

@media (max-width: 800px) {
  .settingsTaskFields { grid-template-columns: 1fr; }
  .addTaskForm { grid-template-columns: 1fr; }
  .settingsListGrid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .settingsTask { grid-template-columns: 24px minmax(0, 1fr); }
  .settingsRemoveTask { grid-column: 2; justify-self: start; }
  .settingsSectionHead { align-items: center; }
}
@media print {
  #view-settings { display: none !important; }
}


/* Optional remote API connection panel (GitHub Pages deployment). */
.apiConnectionCard { margin: 0 0 24px; }
.connectionExplainer { color: var(--muted); font-size: 12px; margin: -5px 0 14px; max-width: 900px; }
.connectionControls { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.connectionUrlField { flex: 1 1 360px; min-width: 230px; }
.connectionButtons { display: flex; gap: 8px; flex-wrap: wrap; }
#apiConnectionStatus { margin: 11px 0 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .connectionControls, .connectionButtons { align-items: stretch; width: 100%; } .connectionButtons { flex-direction: column; } }


/* Full-screen sign-in page for the shared host password (replaces browser prompt). */
#loginScreen[hidden] { display: none !important; }
.loginScreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: radial-gradient(ellipse at 50% -20%, #253a50 0, transparent 48%), #0b1016;
}
.loginPanel {
  width: min(100%, 440px);
  border: 1px solid #2b3949;
  border-radius: 20px;
  padding: clamp(24px, 5vw, 38px);
  background: linear-gradient(150deg, #17212d, #111821);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .4);
}
.loginBrandmark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: #101c2c;
  font-size: 25px;
  font-weight: 950;
  margin-bottom: 22px;
}
.loginEyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
  margin: 0 0 9px;
}
.loginPanel h1 {
  font-size: clamp(25px, 5vw, 31px);
  letter-spacing: -.04em;
  line-height: 1.12;
  margin: 0;
}
.loginDescription {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  margin: 12px 0 20px;
}
.loginHostInfo {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #0d141d;
  margin-bottom: 20px;
}
.loginHostInfo span { color: var(--dim); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.loginHostInfo strong { color: var(--text); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.loginForm { display: grid; gap: 10px; }
.loginPassword { min-height: 44px; font-size: 15px; }
.loginSubmit, .loginSecondary { width: 100%; min-height: 42px; margin-top: 4px; }
.loginSecondary { background: transparent; }
.loginMessage { border: 1px solid #793b46; border-radius: 9px; background: #301a21; color: #ffb1b8; padding: 10px 11px; margin: 0; font-size: 12px; line-height: 1.45; }
.loginMessage[hidden] { display: none !important; }
.loginFoot { color: var(--dim); font-size: 10px; line-height: 1.6; margin: 20px 0 0; }
@media (max-width: 460px) {
  .loginScreen { padding: 14px; }
  .loginPanel { padding: 24px 20px; }
}


/* Published GitHub Pages app fails closed until the fixed API has authenticated. */
body.authPending .app { display: none !important; }
.fixedApiEndpoint { display: grid; gap: 6px; margin: 10px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #0d141d; }
.fixedApiEndpoint span { color: var(--dim); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.fixedApiEndpoint code { color: var(--text); font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }

/* ========================================================================== */
/* Production finish: clearer hierarchy, session controls, and accessible UI. */
/* ========================================================================== */
:root {
  --bg: #0a111a;
  --panel: #111b27;
  --panel2: #182637;
  --line: #2a3b4e;
  --text: #f1f6fc;
  --muted: #b1bdcb;
  --dim: #8090a3;
  --accent: #a3c8ff;
  --red: #ff7b85;
  --amber: #f4cc7b;
  --green: #75dfb2;
  --shadow: 0 18px 44px rgb(0 0 0 / 22%);
}

body {
  background:
    radial-gradient(ellipse at 84% -16%, rgb(52 86 120 / 25%), transparent 41%),
    radial-gradient(ellipse at 12% 100%, rgb(34 64 92 / 10%), transparent 42%),
    var(--bg);
  letter-spacing: .002em;
}

.sidebar {
  background: rgb(10 16 24 / 94%);
  border-right-color: #263649;
  box-shadow: 8px 0 30px rgb(0 0 0 / 8%);
}
.brandmark {
  position: relative;
  box-shadow: 0 7px 18px rgb(83 132 190 / 19%), inset 0 1px 0 rgb(255 255 255 / 30%);
}
.brandmark::after, .loginBrandmark::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #101923;
}
.nav button { transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
.nav button.active { box-shadow: inset 3px 0 0 var(--accent); }
.nav button:active, .btn:active { transform: translateY(1px); }

main { max-width: 1740px; }
.topbar {
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid rgb(76 100 126 / 27%);
}
.pageTitle { letter-spacing: -.045em; font-weight: 780; }
.sub { line-height: 1.65; }
.actions { align-items: center; gap: 8px; }
.btn {
  min-height: 38px;
  border-radius: 10px;
  padding-inline: 13px;
  box-shadow: 0 1px 0 rgb(255 255 255 / 3%) inset;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover { border-color: #48617a; box-shadow: 0 5px 14px rgb(0 0 0 / 13%); }
.btn:disabled { cursor: wait; opacity: .68; transform: none; }
.btn.primary { box-shadow: 0 5px 14px rgb(112 159 220 / 14%), inset 0 1px 0 rgb(255 255 255 / 25%); }
.btn.primary:hover { background: #b4d2ff; border-color: #b4d2ff; }
.field, select, textarea {
  border-color: #304256;
  background: #0c141e;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field:focus, select:focus, textarea:focus {
  border-color: #8fbaff;
  box-shadow: 0 0 0 3px rgb(143 186 255 / 11%);
  outline: none;
}
.card {
  border-color: #2a3b4e;
  background: linear-gradient(150deg, rgb(24 36 51 / 97%), rgb(15 23 33 / 98%));
  box-shadow: 0 16px 34px rgb(0 0 0 / 12%);
}
.eventCard { box-shadow: 0 16px 36px rgb(0 0 0 / 15%), inset 0 1px 0 rgb(255 255 255 / 2%); }
.sectionhead { margin-top: 29px; }
.sectionhead h2 { font-weight: 780; }
.sectionhead p { line-height: 1.55; }
.label { color: #bdc9d7; }
.pill { border-radius: 999px; padding: 5px 9px; letter-spacing: .055em; }

/* Sign-in session identity and explicit sign-out action. */
.sessionControls {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-left: 4px;
  padding-left: 13px;
  border-left: 1px solid #304156;
}
.sessionIdentity { display: flex; align-items: center; gap: 9px; min-width: 145px; }
.sessionAvatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid #425a74;
  border-radius: 11px;
  background: #1e3044;
  color: #d4e5ff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .05em;
}
.sessionCopy { display: grid; gap: 2px; }
.sessionCopy strong { font-size: 11px; font-weight: 800; white-space: nowrap; }
.sessionCopy small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.sessionDot { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgb(117 223 178 / 10%); }
.logoutBtn { background: #1d2631; color: #d5dfeb; border-color: #3a4b5f; }
.logoutBtn:hover { background: #351e26; border-color: #80434d; color: #ffb5bc; }
.logoutSpinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgb(255 255 255 / 25%);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: backstageSpin .75s linear infinite;
}
@keyframes backstageSpin { to { transform: rotate(360deg); } }

/* Refined sign-in surface. The authentication gate is still visible before JS. */
.loginScreen {
  background:
    radial-gradient(ellipse at 51% -7%, rgb(70 110 155 / 25%), transparent 43%),
    radial-gradient(ellipse at 100% 100%, rgb(29 64 89 / 12%), transparent 38%),
    #080e15;
}
.loginPanel {
  position: relative;
  overflow: hidden;
  border-color: #304257;
  background: linear-gradient(155deg, #172332 0%, #111a25 63%, #101720 100%);
  box-shadow: 0 35px 100px rgb(0 0 0 / 48%), 0 1px 0 rgb(255 255 255 / 4%) inset;
}
.loginPanel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #6191d1, #b0d1ff 48%, #75dfb2);
}
.loginBrandmark { position: relative; box-shadow: 0 10px 25px rgb(76 125 187 / 20%), inset 0 1px 0 rgb(255 255 255 / 30%); }
.loginDescription { font-size: 13px; }
.loginHostInfo { border-color: #304357; background: rgb(8 14 21 / 65%); }
.loginHostInfo strong { font-size: 12px; letter-spacing: .005em; }
.loginTrustRow { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -8px 0 19px; color: var(--muted); font-size: 11px; }
.loginTrustRow > span { display: inline-flex; align-items: center; gap: 6px; }
.loginTrustRow svg { color: var(--green); }
.httpsBadge { color: #a5e8cb; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.passwordControl { position: relative; display: flex; align-items: center; }
.passwordControl .loginPassword { padding-right: 48px; }
.passwordToggle {
  position: absolute;
  right: 7px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.passwordToggle:hover { border-color: var(--line); background: #192636; color: var(--text); }
.loginSubmit { min-height: 46px; font-size: 13px; }
.loginMessage { border-color: #735046; background: #2e211e; color: #ffd4b9; }
.loginMessage[hidden] { display: none !important; }
.loginFoot { font-size: 11px; }

/* Do not leave an interactive frame during the final save + sign-out. */
body.signingOut .app { pointer-events: none; filter: saturate(.65); }
body.authPending .app { display: none !important; }

@media (max-width: 1400px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .actions { justify-content: flex-start; width: 100%; }
}
@media (max-width: 900px) {
  .sessionControls { margin-left: 0; padding-left: 0; border-left: 0; }
  main { padding-top: 22px; }
}
@media (max-width: 600px) {
  .actions { align-items: stretch; }
  .actions > .btn { flex: 1 1 auto; }
  .sessionControls { width: 100%; padding-top: 12px; margin-top: 3px; border-top: 1px solid #304156; }
  .sessionIdentity { flex: 1; }
  .logoutBtn { flex: 0 0 auto !important; }
  .loginTrustRow { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* Individual technician accounts */
.loginForm { display: grid; gap: 10px; }
.loginUsername { margin-bottom: 4px; }
.loginPasswordLabel { margin-top: 2px; }
.userAdminPanel[hidden] { display: none !important; }
.userCreateGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 6px 0 22px; }
.userCreateActions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.userCreateActions .helpText { max-width: none; }
.userAdminListHeader { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 17px; margin-top: 8px; }
.userAdminListHeader h3 { margin: 0; font-size: 14px; }
.adminUsersList { display: grid; gap: 10px; margin-top: 12px; }
.adminUserRow { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(150px, 1fr) minmax(210px, 1.5fr) auto; gap: 10px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #111a24; }
.adminUserName { min-width: 0; }
.adminUserName strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.adminUserName small, .adminUserMeta { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.adminUserStatus { display: inline-flex; margin-top: 6px; }
.adminUserTools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.adminUserTools .field { min-width: 120px; flex: 1; padding: 7px 8px; font-size: 11px; }
.adminUserTools .btn { white-space: nowrap; }
.adminUserRow.isDisabled { opacity: .66; }
.accountRole { display: inline-flex; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; border: 1px solid var(--line); color: var(--muted); border-radius: 5px; padding: 3px 5px; margin-top: 5px; }
@media (max-width: 1050px) {
  .adminUserRow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adminUserTools { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .userCreateGrid { grid-template-columns: 1fr; }
  .adminUserRow { grid-template-columns: 1fr; }
  .adminUserTools { grid-column: auto; }
}
