:root {
  --ink: #101923;
  --ink-2: #1a2633;
  --paper: #f4f6f8;
  --surface: #ffffff;
  --line: #dfe4e9;
  --muted: #6b7682;
  --amber: #f4a62a;
  --amber-soft: #fff3dd;
  --blue: #3d7ef0;
  --blue-soft: #eaf2ff;
  --green: #20a376;
  --green-soft: #e4f7f0;
  --violet: #805ad5;
  --violet-soft: #f0eafb;
  --red: #c94747;
  --red-soft: #fdecec;
  --shadow: 0 10px 35px rgba(16, 25, 35, .07);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-width: 320px; background: var(--paper); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 3vw, 2.55rem); line-height: 1.05; letter-spacing: -.04em; }
h2 { margin-bottom: 4px; font-size: 1.15rem; letter-spacing: -.015em; }
h3 { margin-bottom: 4px; }
.muted { margin-bottom: 0; color: var(--muted); }
.eyebrow { margin-bottom: 8px; color: #9a650b; font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.strong { font-weight: 750; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 242px; padding: 24px 18px; flex-direction: column; background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 12px; background: var(--amber); color: var(--ink); font-size: .82rem; font-weight: 900; letter-spacing: -.03em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .98rem; }
.brand small { margin-top: 2px; color: #9dadbd; font-size: .7rem; }
.nav { display: flex; margin-top: 38px; flex: 1; flex-direction: column; gap: 6px; }
.nav a { display: flex; min-height: 44px; padding: 10px 12px; align-items: center; gap: 11px; border-radius: 10px; color: #aeb9c3; font-size: .91rem; font-weight: 650; transition: .15s ease; }
.nav a span { width: 20px; color: #738292; font-size: 1.05rem; text-align: center; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(244, 166, 42, .13); color: #fff; }
.nav a.active span { color: var(--amber); }
.nav-label { margin: 22px 12px 6px; color: #657484; font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-user { display: grid; padding-top: 18px; align-items: center; grid-template-columns: 36px 1fr 30px; gap: 10px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { font-size: .82rem; }
.sidebar-user small { color: #7f8d9c; font-size: .68rem; }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #334353; color: #fff; font-size: .78rem; font-weight: 800; }
.avatar.large { width: 46px; height: 46px; background: var(--blue-soft); color: var(--blue); font-size: 1rem; }
.icon-button { display: grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #81909f; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { min-height: 100vh; margin-left: 242px; padding: 42px clamp(26px, 4vw, 66px) 80px; }
.mobile-head { display: none; }
.page-head { display: flex; margin-bottom: 28px; align-items: flex-end; justify-content: space-between; gap: 24px; }
.head-row, .head-actions { display: flex; align-items: center; gap: 10px; }
.head-row .eyebrow { margin: 0; }
.head-actions { flex-wrap: wrap; justify-content: flex-end; }
.button { display: inline-flex; min-height: 42px; padding: 9px 15px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; background: transparent; font-size: .85rem; font-weight: 750; cursor: pointer; transition: .15s ease; }
.button.primary { background: var(--ink); color: #fff; box-shadow: 0 8px 18px rgba(16,25,35,.15); }
.button.primary:hover { background: #263543; transform: translateY(-1px); }
.button.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.button.secondary:hover { border-color: #bfc8d0; background: #f9fafb; }
.button.small { min-height: 32px; padding: 5px 9px; font-size: .72rem; }
.button.wide { width: 100%; }
.text-link, .row-action { color: #2769c7; font-size: .8rem; font-weight: 750; }
.text-link:hover, .row-action:hover { text-decoration: underline; }

.stats-grid { display: grid; margin-bottom: 26px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { display: flex; min-height: 134px; padding: 22px; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: .15s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: #c8d0d8; }
.stat-card span:last-child { min-width: 0; }
.stat-card small, .stat-card strong, .stat-card em { display: block; }
.stat-card small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.stat-card strong { margin: 2px 0 0; font-size: 1.75rem; line-height: 1.1; }
.stat-card em { margin-top: 5px; overflow: hidden; color: #98a1aa; font-size: .68rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.stat-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 12px; font-size: 1.1rem; font-weight: 800; }
.stat-icon.amber { background: var(--amber-soft); color: #b27108; }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.violet { background: var(--violet-soft); color: var(--violet); }

.panel { margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-head { display: flex; padding: 22px 24px 18px; align-items: center; justify-content: space-between; gap: 20px; }
.panel-head p { font-size: .8rem; }
.project-list { border-top: 1px solid var(--line); }
.project-row { display: grid; min-height: 82px; padding: 13px 24px; align-items: center; grid-template-columns: 50px 1fr auto 18px; gap: 16px; border-bottom: 1px solid #edf0f2; transition: .15s ease; }
.project-row:last-child { border-bottom: 0; }
.project-row:hover { background: #f9fafb; }
.date-tile { display: grid; width: 46px; height: 50px; place-items: center; align-content: center; border-radius: 10px; background: var(--amber-soft); color: #8c5907; }
.date-tile strong, .date-tile small, .project-main strong, .project-main small, .project-meta small { display: block; }
.date-tile strong { font-size: 1.1rem; line-height: 1; }
.date-tile small { margin-top: 3px; font-size: .57rem; }
.project-main strong { margin-bottom: 4px; font-size: .92rem; }
.project-main small, .project-meta small { color: var(--muted); font-size: .71rem; }
.project-meta { display: flex; gap: 18px; }
.arrow { color: #aab3bc; font-size: 1.5rem; }
.empty { padding: 50px 22px; color: var(--muted); text-align: center; }
.empty > span { display: block; margin-bottom: 8px; color: #aab4bd; font-size: 2rem; }
.empty h3 { color: var(--ink); }
.empty p { margin-bottom: 0; font-size: .85rem; }
.empty.compact { padding: 38px 20px; }

.toolbar { display: flex; min-height: 48px; margin-bottom: 14px; align-items: center; justify-content: space-between; gap: 14px; }
.search { display: flex; min-width: min(480px, 100%); gap: 8px; }
.search input { flex: 1; }
.count { color: var(--muted); font-size: .76rem; }
.table-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 15px; background: #f7f8fa; color: #77828d; font-size: .65rem; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 15px; border-top: 1px solid #edf0f2; font-size: .8rem; vertical-align: middle; }
td strong, td small { display: block; }
td small { margin-top: 3px; max-width: 280px; color: var(--muted); }
.badge { display: inline-flex; padding: 4px 8px; align-items: center; border-radius: 99px; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.badge.active, .badge.confirmed { background: var(--green-soft); color: #147d5a; }
.badge.maintenance, .badge.sent { background: var(--amber-soft); color: #946008; }
.badge.retired, .badge.cancelled { background: #edf0f2; color: #6c7781; }
.badge.draft { background: var(--blue-soft); color: #2c68be; }
.badge.pending { background: var(--amber-soft); color: #946008; }
.badge.accepted { background: var(--green-soft); color: #147d5a; }
.badge.declined { background: var(--red-soft); color: #9b3939; }
.badge.assignment-mini { display: flex; width: fit-content; margin-top: 5px; padding: 3px 6px; font-size: .56rem; }

input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #ccd3da; border-radius: 9px; outline: none; background: #fff; color: var(--ink); font-size: .83rem; transition: .15s ease; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61,126,240,.11); }
label, .field-label { display: block; color: #4f5c67; font-size: .7rem; font-weight: 750; }
label input, label select, label textarea { margin-top: 6px; font-weight: 450; }
.checkbox { display: flex; min-height: 42px; align-items: center; gap: 9px; }
.checkbox input { width: 18px; min-height: 18px; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.stack-form { display: grid; gap: 15px; }
.compact-form { gap: 12px; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-panel { max-width: 760px; padding: 26px; }
.form-actions { display: flex; margin-top: 22px; justify-content: flex-end; }
.form-hint { margin: -4px 0 0; color: var(--muted); font-size: .7rem; }
.input-hint { display: block; margin-top: 6px; color: var(--muted); font-size: .62rem; font-weight: 500; }
.account-panel { margin-top: 20px; }
.account-panel .panel-head { padding: 0 0 22px; }
.disable-account-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); text-align: right; }
.danger-button { padding: 7px 0; border: 0; background: transparent; color: var(--red); font-size: .72rem; font-weight: 750; cursor: pointer; }
.account-state { display: inline-flex; align-items: center; gap: 5px; }
.account-state::before { width: 7px; height: 7px; border-radius: 50%; background: var(--green); content: ""; }
.account-state.disabled::before { background: #9aa4ae; }

.dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 28px 90px rgba(0,0,0,.28); }
.dialog::backdrop { background: rgba(9, 17, 25, .65); backdrop-filter: blur(3px); }
.dialog form { padding: 24px; }
.dialog-head { display: flex; margin-bottom: 24px; align-items: flex-start; justify-content: space-between; }
.dialog-head .icon-button { color: var(--muted); font-size: 1.4rem; }
.dialog-head .icon-button:hover { background: #f0f2f4; color: var(--ink); }
.dialog-actions { display: flex; margin-top: 24px; justify-content: flex-end; gap: 9px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.person-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.person-card.inactive-card { opacity: .65; }
.person-top { display: grid; margin-bottom: 22px; align-items: center; grid-template-columns: 46px 1fr auto; gap: 12px; }
.person-top h3 { font-size: .95rem; }
.person-top p { margin: 0; color: var(--muted); font-size: .72rem; }
.person-card dl { margin: 0 0 20px; }
.person-card dl div { display: flex; padding: 10px 0; justify-content: space-between; gap: 16px; border-top: 1px solid #edf0f2; }
.person-card dt, .person-card dd { margin: 0; font-size: .73rem; }
.person-card dt { color: var(--muted); }
.person-card dd { overflow: hidden; font-weight: 650; text-align: right; text-overflow: ellipsis; }
.vehicle-card .person-top { grid-template-columns: 42px 1fr auto; }

.filter-pills { display: flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.filter-pills a { padding: 7px 11px; border-radius: 7px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.filter-pills a.active { background: var(--ink); color: #fff; }

.project-tabbar { position: sticky; z-index: 9; top: 0; display: flex; margin: -8px 0 20px; padding: 0; overflow-x: auto; gap: 6px; border-bottom: 1px solid #cfd6dc; background: rgba(244,246,248,.96); backdrop-filter: blur(8px); }
.project-tabbar a { padding: 13px 11px 11px; flex: 0 0 auto; border-bottom: 3px solid transparent; color: var(--muted); font-size: .72rem; font-weight: 750; }
.project-tabbar a:hover { border-bottom-color: var(--blue); color: var(--ink); }
.project-tabbar a.active { border-bottom-color: var(--blue); color: #245fae; }
.project-workspace { min-width: 0; }
.project-settings-grid { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; }
.project-settings-main, .project-status-panel { overflow: hidden; }
.project-form { padding: 0 24px 24px; }
.project-status-actions { padding: 0 24px 22px; }
.project-facts { border-top: 1px solid var(--line); }
.project-facts div { display: flex; min-height: 54px; padding: 10px 24px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #edf0f2; }
.project-facts div:last-child { border-bottom: 0; }
.project-facts span { color: var(--muted); font-size: .65rem; }
.project-facts strong { font-size: .72rem; text-align: right; }
.project-split { display: grid; align-items: stretch; grid-template-columns: minmax(390px, .86fr) minmax(520px, 1.28fr); gap: 16px; }
.project-pane { min-width: 0; min-height: 665px; overflow: hidden; }
.project-pane-head { display: flex; min-height: 116px; padding: 20px 22px 18px; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: #fff; }
.project-pane-head .eyebrow { margin-bottom: 5px; font-size: .6rem; }
.project-pane-head h2 { margin-bottom: 5px; font-size: 1.05rem; }
.project-pane-head p:not(.eyebrow) { max-width: 530px; margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.project-pane-empty { padding-top: 110px; }
.project-tree-search { display: flex; min-width: 0; padding: 12px 14px; gap: 8px; border-bottom: 1px solid var(--line); background: #f7f8fa; }
.project-tree-search input { min-height: 38px; }
.project-equipment-tree { max-height: 508px; }
.project-items-scroll { max-height: 548px; overflow: auto; }
.project-items-table { min-width: 900px; }
.project-items-table thead { position: sticky; z-index: 2; top: 0; }
.project-items-table th { box-shadow: inset 0 -1px 0 var(--line); }
.project-planned-pane { display: flex; flex-direction: column; }
.line-group-toolbar { display: flex; padding: 10px 14px; align-items: end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #f7f8fa; }
.line-group-create { display: flex; min-width: 0; align-items: center; gap: 7px; }
.line-group-create input { width: min(210px, 100%); min-height: 34px; padding: 6px 8px; }
.line-group-target { display: block; min-width: 160px; }
.line-group-target span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .55rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.line-group-target select { min-height: 34px; padding: 6px 8px; font-size: .68rem; }
.line-drag-hint { align-self: center; color: var(--muted); font-size: .59rem; font-weight: 700; white-space: nowrap; }
.line-group-list { min-height: 0; overflow-y: auto; flex: 1; background: #eef1f4; }
.line-group-block { margin: 10px; overflow: hidden; border: 1px solid #d4dbe1; border-radius: 10px; background: #fff; }
.line-group-block.ungrouped { border-style: dashed; }
.line-drag-active .line-group-block { transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
.line-drag-active .line-group-block:not(.is-drop-target) { border-color: #aebbc6; }
.line-group-block.is-drop-target { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(39, 105, 199, .16); transform: translateY(-1px); }
.line-group-block.is-saving-drop { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36, 148, 111, .16); }
.line-group-head { display: flex; min-height: 44px; padding: 7px 10px; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: #f7f8fa; }
.line-group-rename, .line-group-title { display: flex; min-width: 0; align-items: center; gap: 8px; }
.line-group-rename { flex: 1; }
.line-group-rename input { width: min(260px, 100%); min-height: 31px; padding: 5px 7px; font-size: .73rem; font-weight: 800; }
.line-group-rename .count, .line-group-title .count { flex: 0 0 auto; }
.line-group-title strong { font-size: .74rem; }
.line-group-handle { color: var(--amber); font-size: .68rem; }
.line-group-handle.muted { color: var(--muted); }
.line-group-delete { font-size: .63rem; font-weight: 750; white-space: nowrap; }
.line-group-empty { padding: 18px; color: var(--muted); font-size: .68rem; text-align: center; }
.line-group-note { display: block; margin-top: 4px; color: var(--muted); font-size: .6rem; }
.line-group-block .project-items-scroll { max-height: none; }
.line-description-cell { display: flex; min-width: 190px; align-items: center; gap: 7px; }
.line-description-cell .description { min-width: 150px; flex: 1; }
.line-drag-grip { display: grid; width: 20px; height: 30px; flex: 0 0 20px; place-items: center; border-radius: 6px; color: #8996a1; font-size: .76rem; font-weight: 900; letter-spacing: -3px; cursor: grab; user-select: none; }
.line-drag-grip:hover { background: var(--blue-soft); color: var(--blue); }
.line-drag-grip:active { cursor: grabbing; }
[data-line-item-row].is-dragging { opacity: .38; }
.equipment-workbench { height: clamp(570px, calc(100vh - 285px), 760px); grid-template-columns: minmax(360px, .76fr) 9px minmax(540px, 1.24fr); gap: 0; overflow: hidden; border: 1px solid #cfd6dc; border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.equipment-workbench .project-pane { display: flex; min-height: 0; height: 100%; margin: 0; flex-direction: column; border: 0; border-radius: 0; box-shadow: none; }
.equipment-workbench .project-pane-head { min-height: 96px; flex: 0 0 auto; padding: 16px 18px 14px; }
.equipment-workbench .project-tree-search { flex: 0 0 auto; }
.equipment-workbench .project-equipment-tree { min-height: 0; max-height: none; flex: 1; overflow: auto; }
.equipment-workbench .project-items-scroll { min-height: 0; max-height: none; flex: 1; overflow: auto; }
.equipment-workbench .project-pane-empty { display: grid; min-height: 0; padding: 30px; flex: 1; place-content: center; }
.project-splitter { display: grid; z-index: 2; height: 100%; place-items: center; border-right: 1px solid #cbd3da; border-left: 1px solid #cbd3da; background: #eef1f4; cursor: col-resize; }
.project-splitter span { width: 3px; height: 34px; border-right: 1px dotted #7c8791; border-left: 1px dotted #7c8791; }
.crew-assignment-panel { margin-top: -4px; }
.crew-catalog { max-height: 548px; overflow-y: auto; }
.catalog-section + .catalog-section { border-top: 8px solid var(--paper); }
.catalog-heading { display: flex; min-height: 44px; padding: 10px 14px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #f7f8fa; }
.catalog-heading h3 { margin: 0; font-size: .74rem; text-transform: uppercase; }
.catalog-heading span { display: grid; min-width: 22px; height: 20px; padding: 0 6px; place-items: center; border-radius: 99px; background: #e6ebef; color: var(--muted); font-size: .6rem; font-weight: 800; }
.catalog-row { display: grid; min-height: 72px; padding: 9px 12px; align-items: center; grid-template-columns: minmax(135px, 1fr) 58px 58px auto; gap: 8px; border-bottom: 1px solid #edf0f2; }
.catalog-row:hover { background: #fafbfc; }
.catalog-row > div strong, .catalog-row > div small { display: block; }
.catalog-row > div strong { font-size: .73rem; }
.catalog-row > div small { margin-top: 3px; color: var(--muted); font-size: .59rem; }
.catalog-row label span { display: block; margin-bottom: 3px; color: var(--muted); font-size: .53rem; text-transform: uppercase; }
.catalog-row input { min-height: 32px; padding: 5px 6px; }
.vehicle-catalog-row { grid-template-columns: minmax(160px, 1fr) 60px auto; }
.project-cost-form { padding: 22px; }
.schedule-editor { overflow: hidden; }
.schedule-form { display: grid; padding: 26px; align-items: end; grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr) auto; gap: 16px; border-top: 1px solid var(--line); }
.schedule-form label > span { display: block; margin-bottom: 7px; }
.schedule-arrow { padding-bottom: 10px; color: #a3adb6; font-size: 1.5rem; }
.schedule-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); background: #fafbfc; }
.schedule-summary div { min-height: 96px; padding: 24px; border-right: 1px solid var(--line); }
.schedule-summary div:last-child { border-right: 0; }
.schedule-summary span, .schedule-summary strong { display: block; }
.schedule-summary span { margin-bottom: 7px; color: var(--muted); font-size: .63rem; font-weight: 800; text-transform: uppercase; }
.schedule-summary strong { font-size: .78rem; }
.financial-grid { display: grid; margin-bottom: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.finance-card { min-height: 108px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.finance-card span, .finance-card strong { display: block; }
.finance-card span { margin-bottom: 15px; color: var(--muted); font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.finance-card strong { font-size: 1.35rem; }
.finance-card small { display: block; margin-top: 8px; color: var(--muted); font-size: .61rem; }
.finance-card.primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.finance-card.primary span { color: #9fafbd; }
.financial-layout { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; }
.financial-table-panel { overflow: hidden; }
.financial-groups { min-width: 0; }
.financial-group-panel { overflow: hidden; }
.financial-group-panel .panel-head { border-bottom: 1px solid var(--line); }
.financial-group-panel .eyebrow { margin-bottom: 5px; font-size: .58rem; }
.group-price { text-align: right; }
.group-price span, .group-price strong { display: block; }
.group-price span { margin-bottom: 5px; color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.group-price strong { font-size: 1rem; }
.group-totals { display: flex; padding: 13px 20px; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 18px; border-top: 1px solid var(--line); background: #fafbfc; }
.group-totals span { color: var(--muted); font-size: .67rem; }
.group-totals strong { margin-left: 5px; color: var(--ink); }
.offer-total-panel { display: flex; padding: 18px 22px; justify-content: flex-end; flex-wrap: wrap; gap: 28px; }
.offer-total-panel div { min-width: 120px; text-align: right; }
.offer-total-panel span, .offer-total-panel strong { display: block; }
.offer-total-panel span { margin-bottom: 5px; color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.offer-total-panel strong { font-size: .92rem; }
.offer-total-panel .grand strong { font-size: 1.25rem; }
.financial-settings { overflow: hidden; }
.financial-settings .stack-form { padding: 0 22px 22px; }
.print-choice { display: grid; padding: 20px 22px 22px; gap: 9px; border-top: 1px solid var(--line); background: #fafbfc; }
.print-choice h3 { margin: 0; font-size: .85rem; }
.print-choice p { margin: 0 0 5px; color: var(--muted); font-size: .67rem; line-height: 1.45; }

.staff-functions-panel { overflow: hidden; }
.staff-function-grid { display: grid; padding: 0 20px 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.staff-function-card { display: grid; min-height: 72px; padding: 13px; align-items: center; grid-template-columns: 38px 1fr auto; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.staff-function-card:hover { border-color: #bfc8d0; background: #fff; }
.staff-function-card .stat-icon { width: 36px; height: 36px; flex-basis: 36px; }
.staff-function-card strong, .staff-function-card small { display: block; }
.staff-function-card strong { font-size: .78rem; }
.staff-function-card small { margin-top: 4px; color: var(--muted); font-size: .63rem; }
.employees-title { margin-top: 32px; }

.quote-layout { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; }
.quote-main { min-width: 0; }
.sticky-panel { position: sticky; top: 24px; padding: 0 20px 20px; }
.sticky-panel .panel-head { padding-right: 0; padding-left: 0; }
.sticky-panel hr { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }
.availability-warning { margin-bottom: 20px; padding: 17px 20px; border: 1px solid #eac777; border-radius: 13px; background: #fff8e7; color: #6b4b0f; }
.availability-warning p { margin: 4px 0 0; font-size: .79rem; }
.availability-warning ul { margin: 12px 0 0; padding-left: 20px; font-size: .76rem; }
.quote-table { min-width: 980px; }
.quote-table th, .quote-table td { padding-right: 9px; padding-left: 9px; }
.table-input { min-height: 34px; padding: 6px 7px; font-size: .74rem; }
.table-input.description { min-width: 160px; }
.table-input.numeric { width: 78px; }
.table-input.unit { width: 72px; }
.table-input.group-select { min-width: 120px; }

@media (pointer: coarse) {
  .line-drag-grip, .line-drag-hint { display: none; }
}
.type-label { font-size: .65rem; font-weight: 750; }
.type-label.equipment { color: #9a650b; }
.type-label.employee { color: var(--blue); }
.type-label.vehicle { color: var(--green); }
.type-label.custom { color: var(--violet); }
.table-actions { display: flex; align-items: center; gap: 8px; }
.table-actions form { display: inline; }
.danger-link { padding: 4px 6px; border: 0; background: transparent; color: var(--red); font-size: 1.1rem; cursor: pointer; }
.totals { width: min(360px, 100%); margin: 18px 22px 22px auto; }
.totals > div { display: flex; padding: 7px 0; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .78rem; }
.totals strong { color: var(--ink); }
.totals .grand-total { margin-top: 8px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--ink); font-size: 1rem; }
.totals .grand-total strong { font-size: 1.25rem; }
.add-resources { padding-bottom: 20px; }
.add-grid { display: grid; padding: 0 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.add-card { display: grid; padding: 15px; gap: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.add-card-title { display: flex; align-items: center; gap: 9px; }
.add-card-title .stat-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; font-size: .88rem; }
.add-card-hint { margin: -5px 0 0; color: var(--muted); font-size: .64rem; }
.crew-planner { overflow: hidden; }
.crew-resource-adders { display: grid; padding: 0 20px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.crew-divider { display: flex; padding: 14px 20px; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f7f8fa; }
.crew-divider strong { font-size: .76rem; }
.crew-divider span { color: var(--muted); font-size: .63rem; }
.crew-checklist { padding: 0 20px 20px; }
.crew-checklist-grid { display: grid; padding-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.crew-choice { display: grid; min-height: 64px; padding: 10px 12px; align-items: center; grid-template-columns: 18px 34px minmax(0, 1fr) auto; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; cursor: pointer; }
.crew-choice:hover { border-color: #b8c2cc; background: #fff; }
.crew-choice:has(input:checked) { border-color: #9fc7ff; background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.crew-choice input { width: 17px; min-height: 17px; margin: 0; }
.crew-choice .avatar { width: 32px; height: 32px; }
.crew-choice-name strong, .crew-choice-name small { display: block; }
.crew-choice-name strong { font-size: .76rem; }
.crew-choice-name small { margin-top: 3px; color: var(--muted); font-size: .61rem; }
.crew-save { display: flex; margin-top: 14px; padding-top: 14px; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); }
.crew-save p { margin: 0; color: var(--muted); font-size: .65rem; }
.equipment-tree-panel { overflow: hidden; }
.equipment-tree-head { display: grid; min-height: 38px; padding: 0 20px 0 58px; align-items: center; grid-template-columns: minmax(220px, 1fr) 82px 120px 94px 55px; gap: 12px; border-bottom: 1px solid var(--line); background: #f7f8fa; color: #77828d; font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.equipment-tree-body { padding: 5px 0; }
.equipment-tree-category { border-bottom: 1px solid #edf0f2; }
.equipment-tree-category:last-child { border-bottom: 0; }
.equipment-tree-category summary { display: flex; min-height: 46px; padding: 8px 20px; align-items: center; gap: 9px; background: #fbfcfd; cursor: pointer; list-style: none; user-select: none; }
.equipment-tree-category summary::-webkit-details-marker { display: none; }
.equipment-tree-category summary:hover { background: #f6f8fa; }
.equipment-tree-category summary strong { font-size: .78rem; }
.tree-chevron { color: #768491; font-size: 1.15rem; transform: rotate(0deg); transition: transform .15s ease; }
.equipment-tree-category[open] > summary .tree-chevron { transform: rotate(90deg); }
.tree-folder { color: var(--amber); font-size: .7rem; }
.muted-folder { color: #9aa5af; }
.tree-count { display: inline-grid; min-width: 24px; height: 20px; padding: 0 6px; place-items: center; border-radius: 99px; background: #e8edf2; color: #697683; font-size: .62rem; font-weight: 800; }
.tree-edit { margin-left: auto; color: #2769c7; font-size: .68rem; font-weight: 750; }
.equipment-tree-children { margin-left: 27px; border-left: 1px solid #dce3e9; }
.equipment-tree-item { display: grid; min-height: 58px; padding: 8px 20px 8px 14px; align-items: center; grid-template-columns: 28px minmax(190px, 1fr) 82px 120px 94px 55px; gap: 12px; border-top: 1px solid #edf0f2; }
.equipment-tree-item:hover, .quote-equipment-item:hover { background: #fafbfc; }
.equipment-symbol { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: var(--amber-soft); color: #a56a0b; font-size: .84rem; font-weight: 800; }
.equipment-tree-name strong, .equipment-tree-name small, .equipment-tree-stat strong, .equipment-tree-stat small { display: block; }
.equipment-tree-name strong { font-size: .79rem; }
.equipment-tree-name small { min-height: 13px; margin-top: 3px; color: var(--muted); font-size: .61rem; }
.equipment-tree-stat small { margin-bottom: 3px; color: var(--muted); font-size: .57rem; text-transform: uppercase; }
.equipment-tree-stat strong { font-size: .74rem; }
.tree-search { min-width: min(560px, 100%); }
.tree-no-results { border-top: 1px solid var(--line); }
.category-danger { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.category-danger p { margin: 6px 0 0; font-size: .75rem; }

.equipment-picker { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.equipment-picker-head { display: flex; padding: 14px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: #f7f8fa; }
.equipment-picker-head > div:first-child { display: flex; align-items: center; gap: 10px; }
.equipment-picker-head strong, .equipment-picker-head small, .quote-equipment-name strong, .quote-equipment-name small, .availability-number small, .availability-number strong { display: block; }
.equipment-picker-head small { margin-top: 3px; color: var(--muted); font-size: .64rem; }
.compact-tree-search { display: flex; min-width: min(360px, 48%); gap: 7px; }
.compact-tree-search input { min-height: 36px; }
.quote-equipment-tree { max-height: 520px; overflow-y: auto; }
.quote-tree-category summary { min-height: 42px; padding: 7px 14px; }
.quote-tree-category .equipment-tree-children { margin-left: 22px; }
.quote-equipment-item { display: grid; min-height: 55px; padding: 7px 12px; align-items: center; grid-template-columns: 28px minmax(150px, 1fr) 62px 70px auto; gap: 10px; border-top: 1px solid #edf0f2; }
.quote-equipment-name strong { font-size: .75rem; }
.quote-equipment-name small { margin-top: 3px; color: var(--muted); font-size: .6rem; }
.availability-number { text-align: right; }
.availability-number small { color: var(--muted); font-size: .55rem; text-transform: uppercase; }
.availability-number strong { margin-top: 2px; font-size: .76rem; }
.availability-number.negative strong { color: var(--red); }
.tree-quantity { display: flex; align-items: center; gap: 6px; }
.tree-quantity span { color: var(--muted); font-size: .58rem; }
.tree-quantity input { width: 54px; min-height: 32px; padding: 5px 6px; }
.status-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.status-actions .field-label { grid-column: 1 / -1; margin-bottom: 2px; }
.status-button { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: .7rem; font-weight: 750; cursor: pointer; }
.status-button:hover { border-color: #aeb8c1; }

.warehouse-project { overflow: hidden; }
.warehouse-head { display: flex; padding: 22px 24px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.warehouse-head h2 { margin: 7px 0 4px; }
.warehouse-head p { margin: 0; color: var(--muted); font-size: .76rem; }
.warehouse-items { padding: 4px 24px; }
.warehouse-warning { display: flex; padding: 10px 24px; align-items: flex-start; gap: 10px; border-bottom: 1px solid #efd89d; background: var(--amber-soft); color: #79500c; font-size: .68rem; }
.warehouse-warning strong { flex: 0 0 auto; }
.warehouse-row { display: grid; min-height: 78px; align-items: center; grid-template-columns: minmax(180px, 1fr) minmax(130px, .7fr) minmax(130px, .7fr) auto; gap: 24px; border-bottom: 1px solid #edf0f2; }
.warehouse-row:last-child { border-bottom: 0; }
.warehouse-name strong, .warehouse-name small, .progress-block small { display: block; }
.warehouse-name strong { font-size: .84rem; }
.warehouse-name small, .progress-block small { margin-top: 5px; color: var(--muted); font-size: .65rem; }
.progress { height: 5px; overflow: hidden; border-radius: 99px; background: #e8ecf0; }
.progress span { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--blue); }
.progress-block.returned .progress span { background: var(--green); }
.warehouse-actions { display: flex; gap: 6px; }

.calendar-panel { overflow: hidden; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); background: #f7f8fa; }
.calendar-weekdays span { padding: 10px; color: var(--muted); font-size: .65rem; font-weight: 800; text-align: center; }
.calendar-day { min-height: 145px; padding: 9px; border-right: 1px solid #edf0f2; border-bottom: 1px solid #edf0f2; background: #fff; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { background: #fafbfc; color: #b3bbc3; }
.calendar-day.today .day-number { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; }
.day-number { margin-bottom: 7px; font-size: .72rem; font-weight: 800; }
.day-events { display: grid; gap: 5px; }
.calendar-event { display: block; padding: 7px; overflow: hidden; border-left: 3px solid var(--blue); border-radius: 6px; background: var(--blue-soft); }
.calendar-event.confirmed { border-color: var(--green); background: var(--green-soft); }
.calendar-event strong, .calendar-event small, .calendar-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event strong { font-size: .66rem; }
.calendar-event small { margin-top: 2px; color: var(--muted); font-size: .57rem; }
.calendar-event span { margin-top: 4px; color: #275d4b; font-size: .57rem; font-weight: 700; }
.calendar-event .no-crew { color: #9a650b; }

.section-title { display: flex; margin: 0 0 16px; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-title h2 { margin-bottom: 4px; font-size: 1.25rem; }
.my-upcoming { margin-bottom: 36px; }
.job-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.job-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.job-card.pending { border-top: 3px solid var(--amber); }
.job-card.accepted { border-top: 3px solid var(--green); }
.job-card.declined { border-top: 3px solid var(--red); }
.job-card-link { display: grid; min-height: 160px; padding: 20px; align-items: start; grid-template-columns: 58px 1fr 14px; gap: 15px; }
.job-card-link:hover { background: #fafbfc; }
.job-date { display: grid; width: 56px; height: 64px; place-items: center; align-content: center; border-radius: 13px; background: var(--ink); color: #fff; }
.job-date strong, .job-date span { display: block; }
.job-date strong { font-size: 1.45rem; line-height: 1; }
.job-date span { margin-top: 5px; color: #aeb9c3; font-size: .62rem; }
.job-card-main h3 { margin: 13px 0 6px; font-size: 1.05rem; }
.job-card-main p { margin: 3px 0; color: var(--muted); font-size: .73rem; }
.job-card-main .job-location { color: var(--ink); font-weight: 700; }
.quick-response { display: grid; padding: 12px 20px; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); background: #fafbfc; }
.quick-response form { display: flex; }
.quick-response .button { width: 100%; }
.button.accept { border-color: #a5d7c5; background: var(--green-soft); color: #146d50; }
.button.accept:hover { background: #d4f1e6; }
.button.decline { border-color: #efc0c0; background: #fff; color: #a43d3d; }
.button.decline:hover { background: var(--red-soft); }
.calendar-event.personal.pending { border-color: var(--amber); background: var(--amber-soft); }
.calendar-event.personal.accepted { border-color: var(--green); background: var(--green-soft); }
.calendar-event.personal.declined { border-color: var(--red); background: var(--red-soft); opacity: .72; }
.employee-job-layout { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; }
.job-hero { display: grid; padding: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.job-fact { display: flex; min-height: 84px; padding: 15px; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fafbfc; }
.job-fact small, .job-fact strong { display: block; }
.job-fact small { margin-bottom: 4px; color: var(--muted); font-size: .65rem; font-weight: 750; text-transform: uppercase; }
.job-fact strong { font-size: .87rem; }
.job-notes { padding-bottom: 22px; }
.job-notes > p { margin: 0; padding: 0 24px; color: #4f5c67; font-size: .82rem; line-height: 1.65; white-space: pre-line; }
.team-list { border-top: 1px solid var(--line); }
.team-row { display: grid; min-height: 66px; padding: 10px 24px; align-items: center; grid-template-columns: 36px 1fr auto; gap: 12px; border-bottom: 1px solid #edf0f2; }
.team-row:last-child { border-bottom: 0; }
.team-row strong, .team-row small { display: block; }
.team-row strong { font-size: .8rem; }
.team-row small { margin-top: 3px; color: var(--muted); font-size: .65rem; }
.team-row .stat-icon { width: 36px; height: 36px; flex-basis: 36px; }
.employee-response { position: sticky; top: 24px; padding: 24px; }
.employee-response h2 { margin: 0 0 6px; font-size: 1.3rem; }
.employee-response > .muted { font-size: .75rem; line-height: 1.5; }
.response-summary { margin: 20px 0 14px; padding: 12px; border-radius: 10px; font-size: .75rem; font-weight: 800; text-align: center; }
.response-summary.pending { background: var(--amber-soft); color: #895806; }
.response-summary.accepted { background: var(--green-soft); color: #146b4e; }
.response-summary.declined { background: var(--red-soft); color: #983a3a; }
.response-buttons { display: grid; gap: 8px; }

.flash-stack { position: fixed; z-index: 50; top: 18px; right: 20px; display: grid; max-width: 390px; gap: 8px; }
.flash { padding: 12px 15px; border: 1px solid #cbd3da; border-radius: 10px; background: #fff; box-shadow: var(--shadow); font-size: .78rem; font-weight: 650; }
.flash.success { border-color: #a8dcca; background: var(--green-soft); color: #166b50; }
.flash.error { border-color: #efb9b9; background: var(--red-soft); color: #933636; }
.flash.warning { border-color: #eac777; background: var(--amber-soft); color: #80540a; }

.login-page { display: grid; min-height: 100vh; padding: 22px; place-items: center; background: radial-gradient(circle at top left, #253749, var(--ink) 55%); }
.login-card { display: grid; width: min(420px, 100%); padding: 38px; gap: 34px; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; background: #fff; box-shadow: 0 32px 100px rgba(0,0,0,.35); }
.login-brand { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.login-brand strong { color: var(--ink); }
.login-brand small { color: var(--muted); }

.print-page { background: #dfe3e7; }
.print-toolbar { display: flex; max-width: 900px; margin: 20px auto; justify-content: flex-end; gap: 8px; }
.quote-document { width: 900px; min-height: 1180px; margin: 0 auto 50px; padding: 58px 62px; background: #fff; box-shadow: 0 12px 45px rgba(0,0,0,.15); }
.document-head { display: flex; padding-bottom: 36px; align-items: flex-start; justify-content: space-between; border-bottom: 3px solid var(--ink); }
.document-head > div:last-child { text-align: right; }
.document-head h1 { margin: 0; font-size: 2rem; }
.document-head p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; white-space: pre-line; }
.document-brand { font-size: 1.35rem; font-weight: 900; letter-spacing: -.04em; }
.document-intro { display: grid; padding: 32px 0; grid-template-columns: repeat(2, 1fr); gap: 40px; }
.document-intro span, .document-summary span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.document-intro strong { display: block; font-size: 1rem; }
.document-intro p { margin: 6px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.document-group { margin-top: 24px; break-inside: avoid; }
.document-group-head { display: flex; min-height: 42px; padding: 9px 12px; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--line); border-bottom: 0; background: #f4f6f8; }
.document-group-head h2 { margin: 0; font-size: .87rem; text-transform: uppercase; }
.document-group-head strong { font-size: .78rem; }
.document-table th { background: var(--ink); color: #fff; }
.document-table td { font-size: .75rem; }
.document-table td:first-child { width: 42%; }
.document-table .document-subgroup td { padding: 7px 10px; border-top: 1px solid #cfd6dc; border-bottom: 1px solid #dfe4e8; background: #eef1f4; color: #56636f; font-size: .63rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.document-empty { margin: 0; padding: 18px; border: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.document-group-total { display: flex; min-height: 38px; padding: 8px 12px; align-items: center; justify-content: flex-end; gap: 18px; border: 1px solid var(--line); border-top: 0; color: var(--muted); font-size: .65rem; }
.document-group-total strong { color: var(--ink); font-size: .78rem; }
.document-summary { display: grid; margin-top: 30px; grid-template-columns: 1fr 320px; gap: 55px; }
.document-summary p { color: var(--muted); font-size: .75rem; white-space: pre-line; }
.document-summary .totals { width: 100%; margin: 0; }
.summary-final-total { align-self: start; padding: 22px; border-radius: 12px; background: var(--ink); color: #fff; text-align: right; }
.summary-final-total span, .summary-final-total strong, .summary-final-total small { display: block; }
.summary-final-total span { color: #aeb9c3; font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.summary-final-total strong { margin: 8px 0 5px; font-size: 1.65rem; }
.summary-final-total small { color: #aeb9c3; font-size: .61rem; }
.packing-preview { overflow: hidden; }
.packing-document .document-group { margin-top: 10px; }
.packing-table td:first-child { width: auto; }
.packing-table td:last-child { width: 70px; text-align: center; }
.packing-check { font-size: 1.2rem; }
.packing-notes { margin-top: 28px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.packing-notes span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.packing-notes p { margin: 0; font-size: .75rem; white-space: pre-line; }
.quote-document footer { margin-top: 70px; padding-top: 16px; border-top: 1px solid var(--line); color: #929ca5; font-size: .65rem; text-align: center; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .quote-side { grid-row: 1; }
  .compact-form { grid-template-columns: repeat(2, 1fr); }
  .compact-form > button, .compact-form > label:last-of-type { grid-column: 1 / -1; }
  .warehouse-row { grid-template-columns: minmax(180px, 1fr) minmax(120px, .7fr) minmax(120px, .7fr); padding: 12px 0; }
  .warehouse-actions { grid-column: 1 / -1; }
  .employee-job-layout { grid-template-columns: 1fr; }
  .employee-response { position: static; grid-row: 1; }
  .staff-function-grid { grid-template-columns: repeat(2, 1fr); }
  .project-settings-grid, .project-split, .financial-layout { grid-template-columns: 1fr; }
  .equipment-workbench { height: auto; border: 0; border-radius: 0; overflow: visible; background: transparent; box-shadow: none; }
  .equipment-workbench .project-pane { min-height: 560px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
  .project-splitter { display: none; }
  .project-pane { min-height: 560px; }
  .project-equipment-tree, .crew-catalog, .project-items-scroll { max-height: 440px; }
  .financial-settings { grid-row: 1; }
}

@media (max-width: 860px) {
  .sidebar { inset: auto 0 0; width: 100%; height: 67px; padding: 7px 8px; box-shadow: 0 -8px 28px rgba(0,0,0,.2); }
  .sidebar > .brand, .sidebar-user, .nav-label { display: none; }
  .nav { margin: 0; flex-direction: row; gap: 2px; overflow-x: auto; }
  .nav a { min-width: 74px; min-height: 52px; padding: 5px 7px; flex-direction: column; justify-content: center; gap: 2px; font-size: .58rem; }
  .nav a span { font-size: .92rem; }
  .main { margin-left: 0; padding: 24px 18px 98px; }
  .mobile-head { display: flex; margin-bottom: 28px; }
  .mobile-head .brand strong { font-size: .9rem; }
  .page-head { align-items: flex-start; }
  .calendar-day { min-height: 110px; padding: 6px; }
  .calendar-event span { display: none; }
  .equipment-tree-head { display: none; }
  .equipment-tree-item { grid-template-columns: 28px minmax(150px, 1fr) 65px 50px; }
  .equipment-tree-item .equipment-tree-stat:nth-of-type(2), .equipment-tree-item .badge { display: none; }
  .equipment-picker-head { align-items: stretch; flex-direction: column; }
  .compact-tree-search { min-width: 100%; }
  .project-tabbar { top: -1px; }
  .schedule-form { grid-template-columns: 1fr; }
  .schedule-arrow { display: none; }
  .schedule-form .button { width: 100%; }
  .financial-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 650px) {
  .page-head { flex-direction: column; }
  .page-head .button.primary { width: 100%; }
  .head-actions { width: 100%; justify-content: flex-start; }
  .stats-grid, .card-grid, .add-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 108px; }
  .form-grid, .compact-form { grid-template-columns: 1fr; }
  .span-2, .compact-form > button, .compact-form > label:last-of-type { grid-column: auto; }
  .project-row { grid-template-columns: 44px 1fr 12px; padding-right: 16px; padding-left: 16px; }
  .project-meta { display: none; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .filter-pills { overflow-x: auto; }
  .resource-cards { grid-template-columns: 1fr; }
  .warehouse-head { align-items: flex-start; flex-direction: column; }
  .warehouse-items { padding: 4px 16px; }
  .warehouse-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .warehouse-name, .warehouse-actions { grid-column: 1 / -1; }
  .calendar-panel { overflow-x: auto; }
  .calendar-weekdays, .calendar-grid { min-width: 720px; }
  .flash-stack { right: 12px; left: 12px; max-width: none; }
  .dialog form { padding: 20px; }
  .login-card { padding: 28px; }
  .job-card-grid { grid-template-columns: 1fr; }
  .job-card-link { grid-template-columns: 50px 1fr 12px; padding: 16px; }
  .job-date { width: 48px; height: 56px; }
  .job-hero { grid-template-columns: 1fr; padding: 16px; }
  .job-fact.span-all { grid-column: auto; }
  .equipment-tree-item { grid-template-columns: 28px minmax(120px, 1fr) 46px; padding-right: 12px; }
  .equipment-tree-item .equipment-tree-stat, .equipment-tree-item .badge { display: none; }
  .equipment-tree-category summary { padding-right: 12px; padding-left: 12px; }
  .equipment-tree-children { margin-left: 16px; }
  .quote-equipment-item { grid-template-columns: 27px minmax(110px, 1fr) 56px auto; }
  .quote-equipment-item .availability-number { display: none; }
  .quote-equipment-item .button { grid-column: 2 / -1; }
  .category-danger { align-items: flex-start; flex-direction: column; }
  .staff-function-grid, .crew-checklist-grid, .crew-resource-adders { grid-template-columns: 1fr; }
  .crew-choice { grid-template-columns: 18px 32px minmax(0, 1fr); }
  .crew-choice .badge { grid-column: 3; justify-self: start; }
  .crew-save { align-items: stretch; flex-direction: column; }
  .crew-divider { align-items: flex-start; flex-direction: column; }
  .project-pane { min-height: auto; }
  .project-pane-head { min-height: 0; flex-direction: column; }
  .project-equipment-tree, .crew-catalog, .project-items-scroll { max-height: 520px; }
  .line-group-toolbar { align-items: stretch; flex-direction: column; }
  .line-group-create input, .line-group-target { width: 100%; }
  .line-group-head { align-items: stretch; flex-direction: column; }
  .line-group-rename { flex-wrap: wrap; }
  .line-group-rename input { flex: 1; }
  .catalog-row { grid-template-columns: minmax(120px, 1fr) 54px 54px; }
  .catalog-row .button { grid-column: 1 / -1; }
  .vehicle-catalog-row { grid-template-columns: minmax(120px, 1fr) 58px; }
  .schedule-summary, .financial-grid { grid-template-columns: 1fr; }
  .schedule-summary div { border-right: 0; border-bottom: 1px solid var(--line); }
  .project-form { padding-right: 16px; padding-left: 16px; }
}

@media print {
  @page { size: A4; margin: 0; }
  body.print-page { background: #fff; }
  .print-toolbar { display: none; }
  .quote-document { width: 210mm; min-height: 297mm; margin: 0; padding: 14mm 16mm; box-shadow: none; }
  .document-head { padding-bottom: 9mm; }
  .document-summary { break-inside: avoid; }
}
