:root {
  color-scheme: light;
  --ink: #17222e;
  --muted: #627086;
  --line: #dbe3eb;
  --surface: #ffffff;
  --canvas: #f3f6f8;
  --nav: #102532;
  --nav-soft: #193746;
  --teal: #087f76;
  --teal-soft: #e4f4f1;
  --blue: #1769e0;
  --blue-soft: #e7f0ff;
  --green: #147a43;
  --green-soft: #e6f5ec;
  --amber: #a86409;
  --amber-soft: #fff1d6;
  --red: #ba2d27;
  --red-soft: #fff0ef;
  --shadow: 0 12px 30px rgba(16, 37, 50, 0.12);
  --form-control-height: 42px;
  --form-control-height-compact: 38px;
}

* { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; margin: 0; min-height: 100%; overflow-x: hidden; }
body { background: var(--canvas); color: var(--ink); font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
[hidden] { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--nav); }
.login-panel { width: min(420px, 100%); padding: 32px; border: 1px solid #49606e; background: #152c3a; color: white; box-shadow: var(--shadow); }
.login-panel h1 { margin: 18px 0 4px; font-size: 32px; text-align: center; text-transform: uppercase; }
.login-subtitle { margin: 0 0 28px; color: #b8c8d2; text-align: center; }
.brand-mark { width: 64px; height: 64px; display: grid; place-items: center; margin: auto; border-radius: 8px; background: #135d61; color: #d7f1ee; font-size: 21px; font-weight: 800; }
.brand-mark.small { width: 46px; height: 46px; margin: 0; font-size: 15px; }
.version-label { margin: 24px 0 0; color: #94a8b5; text-align: center; }

.form-stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
.login-panel label { color: #d8e1e7; }
input, select, textarea { width: 100%; border: 1px solid #cfd9e2; border-radius: 6px; background: white; color: var(--ink); padding: 9px 11px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="color"]),
select { height: var(--form-control-height); min-height: var(--form-control-height); line-height: 1.2; }
select { padding-top: 0; padding-bottom: 0; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(8, 127, 118, 0.25); border-color: var(--teal); }
.form-error { margin: 0; padding: 10px 12px; border-left: 3px solid var(--red); background: var(--red-soft); color: #821f1a; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-field { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-weight: 700; }
.autocomplete { position: relative; min-width: 0; color: var(--ink); font-weight: 400; }
.autocomplete-list { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; left: 0; max-height: 220px; overflow-y: auto; border: 1px solid #b9c6d1; border-radius: 6px; background: var(--surface); box-shadow: 0 14px 30px rgba(16, 37, 50, .2); }
.autocomplete-option { width: 100%; min-height: 44px; display: grid; gap: 3px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 11px; text-align: left; cursor: pointer; }
.autocomplete-option:last-child { border-bottom: 0; }
.autocomplete-option:hover, .autocomplete-option.active { background: var(--teal-soft); color: #075f59; }
.autocomplete-option strong, .autocomplete-option small { display: block; overflow-wrap: anywhere; }
.autocomplete-option small { color: var(--muted); font-size: 11px; font-weight: 500; }
.autocomplete-option.active small { color: #326d69; }
.checkbox-field { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.checkbox-field legend { padding: 0 5px; color: var(--muted); font-size: 12px; font-weight: 800; }
.checkbox-field label { min-height: 38px; display: inline-flex; flex-direction: row; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: #f7f9fb; }
.checkbox-field input { width: 18px; height: 18px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.checkbox-line input { width: 18px; min-height: 18px; }

.button { min-height: 40px; border: 1px solid transparent; border-radius: 6px; padding: 9px 15px; font-weight: 750; }
.button.primary { background: var(--blue); color: white; }
.button.secondary { border-color: #cbd6df; background: white; color: var(--ink); }
.button.danger { background: var(--red); color: white; }
.button.ghost { background: transparent; color: var(--teal); }
.button.wide { width: 100%; }
.button:hover:not(:disabled) { filter: brightness(0.95); }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); font-size: 21px; }

.app-view { min-height: 100vh; display: grid; grid-template-columns: 276px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px 14px; background: var(--nav); color: #dce6eb; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 13px; padding: 2px 8px 20px; border-bottom: 1px solid #2b4655; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { margin-top: 4px; color: #859aa8; }
.main-navigation { display: grid; gap: 4px; padding: 18px 0; }
.nav-group { margin: 15px 10px 5px; color: #718998; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.nav-button { min-height: 43px; border: 0; border-left: 4px solid transparent; border-radius: 5px; background: transparent; color: #aebdc7; padding: 9px 12px; text-align: left; font-weight: 800; text-transform: uppercase; }
.nav-button:hover { background: #16313f; color: white; }
.nav-button.active { border-left-color: #2aa6a1; background: var(--nav-soft); color: white; }
.sidebar-footer { display: grid; gap: 8px; margin-top: auto; padding: 15px 8px 4px; border: 1px solid #314b5b; text-align: center; }
.sidebar-footer small { color: #8fa4b1; }
.sidebar-action { min-height: 38px; border: 1px solid #536a77; border-radius: 5px; background: #203846; color: white; }

.workspace-shell { min-width: 0; }
.workspace-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 28px; border-bottom: 1px solid var(--line); background: white; }
.workspace-header h1 { margin: 3px 0 0; font-size: 23px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.sync-status { padding: 7px 10px; border-radius: 999px; background: var(--teal-soft); color: #066a63; font-weight: 750; }
.sync-status.syncing { background: var(--amber-soft); color: var(--amber); }
.sync-status.error { background: var(--red-soft); color: var(--red); }
.workspace { padding: 24px 28px 40px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.segmented { display: inline-flex; border: 1px solid #cdd8e0; border-radius: 6px; background: #f7f9fb; overflow: hidden; }
.segmented button { min-height: 38px; border: 0; border-right: 1px solid #dbe3e9; background: transparent; color: var(--ink); padding: 8px 14px; font-weight: 750; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--ink); color: white; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { min-height: 104px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.metric span { display: block; color: var(--muted); }
.metric strong { display: block; margin-top: 9px; font-size: 28px; }
.section-panel { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 6px; background: white; overflow: hidden; }
.section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); }
.section-body { padding: 18px; }

.horizontal-scroll-frame { min-width: 0; }
.horizontal-scroll-surface {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: #91a2af #edf2f5;
  scrollbar-width: thin;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}
.horizontal-scroll-surface:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.horizontal-scroll-surface::-webkit-scrollbar { height: 11px; }
.horizontal-scroll-surface::-webkit-scrollbar-track { background: #edf2f5; }
.horizontal-scroll-surface::-webkit-scrollbar-thumb { border: 2px solid #edf2f5; border-radius: 6px; background: #91a2af; }
.data-table-wrap { overflow-y: hidden; }
.data-table { width: 100%; min-width: var(--table-min-width, 560px); border-collapse: collapse; }
.data-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); background: #f5f8fa; color: var(--muted); text-align: left; font-size: 12px; }
.data-table td { padding: 12px; border-bottom: 1px solid #e6ebf0; vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-open] { cursor: pointer; }
.data-table tbody tr[data-open]:hover { background: #f6faf9; }
.cell-title { display: block; font-weight: 800; }
.cell-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 7px; }
.table-action { min-height: 32px; border: 1px solid #ced8df; border-radius: 5px; background: white; padding: 5px 9px; font-weight: 700; }

.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; background: #edf1f5; color: #475568; font-size: 12px; font-weight: 800; text-transform: capitalize; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: #1253aa; }
.empty-state { min-height: 170px; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 7px; }

.calendar-shell { border: 1px solid var(--line); border-radius: 6px; background: white; overflow: hidden; }
.calendar-grid { min-width: 920px; display: grid; grid-template-columns: 230px repeat(7, minmax(125px, 1fr)); }
.calendar-cell { min-height: 108px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-header { min-height: 58px; display: grid; align-content: center; background: #e8eef4; color: var(--muted); font-weight: 800; }
.calendar-header.today { background: #daf2ed; color: #057269; }
.calendar-row-label { background: #f7f9fb; }
.calendar-row-label strong, .calendar-row-label span { display: block; }
.calendar-row-label span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.calendar-item { width: 100%; margin-bottom: 7px; border: 0; border-left: 4px solid var(--blue); border-radius: 5px; background: var(--blue-soft); color: #174b8f; padding: 8px; text-align: left; }
.calendar-item.callout { border-left-color: var(--red); background: var(--red-soft); color: #8e241f; }
.calendar-item.leave { border-left-color: var(--amber); background: var(--amber-soft); color: #815107; }
.calendar-item strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-item small { display: block; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.map-canvas { position: relative; min-height: 520px; border: 1px solid var(--line); background-color: #eef3f0; background-image: linear-gradient(#dbe6df 1px, transparent 1px), linear-gradient(90deg, #dbe6df 1px, transparent 1px); background-size: 44px 44px; overflow: hidden; }
.map-pin { position: absolute; width: 20px; height: 20px; border: 3px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 2px 8px rgba(0,0,0,.25); transform: translate(-50%, -50%); }
.map-pin.callout { background: var(--red); }
.map-pin.staff { background: var(--teal); }
.map-legend { display: flex; gap: 18px; padding: 12px 16px; border-top: 1px solid var(--line); }
.map-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--blue); }
.map-legend .callout-key::before { background: var(--red); }
.map-legend .staff-key::before { background: var(--teal); }

.modal-root { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(8, 23, 32, 0.58); }
.modal { width: min(760px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; border-radius: 7px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: hidden; }
.modal.wide { width: min(1060px, 100%); }
.modal-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 3px 0 0; font-size: 20px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px; border-top: 1px solid var(--line); background: #f7f9fa; }
.modal-footer .danger-zone { margin-right: auto; }
.close-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 6px; background: white; font-size: 19px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.detail-field { min-height: 75px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.detail-field span { display: block; color: var(--muted); font-size: 12px; }
.detail-field strong { display: block; margin-top: 6px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 90; max-width: 420px; padding: 13px 16px; border-radius: 6px; background: var(--ink); color: white; box-shadow: var(--shadow); }
.toast.error { background: var(--red); }

.mobile-navigation { display: none; }
.field-mobile .sidebar { display: none; }
.field-mobile.app-view { grid-template-columns: 1fr; }
.field-mobile .workspace-header { padding: 15px 18px; }
.field-mobile .workspace-header h1 { font-size: 24px; text-transform: uppercase; }
.field-mobile .workspace { padding: 16px 16px 92px; }
.field-mobile .mobile-navigation { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: white; }
.mobile-nav-button { min-height: 66px; border: 0; border-top: 3px solid transparent; background: white; color: var(--muted); font-size: 12px; font-weight: 800; }
.mobile-nav-button.active { border-top-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.mobile-card-list { display: grid; gap: 12px; }
.mobile-card { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.mobile-card h2, .mobile-card h3 { margin: 0 0 7px; }
.mobile-card p { color: var(--muted); }

@media (max-width: 1100px) {
  .app-view { grid-template-columns: 230px minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-view:not(.field-mobile) { grid-template-columns: 1fr; }
  .app-view:not(.field-mobile) .sidebar { position: static; width: 100%; height: auto; max-height: none; }
  .app-view:not(.field-mobile) .sidebar-footer { display: grid; }
  .main-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-group { grid-column: 1 / -1; }
  .workspace-header, .workspace { padding-left: 16px; padding-right: 16px; }
  .metric-grid, .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .modal-root { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 94vh; border-radius: 7px 7px 0 0; }
  .calendar-grid { grid-template-columns: 190px repeat(7, 130px); }
}

/* Production visual system: aligned with the approved operations prototype. */
:root {
  --ink: #17212b;
  --muted: #667085;
  --line: #e1e7ec;
  --surface: #ffffff;
  --canvas: #f1f4f6;
  --nav: #10212e;
  --nav-soft: #1a3543;
  --teal: #0f766e;
  --teal-soft: #e8f6f2;
  --blue: #1769e0;
  --blue-soft: #eaf3ff;
  --green: #16803c;
  --green-soft: #e8f6ef;
  --amber: #b7791f;
  --amber-soft: #fff6db;
  --red: #b42318;
  --red-soft: #ffefed;
  --shadow: 0 1px 2px rgba(20, 35, 50, 0.05), 0 8px 24px rgba(20, 35, 50, 0.055);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

.login-view { background: var(--nav); }
.login-panel {
  width: min(460px, 100%);
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}
.login-brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.login-brand .brand-mark { width: 44px; height: 44px; margin: 0; font-size: 15px; }
.login-panel .login-brand h1 { margin: 0; color: var(--ink); font-size: 20px; text-align: left; text-transform: none; }
.login-panel .login-subtitle { margin: 2px 0 0; color: var(--muted); text-align: left; }
.login-heading { margin: 18px 0; }
.login-heading h2 { margin: 3px 0 0; font-size: 18px; }
.login-panel label { color: var(--muted); }
.login-panel .version-label { margin-bottom: 0; }

.app-view {
  height: 100vh;
  min-height: 100vh;
  grid-template-columns: 248px minmax(0, 1fr);
  overflow: hidden;
}
.sidebar { padding: 18px 14px; }
.sidebar-brand { gap: 12px; padding: 2px 6px 18px; }
.main-navigation { gap: 12px; padding: 16px 0; align-content: start; }
.nav-section, .nav-group-items { display: grid; }
.nav-section { gap: 4px; }
.nav-group-items { gap: 1px; }
.nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 2px;
  color: #8293a9;
  font-size: 12px;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
}
.nav-group::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  min-width: 12px;
  background: rgba(183, 196, 216, 0.28);
}
.nav-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: #d7dfeb;
  font-weight: 600;
  text-transform: uppercase;
}
.nav-button:hover, .nav-button.active { background: var(--nav-soft); color: white; }
.nav-button.active { border-left: 0; box-shadow: inset 3px 0 0 #38b2ac; }
.sidebar-footer {
  gap: 7px;
  margin-top: 16px;
  padding: 12px;
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}
.sidebar-action { min-height: 38px; border-color: rgba(255, 255, 255, 0.25); border-radius: 6px; background: rgba(255, 255, 255, 0.09); }
.sidebar-action:hover { border-color: white; background: white; color: var(--ink); }

.workspace-shell { height: 100vh; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.workspace-header {
  position: relative;
  z-index: 20;
  min-height: 86px;
  padding: 18px 26px 14px;
  background: rgba(241, 244, 246, 0.94);
  backdrop-filter: blur(14px);
}
.workspace-header h1 { font-size: 19px; }
.workspace { min-height: 0; height: 100%; padding: 14px 24px 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.sync-status { border: 1px solid #b9ddd7; border-radius: 6px; padding: 6px 9px; }

.button, .icon-button, .table-action, .sidebar-action { transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled), .table-action:hover:not(:disabled) { filter: none; border-color: #aab8c5; background: #f6f8fa; color: var(--ink); }
.button.primary:hover:not(:disabled) { border-color: #105abf; background: #105abf; color: white; }
.button.danger:hover:not(:disabled) { border-color: #941d14; background: #941d14; color: white; }
.segmented button { min-width: 74px; }
.segmented button.active, .segmented button.active:hover { border-color: var(--ink); background: var(--ink); color: white; }
.segmented.vertical { display: grid; grid-auto-flow: row; }

.section-panel { border-radius: 8px; box-shadow: var(--shadow); }
.section-heading { padding: 16px; }
.section-heading h2 { font-size: 14px; }
.section-heading p { font-size: 12px; }
.section-navigation {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid #cdd8e0;
  border-radius: 6px;
  background: #f7f9fb;
  overflow-x: auto;
}
.section-nav-button {
  min-height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-right: 1px solid #dbe3e9;
  background: transparent;
  color: var(--ink);
  padding: 8px 15px;
  font-weight: 750;
}
.section-nav-button:last-child { border-right: 0; }
.section-nav-button:hover:not(.active) { background: white; }
.section-nav-button.active { background: var(--ink); color: white; }
.data-table th { height: 42px; padding: 10px 12px; background: #eef3f8; }
.data-table td { padding: 12px; }
.table-action { border-radius: 6px; }
.actions-cell { flex-direction: column; align-items: stretch; }

.calendar-shell {
  min-height: calc(100vh - 126px);
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: background-color 160ms ease, border-color 160ms ease;
}
.calendar-shell.planning { border-color: #e9ad55; background: #fff8ed; box-shadow: inset 0 4px 0 #d97706, var(--shadow); }
.calendar-publication-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.72); }
.calendar-publication-summary article { display: grid; gap: 2px; min-width: 0; padding: 12px 16px; border-right: 1px solid var(--line); }
.calendar-publication-summary article:last-child { border-right: 0; }
.calendar-publication-summary span, .calendar-publication-summary small { color: var(--muted); }
.calendar-publication-summary strong { font-size: 22px; }
.publication-notes { display: grid; gap: 6px; margin-top: 16px; color: var(--muted); font-weight: 800; }
.calendar-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: white;
}
.calendar-shell.planning .calendar-panel-header,
.calendar-shell.planning .calendar-legend,
.calendar-shell.planning .calendar-scroll { background: #fff8ed; }
.calendar-panel-header h2 { margin: 0; font-size: 14px; }
.calendar-panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.calendar-header-actions { display: flex; align-items: end; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.layer-control { display: grid; gap: 5px; }
.layer-control > span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.calendar-legend {
  min-height: 42px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line);
  background: white;
  font-size: 12px;
}
.calendar-legend > strong, .legend-divider { color: var(--muted); font-weight: 800; }
.legend-divider { margin-left: 6px; padding-left: 12px; border-left: 1px solid var(--line); }
.legend-item { display: inline-flex; min-height: 28px; align-items: center; gap: 7px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.legend-item i { width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
.legend-item.callout { color: var(--red); }
.legend-item.project { color: var(--blue); }
.legend-item.maintenance { color: var(--green); }
.legend-item.unavailable { color: var(--red); background: #fff8f7; }
.legend-item.review i { width: 14px; height: 14px; border: 2px solid rgba(180, 35, 24, 0.72); background: white; }
.calendar-scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; background: white; }
.calendar-grid { min-width: max(100%, calc(300px + var(--calendar-days) * var(--calendar-column-width, 155px))); grid-template-columns: 300px repeat(var(--calendar-days), minmax(var(--calendar-column-width, 155px), 1fr)); }
.calendar-control-cell {
  position: sticky;
  left: 0;
  z-index: 8;
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  grid-template-rows: 30px 32px;
  gap: 6px 8px;
  align-items: stretch;
  padding: 6px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #e8eef4;
}
.calendar-control-cell > [data-calendar="today"] { grid-column: 1; grid-row: 1; min-height: 30px; padding: 0 8px; font-size: 12px; }
.calendar-control-row { display: contents; }
.calendar-axis-toggle { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calendar-period-toggle { grid-column: 2; grid-row: 1 / 3; }
.calendar-axis-toggle button, .calendar-period-toggle button { min-width: 0; padding: 0 5px; }
.calendar-axis-toggle button { min-height: 32px; font-size: 12px; }
.calendar-period-toggle button { min-height: 18px; padding: 0 3px; font-size: 9px; }
.calendar-cell { min-height: 112px; background: white; }
.calendar-header { position: sticky; top: 0; z-index: 6; min-height: 88px; align-content: center; text-align: center; }
.calendar-row-label { position: sticky; left: 0; z-index: 4; min-height: 112px; }
.calendar-shell.planning .calendar-cell { background: #fffcf7; }
.calendar-shell.planning .calendar-header { background: #ffe3b3; color: #6f4709; }
.calendar-shell.planning .calendar-header.today, .calendar-header.today { background: #dff5f1; color: var(--teal); }
.calendar-shell.planning .calendar-row-label { background: #fff0d8; }
.calendar-item { border-left-color: var(--blue); background: var(--blue-soft); color: #174b8f; }
.calendar-item.project { border-left-color: var(--blue); background: var(--blue-soft); color: #174b8f; }
.calendar-item.maintenance { border-left-color: var(--green); background: var(--green-soft); color: var(--green); }
.calendar-item.callout { border-left-color: var(--red); background: var(--red-soft); color: #8e241f; }
.calendar-item.unavailable { border: 1px solid rgba(180, 35, 24, 0.34); border-left: 4px solid var(--red); background: #fff5f4; color: #8e241f; }
.calendar-item:hover { box-shadow: 0 3px 10px rgba(23, 33, 43, 0.14); }
.calendar-empty-controls { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 240px; }
.calendar-empty-controls .empty-state { min-height: 240px; }
.calendar-grid-empty { grid-column: 1 / -1; min-height: 190px; background: white; border-bottom: 1px solid var(--line); }
.calendar-shell.planning .calendar-grid-empty { background: #fffcf7; }

.field-calendar-panel { min-height: calc(100dvh - 190px); display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow); }
.field-calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-calendar-zone { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.field-calendar-scroll { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
.field-calendar-board { display: grid; grid-template-columns: 64px repeat(var(--field-calendar-columns), var(--field-calendar-column-width)); width: max-content; min-width: 100%; }
.field-calendar-corner, .field-calendar-axis, .field-calendar-time, .field-calendar-slot { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.field-calendar-corner, .field-calendar-axis { position: sticky; top: 0; z-index: 3; min-height: 48px; display: grid; place-items: center; padding: 10px 6px; background: #eef3f8; font-size: 12px; font-weight: 800; text-align: center; }
.field-calendar-corner { left: 0; z-index: 5; }
.field-calendar-axis.today { background: #dff5f1; color: var(--teal); }
.field-calendar-time { position: sticky; left: 0; z-index: 2; min-height: 68px; padding: 10px 8px; background: #f8fafc; color: var(--muted); font-size: 12px; font-weight: 800; text-align: right; }
.field-calendar-slot { min-height: 68px; display: grid; align-content: start; gap: 6px; padding: 6px; background: white; }
.field-calendar-slot.today { background: #f7fffd; }
.field-calendar-task { width: 100%; min-width: 0; display: grid; gap: 3px; padding: 7px; overflow: hidden; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 6px; background: #f8fafc; color: var(--ink); text-align: left; }
.field-calendar-task.callout { border-left-color: var(--red); background: #fff7f7; }
.field-calendar-task.maintenance { border-left-color: var(--green); background: #f3fbf5; }
.field-calendar-task strong, .field-calendar-task span, .field-calendar-task small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-calendar-task span, .field-calendar-task small { color: var(--muted); font-size: 11px; }

.field-mobile.app-view {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: var(--app-viewport-height, 100dvh);
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}
.field-mobile .workspace-shell { width: 100%; min-width: 0; height: auto; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.field-mobile .workspace-header { position: static; width: 100%; min-width: 0; min-height: 82px; padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left)); background: white; }
.field-mobile .workspace-header > div:first-child { min-width: 0; }
.field-mobile .workspace-header h1 { max-width: min(75vw, 560px); font-size: clamp(20px, 4vw, 28px); line-height: 1.08; overflow-wrap: anywhere; }
.field-mobile .header-actions { flex: 0 0 auto; align-self: start; }
.field-mobile .workspace { width: 100%; max-width: 100%; min-width: 0; min-height: 0; height: 100%; padding: 14px max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left)); overflow-x: hidden; overflow-y: auto; scrollbar-gutter: auto; }
.field-mobile .mobile-navigation {
  position: relative;
  inset: auto;
  width: 100%;
  min-width: 0;
  padding: 0 max(4px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
}
.mobile-nav-button { min-width: 0; min-height: 64px; display: grid; place-items: center; align-content: center; gap: 4px; padding: 7px 2px 6px; overflow: hidden; }
.mobile-nav-icon { width: 24px; height: 24px; min-height: 24px; display: grid; place-items: center; line-height: 1; }
.mobile-nav-svg { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mobile-nav-label { display: block; width: 100%; overflow: hidden; font-size: 11px; line-height: 1.2; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.field-mobile .mobile-card-list, .field-mobile .mobile-card, .field-mobile .detail-field { min-width: 0; max-width: 100%; }
.field-mobile .mobile-card p, .field-mobile .mobile-card strong { overflow-wrap: anywhere; }
.mobile-card { border-radius: 8px; box-shadow: var(--shadow); }

@media (max-width: 1100px) {
  .app-view { grid-template-columns: 224px minmax(0, 1fr); }
  .calendar-panel-header { align-items: stretch; }
}

@media (max-width: 760px) {
  .app-view:not(.field-mobile) { height: auto; min-height: 100vh; overflow: visible; }
  .app-view:not(.field-mobile) .sidebar { position: relative; height: auto; min-height: 0; padding-bottom: 10px; }
  .app-view:not(.field-mobile) .main-navigation { grid-template-columns: 1fr; }
  .app-view:not(.field-mobile) .workspace-shell { height: auto; min-height: 100vh; display: block; overflow: visible; }
  .app-view:not(.field-mobile) .workspace-header { position: sticky; top: 0; }
  .app-view:not(.field-mobile) .workspace { height: auto; min-height: calc(100vh - 86px); display: block; overflow: visible; }
  .calendar-shell { min-height: calc(100vh - 118px); }
  .calendar-panel-header { flex-direction: column; }
  .calendar-header-actions { justify-content: flex-start; }
  .calendar-grid { min-width: max(100%, calc(240px + var(--calendar-days) * var(--calendar-column-width, 140px))); grid-template-columns: 240px repeat(var(--calendar-days), var(--calendar-column-width, 140px)); }
  .calendar-control-cell { width: 240px; }
  .calendar-empty-controls { grid-template-columns: 240px minmax(0, 1fr); }
  .calendar-legend { overflow-x: auto; flex-wrap: nowrap; }
  .field-mobile .workspace-header { padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left)); }
  .field-mobile .workspace { padding: 10px max(10px, env(safe-area-inset-right)) 12px max(10px, env(safe-area-inset-left)); }
  .field-mobile .field-calendar-panel { height: 100%; min-height: 100%; padding: 12px; }
}

.button-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.plain-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6f8fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}
.summary-item { min-height: 82px; display: grid; align-content: center; gap: 4px; padding: 13px 16px; border-right: 1px solid var(--line); }
.summary-item:last-child { border-right: 0; }
.summary-item strong { font-size: 22px; line-height: 1.1; }
.summary-item span { color: var(--muted); font-size: 12px; }
.summary-item.red strong { color: var(--red); }
.command-bar {
  --form-control-height: var(--form-control-height-compact);
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(135px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}
.command-bar label, .analytics-filter-bar label, .gps-trail-filter-bar label { font-size: 12px; }
.command-bar .button, .gps-trail-filter-bar .button { height: var(--form-control-height); min-height: var(--form-control-height); }
.focus-bar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.sortable-heading { display: inline-flex; align-items: center; gap: 6px; }
.sort-icon { color: #8997a7; font-size: 14px; }
.workflow-guidance { display: grid; grid-template-columns: minmax(120px, 0.25fr) 1fr; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #c9e2dd; background: var(--teal-soft); color: #0b625c; }
.workflow-guidance span { color: #385f5c; }
.callout-legend { min-height: 48px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.callout-legend > strong { margin-right: auto; color: var(--muted); }
.callout-status.open { color: var(--red); }
.callout-status.assigned { color: var(--blue); }
.callout-status.accepted { color: var(--teal); }
.callout-status.in_progress { color: var(--amber); }
.callout-status.completed { color: var(--green); }
.alert-inbox-tabs { display: flex; gap: 0; padding: 12px 16px 0; overflow-x: auto; }
.alert-inbox-tabs .segment { min-height: 40px; border: 1px solid var(--line); border-right: 0; background: white; padding: 8px 13px; color: var(--ink); font-weight: 750; white-space: nowrap; }
.alert-inbox-tabs .segment:first-child { border-radius: 6px 0 0 6px; }
.alert-inbox-tabs .segment:last-child { border-right: 1px solid var(--line); border-radius: 0 6px 6px 0; }
.alert-inbox-tabs .segment.active { border-color: var(--ink); background: var(--ink); color: white; }
.alert-inbox-tabs .segment span { display: inline-grid; min-width: 22px; min-height: 22px; place-items: center; margin-left: 5px; border-radius: 999px; background: rgba(255,255,255,.16); }

.analytics-sticky-controls { position: sticky; top: 0; z-index: 12; padding-top: 1px; background: var(--canvas); }
.analytics-filter-bar { --form-control-height: var(--form-control-height-compact); display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; padding: 15px 16px; }
.analytics-overview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 16px; margin-bottom: 18px; }
.chart-panel { min-height: 260px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow); }
.chart-panel h3, .subsection-heading h3 { margin: 0; font-size: 14px; }
.capacity-chart { min-height: 190px; display: flex; align-items: end; justify-content: center; gap: 42px; padding: 25px 20px 0; border-bottom: 1px solid var(--line); }
.capacity-bar { width: min(90px, 28%); height: var(--bar); min-height: 26px; display: flex; justify-content: center; padding: 8px; border-radius: 5px 5px 0 0; color: white; font-weight: 750; transition: height 180ms ease; }
.capacity-bar.available { background: var(--teal); }
.capacity-bar.committed { background: var(--blue); }

.map-stage { position: relative; }
.map-canvas { min-height: 520px; background-color: #e8efec; background-image: linear-gradient(rgba(125,151,139,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(125,151,139,.16) 1px, transparent 1px); background-size: 44px 44px; }
.field-map { position: relative; height: clamp(390px, 58vh, 650px); min-height: 390px; overflow: hidden; border: 1px solid var(--line); background: #dbe5df; cursor: grab; isolation: isolate; touch-action: none; user-select: none; }
.field-map:focus-visible { outline: 3px solid rgba(37,99,235,.28); outline-offset: 2px; }
.field-map.dragging { cursor: grabbing; }
.map-tile-layer, .map-marker-layer { position: absolute; inset: 0; }
.map-tile-layer { z-index: 0; overflow: hidden; }
.map-marker-layer { z-index: 2; pointer-events: none; }
.map-tile { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.map-controls { position: absolute; z-index: 5; top: 14px; left: 14px; display: grid; grid-template-columns: 36px 34px 36px auto; align-items: center; overflow: hidden; border: 1px solid rgba(109,124,143,.4); border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 8px 22px rgba(18,32,54,.16); }
.map-control-button { min-width: 36px; min-height: 36px; padding: 0 9px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 12px; font-weight: 800; }
.map-control-button:hover { background: #edf3f8; }
.map-control-button.fit { border-right: 0; }
.map-zoom-label { color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
.map-attribution { position: absolute; z-index: 5; right: 6px; bottom: 5px; padding: 3px 5px; border-radius: 4px; background: rgba(255,255,255,.9); color: #42526a; font-size: 11px; text-decoration: none; }
.operations-map-marker { position: absolute; z-index: 2; width: 42px; height: 42px; display: grid; place-items: center; transform: translate(-50%, -50%); border: 3px solid white; border-radius: 999px; background: var(--teal); color: white; font-size: 12px; font-weight: 900; box-shadow: 0 10px 22px rgba(18,32,54,.22); pointer-events: auto; cursor: pointer; }
.operations-map-marker.callout { border-radius: 8px; background: var(--red); }
.operations-map-marker.target { pointer-events: none; }
.operations-map-marker.selected { outline: 3px solid var(--ink); outline-offset: 2px; }
.operations-map-marker.site { border-radius: 999px 999px 999px 4px; background: var(--blue); transform: translate(-50%, -50%) rotate(-45deg); }
.operations-map-marker.site span { transform: rotate(45deg); }
.operations-map-marker small { position: absolute; left: 50%; top: calc(100% + 6px); width: max-content; max-width: 150px; overflow: hidden; padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.94); color: var(--ink); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; transform: translateX(-50%); box-shadow: 0 8px 16px rgba(18,32,54,.12); }
.operations-map-marker.site small { left: 64%; top: calc(100% + 10px); transform: translateX(-50%) rotate(45deg); }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 750; }
.filter-options { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; grid-column: 2 / -1; }
.map-category { border-color: currentColor; }
.map-category.staff { color: var(--teal); }
.map-category.callout { color: var(--red); }
.map-category.site { color: var(--blue); }
.map-category:not(.active) { border-color: var(--line); background: white; color: var(--muted); opacity: .62; }
.map-category.active { box-shadow: inset 0 0 0 1px currentColor; }
.map-pin.selected, .resource-option.selected { outline: 3px solid var(--ink); outline-offset: 2px; }
.map-pin.target-pin { cursor: default; }

.subsection { min-width: 0; padding: 16px; }
.subsection + .subsection { border-top: 1px solid var(--line); }
.subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.subsection-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.subsection-heading .button { flex: 0 0 auto; white-space: nowrap; }
.users-layout { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.5fr); }
.users-layout .subsection + .subsection { border-top: 0; border-left: 1px solid var(--line); }
.modal-subsection { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.request-summary { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.form-section { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; }
.form-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.form-section-heading span { color: var(--ink); font-weight: 850; }
.form-section-heading small { color: var(--muted); text-align: right; }
.account-management-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.account-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.client-location-drafts { display: grid; gap: 12px; margin-bottom: 12px; }
.client-location-draft { padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.client-location-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.button.compact { min-height: 34px; padding: 6px 10px; }
.location-map-choice { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.location-selection-summary { display: grid; gap: 2px; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.location-selection-summary span, .location-selection-summary small { color: var(--muted); }
.staff-office-location { display: grid; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.staff-office-location .form-section-heading { margin-bottom: 0; }
.inferred-location-fields { margin-top: 0; }
.inferred-location-fields input[readonly] { background: var(--surface-muted); color: var(--ink); cursor: default; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.permission-grid legend { padding: 0 5px; color: var(--muted); font-size: 12px; font-weight: 800; }
.permission-check { min-height: 58px; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--ink); }
.permission-check input { width: 18px; min-height: 18px; }
.permission-check strong, .permission-check small { display: block; overflow-wrap: anywhere; }
.permission-check strong { text-transform: capitalize; }
.permission-check small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.protected-label { display: inline-flex; min-height: 21px; align-items: center; margin-left: 5px; padding: 2px 6px; border: 1px solid #b9ddd7; border-radius: 4px; background: var(--teal-soft); color: var(--teal); font-size: 10px; text-transform: uppercase; vertical-align: middle; }
.danger-text { border-color: #f0b8b2; color: var(--red); }
.delete-warning { margin: 16px 0 0; padding: 11px 12px; border-left: 3px solid var(--red); background: var(--red-soft); color: #7f1d17; }

.location-picker-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(8, 23, 32, .68); }
.location-picker-modal { max-height: calc(100dvh - 48px); }
.location-picker-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 10px 16px; min-height: 0; }
.location-search-bar { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 9px; }
.location-picker-status { grid-column: 1 / -1; min-height: 22px; margin: 0; color: var(--muted); }
.location-picker-status.error { color: var(--red); }
.location-search-results { min-height: 0; max-height: 480px; display: grid; align-content: start; gap: 7px; overflow-y: auto; padding-right: 4px; }
.location-search-result { min-width: 0; display: grid; gap: 3px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--ink); text-align: left; }
.location-search-result:hover { border-color: #9aabb9; background: #f6faf9; }
.location-search-result.selected { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 3px 0 0 var(--teal); }
.location-search-result strong, .location-search-result span { overflow-wrap: anywhere; }
.location-search-result span { color: var(--muted); font-size: 12px; }
.location-picker-map { grid-column: 2; grid-row: 3; height: min(52vh, 520px); min-height: 360px; }
.location-picker-pin { position: absolute; width: 30px; height: 30px; transform: translate(-50%, -92%) rotate(-45deg); border: 4px solid white; border-radius: 50% 50% 50% 5px; background: var(--red); box-shadow: 0 8px 18px rgba(18, 32, 54, .28); }
.location-picker-pin::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: white; }
.location-provider-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; }

.workspace.page-map,
.workspace.page-gps-trails { display: flex; flex-direction: column; }
.page-map > .section-navigation,
.page-gps-trails > .section-navigation { flex: 0 0 auto; }
.page-map > .section-panel,
.page-gps-trails > .section-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0; }
.page-map .map-stage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.page-map .field-map { flex: 1 1 auto; height: auto; max-height: none; }
.page-gps-trails .gps-trail-map { flex: 1 1 auto; min-height: 390px; }
.grouped-skill-selector { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.skill-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.skill-group legend { padding: 0 4px; color: var(--ink); font-size: 12px; font-weight: 850; }
.skill-group label { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; background: #f7f9fb; color: var(--ink); }
.skill-group input { width: 17px; min-height: 17px; }
.skill-catalogue-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 220px; }
.skill-catalogue-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 8px; border: 1px solid #cbd7e0; border-radius: 4px; background: #f5f8fa; color: var(--ink); font-size: 12px; font-weight: 750; }
.skill-editor-list { display: grid; gap: 8px; }
.skill-editor-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 8px; }
.skill-editor-row .icon-button { width: 38px; min-width: 38px; min-height: var(--form-control-height); }
.draft-shift-list { display: grid; gap: 8px; margin-bottom: 12px; }
.draft-shift-row { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.draft-shift-row > div { min-width: 0; }
.draft-shift-row strong, .draft-shift-row small { display: block; }
.draft-shift-row strong { margin: 3px 0; color: var(--ink); }
.draft-shift-row small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.wide-command { width: 100%; justify-content: center; }
.location-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; }
.location-picker > label { min-height: 58px; display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--ink); }
.location-picker input { width: 18px; min-height: 18px; }
.location-picker strong, .location-picker small, .resident-team-option strong, .resident-team-option small { display: block; }
.location-picker small, .resident-team-option small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.shift-location-list { display: grid; gap: 8px; }
.shift-location-list-item { min-height: 72px; display: grid; grid-template-columns: minmax(170px, 1fr) minmax(220px, 1.4fr) auto 56px; align-items: center; gap: 14px; width: 100%; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 11px 13px; color: var(--ink); text-align: left; }
.shift-location-list-item:hover { border-color: #aebdca; background: #f8fafb; }
.shift-location-list-item strong, .shift-location-list-item small { display: block; }
.shift-location-list-item small { margin-top: 4px; color: var(--muted); font-weight: 500; }
.shift-location-action { color: var(--teal); font-weight: 800; text-align: right; }
.inline-empty { padding: 18px; border: 1px dashed #cbd6df; border-radius: 5px; color: var(--muted); text-align: center; }
.shift-location-editor-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(8,23,32,.66); }
.shift-location-editor-backdrop .modal { max-height: calc(100vh - 48px); }
.resident-team-option { align-items: center; }
.resident-team-option > span { min-width: 0; }
.maintenance-cycle-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0 10px; }
.maintenance-cycle-heading strong, .maintenance-cycle-heading small { display: block; }
.maintenance-cycle-heading small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.maintenance-cycle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.preferred-staff-picker { display: grid; gap: 12px; }
.preferred-staff-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; }
.preferred-staff-entry .button { min-height: 42px; }
.preferred-staff-chips { min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.preferred-staff-chips > p { margin: 0; color: var(--muted); }
.preferred-staff-chip { min-width: 180px; display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: center; gap: 8px; padding: 7px 7px 7px 10px; border: 1px solid #b9ddd7; border-radius: 5px; background: var(--teal-soft); }
.preferred-staff-chip strong, .preferred-staff-chip small { display: block; overflow-wrap: anywhere; }
.preferred-staff-chip small { margin-top: 2px; color: var(--muted); font-weight: 500; }
.preferred-staff-chip button { width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font-weight: 850; }
.preferred-staff-chip button:hover { background: white; }
.capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.capability-grid legend { padding: 0 5px; color: var(--muted); font-size: 12px; font-weight: 800; }
.capability-grid label { min-height: 54px; display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 2px 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: #f7f9fb; color: var(--ink); }
.capability-grid input { width: 18px; min-height: 18px; grid-row: 1 / 3; }
.capability-grid small { color: var(--muted); font-weight: 500; }

.assignment-map { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.assignment-field-map { height: 360px; min-height: 330px; }
.coverage-preview { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.coverage-hours { display: grid; grid-template-columns: repeat(7, 1fr); min-height: 74px; align-items: end; margin-top: 12px; border: 1px solid var(--line); background: repeating-linear-gradient(90deg, transparent 0, transparent calc(14.285% - 1px), var(--line) calc(14.285% - 1px), var(--line) 14.285%); }
.coverage-hours span { padding: 7px; color: var(--muted); font-size: 11px; }
.resource-picker { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.resource-picker-header { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.resource-picker-header h3 { margin: 0; font-size: 14px; }
.resource-picker-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.resource-picker-header input { width: min(320px, 100%); }
.resource-list { max-height: 390px; display: grid; gap: 8px; overflow-y: auto; padding: 2px 5px 2px 2px; }
.resource-option { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 6px; background: white; padding: 10px 12px; text-align: left; }
.resource-option.unavailable { border-left-color: var(--red); background: #fff8f7; }
.resource-option span > strong, .resource-option span > small { display: block; }
.resource-option span > small { margin-top: 3px; color: var(--muted); }

.gps-trail-filter-bar { --form-control-height: var(--form-control-height-compact); display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)) auto; align-items: end; gap: 10px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.gps-trail-summary, .retention-note { padding: 12px 16px; color: var(--muted); }
.gps-trail-map { min-height: 520px; border-left: 0; border-right: 0; }
.trail-point { width: 14px; height: 14px; border-width: 2px; background: var(--teal); }
.retention-note { margin: 0; border-top: 1px solid var(--line); font-size: 12px; }
.load-more-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); }
.mobile-detail-grid { grid-template-columns: 1fr; }

@media (max-width: 1180px) {
  .command-bar { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .command-search { grid-column: 1 / -1; }
  .filter-options { grid-column: 1 / -1; justify-content: flex-start; }
  .analytics-filter-bar { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .users-layout { grid-template-columns: 1fr; }
  .users-layout .subsection + .subsection { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 760px) {
  .button-row { justify-content: flex-start; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .command-bar, .analytics-filter-bar, .gps-trail-filter-bar { grid-template-columns: 1fr; }
  .command-search, .filter-options { grid-column: 1; }
  .focus-bar, .resource-picker-header, .load-more-bar { align-items: stretch; flex-direction: column; }
  .workflow-guidance { grid-template-columns: 1fr; }
  .analytics-sticky-controls { position: static; }
  .analytics-overview-grid { grid-template-columns: 1fr; }
  .capability-grid { grid-template-columns: 1fr; }
  .location-picker { grid-template-columns: 1fr; }
  .shift-location-list-item { grid-template-columns: 1fr auto; }
  .shift-location-list-item > span:nth-child(2) { grid-column: 1 / -1; }
  .shift-location-editor-backdrop { padding: 0; align-items: end; }
  .form-section-heading { align-items: flex-start; flex-direction: column; }
  .form-section-heading small { text-align: left; }
  .grouped-skill-selector, .skill-group { grid-template-columns: 1fr; }
  .maintenance-cycle-grid { grid-template-columns: 1fr; }
  .maintenance-cycle-heading { align-items: flex-start; flex-direction: column; }
  .preferred-staff-entry { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .location-map-choice { grid-template-columns: 1fr; }
  .location-picker-backdrop { padding: 0; align-items: end; }
  .location-picker-modal { max-height: 96dvh; }
  .location-picker-body { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto auto; }
  .location-search-bar { grid-column: 1; grid-template-columns: 1fr 1fr; }
  .location-search-bar label { grid-column: 1 / -1; }
  .location-picker-status, .location-provider-note { grid-column: 1; }
  .location-search-results { max-height: 150px; }
  .location-picker-map { grid-column: 1; grid-row: auto; height: 42vh; min-height: 280px; }
  .workspace.page-map, .workspace.page-gps-trails { display: block; }
  .page-map > .section-panel, .page-gps-trails > .section-panel { display: block; }
  .page-map .field-map { height: clamp(390px, 58vh, 650px); }
  .calendar-publication-summary { grid-template-columns: 1fr; }
  .calendar-publication-summary article { border-right: 0; border-bottom: 1px solid var(--line); }
  .calendar-publication-summary article:last-child { border-bottom: 0; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-item { border-bottom: 1px solid var(--line); }
  .callout-legend { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .callout-legend > strong { margin-right: 4px; }
  .resource-picker-header input { width: 100%; }
}
