/* Labor Forecast Manager — serious, compact operations UI. */
body.labor-app-active { overflow: hidden; background: #eef1f4; }

.labor-app {
  --lf-bg: #eef1f4;
  --lf-surface: #fff;
  --lf-surface-muted: #f7f8fa;
  --lf-border: #d8dde4;
  --lf-border-strong: #bcc4ce;
  --lf-text: #17202a;
  --lf-text-soft: #596675;
  --lf-text-dim: #7d8896;
  --lf-navy: #17212d;
  --lf-navy-2: #202d3b;
  --lf-accent: #1473e6;
  --lf-accent-hover: #0d5fbe;
  --lf-accent-soft: #e8f2ff;
  --lf-green: #147a4b;
  --lf-green-soft: #e7f6ee;
  --lf-yellow: #a85d00;
  --lf-yellow-soft: #fff2d8;
  --lf-red: #b4232c;
  --lf-red-soft: #fdebec;
  --lf-purple: #7047a5;
  --lf-purple-soft: #f1eafa;
  --lf-cyan: #087b8b;
  --lf-cyan-soft: #e2f5f7;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: var(--lf-bg);
  color: var(--lf-text);
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
}

.labor-app *, .labor-app *::before, .labor-app *::after { box-sizing: border-box; }
.labor-app button, .labor-app input, .labor-app select, .labor-app textarea { font: inherit; }
.labor-app button:focus-visible, .labor-app input:focus-visible, .labor-app select:focus-visible,
.labor-app textarea:focus-visible, .labor-app [tabindex]:focus-visible {
  outline: 3px solid rgba(20, 115, 230, .25);
  outline-offset: 1px;
}
.labor-app h1, .labor-app h2, .labor-app h3, .labor-app p { margin-top: 0; }
.labor-app .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.lf-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); height: 100%; }
.lf-sidebar {
  display: flex; flex-direction: column; min-width: 0; background: var(--lf-navy); color: #fff;
  border-right: 1px solid #0d141d; box-shadow: 2px 0 12px rgba(16, 24, 40, .14); z-index: 4;
}
.lf-brand {
  display: grid; grid-template-columns: 32px 38px minmax(0, 1fr); align-items: center; gap: 9px;
  min-height: 68px; padding: 0 14px; border-bottom: 1px solid rgba(255,255,255,.09);
}
.lf-brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #5aa1f6;
  border-radius: 7px; background: var(--lf-accent); font-size: 12px; font-weight: 900; letter-spacing: .04em;
}
.lf-brand > div:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.16; }
.lf-brand strong { font-size: 14px; white-space: nowrap; }
.lf-brand span { color: #9fb0c3; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.lf-apps-button {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid rgba(255,255,255,.13); border-radius: 5px; background: transparent; color: #d6e0ea; cursor: pointer;
}
.lf-apps-button:hover { background: rgba(255,255,255,.08); color: #fff; }
.lf-nav { display: flex; flex-direction: column; gap: 3px; padding: 14px 10px; overflow-y: auto; }
.lf-nav button {
  display: grid; grid-template-columns: 25px 1fr; align-items: center; min-height: 39px; padding: 7px 10px;
  border: 1px solid transparent; border-radius: 5px; background: transparent; color: #aebdcd; cursor: pointer; text-align: left;
}
.lf-nav button > span { font-size: 16px; text-align: center; }
.lf-nav button em { font-style: normal; font-size: 13px; font-weight: 600; }
.lf-nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.lf-nav button.is-active { border-color: #377fcb; background: #1d5e9d; color: #fff; }
.lf-sidebar-foot {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
  margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.09); background: #121c27;
}
.lf-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.lf-user-avatar {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: #285f96; color: #fff; font-size: 12px; font-weight: 800;
}
.lf-user > div { display: flex; flex-direction: column; min-width: 0; }
.lf-user strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.lf-user span:last-child { color: #93a4b6; font-size: 10.5px; }

.lf-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lf-topbar {
  display: flex; align-items: center; justify-content: space-between; flex: none; min-height: 52px; padding: 0 18px;
  border-bottom: 1px solid var(--lf-border); background: #fff;
}
.lf-topbar-start, .lf-topbar-end { display: flex; align-items: center; gap: 12px; }
.lf-breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--lf-text-dim); font-size: 12.5px; }
.lf-breadcrumb b { color: #c1c7cf; }
.lf-breadcrumb strong { color: var(--lf-text); }
.lf-live-indicator { display: inline-flex; align-items: center; gap: 7px; color: var(--lf-text-soft); font-size: 11.5px; font-weight: 600; }
.lf-live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 3px #dcf5e9; }
.lf-icon-button {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--lf-border); border-radius: 5px; background: #fff; color: var(--lf-text-soft); cursor: pointer;
}
.lf-sidebar .lf-icon-button { border-color: rgba(255,255,255,.12); background: transparent; color: #bdcad7; }
.lf-icon-button:hover { border-color: #9ca9b7; background: var(--lf-surface-muted); color: var(--lf-text); }
.lf-mobile-menu { display: none; }
.lf-sidebar-backdrop { display: none; }
.lf-content { flex: 1; min-width: 0; min-height: 0; padding: 22px; overflow: auto; outline: none; }

.lf-page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin: 0 0 18px;
}
.lf-page-head h1, .lf-plan-title-row h1 { margin: 0 0 4px; color: #17212b; font-size: 25px; line-height: 1.18; letter-spacing: -.025em; }
.lf-page-head p:not(.lf-eyebrow), .lf-plan-title-row p:not(.lf-eyebrow) { margin: 0; color: var(--lf-text-soft); }
.lf-eyebrow { margin: 0 0 4px; color: var(--lf-accent); font-size: 10.5px; font-weight: 800; letter-spacing: .095em; text-transform: uppercase; }
.lf-page-actions, .lf-plan-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.lf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 35px; padding: 7px 12px;
  border: 1px solid var(--lf-border-strong); border-radius: 5px; background: #fff; color: var(--lf-text);
  cursor: pointer; font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.lf-btn:hover:not(:disabled) { border-color: #8795a5; background: #f6f8fa; }
.lf-btn:disabled { cursor: not-allowed; opacity: .5; }
.lf-btn-primary { border-color: var(--lf-accent); background: var(--lf-accent); color: #fff; }
.lf-btn-primary:hover:not(:disabled) { border-color: var(--lf-accent-hover); background: var(--lf-accent-hover); }
.lf-btn-danger { border-color: #e8aeb2; color: var(--lf-red); }
.lf-btn-danger:hover:not(:disabled) { border-color: var(--lf-red); background: var(--lf-red-soft); }
.lf-btn-small { min-height: 29px; padding: 4px 9px; font-size: 11.5px; }
.lf-text-link { color: var(--lf-accent); font-size: 12px; font-weight: 700; margin-left: 12px; }
.lf-row-link, .lf-row-actions button {
  border: 0; background: transparent; color: var(--lf-accent); cursor: pointer; font-size: 12px; font-weight: 700;
}
.lf-row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.lf-back-link { margin: 0 0 10px; padding: 0; border: 0; background: transparent; color: var(--lf-accent); cursor: pointer; font-weight: 700; }

.lf-card {
  min-width: 0; margin-bottom: 14px; border: 1px solid var(--lf-border); border-radius: 7px;
  background: var(--lf-surface); box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.lf-card > header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding: 13px 15px;
  border-bottom: 1px solid #e7eaee;
}
.lf-card > header h2 { margin: 0 0 2px; font-size: 14.5px; letter-spacing: -.01em; }
.lf-card > header p { margin: 0; color: var(--lf-text-soft); font-size: 11.5px; }
.lf-card-chip { padding: 3px 7px; border: 1px solid #d8e3f0; border-radius: 4px; background: #f4f8fc; color: #47617e; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.lf-notes { margin: 0; padding: 18px; color: var(--lf-text-soft); white-space: pre-wrap; }
.lf-detail-grid, .lf-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 14px; }

.lf-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)); gap: 10px; margin: 0 0 14px; }
.lf-kpi-grid-small { grid-template-columns: repeat(3, minmax(160px, 240px)); }
.lf-summary { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 8px; margin: 0 0 14px; }
.lf-summary-compact { margin: 0 0 12px; }
.lf-metric {
  display: flex; flex-direction: column; min-width: 0; min-height: 91px; padding: 12px 13px;
  border: 1px solid var(--lf-border); border-radius: 6px; background: #fff;
}
.lf-metric > span { color: var(--lf-text-soft); font-size: 10.5px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.lf-metric > strong { margin: 5px 0 2px; color: var(--lf-text); font-size: 23px; line-height: 1; letter-spacing: -.025em; }
.lf-metric > small { overflow: hidden; color: var(--lf-text-dim); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.lf-metric-success { border-left: 3px solid var(--lf-green); }
.lf-metric-danger { border-left: 3px solid var(--lf-red); }
.lf-metric-warning { border-left: 3px solid var(--lf-yellow); }
.lf-metric-info { border-left: 3px solid var(--lf-accent); }
.lf-metric-purple { border-left: 3px solid var(--lf-purple); }

.lf-badge {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 7px;
  border: 1px solid var(--lf-border); border-radius: 4px; background: #f5f7f9; color: #485565;
  font-size: 10.5px; font-weight: 800; white-space: nowrap;
}
.lf-badge b { display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; font-size: 9px; }
.lf-risk-green, .lf-status-current, .lf-preview-valid, .lf-status-completed { border-color: #a9dec4; background: var(--lf-green-soft); color: var(--lf-green); }
.lf-risk-yellow, .lf-preview-warning, .lf-status-on-hold { border-color: #e8c681; background: var(--lf-yellow-soft); color: var(--lf-yellow); }
.lf-risk-red, .lf-preview-error, .lf-status-overdue, .lf-status-rejected, .lf-status-voided { border-color: #e8b2b6; background: var(--lf-red-soft); color: var(--lf-red); }
.lf-status-active, .lf-status-approved { border-color: #a8caf4; background: var(--lf-accent-soft); color: #0b5fbf; }
.lf-status-draft, .lf-status-closed { background: #eceff3; color: #5d6773; }
.lf-status-submitted, .lf-status-completed-with-exceptions { border-color: #c7b3e1; background: var(--lf-purple-soft); color: var(--lf-purple); }
.lf-job-status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -9px 0 13px; color: var(--lf-text-dim); font-size: 11px; }

.lf-table-card { overflow: hidden; }
.lf-table-scroll { min-width: 0; overflow: auto; }
.lf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lf-table th {
  padding: 9px 10px; border-bottom: 1px solid var(--lf-border-strong); background: #f5f7f9;
  color: #536171; font-size: 10px; font-weight: 800; letter-spacing: .045em; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.lf-table td { padding: 10px; border-bottom: 1px solid #e8ebef; color: #334050; vertical-align: middle; }
.lf-table tbody tr:last-child td { border-bottom: 0; }
.lf-table tbody tr[data-job-id], .lf-table tbody tr[data-open-job] { cursor: pointer; }
.lf-table tbody tr:hover td { background: #f8fafc; }
.lf-table td > strong { display: block; color: var(--lf-text); font-size: 12.5px; }
.lf-table td > span { display: block; margin-top: 2px; color: var(--lf-text-dim); font-size: 10.5px; }
.lf-table tfoot th { border-top: 1px solid var(--lf-border-strong); border-bottom: 0; background: #eef2f6; color: var(--lf-text); }
.lf-negative { color: var(--lf-red) !important; font-weight: 800; }
.lf-positive { color: var(--lf-green) !important; font-weight: 800; }
.lf-result-count { margin-left: auto; color: var(--lf-text-dim); font-size: 11.5px; }

/* Read-only legacy V2 Manpower projection */
.lf-manpower-card { overflow: hidden; }
.lf-manpower-table-wrap {
  max-width: 100%; max-height: calc(100vh - 330px); min-height: 360px; overflow: auto;
  background: #fff;
}
.lf-manpower-table {
  width: 100%; min-width: 1580px; border-collapse: separate; border-spacing: 0;
  color: var(--lf-text); font-size: 12px; font-variant-numeric: tabular-nums;
}
.lf-manpower-table th, .lf-manpower-table td {
  min-width: 125px; height: 43px; padding: 8px 10px; border-right: 1px solid #e0e4e9; border-bottom: 1px solid #e0e4e9;
  background: #fff; text-align: center; white-space: nowrap;
}
.lf-manpower-table thead th {
  position: sticky; top: 0; z-index: 2; height: 50px; background: #eef2f6;
  color: #536171; font-size: 10px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase;
}
.lf-manpower-table th:first-child {
  position: sticky; left: 0; z-index: 1; min-width: 112px; width: 112px;
  border-right-color: var(--lf-border-strong); background: #f6f8fa; text-align: left;
}
.lf-manpower-table thead th:first-child { z-index: 3; background: #e7edf3; }
.lf-manpower-table tbody tr:nth-child(even) th:first-child { background: #edf1f5; }
.lf-manpower-table tbody tr:hover th, .lf-manpower-table tbody tr:hover td { filter: brightness(.98); }
.lf-manpower-table td { font-weight: 800; }
.lf-manpower-load-zero { background: #f4f6f8 !important; color: #8b96a3; }
.lf-manpower-load-active { color: var(--lf-text); }
.lf-manpower-load-medium { background: var(--lf-purple-soft) !important; color: var(--lf-purple); }
.lf-manpower-load-high { background: #fff0e6 !important; color: #c3540a; }
.lf-manpower-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 15px; padding: 10px 14px;
  border-top: 1px solid var(--lf-border); color: var(--lf-text-dim); font-size: 10.5px;
}
.lf-manpower-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lf-manpower-legend i { width: 15px; height: 12px; border: 1px solid var(--lf-border); border-radius: 2px; }

.lf-projection-dialog {
  width: min(1040px, calc(100vw - 40px)); max-width: none; max-height: calc(100vh - 40px); padding: 0;
  border: 1px solid var(--lf-border-strong); border-radius: 8px; background: var(--lf-bg); color: var(--lf-text);
  box-shadow: 0 20px 60px rgba(16,24,40,.3);
}
.lf-projection-dialog::backdrop { background: rgba(13,20,29,.6); }
.lf-projection-dialog-head {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border-bottom: 1px solid var(--lf-border); background: #fff;
}
.lf-projection-dialog-head h2 { margin: 0; font-size: 20px; }
.lf-projection-dialog-body { padding: 16px; overflow: auto; }
.lf-breakdown-section {
  margin-bottom: 14px; padding: 14px; border: 1px solid var(--lf-border); border-radius: 7px; background: #fff;
}
.lf-breakdown-section > h3 { margin: 0 0 2px; font-size: 15px; }
.lf-breakdown-section > p { margin-bottom: 12px; color: var(--lf-text-soft); font-size: 11.5px; }
.lf-breakdown-trades { display: flex; flex-direction: column; gap: 7px; }
.lf-breakdown-trades details { border: 1px solid var(--lf-border); border-radius: 6px; overflow: hidden; }
.lf-breakdown-trades summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px;
  background: #f6f8fa; color: var(--lf-text); cursor: pointer; list-style-position: inside;
}
.lf-breakdown-trades summary > span { display: inline-flex; flex-direction: column; }
.lf-breakdown-trades summary small { color: var(--lf-text-dim); font-size: 10.5px; font-weight: 500; }
.lf-breakdown-trades summary > b { color: var(--lf-purple); font-size: 11px; white-space: nowrap; }

.lf-filterbar, .lf-grid-toolbar, .lf-plan-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-height: 54px; margin-bottom: 10px; padding: 9px 11px;
  border: 1px solid var(--lf-border); border-radius: 6px; background: #fff;
}
.lf-filterbar label, .lf-grid-toolbar label, .lf-plan-toolbar label { display: flex; align-items: center; gap: 6px; }
.lf-filterbar label > span, .lf-grid-toolbar label > span, .lf-plan-toolbar label > span { color: var(--lf-text-dim); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.lf-filterbar select, .lf-filterbar input, .lf-grid-toolbar select, .lf-plan-toolbar select {
  min-height: 34px; padding: 5px 8px; border: 1px solid var(--lf-border); border-radius: 5px; background: #fff; color: var(--lf-text);
}
.lf-search { position: relative; flex: 1 1 260px; }
.lf-search i { position: absolute; left: 9px; color: var(--lf-text-dim); font-style: normal; }
.lf-search input { width: 100%; padding-left: 28px; }
.lf-grid-toolbar { justify-content: space-between; }
.lf-grid-toolbar > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }

.lf-alert {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 9px;
  margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--lf-border); border-radius: 6px; background: #fff;
}
.lf-alert > b { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; font-size: 12px; }
.lf-alert > div { display: flex; flex-direction: column; }
.lf-alert strong { font-size: 12.5px; }
.lf-alert span { color: inherit; font-size: 11.5px; opacity: .86; }
.lf-alert-info { border-color: #acd0f6; background: var(--lf-accent-soft); color: #145a9f; }
.lf-alert-info > b { background: #cfe4fd; }
.lf-alert-success { border-color: #addac4; background: var(--lf-green-soft); color: var(--lf-green); }
.lf-alert-success > b { background: #ccebdc; }
.lf-alert-warning { border-color: #e3c17c; background: var(--lf-yellow-soft); color: #875000; }
.lf-alert-warning > b { background: #f7dfad; }
.lf-alert-danger { border-color: #e7afb3; background: var(--lf-red-soft); color: var(--lf-red); }
.lf-alert-danger > b { background: #f7cfd2; }
.lf-alert-purple { border-color: #c6afe1; background: var(--lf-purple-soft); color: var(--lf-purple); }
.lf-alert-purple > b { background: #dfd1ef; }

.lf-bar-chart, .lf-trend-chart {
  display: flex; align-items: flex-end; gap: 9px; height: 230px; padding: 24px 16px 14px; overflow-x: auto;
}
.lf-bar-group, .lf-trend-chart > div {
  display: grid; grid-template-rows: 18px minmax(0, 1fr) 20px; align-items: end; justify-items: center;
  flex: 1 0 54px; height: 100%; color: var(--lf-text-dim); font-size: 10px;
}
.lf-bar-group i, .lf-trend-chart i { display: block; width: 70%; min-height: 3px; border-radius: 2px 2px 0 0; background: #4e8fda; }
.lf-bar-group span, .lf-trend-chart span { color: var(--lf-text-soft); font-size: 9.5px; font-weight: 700; }
.lf-bar-group small, .lf-trend-chart small { white-space: nowrap; }
.lf-trend-chart { height: 210px; }
.lf-trend-chart i { background: #5a82b3; }
.lf-chart-baseline { padding: 0 16px 13px; color: var(--lf-accent); font-size: 10.5px; font-weight: 700; text-align: right; }
.lf-risk-distribution { display: flex; flex-direction: column; gap: 18px; padding: 22px 18px; }
.lf-risk-distribution > div > span { display: inline-flex; align-items: center; gap: 7px; color: var(--lf-text-soft); font-size: 11.5px; }
.lf-risk-distribution > div > strong { float: right; }
.lf-risk-distribution > div > div { height: 7px; margin-top: 7px; border-radius: 4px; background: #ebedf0; overflow: hidden; }
.lf-risk-distribution > div > div > b { display: block; height: 100%; }
.lf-fill-green { background: var(--lf-green); } .lf-fill-yellow { background: #d18a20; } .lf-fill-red { background: var(--lf-red); }
.lf-dot { width: 8px; height: 8px; border-radius: 50%; } .lf-dot-green { background: var(--lf-green); } .lf-dot-yellow { background: #d18a20; } .lf-dot-red { background: var(--lf-red); }

.lf-definition-list { margin: 0; padding: 8px 16px 14px; }
.lf-definition-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf0f3; }
.lf-definition-list dt { color: var(--lf-text-soft); }
.lf-definition-list dd { margin: 0; color: var(--lf-text); font-weight: 800; }
.lf-tabs { display: flex; gap: 2px; margin: 0 0 12px; border-bottom: 1px solid var(--lf-border); }
.lf-tabs button { padding: 9px 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--lf-text-soft); cursor: pointer; font-size: 12px; font-weight: 700; }
.lf-tabs button:hover { color: var(--lf-text); }
.lf-tabs button.is-active { border-bottom-color: var(--lf-accent); color: var(--lf-accent); }

.lf-form { display: flex; flex-direction: column; gap: 13px; padding: 16px; }
.lf-form label, .lf-inline-form label { display: flex; flex-direction: column; gap: 5px; }
.lf-form label > span, .lf-inline-form label > span {
  color: var(--lf-text-soft); font-size: 10.5px; font-weight: 800; letter-spacing: .025em; text-transform: uppercase;
}
.lf-form label > span small { color: var(--lf-text-dim); font-weight: 500; text-transform: none; }
.lf-form input, .lf-form select, .lf-form textarea, .lf-inline-form input, .lf-inline-form select {
  width: 100%; min-height: 37px; padding: 7px 9px; border: 1px solid var(--lf-border-strong); border-radius: 5px; background: #fff; color: var(--lf-text);
}
.lf-form textarea { resize: vertical; }
.lf-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lf-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.lf-inline-form { display: grid; grid-template-columns: 1.1fr 1fr 1.4fr .8fr .8fr .8fr auto; gap: 7px; align-items: center; padding: 12px; border-top: 1px solid var(--lf-border); background: #f8f9fb; }
.lf-check { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 8px !important; color: var(--lf-text-soft); font-size: 12px; line-height: 1.45; }
.lf-check input { width: 16px !important; min-height: 16px !important; margin-top: 1px; accent-color: var(--lf-accent); }

.lf-side-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(440px, calc(100vw - 30px));
  border-left: 1px solid var(--lf-border-strong); background: #fff; box-shadow: -12px 0 35px rgba(16,24,40,.18); overflow-y: auto;
}
.lf-side-panel[hidden] { display: none; }
.lf-side-panel-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 17px 16px; border-bottom: 1px solid var(--lf-border); background: #f8f9fb;
}
.lf-side-panel-head h2 { margin: 0; font-size: 18px; }
.lf-side-panel-head > div > span { color: var(--lf-text-soft); font-size: 11px; }
.lf-side-panel .lf-summary { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
.lf-side-panel .lf-metric { min-height: 78px; }
.lf-side-panel .lf-metric > strong { font-size: 19px; }

.lf-empty, .lf-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 240px; padding: 35px;
  color: var(--lf-text-soft); text-align: center;
}
.lf-empty h2 { margin: 8px 0 4px; color: var(--lf-text); font-size: 17px; }
.lf-empty p { max-width: 500px; }
.lf-empty-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--lf-border); border-radius: 50%; background: #f5f7f9; color: var(--lf-text-dim); font-size: 21px; }
.lf-error-state .lf-empty-icon { border-color: #e2aeb2; background: var(--lf-red-soft); color: var(--lf-red); }
.lf-spinner { width: 28px; height: 28px; border: 3px solid #d7e4f2; border-top-color: var(--lf-accent); border-radius: 50%; animation: lf-spin .75s linear infinite; }
@keyframes lf-spin { to { transform: rotate(360deg); } }

.lf-audit-list { list-style: none; margin: 0; padding: 6px 16px 18px; }
.lf-audit-list li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid #e8ebef; }
.lf-audit-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--lf-accent-soft); color: var(--lf-accent); }
.lf-audit-list strong { text-transform: capitalize; }
.lf-audit-list p { margin: 2px 0; color: var(--lf-text-dim); font-size: 11px; }
.lf-audit-list pre, .lf-table pre { max-width: 600px; padding: 9px; overflow: auto; border-radius: 4px; background: #17212d; color: #dfe8f2; font: 10.5px/1.45 ui-monospace, monospace; }
.lf-audit-list summary, .lf-table summary { color: var(--lf-accent); cursor: pointer; font-size: 11px; font-weight: 700; }

.lf-utilization { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.lf-utilization > span { width: 75px; height: 7px; overflow: hidden; border-radius: 4px; background: #e3e7ec; }
.lf-utilization i { display: block; height: 100%; background: #4e8fda; }
.lf-utilization b { font-size: 10.5px; }
.lf-capacity-over td { background: #faf6ff !important; }
.lf-capacity-over .lf-utilization i { background: var(--lf-purple); }

.lf-import-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(400px, 1.2fr); gap: 14px; }
.lf-dropzone {
  display: grid !important; place-items: center; min-height: 110px; padding: 18px;
  border: 1px dashed #9eafc2; border-radius: 6px; background: #f7f9fc; color: var(--lf-accent); cursor: pointer; text-align: center;
}
.lf-dropzone:hover { border-color: var(--lf-accent); background: #f0f6fd; }
.lf-dropzone span { color: var(--lf-text-dim) !important; font-weight: 500 !important; text-transform: none !important; }
.lf-import-mapping { margin: 0 16px 16px; padding: 13px; border: 1px solid #cbd9e8; border-radius: 6px; background: #f5f9fd; }
.lf-import-mapping h3 { margin: 0 0 2px; font-size: 13px; }
.lf-import-mapping p { color: var(--lf-text-soft); font-size: 11px; }
.lf-import-mapping > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.lf-import-mapping label { display: flex; flex-direction: column; gap: 3px; }
.lf-import-mapping label span { font: 700 10px ui-monospace, monospace; }
.lf-import-mapping select { min-height: 32px; border: 1px solid var(--lf-border); border-radius: 4px; background: #fff; }
.lf-import-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 12px; }
.lf-import-stats .lf-metric { min-height: 74px; padding: 9px; }
.lf-import-stats .lf-metric strong { font-size: 18px; }
.lf-confirm-import { float: right; margin: 12px; }

.lf-report-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 12px; }
.lf-report-card { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 16px; }
.lf-report-card > div:last-child { grid-column: 2; display: flex; gap: 7px; }
.lf-report-card h2 { margin: 0 0 3px; font-size: 14px; }
.lf-report-card p { margin: 0; color: var(--lf-text-soft); font-size: 11.5px; }
.lf-report-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #b9d3f2; border-radius: 5px; background: var(--lf-accent-soft); color: var(--lf-accent); font-size: 18px; }
.lf-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lf-admin-card { overflow: hidden; }
.lf-settings-list { display: flex; flex-direction: column; padding: 0 14px; }
.lf-settings-list form { display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #e8ebef; }
.lf-settings-list form:last-child { border-bottom: 0; }
.lf-settings-list form > div { display: flex; flex-direction: column; }
.lf-settings-list form strong { text-transform: capitalize; }
.lf-settings-list form span { color: var(--lf-text-dim); font-size: 11px; }
.lf-settings-list input:not([type="checkbox"]) { min-height: 34px; padding: 6px 8px; border: 1px solid var(--lf-border); border-radius: 4px; }
.lf-switch { position: relative; display: inline-flex; width: 40px; height: 22px; }
.lf-switch input { opacity: 0; width: 0; height: 0; }
.lf-switch span { position: absolute; inset: 0; border-radius: 11px; background: #b5bdc7; cursor: pointer; }
.lf-switch span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.lf-switch input:checked + span { background: var(--lf-accent); }
.lf-switch input:checked + span::before { transform: translateX(18px); }

/* Planning grid */
.lf-plan-header { margin-bottom: 10px; }
.lf-plan-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.lf-plan-actions > span { color: var(--lf-green); font-size: 11px; font-weight: 700; }
.lf-plan-actions > span.is-dirty { color: var(--lf-yellow); }
.lf-plan-toolbar { margin: 0; }
.lf-plan-toolbar > label:first-child { min-width: min(430px, 45vw); }
.lf-plan-toolbar > label:first-child select { width: 100%; }
.lf-week-nav { display: flex; gap: 4px; }
.lf-plan-range { padding: 5px 8px; border-left: 1px solid var(--lf-border); color: var(--lf-text-soft); font-size: 11.5px; font-weight: 700; }
.lf-plan-meta { margin-left: auto; color: var(--lf-text-dim); font-size: 11px; }
.lf-plan-grid-wrap {
  max-width: 100%; max-height: calc(100vh - 390px); min-height: 300px; overflow: auto;
  border: 1px solid var(--lf-border-strong); border-radius: 5px; background: #fff;
}
.lf-plan-table { min-width: 2050px; width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.lf-plan-table th {
  position: sticky; top: 0; z-index: 4; min-width: 84px; height: 48px; padding: 6px 7px;
  border-right: 1px solid #d8dde4; border-bottom: 1px solid #b9c1cb; background: #eaf0f5;
  color: #435263; font-size: 9.5px; font-weight: 800; letter-spacing: .035em; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.lf-plan-table th.lf-week { text-align: center; }
.lf-plan-table th.lf-week span { display: block; font-size: 10px; }
.lf-plan-table th.lf-week small { display: block; color: #7c8998; font-size: 8.5px; font-weight: 600; text-transform: none; }
.lf-plan-table th.is-locked { background: #e1e5ea; color: #737e89; }
.lf-plan-table td {
  height: 42px; padding: 5px 7px; border-right: 1px solid #e3e7eb; border-bottom: 1px solid #e5e8ec;
  background: #fff; color: #354252; vertical-align: middle;
}
.lf-plan-table tbody tr:hover td { background: #f8fbfe; }
.lf-plan-table tbody tr.is-selected td { background: #f1f7fe; }
.lf-plan-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--lf-accent); }
.lf-plan-table td > strong { display: block; font-size: 11px; }
.lf-plan-table td > span { display: block; max-width: 150px; overflow: hidden; color: var(--lf-text-dim); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.lf-plan-table .lf-sticky-col { position: sticky; z-index: 3; background: #fff; }
.lf-plan-table thead .lf-sticky-col { z-index: 6; background: #eaf0f5; }
.lf-plan-table .lf-col-phase { left: 0; min-width: 175px; width: 175px; }
.lf-plan-table .lf-col-role { left: 175px; min-width: 145px; width: 145px; }
.lf-plan-table .lf-col-crew { left: 320px; min-width: 135px; width: 135px; box-shadow: 3px 0 3px rgba(30,40,50,.06); }
.lf-plan-table .lf-col-notes { min-width: 150px; width: 150px; }
.lf-plan-table .lf-number { text-align: right; font-variant-numeric: tabular-nums; }
.lf-plan-table .lf-plan-cell { min-width: 84px; padding: 3px; }
.lf-plan-input, .lf-row-note, .lf-dim-select {
  width: 100%; min-height: 30px; padding: 4px 5px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--lf-text); font-size: 11px;
}
.lf-plan-input { text-align: right; font-variant-numeric: tabular-nums; }
.lf-plan-input:hover:not(:disabled), .lf-row-note:hover:not(:disabled) { border-color: #b9c7d6; background: #fff; }
.lf-plan-input:focus, .lf-row-note:focus { border-color: var(--lf-accent); background: #fff; outline: 2px solid rgba(20,115,230,.18); }
.lf-plan-input:disabled { color: #7f8994; cursor: not-allowed; }
.lf-plan-cell:has(.lf-plan-input:disabled) { background: #f0f2f4; }
.lf-plan-cell.is-edited { background: #fff5da !important; box-shadow: inset 0 -2px 0 #cc8500; }
.lf-plan-cell.is-review-change:not(.is-edited) { background: #edf5ff !important; box-shadow: inset 0 -2px 0 #448fdc; }
.lf-row-menu { width: 25px; height: 25px; border: 0; border-radius: 3px; background: transparent; color: #87929f; cursor: pointer; }
.lf-row-menu:hover { background: var(--lf-red-soft); color: var(--lf-red); }
.lf-plan-table tfoot th { top: auto; bottom: 0; z-index: 5; border-top: 1px solid #adb7c3; border-bottom: 0; background: #dfe7ef; color: #263544; text-align: right; }
.lf-plan-table tfoot .lf-sticky-col { z-index: 7; text-align: left; }
.lf-grid-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 8px 3px; color: var(--lf-text-dim); font-size: 10.5px; }
.lf-grid-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lf-grid-legend i { width: 13px; height: 10px; border: 1px solid var(--lf-border); }
.lf-grid-legend i.is-edited { background: #fff5da; border-bottom: 2px solid #cc8500; }
.lf-grid-legend i.is-review-change { background: #edf5ff; border-bottom: 2px solid #448fdc; }
.lf-grid-legend i.is-locked { background: #e4e7eb; }
.lf-bulk-button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

@media (max-width: 1250px) {
  .lf-kpi-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .lf-summary { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .lf-inline-form { grid-template-columns: repeat(3, 1fr); }
  .lf-inline-form .lf-btn { grid-column: 3; }
}

@media (max-width: 980px) {
  .lf-shell { grid-template-columns: 1fr; }
  .lf-sidebar {
    position: fixed; inset: 0 auto 0 0; width: 230px; transform: translateX(-102%);
    transition: transform .16s ease; box-shadow: 10px 0 30px rgba(0,0,0,.25);
  }
  .lf-sidebar.is-open { transform: translateX(0); }
  .lf-sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 3; padding: 0; border: 0;
    background: rgba(13, 20, 29, .48); cursor: default;
  }
  .lf-sidebar-backdrop[hidden] { display: none; }
  .lf-mobile-menu { display: inline-grid; }
  .lf-content { padding: 16px; }
  .lf-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .lf-dashboard-grid, .lf-detail-grid, .lf-import-grid, .lf-admin-grid { grid-template-columns: 1fr; }
  .lf-report-grid { grid-template-columns: 1fr; }
  .lf-plan-title-row { align-items: flex-start; flex-direction: column; }
  .lf-plan-actions { width: 100%; }
  .lf-plan-toolbar > label:first-child { min-width: 100%; }
  .lf-plan-meta { margin-left: 0; }
}

@media (max-width: 650px) {
  .lf-topbar { padding: 0 10px; }
  .lf-live-indicator { display: none; }
  .lf-content { padding: 12px; }
  .lf-page-head { align-items: flex-start; flex-direction: column; }
  .lf-page-head h1, .lf-plan-title-row h1 { font-size: 21px; }
  .lf-kpi-grid, .lf-summary, .lf-kpi-grid-small { grid-template-columns: 1fr 1fr; }
  .lf-metric { min-height: 80px; }
  .lf-metric > strong { font-size: 20px; }
  .lf-field-row, .lf-import-mapping > div { grid-template-columns: 1fr; }
  .lf-settings-list form { grid-template-columns: 1fr auto; }
  .lf-settings-list form .lf-btn { grid-column: 1 / -1; }
  .lf-import-stats { grid-template-columns: 1fr 1fr; }
  .lf-projection-dialog { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .lf-projection-dialog-body { padding: 10px; }
  .lf-breakdown-section { padding: 10px; }
  .lf-breakdown-trades summary { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .lf-sidebar, .lf-switch span::before { transition: none; }
  .lf-spinner { animation-duration: 1.5s; }
}
