:root {
  /* Replace these values with the production NMC theme during integration. */
  color-scheme: dark;
  --font-ui: Roboto, Arial, sans-serif;
  --font-heading: "Roboto Condensed", "Arial Narrow", var(--font-ui);
  --canvas: #000;
  --surface: #121212;
  --raised: #1a1a1a;
  --border: #2e2e2e;
  --control-border: #646464;
  --text: #f4f4f4;
  --muted: #aaa;
  --accent: #36a5d5;
  --on-accent: #07141a;
  --radius: 0.65rem;
  --success: #83deb0;
  --caution: #ffce72;
  --danger: #ff9da5;
  --success-surface: #142d21;
  --caution-surface: #332510;
  --danger-surface: #361c21;
  font-family: var(--font-ui);
  background: var(--canvas);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid var(--border);
}
.eyebrow { color: var(--muted); font-size: 0.75em; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.masthead h1 { font-size: clamp(1.75rem, 4vw, 2.45rem); line-height: 1.15; margin-block-start: 0.25rem; }
.brand-logo { display: block; width: min(11rem, 60vw); height: auto; margin-block-end: 0.65rem; }
.brand-logo img { display: block; width: 100%; height: auto; }
.brand-logo-light { display: none !important; }
.workspace-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "logo title settings" "left . right";
  align-items: center;
}
.workspace-header .brand-logo { grid-area: logo; margin: 0; }
.workspace-header h1 { grid-area: title; text-align: center; font-size: clamp(2rem, 4vw, 2.85rem); }
.workspace-left { grid-area: left; justify-self: end; }
.workspace-right { grid-area: right; justify-self: start; }
.settings-gear { grid-area: settings; justify-self: end; align-self: start; padding: 0.48em 0.8em; border: 0.2rem solid var(--accent); border-radius: var(--radius); }
.settings-gear img { display: block; width: clamp(2.35rem, 3.6vw, 3.1rem); height: auto; }
.settings-gear:hover { filter: brightness(1.2); }
.masthead nav { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
button, input, textarea { font: inherit; }
button, .masthead nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.48em 0.8em;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.masthead nav a:not([aria-current]), .secondary-button {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
button:not(:disabled):hover, .masthead nav a:hover { filter: brightness(1.13); }
:focus-visible { outline: 2px solid var(--accent-text, var(--accent)); outline-offset: 3px; }
button:disabled { opacity: 0.55; cursor: default; }
.admin { max-width: 100rem; margin: auto; padding: 1rem clamp(1rem, 3vw, 3rem) 3rem; }
#message:not(:empty) { padding: 0.55rem 0; font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-block: 0.85rem; }
.panel h2 { font-size: 1.25rem; }
.panel h3 { font-size: 1rem; }
.panel p { margin-block: 0.35rem; }
.pending { border-left: 0.35rem solid var(--caution); }
.warnings { margin-block: 0.5rem; padding-inline-start: 1.4rem; }
.warnings li { margin-block: 0.3rem; }
.warnings .critical { color: var(--danger); }
.warnings .warning { color: var(--caution); }
.muted, .empty, .page-intro { color: var(--muted); }
.job-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 0;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.job-heading h2 { font-size: 1.6rem; font-weight: 800; overflow-wrap: anywhere; }
.today-heading { font-size: 1.6rem; font-weight: 800; }
.page-intro { margin-block: 0.35rem 1rem; max-width: 70ch; }
.task-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem 0.65rem; }
.task-heading h3 { overflow-wrap: anywhere; }
.task-status { flex: none; }
.schedule-dates { margin-top: 0.7rem; }
.job-setup { min-height: 100vh; }
.job-setup .admin { max-width: 78rem; }
.setup-new { border-top: 0.2rem solid var(--accent); }
.setup-job h2 { font-size: 1.5rem; overflow-wrap: anywhere; }
.setup-job > h3 { margin-top: 1rem; }
.setup-section { margin-top: 0.7rem; }
.setup-section summary { color: var(--accent-text, var(--accent)); }
.setup-section > div { margin-block-start: 0.5rem; }
#operational-settings dl { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 1rem; max-width: 30rem; }
#operational-settings dd { margin: 0; font-weight: 650; }
.edit-form .color-picker { flex: 0 1 auto; display: block; padding: 0.45rem; border: 1px solid var(--border); border-radius: var(--radius); max-width: 100%; }
.color-picker legend { font-weight: 700; }
.color-options { display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0.35rem; }
.edit-form .color-choice { display: grid; justify-items: center; flex: 0 0 auto; position: relative; cursor: pointer; }
.edit-form .color-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.color-dot { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border: 2px solid var(--border); border-radius: 0.35rem; }
.color-choice input:checked + .color-dot { outline: 3px solid var(--text); outline-offset: 2px; }
.color-choice input:checked + .color-dot::after { content: '✓'; color: #07141a; font-size: 1.7rem; font-weight: 800; }
.color-choice input:focus-visible + .color-dot { outline: 3px solid var(--accent); outline-offset: 4px; }
.color-name { font-size: 0.8rem; line-height: 1.15; }
.screens-form > fieldset { border: 0; padding: 0; margin: 0; }
.screen-settings { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.screen-settings label { display: grid; gap: 0.25rem; }
.screen-settings textarea { width: min(28rem, 90vw); min-height: 4rem; resize: vertical; }
.screen-settings input[type=number] { width: 6rem; }
.screen-settings input[type=checkbox] { accent-color: var(--accent); }
.screen-image-controls { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; }
.screen-image-controls button { min-height: 0; padding: 0.3em 0.5em; }
.image-confirmation, .task-confirmation { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.screen-preview { display: block; max-width: 12rem; max-height: 7rem; object-fit: contain; }
.rotation-screen { position: fixed; inset: 0; z-index: 10; background: var(--canvas); color: var(--text); padding: 5vh 6vw; overflow: auto; border-top: 0.35rem solid var(--accent); }
.rotation-screen.has-image { display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: #000; overflow: hidden; }
.rotation-screen.has-image img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.rotation-screen.has-image p { position: absolute; inset: auto 0 0; margin: 0; padding: 0.5rem 1rem; background: rgba(0, 0, 0, 0.8); color: #fff; font-size: clamp(1rem, 1.6vw, 2rem); }
.rotation-screen h2 { font-size: clamp(2rem, 4vw, 5rem); margin: 0 0 1em; }
.rotation-screen p { font-size: clamp(1.5rem, 3vw, 4rem); white-space: pre-wrap; overflow-wrap: anywhere; }
.progress-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.edit-form button, .progress-actions button, .job-notes button, .force-warning button, .template-list button {
  min-height: 0;
  padding: 0.25em 0.45em;
  border-radius: 0.45rem;
}
.category-label { color: var(--accent-text, var(--accent)); }
.requires-label { color: var(--caution); background: var(--caution-surface); border-radius: 0.2rem; padding: 0.03em 0.24em; }
.pending-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem; }
.countdown { color: var(--caution); font-weight: 700; font-variant-numeric: tabular-nums; }
.force-warning { margin-top: 0.7rem; }
.force-warning button + button { margin-inline-start: 0.5rem; }
.force-confirm { border-color: var(--caution); }
.template-list { list-style: none; padding: 0; max-width: 30rem; }
.template-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding-block: 0.5rem; border-top: 1px solid var(--border); }
.badge { display: inline-block; font-size: 0.8em; font-weight: 800; border-radius: 0.25rem; padding: 0.13em 0.42em; background: var(--raised); color: var(--text); border: 1px solid var(--border); }
.badge.on-time { background: var(--success-surface); color: var(--success); }
.badge.warning { background: var(--caution-surface); color: var(--caution); }
.badge.critical { background: var(--danger-surface); color: var(--danger); }
.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); gap: 0.75rem; margin-top: 1rem; }
.task { padding: 0.75rem; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); }
.edit-form fieldset { padding: 0; margin: 0.75rem 0 0; border: 0; min-inline-size: 0; display: flex; align-items: end; gap: 0.5rem; flex-wrap: wrap; }
.job-details-form fieldset { gap: 0.75rem; }
.job-details-form label { text-align: center; }
.edit-form label { display: grid; gap: 0.25rem; min-width: 0; max-width: 100%; font-size: 0.9rem; }
.edit-form input, .edit-form select, .job-notes textarea {
  width: min(100%, 18rem);
  min-height: 2.75rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: var(--canvas);
  color: var(--text);
  font: inherit;
}
.edit-form input[type=number] { width: 7rem; }
.edit-form input[type=checkbox] { width: 1rem; min-height: auto; accent-color: var(--accent); }
.edit-form label:has(input[type=checkbox]) { display: flex; align-items: center; }
.edit-form .prerequisite-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  flex: 1 0 100%;
  padding: 0.45rem 0.65rem;
  margin: 0.35rem 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.prerequisite-fields legend { font-weight: 650; }
.prerequisite-fields input { flex: none; }
.local-tasks { padding: 0; list-style: none; }
.local-task, .history-entry { border-top: 1px solid var(--border); padding-block: 0.6rem; overflow-wrap: anywhere; }
.local-task button { margin-top: 0.25rem; }
.edit-form + h3 { margin-top: 1rem; }
summary { cursor: pointer; font-weight: 650; }
.history-entry:first-of-type { margin-top: 0.6rem; }
.history-note { margin: 0.25rem 0 0; padding-inline-start: 0.65rem; border-inline-start: 2px solid var(--border); color: var(--muted); font-size: 0.85em; white-space: pre-wrap; }
.job-notes { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.job-notes label { display: grid; gap: 0.35rem; font-weight: 700; }
.job-notes textarea { width: 100%; resize: none; font-weight: 400; }
.job-notes button { margin: 0.4rem 0.65rem 0 0; }
.job-notes label, .saved-notes { margin-block-start: 0.35rem; }
.saved-notes { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-byline { display: block; margin-block-start: 0.35rem; color: var(--muted); }
.note-byline:empty { display: none; }
.note-entry + .note-entry { margin-block-start: 0.7rem; }
.note-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; align-items: start; }
.note-byline, .note-entry .saved-notes { grid-column: 1; }
.note-delete { grid-column: 2; grid-row: 1 / span 2; font-size: 0.8rem; }
.note-confirmation { grid-column: 2; grid-row: 1 / span 2; }
.login-page { max-width: 32rem; }
.login-form { display: grid; gap: 0.8rem; margin-block: 1rem; }
.login-form label { display: grid; gap: 0.3rem; }
.login-form button { justify-self: start; }
.warning-link { color: inherit; }
.schedule-issue { border-inline-start: 3px solid var(--caution); }
.schedule-issue.critical { border-inline-start-color: var(--danger); }
.issue-label { color: var(--caution); font-weight: 700; }
.schedule-issue.critical > .issue-label { color: var(--danger); }

.display { font-size: clamp(1rem, 1.4vw, 3.5rem); }
.display .masthead { padding: 0.45em 1.05em; border-bottom: 2px solid var(--accent); }
.display .masthead h1 { font-size: 1.7em; }
.display h1, .display h2, .display h3 { font-family: var(--font-heading); }
#board-status { font-size: 1.2em; color: var(--muted); }
.board { padding: 0.5em 1.05em 0.75em; }
.week h2 { margin-block: 0.2em 0.45em; font-size: 1.12em; }
.day-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.42em; }
.day { background: var(--surface); border-radius: 0.25em; padding: 0.38em; border-top: 2px solid var(--accent); }
.day.today { outline: 0.12em solid var(--accent); outline-offset: -0.12em; }
.day h3 { font-size: 1em; margin: 0.15em 0.15em 0.38em; }
.display .empty { font-size: 0.82em; padding: 0.2em; }
.board-card {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 0.15em;
  margin-top: 0.35em;
  padding: 0.35em 0.45em;
  border-radius: 0.22em;
  border-left: 0.2em solid var(--muted);
  background: var(--raised);
  line-height: 1.16;
  overflow-wrap: anywhere;
}
.board-card.on-time { border-color: var(--success); }
.board-card.warning { border-color: var(--caution); }
.board-card.critical { border-color: var(--danger); }
.board-statuses { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15em 0.42em; }
.board-card .badge { background: var(--surface); }
.board-card .install { color: var(--muted); font-size: 0.82em; }
.board-employees { color: var(--accent-text, var(--accent)); font-size: 0.86em; font-weight: 700; }
.board-overflow { color: var(--muted); font-size: 0.64em; padding-top: 0.25em; }
.board-card .job-health { font-size: 0.72em; font-weight: 700; color: var(--muted); }
.board-card.on-time .job-health { color: var(--success); }
.board-card.warning .job-health { color: var(--caution); }
.board-card.critical .job-health { color: var(--danger); }
.next-week { font-size: 0.64em; margin-top: 0.7em; }
@media (min-width: 801px) {
  .display {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }
  .board {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 2fr) minmax(0, 1fr);
    gap: 0.55em;
  }
  .week { display: grid; grid-template-rows: auto minmax(0, 1fr); }
  .day { display: flex; flex-direction: column; min-height: 0; }
  .day-entries { flex: 1; min-height: 0; overflow: hidden; }
  .next-week { margin-top: 0; }
}
@media (max-width: 800px) {
  .workspace-header { grid-template-columns: 1fr 1fr; grid-template-areas: "logo settings" "title title" "left right"; }
  .workspace-header .brand-logo { width: min(8rem, 50vw); }
  .workspace-left { justify-content: flex-end; }
  .day-grid { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr)); }
  .next-week { font-size: 0.86em; }
}
