:root {
  color-scheme: light;
  --bg: #f5f6f0;
  --ink: #242721;
  --muted: #697066;
  --line: #dce0d5;
  --surface: #ffffff;
  --surface-2: #f9faf5;
  --primary: #1f766f;
  --primary-dark: #135c56;
  --primary-soft: #dff1ed;
  --accent: #d97745;
  --accent-soft: #f8e3d2;
  --warn: #b85d46;
  --warn-soft: #fae2dd;
  --good: #32794f;
  --good-soft: #dff0e5;
  --pending: #90721a;
  --pending-soft: #f5ebc8;
  --shadow: 0 14px 35px rgba(30, 39, 28, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Segoe UI", "Malgun Gothic", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: var(--bg);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 4px;
  color: var(--ink);
}

.login-brand span {
  color: var(--muted);
}

.login-error {
  min-height: 22px;
  margin: 0;
  color: var(--warn);
  font-size: 14px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--warn);
  font-size: 14px;
}

.app-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px;
  background: #28352f;
  color: #f8fbf2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #f2b26f;
  color: #26322e;
  font-weight: 800;
}

.brand-logo-frame {
  padding: 4px;
  background: #fff;
}

.brand-logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #ccd8cc;
  font-size: 13px;
}

.brand-version-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.version-release-button {
  min-height: 20px;
  padding: 1px 6px 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fbf2;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.version-release-button:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #edf4e9;
  text-align: left;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-note b,
.sidebar-note span {
  display: block;
}

.sidebar-note span {
  margin-top: 4px;
  color: #d9e3d5;
  font-size: 13px;
}

.workspace {
  min-width: 0;
  padding: 28px 28px 28px 14px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions,
.form-actions,
.toolbar-row,
.calendar-controls,
.calendar-filter,
.inline-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  max-width: 260px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.icon-button,
.tiny-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  background: var(--accent-soft);
  color: #6d371b;
  border-color: #efc3a4;
}

.ghost-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.text-button {
  min-height: 32px;
  padding: 4px 0;
  background: transparent;
  color: var(--primary-dark);
}

.icon-button {
  display: grid;
  width: 38px;
  padding: 0;
  place-items: center;
  background: #fff;
  border-color: var(--line);
  font-size: 24px;
  line-height: 1;
}

.month-label {
  min-width: 92px;
  color: var(--ink);
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
}

.tiny-button {
  min-height: 30px;
  padding: 4px 10px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.tiny-button.danger {
  color: #8f3429;
  border-color: #efc2b9;
  background: var(--warn-soft);
}

.tiny-button.neutral {
  color: #4d554d;
  border-color: var(--line);
  background: #eef1e9;
}

.tiny-button:disabled,
.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-label input {
  width: auto;
}

.danger-action {
  border-color: #d84b3d;
  background: #d84b3d;
  color: #fff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.two-column,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.45fr);
  gap: 18px;
}

.construction-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(312px, 0.6fr);
  gap: 18px;
}

#construction-layout {
  grid-template-columns: minmax(520px, 1fr) 18px minmax(312px, 0.6fr);
  gap: 0;
  align-items: stretch;
}

.construction-list-panel {
  margin-right: 0;
}

.construction-resizer {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 18px;
  cursor: col-resize;
  touch-action: none;
}

.construction-resizer::before {
  content: "";
  width: 6px;
  height: 100%;
  min-height: 120px;
  border-radius: 999px;
  background: #d8ddd4;
  transition: background 0.15s ease, width 0.15s ease;
}

.construction-resizer:hover::before,
.construction-resizer:focus-visible::before,
body.is-resizing-construction .construction-resizer::before {
  width: 8px;
  background: var(--primary);
}

body.is-resizing-construction {
  cursor: col-resize;
  user-select: none;
}

.surface {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 3px 0 0;
  font-size: 18px;
  line-height: 1.25;
}

.section-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.stack-list.compact {
  gap: 8px;
}

.release-notes-list {
  display: grid;
  gap: 10px;
}

.release-notes-list.compact {
  max-height: min(520px, calc(100vh - 250px));
  overflow: auto;
  padding-right: 4px;
}

.release-note-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.release-note-card.compact {
  padding: 12px;
  background: #fff;
}

.release-note-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.release-note-head strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.release-note-head h3 {
  margin: 3px 0 0;
  font-size: 17px;
  line-height: 1.3;
}

.release-note-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.release-note-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.release-note-card li {
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-2);
}

.order-card,
.request-card,
.person-card,
.load-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.order-card {
  display: grid;
  gap: 10px;
}

.order-card.selected {
  outline: 3px solid var(--primary-soft);
  border-color: var(--primary);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  min-width: 0;
}

.card-title strong {
  display: block;
  overflow-wrap: anywhere;
}

.card-title span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.change-summary {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.change-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #eadca9;
  border-radius: 8px;
  background: #fffaf0;
  font-size: 12px;
}

.change-row span {
  color: #6c5311;
  font-weight: 900;
}

.change-row strong {
  overflow-wrap: anywhere;
}

.change-row b {
  color: #8d6a12;
  text-align: center;
}

.request-note {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.request-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.request-note p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  white-space: pre-wrap;
}

.schedule-note-list {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.schedule-note-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.schedule-note-meta {
  display: grid;
  gap: 2px;
}

.schedule-note-meta span,
.schedule-note-meta small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.schedule-note-item p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.schedule-note-item .change-summary {
  grid-column: 1 / -1;
  margin-top: 0;
}

.content-notice-card {
  border-color: #e2c45b;
  background: #fff9e7;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.pending {
  background: var(--pending-soft);
  color: #6c5311;
}

.badge.warn {
  background: var(--warn-soft);
  color: #8f3429;
}

.badge.good {
  background: var(--good-soft);
  color: #23603d;
}

.badge.neutral {
  background: #ecefe7;
  color: #4d554d;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

input[readonly],
.readonly-field {
  background: #eef1e9;
  color: #4f584d;
}

.status-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.status-checks label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.status-checks input {
  width: auto;
  min-height: 0;
  margin: 0 5px 0 0;
}

.muted {
  color: var(--muted);
}

.toolbar-row {
  margin-bottom: 12px;
}

.toolbar-row input {
  flex: 1;
}

.lookup-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.lookup-result-list {
  display: grid;
  gap: 8px;
}

.lookup-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.lookup-result-row strong,
.lookup-result-row span,
.lookup-result-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lookup-result-row span,
.lookup-result-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toolbar-row select {
  max-width: 140px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.order-detail-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr 1.2fr 1.2fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.order-detail-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.order-detail-rows {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.order-detail-row {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.order-detail-row.cols-4 {
  grid-template-columns: 1fr 1.6fr 1fr 1fr;
}

.order-detail-row.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-detail-row.cols-1 {
  grid-template-columns: 1fr;
}

.detail-mini {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.detail-mini span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-mini strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  margin-top: 4px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--primary-dark);
  text-decoration: none;
}

.attachment-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.attachment-selection {
  display: grid;
  gap: 8px;
  min-height: 42px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.attachment-selection-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.attachment-selection-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attachment-selection-items span,
.attachment-chip {
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.attachment-chip b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-remove-button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #f3dedb;
  color: #9c352e;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.detail-cell {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.detail-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-cell strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.detail-cell-body {
  margin-top: 5px;
}

.schedule-planner-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.86fr) minmax(560px, 1.24fr);
  gap: 14px;
  align-items: start;
  min-height: 0;
}

.schedule-reference-pane,
.schedule-edit-pane {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  max-height: calc(100vh - 132px);
  overflow: auto;
  padding-right: 4px;
}

.schedule-reference-pane .detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.schedule-reference-pane .wide {
  grid-column: 1 / -1;
}

.schedule-edit-pane .schedule-form {
  margin: 0;
}

.schedule-plan-grid {
  display: grid;
  grid-template-columns: minmax(310px, 344px) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.schedule-plan-grid .schedule-range-picker {
  width: 100%;
}

.schedule-phase-side {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.schedule-form {
  align-items: end;
  margin: 16px 0;
}

.schedule-title-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.schedule-title-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.schedule-range-picker {
  display: grid;
  gap: 6px;
  width: min(344px, 100%);
  padding: 10px 14px 13px;
  border: 1px solid #eef1f6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 35, 74, 0.05);
}

.schedule-range-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.schedule-range-head > div:first-child {
  display: none;
}

.schedule-range-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.schedule-range-head strong {
  color: var(--ink);
  font-size: 13px;
}

.schedule-range-head .calendar-controls strong {
  min-width: 100px;
  color: #11296f;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.schedule-range-head .icon-button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border-color: transparent;
  background: transparent;
  color: #9aa0a6;
  font-size: 18px;
  font-weight: 400;
}

.schedule-range-head .icon-button:hover {
  background: #f5f7fb;
  color: #11296f;
}

.compact-weekday-row {
  margin-top: 4px;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.compact-weekday-row div {
  padding: 8px 4px 12px;
  background: transparent;
  color: #11296f;
  font-size: 14px;
  font-weight: 700;
}

.schedule-range-picker .weekday-row.compact-weekday-row {
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.schedule-range-picker .weekday-row.compact-weekday-row div,
.schedule-range-picker .weekday-row.compact-weekday-row div:last-child {
  padding: 6px 4px;
  background: #eef1e7;
  color: #11296f;
  font-size: 13px;
  font-weight: 700;
}

.schedule-range-picker .weekday-row.compact-weekday-row div:first-child {
  background: #faecea;
  color: #ff1d1d;
}

.schedule-range-picker .weekday-row.compact-weekday-row div:last-child {
  background: #e8f0fb;
}

.schedule-range-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  row-gap: 6px;
  border: 0;
}

.schedule-range-day {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #11296f;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

.schedule-range-day span {
  display: grid;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-items: center;
  border-radius: 50%;
  line-height: 1;
}

.schedule-range-day small {
  display: block;
  max-width: 42px;
  overflow: hidden;
  color: #ff1d1d;
  font-size: 7px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-range-day:hover:not(:disabled) {
  background: transparent;
  box-shadow: none;
}

.schedule-range-day:hover:not(:disabled) span {
  box-shadow: none;
}

.schedule-range-day.muted {
  color: transparent;
  pointer-events: none;
}

.schedule-range-day.holiday {
  color: #ff1d1d;
}

.schedule-range-day.saturday {
  color: #11296f;
}

.schedule-range-day.muted,
.schedule-range-day.muted.holiday,
.schedule-range-day.muted.saturday {
  color: transparent;
}

.schedule-range-day.muted small {
  color: transparent;
}

.schedule-range-day.today {
  box-shadow: none;
}

.schedule-range-day.today span {
  box-shadow: inset 0 0 0 1px #2f8f62;
}

.schedule-range-day.in-range,
.schedule-range-day.preview-range {
  background: #eef8f1;
  color: #11296f;
}

.schedule-range-day.range-start,
.schedule-range-day.range-end,
.schedule-range-day.preview-end {
  background: #dff1e8;
  color: #0c5f3d;
}

.schedule-range-day.range-start span,
.schedule-range-day.range-end span,
.schedule-range-day.preview-end span {
  background: #16804f;
  color: #fff;
  box-shadow: none;
}

.schedule-range-day.range-start.today span,
.schedule-range-day.range-end.today span,
.schedule-range-day.preview-end.today span {
  box-shadow: none;
}

.schedule-range-day:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.phase-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.phase-table-panel {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.phase-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.phase-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.phase-table-actions {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.phase-new-button,
.phase-table-actions #build-days {
  width: 84px;
  min-width: 84px;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.phase-table-actions #build-days.schedule-edit-button {
  border-color: #d97706;
  background: #f28c28;
  color: #fff;
}

.phase-table-actions #build-days.schedule-edit-button:hover {
  background: #dd7b18;
}

.phase-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.phase-table {
  min-width: 0;
  table-layout: fixed;
}

.phase-table th,
.phase-table td {
  padding: 7px 8px;
  vertical-align: middle;
}

.phase-table th:nth-child(1),
.phase-table td:nth-child(1) {
  width: 35px;
}

.phase-table th:nth-child(3),
.phase-table td:nth-child(3) {
  width: 138px;
}

.phase-table th:nth-child(4),
.phase-table td:nth-child(4) {
  width: 42px;
  text-align: center;
}

.phase-table tbody tr {
  cursor: pointer;
}

.phase-table tbody tr.active td {
  background: #e8f5f2;
}

.phase-table-select {
  color: var(--primary-dark);
  font-weight: 800;
}

.phase-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase-range-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.phase-day-count {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.phase-delete-button {
  min-height: 20px;
  padding: 1px 5px;
  font-size: 10px;
  line-height: 1.1;
}

.assignment-group-head {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.phase-list {
  display: grid;
  gap: 6px;
}

.phase-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.phase-item.active {
  border-color: var(--primary);
  background: #e8f5f2;
  box-shadow: inset 4px 0 0 var(--primary);
}

.phase-select-button {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.phase-select-button strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase-range {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.day-assignment {
  display: grid;
  gap: 10px;
}

.phase-assignment-panel {
  display: grid;
  gap: 10px;
}

.phase-day-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.assignment-table-head {
  display: grid;
  grid-template-columns: 60px minmax(0, 2fr) minmax(0, 1fr);
  background: #eef1e7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.assignment-table-head div {
  min-width: 0;
  padding: 6px 8px;
  border-right: 1px solid var(--line);
}

.assignment-table-head div:last-child {
  border-right: 0;
}

.day-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 2fr) minmax(0, 1fr);
  min-height: 40px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.day-date {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  min-width: 0;
  padding: 5px 3px;
  border-right: 1px solid var(--line);
  color: var(--primary-dark);
}

.day-date strong {
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
}

.day-date span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.assignment-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.assignment-controls select {
  min-height: 24px;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 800;
}

.assignment-groups {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 10px;
}

.assignment-group {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-content: start;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 5px 6px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.assignment-group:last-child {
  border-right: 0;
}

.assignment-group > .assignment-chips:first-child {
  grid-column: 1 / -1;
}

.assignment-group .day-labor-editor {
  grid-column: 1 / -1;
}

.assignment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.assignment-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 8px;
  border: 0;
  border-radius: 999px;
  background: #eef5f3;
  color: #174f49;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.assignment-chip-button {
  cursor: pointer;
}

.assignment-chip-button:hover {
  background: #d5e8e4;
}

.day-labor-chip {
  background: #fff3df;
  color: #7a4a10;
}

.day-labor-editor {
  display: grid;
  grid-template-columns: 74px minmax(110px, 1fr) auto auto;
  align-items: end;
  gap: 5px;
}

.day-labor-editor label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.day-labor-editor span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.day-labor-editor input {
  min-height: 26px;
  padding: 3px 6px;
  font-size: 11px;
}

.day-labor-editor .tiny-button {
  min-height: 26px;
  padding: 3px 6px;
  font-size: 11px;
}

.order-table {
  overflow-x: auto;
}

#orders-table,
#construction-order-list {
  max-height: calc(100vh - 232px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.order-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

#customer-list table {
  min-width: 1112px;
  table-layout: fixed;
}

#customer-list th,
#customer-list td {
  padding: 9px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#customer-list th:nth-child(1),
#customer-list td:nth-child(1) {
  width: 216px;
  overflow: visible;
  white-space: nowrap;
  text-align: left;
}

#customer-list th:nth-child(2),
#customer-list td:nth-child(2) {
  width: 240px;
}

#customer-list th:nth-child(3),
#customer-list td:nth-child(3) {
  width: 116px;
}

#customer-list th:nth-child(4),
#customer-list td:nth-child(4) {
  width: 164px;
}

#customer-list th:nth-child(5),
#customer-list td:nth-child(5) {
  width: 122px;
}

#customer-list th:nth-child(6),
#customer-list td:nth-child(6) {
  width: 88px;
}

#customer-list th:nth-child(7),
#customer-list td:nth-child(7) {
  width: auto;
}

#customer-list .row-actions {
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-start;
}

#customer-list .tiny-button {
  min-height: 26px;
  padding: 3px 6px;
}

#customer-list .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 26px;
  white-space: nowrap;
  text-align: left;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

#customer-list .badge {
  min-height: 22px;
  padding: 2px 7px;
}

.user-table table {
  min-width: 660px;
  table-layout: fixed;
}

.user-id-col {
  width: 18%;
}

.user-name-col {
  width: 25%;
}

.user-role-col {
  width: 22%;
}

.user-status-col {
  width: 10%;
}

.user-actions-col {
  width: 25%;
}

.user-table select,
.user-table input {
  min-height: 30px;
  padding: 5px 7px;
}

.user-table th,
.user-table td {
  padding: 8px 8px;
  vertical-align: middle;
}

.user-id-text {
  cursor: help;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.user-actions .tiny-button {
  min-height: 24px;
  padding: 2px 5px;
  font-size: 11px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: var(--surface-2);
}

td {
  font-size: 14px;
}

#view-orders .surface,
#view-construction .surface {
  padding: 16px;
}

#view-people .split-layout {
  grid-template-columns: 1fr;
}

#view-users .split-layout {
  grid-template-columns: minmax(280px, 0.55fr) minmax(640px, 1.45fr);
}

#view-orders .section-head,
#view-construction .section-head {
  margin-bottom: 10px;
}

#view-orders .toolbar-row,
#view-construction .toolbar-row {
  margin-bottom: 8px;
}

#orders-table table,
#construction-order-list table {
  min-width: 860px;
  table-layout: fixed;
}

#orders-table th,
#orders-table td,
#construction-order-list th,
#construction-order-list td {
  padding: 7px 8px;
}

#orders-table td,
#construction-order-list td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#orders-table th:nth-child(1),
#orders-table td:nth-child(1) {
  width: 119px;
}

#orders-table th:nth-child(2),
#orders-table td:nth-child(2) {
  width: 150px;
}

#orders-table th:nth-child(4),
#orders-table td:nth-child(4) {
  width: 73px;
}

#orders-table th:nth-child(5),
#orders-table td:nth-child(5) {
  width: 98px;
}

#orders-table th:nth-child(6),
#orders-table td:nth-child(6) {
  width: 96px;
}

#orders-table th:nth-child(7),
#orders-table td:nth-child(7) {
  width: 142px;
  overflow: visible;
}

#construction-order-list table {
  min-width: 760px;
}

#construction-order-list th:nth-child(1),
#construction-order-list td:nth-child(1) {
  width: 119px;
}

#construction-order-list th:nth-child(2),
#construction-order-list td:nth-child(2) {
  width: 122px;
}

#construction-order-list th:nth-child(3),
#construction-order-list td:nth-child(3) {
  width: auto;
}

#construction-order-list th:nth-child(4),
#construction-order-list td:nth-child(4) {
  width: 73px;
}

#construction-order-list th:nth-child(5),
#construction-order-list td:nth-child(5) {
  width: 98px;
}

#construction-order-list th:nth-child(6),
#construction-order-list td:nth-child(6) {
  width: 106px;
  white-space: normal;
}

#construction-order-list th:nth-child(7),
#construction-order-list td:nth-child(7) {
  width: 58px;
  text-align: center;
}

#orders-table .link-button,
#construction-order-list .link-button {
  font-weight: 400;
}

.man-day-cell {
  color: var(--primary-dark);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.selected-row td {
  background: #edf7f4;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 900;
  text-align: left;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
}

#orders-table .tiny-button,
#construction-order-list .tiny-button {
  min-height: 28px;
  padding: 3px 8px;
}

.detail-panel {
  margin-top: 18px;
}

.order-detail-modal {
  width: min(1120px, 100%);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 10px;
}

.history-head h3 {
  margin: 3px 0 0;
  font-size: 16px;
}

.history-list,
.customer-list {
  display: grid;
  gap: 10px;
}

.calendar-controls input {
  width: 150px;
}

.calendar-fullscreen-button {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.calendar-filter {
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.calendar-filter label {
  min-width: 180px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.weekday-row div {
  padding: 10px;
  background: #eef1e7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.weekday-row div:first-child {
  color: #a13d35;
  background: #faecea;
}

.weekday-row div:last-child {
  color: #2f5c98;
  background: #e8f0fb;
}

.calendar-day {
  min-height: 132px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.construction-calendar .calendar-day {
  min-height: 108px;
}

.construction-calendar .calendar-chip {
  white-space: normal;
}

#construction-calendar-grid,
#orders-calendar-grid,
.timeline-calendar {
  display: grid;
  grid-template-columns: 1fr;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.construction-week {
  display: grid;
  grid-template-rows: auto max-content;
  align-content: start;
  min-height: var(--schedule-week-min-height, 0);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.construction-week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 34px;
}

.timeline-day {
  min-width: 0;
  padding: 7px 8px;
  border-right: 1px solid #edf0e8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.timeline-day:last-child {
  border-right: 0;
}

.timeline-day.muted {
  background: #f2f4ee;
  color: #9aa297;
}

.calendar-day.holiday,
.timeline-day.holiday {
  background: #fff2f0;
  color: #9c352e;
}

.calendar-day.saturday,
.timeline-day.saturday {
  background: #eef5ff;
  color: #315f9b;
}

.calendar-day.muted.holiday,
.timeline-day.muted.holiday {
  background: #f6e7e4;
  color: #b47a73;
}

.calendar-day.muted.saturday,
.timeline-day.muted.saturday {
  background: #e5edf7;
  color: #728aa8;
}

.timeline-day.today {
  box-shadow: inset 0 0 0 2px var(--accent-soft);
}

.construction-week-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-content: start;
  gap: 5px 4px;
  min-height: 34px;
  padding: 7px 6px 8px;
  overflow: visible;
}

.schedule-bar {
  box-sizing: border-box;
  min-width: 0;
  min-height: 24px;
  margin-inline: 2px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-bar.status-received {
  background: #8d6a12;
}

.schedule-bar.status-scheduled {
  background: #1f766f;
}

.schedule-bar.status-review {
  background: #f2d56f;
  color: #5f4b0d;
}

.schedule-bar.status-done {
  background: #7c827b;
}

.schedule-bar.selected {
  outline: 3px solid #2e6fbd;
  outline-offset: 1px;
  box-shadow: 0 0 0 2px #fff;
}

.calendar-fullscreen-panel:fullscreen,
.calendar-fullscreen-panel.fallback-fullscreen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  max-height: none;
  padding: 22px;
  border: 0;
  border-radius: 0;
  background: #f7f9f5;
  overflow: auto;
}

.calendar-fullscreen-panel.fallback-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.calendar-fullscreen-panel:fullscreen .section-head,
.calendar-fullscreen-panel.fallback-fullscreen .section-head {
  flex: 0 0 auto;
}

.calendar-fullscreen-panel:fullscreen .calendar-filter,
.calendar-fullscreen-panel.fallback-fullscreen .calendar-filter {
  flex: 0 0 auto;
}

.calendar-fullscreen-panel:fullscreen #calendar-grid,
.calendar-fullscreen-panel:fullscreen #construction-calendar-grid,
.calendar-fullscreen-panel.fallback-fullscreen #calendar-grid,
.calendar-fullscreen-panel.fallback-fullscreen #construction-calendar-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.calendar-fullscreen-panel:fullscreen .construction-week,
.calendar-fullscreen-panel:fullscreen .crew-week,
.calendar-fullscreen-panel.fallback-fullscreen .construction-week,
.calendar-fullscreen-panel.fallback-fullscreen .crew-week {
  min-height: max(calc((100vh - 172px) / 6), var(--schedule-week-min-height, 0px));
}

.calendar-fullscreen-panel:fullscreen .calendar-day,
.calendar-fullscreen-panel.fallback-fullscreen .calendar-day {
  min-height: calc((100vh - 194px) / 6);
}

#monthly-calendar-panel:fullscreen,
#monthly-calendar-panel.fallback-fullscreen {
  padding: 14px 18px;
  overflow: hidden;
}

#monthly-calendar-panel:fullscreen .calendar-filter,
#monthly-calendar-panel.fallback-fullscreen .calendar-filter {
  display: none;
}

#monthly-calendar-panel:fullscreen .section-head,
#monthly-calendar-panel.fallback-fullscreen .section-head {
  margin-bottom: 8px;
}

#monthly-calendar-panel:fullscreen .weekday-row,
#monthly-calendar-panel.fallback-fullscreen .weekday-row {
  flex: 0 0 auto;
}

#monthly-calendar-panel:fullscreen .weekday-row div,
#monthly-calendar-panel.fallback-fullscreen .weekday-row div {
  padding: 5px 8px;
  font-size: 11px;
}

#monthly-calendar-panel:fullscreen #calendar-grid,
#monthly-calendar-panel.fallback-fullscreen #calendar-grid {
  flex: 1 1 auto;
  overflow: hidden;
}

#monthly-calendar-panel:fullscreen #calendar-grid.timeline-calendar,
#monthly-calendar-panel.fallback-fullscreen #calendar-grid.timeline-calendar {
  grid-template-rows: repeat(var(--calendar-week-count, 6), minmax(0, 1fr));
}

#monthly-calendar-panel:fullscreen .construction-week,
#monthly-calendar-panel.fallback-fullscreen .construction-week {
  min-height: 0;
  grid-template-rows: 30px minmax(0, 1fr);
  overflow: hidden;
}

#monthly-calendar-panel:fullscreen .construction-week-days,
#monthly-calendar-panel.fallback-fullscreen .construction-week-days {
  min-height: 30px;
}

#monthly-calendar-panel:fullscreen .timeline-day,
#monthly-calendar-panel.fallback-fullscreen .timeline-day {
  padding: 5px 6px;
  font-size: 14px;
  line-height: 18px;
}

#monthly-calendar-panel:fullscreen .construction-week-bars,
#monthly-calendar-panel.fallback-fullscreen .construction-week-bars {
  --schedule-bar-row-height: minmax(0, 1fr);
  --schedule-bars-min-height: 0px;
  min-height: 0;
  gap: 5px 4px;
  padding: 2px 4px 3px;
  overflow: hidden;
}

#monthly-calendar-panel:fullscreen .schedule-bar,
#monthly-calendar-panel.fallback-fullscreen .schedule-bar {
  min-height: 0;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: var(--fullscreen-schedule-bar-font-size, 16px);
  line-height: 1.15;
}

.crew-week {
  display: grid;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.crew-week-days {
  display: grid;
  grid-template-columns: 108px repeat(7, minmax(0, 1fr));
  min-height: 34px;
}

.crew-corner {
  border-right: 1px solid #edf0e8;
  background: #f7f8f2;
}

.crew-week-bars {
  display: grid;
  grid-template-columns: 108px repeat(7, minmax(0, 1fr));
  gap: 5px 4px;
  min-height: 34px;
  padding: 7px 6px 8px;
}

.crew-person-label {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 7px;
  border-right: 1px solid #edf0e8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day:nth-child(7n + 1) {
  border-left: 1px solid var(--line);
}

.calendar-day.muted {
  background: #f2f4ee;
  color: #9aa297;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 3px var(--accent-soft);
}

.calendar-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 900;
}

.calendar-events {
  display: grid;
  gap: 5px;
}

.calendar-chip {
  display: block;
  width: 100%;
  padding: 5px 6px;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: var(--primary-soft);
  color: #174f49;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-chip.deadline {
  border-color: var(--warn);
  background: var(--warn-soft);
  color: #833025;
}

.calendar-chip.request {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #753d1e;
}

.calendar-chip.crew {
  border-color: #486a9b;
  background: #e2ebf7;
  color: #26466f;
}

.people-list {
  display: grid;
  gap: 14px;
}

#person-form {
  grid-template-columns: minmax(120px, 0.85fr) 116px minmax(130px, 1fr) minmax(150px, 1fr) auto;
  align-items: end;
}

#person-form .wide {
  grid-column: auto;
}

#person-form .form-actions {
  align-self: end;
}

#view-people .people-form-title {
  margin-top: 0;
  font-size: 18px;
}

.people-sections {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
  gap: 14px;
}

.people-section {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.people-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.people-section-head h3 {
  margin: 0;
  font-size: 16px;
}

.people-table-wrap {
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.people-table {
  min-width: 0;
  table-layout: fixed;
}

.people-table.assignable {
  min-width: 0;
}

.people-table.sales {
  min-width: 0;
}

.people-table.assignable .person-name-col {
  width: 16%;
}

.people-table.assignable .person-type-col {
  width: 12%;
}

.people-table.assignable .person-dept-col {
  width: 18%;
}

.people-table.assignable .person-skill-col {
  width: 20%;
}

.people-table.assignable .person-status-col {
  width: 10%;
}

.people-table.assignable .person-actions-col {
  width: 24%;
}

.people-table.sales .person-name-col {
  width: 28%;
}

.people-table.sales .person-dept-col {
  width: 28%;
}

.people-table.sales .person-status-col {
  width: 14%;
}

.people-table.sales .person-actions-col {
  width: 30%;
}

.people-table th,
.people-table td {
  padding: 5px 6px;
  vertical-align: middle;
}

.people-table th {
  white-space: nowrap;
  font-size: 11px;
}

.people-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.25;
}

.people-table tr.inactive {
  background: #f2f4ee;
  opacity: 0.72;
}

.people-table-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.people-table .tiny-button {
  min-height: 21px;
  padding: 2px 4px;
  font-size: 11px;
}

.people-table .badge {
  min-height: 18px;
  padding: 1px 5px;
  font-size: 11px;
}

.assignable-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.sales-people-list {
  display: grid;
  gap: 10px;
}

.people-group {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 10px;
}

.people-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.people-group-head h3 {
  margin: 0;
  font-size: 15px;
}

.people-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  align-items: start;
  gap: 10px;
}

.person-card {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 10px;
  min-height: 0;
}

.person-card.inactive {
  opacity: 0.68;
  background: #f2f4ee;
}

.person-card .card-head {
  align-items: flex-start;
}

.badge-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.status-stack {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.status-stack.compact {
  justify-items: start;
}

.person-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.person-toggle-button {
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.person-toggle-button.danger {
  color: #8f3429;
  border-color: #efc2b9;
  background: var(--warn-soft);
}

.load-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.load-bar {
  height: 10px;
  border-radius: 999px;
  background: #e4e8df;
  overflow: hidden;
}

.load-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #24302b;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(20, 28, 24, 0.5);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(940px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(18, 27, 24, 0.28);
}

.modal.narrow {
  width: min(720px, 100%);
}

.modal.schedule-modal {
  width: min(1320px, calc(100vw - 44px));
}

.address-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
}

.address-suggestions {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 10px;
  max-height: min(360px, calc(100vh - 300px));
  overflow: auto;
  padding-right: 4px;
}

.address-option {
  height: auto;
  min-height: 64px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.address-result {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.address-result > span:last-child {
  min-width: 0;
}

.address-result strong,
.address-result small {
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.address-result small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.address-zip {
  color: var(--primary-dark);
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}

.address-help {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.address-loading {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.postcode-search-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.address-option:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 3px 0 0;
  font-size: 20px;
}

.modal-summary {
  margin-bottom: 14px;
}

.compact-detail {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
  }

  .sidebar-note {
    display: none;
  }

  .planner-layout,
  .schedule-planner-layout,
  .construction-layout,
  .order-detail-layout,
  .order-detail-row.cols-4,
  .order-detail-row.cols-3,
  .two-column,
  .split-layout,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .construction-layout {
    grid-template-columns: 1fr !important;
  }

  .construction-resizer {
    display: none;
  }

  .schedule-reference-pane,
  .schedule-edit-pane {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-head,
  .schedule-range-head {
    display: grid;
  }

  .topbar-actions,
  .form-actions,
  .toolbar-row,
  .calendar-controls,
  .calendar-filter {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .detail-grid,
  .schedule-plan-grid,
  .schedule-reference-pane .detail-grid,
  .order-detail-layout,
  .order-detail-row.cols-4,
  .order-detail-row.cols-3,
  .compact-detail,
  .people-sections,
  .assignable-groups,
  .people-list-grid,
  .assignment-groups,
  .assignment-group,
  .assignment-table-head,
  .day-labor-editor,
  #person-form,
  .address-suggestions,
  .address-field,
  .day-row {
    grid-template-columns: 1fr;
  }

  .assignment-table-head div,
  .day-date,
  .assignment-group {
    border-right: 0;
  }

  .assignment-table-head div:not(:last-child),
  .day-date,
  .day-row .assignment-group:not(:last-child) {
    border-bottom: 1px solid var(--line);
  }

  .phase-item {
    grid-template-columns: 1fr;
  }

  .phase-range {
    white-space: normal;
  }

  .wide {
    grid-column: auto;
  }

  .calendar-day {
    min-height: 108px;
    padding: 6px;
  }

  .calendar-chip {
    white-space: normal;
  }
}
