:root {
  --navy: #17324d;
  --navy-2: #244d70;
  --ink: #172331;
  --muted: #607184;
  --line: #d7e0e8;
  --soft: #f4f7fa;
  --panel: #ffffff;
  --accent: #2f6f9f;
  --danger: #b64040;
  --warning: #9a6711;
  --worker-width: 190px;
  --row-height: 78px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #edf2f6;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #edf2f6; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(68, 124, 164, .20), transparent 34%),
    linear-gradient(145deg, #10273c, #264e6e 58%, #dce8f0 58%);
}
.login-card {
  width: min(440px, 100%);
  background: rgba(255,255,255,.98);
  border-radius: 18px;
  padding: 34px;
  box-shadow: 0 24px 70px rgba(3, 18, 31, .28);
}
.login-mark, .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--navy);
  color: white;
  font-weight: 800;
  letter-spacing: .04em;
}
.login-logo { display: block; width: 150px; max-width: 55%; margin: 0 auto 18px; border-radius: 14px; }
.login-card h1 { margin: 18px 0 8px; font-size: 1.65rem; }
.login-card > p { margin: 0 0 22px; color: var(--muted); }
label { display: grid; gap: 7px; font-weight: 650; font-size: .9rem; }
.login-card label { margin: 14px 0; }
input, select, textarea {
  border: 1px solid #bdcbd7;
  border-radius: 8px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(47, 111, 159, .18);
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 82px; }
button {
  border: 1px solid #b9c8d4;
  border-radius: 8px;
  padding: 8px 12px;
  background: white;
  color: var(--ink);
  font-weight: 650;
}
button:hover { background: #f0f5f8; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); color: white; border-color: var(--accent); }
button.primary:hover { background: #245b82; }
button.danger { color: white; background: var(--danger); border-color: var(--danger); }
button.wide { width: 100%; margin-top: 8px; padding: 11px; }
.form-error { min-height: 22px; color: var(--danger); margin-top: 8px; }
.demo-accounts { margin-top: 16px; color: var(--muted); font-size: .82rem; }
.demo-accounts p { margin: 7px 0; }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  min-height: 64px;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--navy);
  color: white;
  box-shadow: 0 2px 12px rgba(15, 37, 55, .24);
  position: relative;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-logo { width: 46px; height: 44px; object-fit: cover; border-radius: 7px; box-shadow: 0 0 0 1px rgba(255,255,255,.4); }
.brand-mark { background: white; color: var(--navy); width: 40px; height: 40px; }
.brand strong, .brand small { display: block; }
.brand small { opacity: .72; font-size: .72rem; margin-top: 2px; }
.version-badge { display: inline-block; margin-left: 5px; padding: 2px 6px; border-radius: 99px; background: #fff; color: var(--navy); font-size: .62rem; font-style: normal; vertical-align: 2px; }
.top-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top-actions button { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.10); color: white; }
.top-actions button:hover { background: rgba(255,255,255,.19); }
.top-actions button.primary { background: white; color: var(--navy); }
.account-button { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.banner { padding: 9px 18px; border-bottom: 1px solid; font-size: .9rem; }
.banner.warning { background: #fff5d8; color: #694600; border-color: #ead48c; }
.banner.review { background: #f4eaff; color: #604078; border-color: #d9bee8; }
.link-button { border: 0; background: none; padding: 0 3px; text-decoration: underline; color: inherit; }

.planner-controls {
  padding: 10px 14px;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.date-controls, .view-controls, .priority-controls, .legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-controls input { width: 145px; }
.range-label { padding: 7px 10px; border-radius: 7px; background: #eef4f8; color: #31546e; font-size: .78rem; font-weight: 750; }
.view-controls { gap: 3px; }
.view-controls button { min-width: 36px; padding: 7px 8px; font-weight: 800; }
.view-controls button.active { background: var(--navy-2); color: white; border-color: var(--navy-2); }
.view-controls #shuntNowButton { min-width: 60px; margin-left: 5px; }
.priority-controls button { padding: 7px 11px; }
.priority-controls button.active { background: var(--navy-2); color: white; border-color: var(--navy-2); }
.legend { color: var(--muted); font-size: .78rem; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-swatch { width: 14px; height: 10px; display: inline-block; border-radius: 2px; border: 1px solid rgba(0,0,0,.15); }
.locked-swatch { background: repeating-linear-gradient(135deg, #49596a, #49596a 3px, #718091 3px, #718091 6px); }
.absence-swatch { background: #ecd7d7; }
.nonwork-swatch { background: #e7edf2; }

.board-shell { flex: 1; min-height: 0; padding: 12px; display: flex; }
.board-message { margin: auto; color: var(--muted); }
.board-scroll {
  width: 100%;
  height: calc(100vh - 152px);
  min-height: 420px;
  overflow: auto;
  background: white;
  border: 1px solid #c8d4de;
  border-radius: 10px;
  box-shadow: 0 7px 22px rgba(28, 57, 81, .09);
  overscroll-behavior: contain;
  touch-action: pan-y;
  cursor: grab;
}
.board-scroll.panning { cursor: grabbing; user-select: none; }
.board-grid {
  display: grid;
  grid-template-columns: var(--worker-width) 1fr;
  align-items: stretch;
  align-content: start;
  position: relative;
  min-height: 100%;
}
.corner-cell, .timeline-header {
  position: sticky;
  top: 0;
  z-index: 12;
  height: 64px;
  background: #f8fafc;
  border-bottom: 1px solid #aebdca;
}
.corner-cell {
  left: auto;
  transform: translateX(var(--board-scroll-x, 0px));
  will-change: transform;
  z-index: 16;
  padding: 12px;
  display: flex;
  align-items: end;
  font-weight: 750;
  border-right: 1px solid #aebdca;
}
.timeline-header { position: sticky; overflow: hidden; }
.day-header {
  position: absolute;
  top: 0;
  height: 34px;
  border-right: 1px solid #9fb1bf;
  padding: 7px 9px;
  background: #eef4f8;
  font-size: .82rem;
  font-weight: 750;
  white-space: nowrap;
}
.hour-label {
  position: absolute;
  top: 34px;
  height: 30px;
  padding: 7px 3px 0;
  border-left: 1px solid #d8e1e8;
  font-size: .67rem;
  color: #6f8090;
}
.worker-cell {
  position: relative;
  left: auto;
  transform: translateX(var(--board-scroll-x, 0px));
  will-change: transform;
  z-index: 10;
  height: var(--row-height);
  background: #fbfcfd;
  border-right: 1px solid #aebdca;
  border-bottom: 1px solid var(--line);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 3px 0 5px rgba(28, 57, 81, .08);
}
.worker-cell strong { font-size: .95rem; }
.worker-cell small { color: var(--muted); font-size: .72rem; margin-top: 4px; }
.worker-cell .absence-badge { color: #914545; font-weight: 700; }
.timeline-row {
  height: var(--row-height);
  position: relative;
  border-bottom: 1px solid var(--line);
  background-color: white;
  background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--hour-px) - 1px), #e3e9ee calc(var(--hour-px) - 1px), #e3e9ee var(--hour-px));
}
.timeline-row.drop-target { box-shadow: inset 0 0 0 3px rgba(47, 111, 159, .45); }
.day-line { position: absolute; top: 0; bottom: 0; width: 1px; background: #9fb1bf; z-index: 1; pointer-events: none; }
.nonworking, .absence, .today-column { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.nonworking { background: rgba(216, 225, 233, .58); z-index: 0; }
.absence { background: repeating-linear-gradient(135deg, rgba(194, 89, 89, .19), rgba(194, 89, 89, .19) 7px, rgba(194, 89, 89, .08) 7px, rgba(194, 89, 89, .08) 14px); z-index: 2; border-left: 1px solid rgba(164, 76, 76, .35); border-right: 1px solid rgba(164, 76, 76, .35); }
.today-column { background: rgba(255, 231, 153, .10); z-index: 0; }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #d34b4b; z-index: 7; pointer-events: none; }

.job-block {
  position: absolute;
  top: 12px;
  height: 52px;
  min-width: 7px;
  z-index: 5;
  border: 1px solid rgba(0,0,0,.24);
  border-radius: 7px;
  box-shadow: 0 2px 5px rgba(20, 44, 62, .20);
  color: white;
  padding: 5px 18px 5px 7px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  transition: opacity .13s, filter .13s, transform .13s;
}
.job-block:hover { transform: translateY(-1px); filter: brightness(1.04); z-index: 9; }
.job-block.dimmed { opacity: .18; filter: grayscale(.65); }
.job-block.priority-match { box-shadow: 0 0 0 3px rgba(29, 54, 78, .28), 0 3px 8px rgba(20,44,62,.25); z-index: 8; }
.job-block.locked { border-width: 2px; border-style: double; }
.job-block.continuation { border-left-style: dashed; }
.job-block.live-position { z-index: 10; box-shadow: 0 0 0 2px rgba(255,255,255,.75), 0 3px 8px rgba(20,44,62,.3); }
.job-block .job-title { font-weight: 750; font-size: .68rem; line-height: 1.12; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-block .job-meta { font-size: .65rem; opacity: .9; display: block; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-icons { position: absolute; right: 5px; top: 4px; display: grid; gap: 1px; font-size: .7rem; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.resize-handle { position: absolute; right: -1px; top: 0; bottom: 0; width: 11px; cursor: ew-resize; background: linear-gradient(to left, rgba(255,255,255,.42), transparent); }

.job-tooltip {
  position: fixed;
  z-index: 100;
  width: min(330px, calc(100vw - 24px));
  background: #102538;
  color: white;
  border-radius: 9px;
  padding: 11px 13px;
  box-shadow: 0 14px 34px rgba(0,0,0,.3);
  pointer-events: none;
  font-size: .78rem;
}
.job-tooltip strong { display: block; font-size: .86rem; margin-bottom: 6px; }
.job-tooltip dl { display: grid; grid-template-columns: 64px 1fr; gap: 4px 8px; margin: 0; }
.job-tooltip dt { color: #aac0d2; }
.job-tooltip dd { margin: 0; white-space: pre-wrap; max-height: 78px; overflow: hidden; }
.drag-ghost {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  width: 220px;
  min-height: 44px;
  border-radius: 7px;
  background: rgba(23, 50, 77, .92);
  color: white;
  padding: 9px;
  box-shadow: 0 14px 32px rgba(0,0,0,.30);
  font-weight: 750;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 25, 38, .55);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-panel {
  width: min(880px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 14px;
  box-shadow: 0 26px 76px rgba(0,0,0,.34);
  overflow: hidden;
}
.modal-panel.wide { width: min(1120px, 100%); }
.modal-header, .modal-footer { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 1.2rem; }
.modal-header p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.modal-footer { border-top: 1px solid var(--line); justify-content: flex-end; flex-wrap: wrap; }
.modal-body { padding: 18px; overflow: auto; }
.icon-button { border: 0; background: none; font-size: 1.7rem; line-height: 1; padding: 3px 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field-note { color: var(--muted); font-size: .74rem; font-weight: 450; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; }
.check-card { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 9px; font-weight: 600; }
.check-card input { margin: 0; }
.source-chip { display: inline-block; border-radius: 99px; padding: 3px 8px; background: #e9f0f6; color: #3c5870; font-size: .72rem; }
.dependency-banner { padding: 10px 12px; border-radius: 8px; background: #fff5d8; border: 1px solid #ead48c; }
.dependency-panel { display: grid; gap: 7px; padding: 12px; border: 1px solid #cbd9e4; border-radius: 9px; background: #f6f9fb; }
.dependency-panel h3 { margin: 0 0 3px; }
.dependency-link { width: 100%; text-align: left; background: white; }
.schedule-list { margin: 0; padding-left: 19px; color: var(--muted); font-size: .82rem; }

.settings-layout { display: grid; grid-template-columns: 170px 1fr; min-height: 480px; }
.settings-nav { padding-right: 14px; border-right: 1px solid var(--line); display: grid; align-content: start; gap: 6px; }
.settings-nav button { text-align: left; }
.settings-nav button.active { background: var(--navy); color: white; border-color: var(--navy); }
.settings-content { padding-left: 18px; }
.settings-section h3 { margin-top: 0; }
.worker-list, .user-list, .absence-list, .history-list { display: grid; gap: 7px; }
.list-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fbfcfd; }
.list-row small { color: var(--muted); display: block; margin-top: 2px; }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { padding: 7px; border-bottom: 1px solid var(--line); text-align: left; }
.hours-table input[type="time"] { width: 116px; }
.colour-row { display: grid; grid-template-columns: 1fr 72px auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.colour-row input[type="color"] { width: 58px; height: 36px; padding: 2px; }
.priority-actions { display: flex; align-items: center; gap: 0; }
.priority-colour-picker { display: flex; align-items: center; gap: 7px; margin-right: 10px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.priority-colour-picker input[type="color"] { width: 48px; height: 38px; padding: 2px; }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin: 12px 0; }
.inline-form label { flex: 1 1 160px; }
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; margin-bottom: 18px; }
.dashboard-cards > div { display: grid; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f5f9fc; }
.dashboard-cards > div strong { font-size: 1.35rem; color: var(--navy); }
.dashboard-cards > div span { color: var(--muted); font-size: .82rem; }
.dashboard-cards > div.attention { background: #fff4e5; border-color: #edb96c; }
.dashboard-card { display: grid; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f5f9fc; color: inherit; text-align: left; cursor: pointer; }
.dashboard-card strong { font-size: 1.35rem; color: var(--navy); }
.dashboard-card span { color: var(--muted); font-size: .82rem; }
.dashboard-card small { color: #718398; font-size: .7rem; }
.dashboard-card:hover { border-color: #83a9c4; background: #edf6fc; transform: translateY(-1px); }
.dashboard-card.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(45, 126, 178, .16); background: #eaf5fc; }
.dashboard-card.attention { background: #fff4e5; border-color: #edb96c; }
.dashboard-card.attention.active { box-shadow: 0 0 0 2px rgba(221, 132, 35, .2); }
.dashboard-help { color: var(--muted); margin: -6px 0 12px; }
.checklist-occurrence-row { width: 100%; text-align: left; color: inherit; }
.checklist-occurrence-row.overdue-row { background: #fff8ef; border-color: #edb96c; }
.overdue-owner { color: #a55317; }
.invoice-tabs, .bulk-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 14px; }
.invoice-tab.active { background: var(--navy); color: white; }
.bulk-toolbar { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fb; }
.bulk-toolbar label { flex: 0 1 190px; }
.bulk-toolbar label.grow { flex: 1 1 240px; }
.invoice-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.invoice-open { border: 0; background: transparent; text-align: left; color: inherit; padding: 0; }
.invoice-check { width: 20px; height: 20px; }
.section-divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.history-row { cursor: pointer; }
.history-row:hover { border-color: #9db4c6; background: #f4f8fb; }
.history-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); align-items: end; gap: 9px; margin-bottom: 16px; }
.checklist-panel { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #f7fbf9; }
.checklist-panel h3 { margin: 0 0 9px; }
.checklist-row { display: flex; align-items: flex-start; gap: 9px; padding: 9px 5px; border-bottom: 1px solid #dce9e2; font-weight: 600; }
.checklist-row:last-of-type { border-bottom: 0; }
.checklist-row input { width: 20px; height: 20px; flex: 0 0 auto; }
.checklist-template-row { width: 100%; text-align: left; color: inherit; }
.empty-state { color: var(--muted); padding: 24px 4px; text-align: center; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.job-photos-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #f8fafc;
}
.job-photos-panel h3 { margin: 0 0 12px; }
.photo-actions, .photo-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.photo-actions button, .photo-preview-actions button { min-height: 48px; }
.job-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.job-photo-card {
  display: grid;
  gap: 8px;
  align-content: start;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  overflow: hidden;
}
.job-photo-card a {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: #e8eef3;
}
.job-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.job-photo-details { min-width: 0; }
.job-photo-details strong, .job-photo-details small { display: block; overflow-wrap: anywhere; }
.job-photo-details small { color: var(--muted); margin-top: 3px; font-size: .75rem; }
button.compact { min-height: 40px; padding: 7px 10px; }
.job-photo-card button.compact {
  justify-self: start;
  width: auto;
  min-height: 30px;
  padding: 4px 9px;
  font-size: .75rem;
}
.photo-preview {
  margin-top: 14px;
  padding: 12px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: white;
}
.photo-camera {
  margin-top: 14px;
  padding: 12px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: #101820;
  color: white;
}
.photo-camera h4 { margin: 0 0 10px; }
.photo-camera video {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 8px;
  background: black;
}
.photo-camera-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 12px;
}
.photo-camera-actions button { min-height: 48px; }
.photo-preview h4 { margin: 0 0 10px; }
.photo-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 52vh;
  margin: 0 auto 12px;
  border-radius: 8px;
  object-fit: contain;
  background: #101820;
}
.photo-preview label { display: grid; gap: 5px; margin-bottom: 12px; }
.photo-preview-actions { justify-content: flex-end; }

.toast-area { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: grid; gap: 9px; }
.toast { max-width: 390px; background: #17324d; color: white; padding: 11px 14px; border-radius: 9px; box-shadow: 0 12px 28px rgba(0,0,0,.25); animation: toast-in .18s ease-out; }
.toast.error { background: #8e3535; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  :root { --worker-width: 150px; --row-height: 84px; }
  .topbar { align-items: flex-start; }
  .brand small { display: none; }
  .top-actions button { padding: 7px 9px; font-size: .82rem; }
  .planner-controls { align-items: flex-start; }
  .legend { width: 100%; }
  .board-shell { padding: 8px; }
  .board-scroll { height: calc(100vh - 190px); }
}

@media (max-width: 650px) {
  :root { --worker-width: 126px; --row-height: 88px; }
  .topbar { padding: 8px; gap: 8px; }
  .brand span:last-child { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .top-actions { gap: 4px; }
  .top-actions button { font-size: .75rem; padding: 7px; }
  .account-button { max-width: 76px; }
  .photo-actions { display: grid; grid-template-columns: 1fr; }
  .photo-actions button { width: 100%; }
  .job-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-preview-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .photo-preview-actions .primary { grid-column: 1 / -1; grid-row: 1; }
  .photo-camera-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .planner-controls { padding: 8px; gap: 8px; }
  .date-controls input { width: 126px; }
  .legend { display: none; }
  .board-scroll { height: calc(100vh - 183px); border-radius: 7px; }
  .worker-cell { padding: 8px; }
  .worker-cell strong { font-size: .83rem; }
  .job-block { top: 14px; height: 58px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { grid-template-columns: repeat(2, 1fr); border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; margin-bottom: 14px; }
  .settings-content { padding-left: 0; }
  .modal-backdrop { padding: 6px; }
  .modal-panel { max-height: 96vh; border-radius: 10px; }
  .modal-body { padding: 13px; }
  .hours-table input[type="time"] { width: 98px; }
}

/* Individual maintenance-person job list */
.print-only { display: none; }
.worker-cell { padding: 0; }
.worker-name-button {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 11px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  color: inherit;
}
.worker-name-button:hover,
.worker-name-button:focus-visible {
  background: #eef5fa;
  outline: 3px solid rgba(47, 111, 159, .18);
  outline-offset: -3px;
}
.worker-name-button strong { font-size: .95rem; }
.worker-name-button small { color: var(--muted); font-size: .72rem; margin-top: 4px; }
.worker-name-button.worker-status-working { background: #d9f4df; box-shadow: inset 5px 0 #25833a; }
.worker-name-button.worker-status-idle { background: #fde0df; box-shadow: inset 5px 0 #c0392b; }
.worker-live-label { font-size: .68rem; font-weight: 750; margin-top: 3px; }
.worker-status-working .worker-live-label { color: #17652a; }
.worker-status-idle .worker-live-label { color: #9d241b; }
.worker-list-link { color: var(--accent); font-size: .68rem; margin-top: 5px; font-weight: 750; }

.person-jobs-view {
  flex: 1;
  width: min(1180px, calc(100% - 24px));
  margin: 12px auto 30px;
  background: white;
  border: 1px solid #c8d4de;
  border-radius: 12px;
  box-shadow: 0 7px 22px rgba(28, 57, 81, .09);
  overflow: hidden;
}
.person-list-header {
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.person-list-heading { display: flex; align-items: flex-start; gap: 14px; }
.person-list-heading h1 { margin: 1px 0 3px; font-size: 1.45rem; }
.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .7rem;
  font-weight: 800;
}
.person-list-subtitle { margin: 0; color: var(--muted); font-size: .84rem; }
.person-list-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.back-to-plan { white-space: nowrap; }
.person-list-notice {
  padding: 9px 18px;
  background: #eef5fa;
  border-bottom: 1px solid #d4e2ec;
  color: #31546e;
  font-size: .8rem;
}
.person-list-notice:empty { display: none; }
.person-list-message { padding: 40px 20px; text-align: center; color: var(--muted); }
.person-job-list { padding: 12px; display: grid; gap: 7px; }
.person-job-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  border: 1px solid #bfcbd5;
  border-left: 6px solid var(--job-color, #4f7cac);
  border-radius: 6px;
  background: white;
  overflow: hidden;
  break-inside: avoid;
}
.person-job-card.locked { border-style: double; border-width: 3px 1px 3px 6px; }
.person-job-card.selected { box-shadow: 0 0 0 3px rgba(47, 111, 159, .30); background: #f4f9fd; }
.person-job-card.working-now { border-color: #16803c; background: #dcfce7; }
.person-job-card.working-now .person-job-compact-cell,
.person-job-card.working-now .person-job-order { background: #dcfce7; color: #14532d; }
.person-job-card.working-now .person-job-compact-label { color: #166534; font-weight: 700; }
.person-job-card.dragging { opacity: .45; box-shadow: 0 0 0 3px rgba(47, 111, 159, .22); }
.person-job-card.drop-before { box-shadow: 0 -4px 0 var(--accent); }
.person-job-card.drop-after { box-shadow: 0 4px 0 var(--accent); }
.person-job-order {
  background: #f3f6f8;
  border-right: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 5px;
  gap: 4px;
}
.person-select-label { display: grid; place-items: center; width: 34px; min-height: 25px; }
.person-job-select { width: 19px; height: 19px; accent-color: var(--accent); }
.person-drag-handle {
  width: 34px;
  min-height: 48px;
  border: 1px solid #b9c8d4;
  background: white;
  padding: 5px;
  font-size: 1.05rem;
  line-height: 1;
  touch-action: none;
  cursor: grab;
}
.person-drag-handle:active { cursor: grabbing; }
.person-lock-marker { font-size: 1rem; line-height: 1; }
.person-job-compact-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  grid-template-rows: auto auto;
}
.person-job-compact-cell {
  min-width: 0;
  padding: 8px 11px;
  background: white;
  color: inherit;
  text-align: left;
  border: 0;
  border-radius: 0;
}
button.person-job-compact-cell { cursor: pointer; font: inherit; }
button.person-job-compact-cell:hover,
button.person-job-compact-cell:focus-visible { background: #f6f9fb; outline: 2px solid rgba(47, 111, 159, .2); outline-offset: -2px; }
.person-job-name,
.person-job-plot { border-bottom: 1px solid var(--line); }
.person-job-plot,
.person-job-length { border-left: 1px solid var(--line); }
.person-job-compact-label {
  display: block;
  margin-bottom: 2px;
  color: #5d6e7d;
  font-size: .64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.person-job-name strong { display: block; font-size: .96rem; line-height: 1.25; overflow-wrap: anywhere; }
.person-job-details > span:last-child { display: block; font-size: .83rem; line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere; }
.person-job-plot strong,
.person-job-length strong { display: block; font-size: .9rem; line-height: 1.25; overflow-wrap: anywhere; }
.person-job-length small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; font-weight: 700; }
.person-print-footer { padding: 12px 0 0; color: #555; font-size: 8pt; text-align: right; }

.release-history { display: grid; gap: 12px; max-height: 62vh; overflow: auto; padding-right: 4px; }
.release-entry { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fbfcfd; }
.release-entry.current { border-color: #79a8c8; background: #eef7fc; }
.release-entry header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.release-entry h3 { margin: 3px 0 0; font-size: 1rem; }
.release-entry time { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.release-entry ul { margin: 10px 0 0; padding-left: 21px; }
.release-entry li + li { margin-top: 5px; }

@media (max-width: 900px) {
  .person-jobs-view { width: calc(100% - 16px); margin: 8px auto 20px; }
  .person-list-header { padding: 14px; }
  .person-job-list { padding: 10px; }
  .person-job-compact-grid { grid-template-columns: minmax(0, 1fr) 150px; }
}

@media (max-width: 650px) {
  .worker-name-button { padding: 8px; }
  .worker-name-button strong { font-size: .83rem; }
  .worker-list-link { font-size: .62rem; }
  .person-list-header { display: grid; }
  .person-list-heading { display: grid; gap: 9px; }
  .person-list-actions { justify-content: stretch; }
  .person-list-actions button { flex: 1; }
  .range-label { width: 100%; text-align: center; }
  .release-entry header { display: grid; }
  .person-job-card { grid-template-columns: 40px minmax(0, 1fr); }
  .person-job-compact-grid { grid-template-columns: minmax(0, 1fr) 112px; }
  .person-job-compact-cell { padding: 7px 8px; }
  .person-job-name strong { font-size: .9rem; }
  .person-job-details > span:last-child { font-size: .78rem; }
  .person-job-plot strong, .person-job-length strong { font-size: .82rem; }
}

@media print {
  @page { size: auto; margin: 12mm; }
  html, body { background: white !important; color: black; min-height: auto; }
  .topbar,
  .banner,
  #plannerControls,
  #boardShell,
  .screen-only,
  .modal-backdrop,
  .toast-area,
  .job-tooltip,
  .drag-ghost { display: none !important; }
  #app { display: block !important; min-height: auto; }
  #personJobsView {
    display: block !important;
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  .person-list-header {
    display: block;
    padding: 0 0 8mm;
    background: white;
    border-bottom: 2px solid black;
  }
  .person-list-heading { display: block; }
  .eyebrow { color: black; }
  .person-list-heading h1 { font-size: 18pt; }
  .person-list-subtitle { color: #333; font-size: 9pt; }
  .person-list-message { display: none !important; }
  .person-job-list { display: grid !important; padding: 5mm 0 0; gap: 2.5mm; }
  .person-job-card {
    display: block;
    border: 1px solid #777;
    border-left: 2px solid #333;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }
  .person-job-order { display: none !important; }
  .person-job-compact-grid { grid-template-columns: minmax(0, 1fr) 38mm; }
  .person-job-compact-cell { padding: 2mm 2.5mm; }
  .person-job-compact-label { color: #333; font-size: 6.5pt; }
  .person-job-name strong { font-size: 10pt; }
  .person-job-details > span:last-child { font-size: 8pt; line-height: 1.25; }
  .person-job-plot strong, .person-job-length strong { font-size: 9pt; }
  .person-job-length small { font-size: 6.5pt; }
  .print-only { display: block !important; }
}
:root { --attendance-border: #cbd9e3; }
.clock-since { color:#fff; font-weight:600; align-self:center; max-width:260px; padding:6px; }
.attendance-table button.attendance-drill { color:#205a85; text-decoration:underline; background:transparent; border:0; border-radius:4px; padding:8px 4px; min-height:44px; text-align:left; font-weight:600; }
.attendance-table button.attendance-drill:hover { background:#e1eff9; }
.attendance-table button.attendance-drill:focus-visible { outline:2px solid #205a85; }
button.holiday-pending { background:#ffeb00; color:#172331; border:2px solid #dbc600; font-weight:800; min-height:44px; }
button.holiday-pending:hover { background:#fff34d; color:#172331; }
button.holiday-pending:focus-visible { outline:3px solid #172331; outline-offset:3px; }
.attendance-tabs, .attendance-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:end; margin-bottom:16px; }
.attendance-card { padding:16px; border:1px solid var(--attendance-border); border-radius:8px; margin:14px 0; }
.attendance-card summary { cursor:pointer; font-weight:700; min-height:40px; }
.attendance-record { border-top:1px solid var(--attendance-border); padding:12px 0; }
.attendance-table-wrap { overflow-x:auto; max-width:100%; }
.attendance-table { border-collapse:collapse; width:100%; font-size:.88rem; }
.attendance-table td, .attendance-table th { border:1px solid var(--attendance-border); padding:9px; text-align:left; white-space:nowrap; }
.attendance-table th { background:#edf4f8; }
.attendance-table small { display:block; }
.attendance-card button, .attendance-actions button, .attendance-tabs button { min-height:44px; }
