:root {
  --empire-blue: #0d7ff2;
  --empire-blue-dark: #075db7;
  --empire-blue-soft: #e7f2ff;
  --steel-950: #0b1623;
  --steel-800: #273746;
  --steel-650: #596b79;
  --steel-500: #71808b;
  --steel-300: #c8d0d6;
  --steel-200: #dfe4e8;
  --steel-100: #edf1f3;
  --steel-050: #eef2f5;
  --white: #fff;
  --red: #b42318;
  --red-soft: #fff0ed;
  --green: #177245;
  --green-soft: #eaf7f0;
  --amber: #8d5b00;
  --amber-soft: #fff7e5;
  --shadow: 0 14px 34px rgba(11, 22, 35, .13);
  --shadow-soft: 0 4px 14px rgba(11, 22, 35, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 760px; background: #f6f7fb; color: #0f172a; font-family: "Open Sans", "Segoe UI", Arial, sans-serif; font-size: 15px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, h1, h2, h3, h4, .brand, .user-block { font-family: "Poppins", "Segoe UI", Arial, sans-serif; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(8, 103, 178, .24); outline-offset: 1px; }

.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 32px; border-top: 6px solid var(--empire-blue); background: #eef3f7; }
.auth-gate[hidden] { display: none; }
.auth-panel { width: min(440px, calc(100vw - 64px)); border: 1px solid #b8c9d7; border-radius: 8px; background: var(--white); padding: 36px; box-shadow: 0 24px 60px rgba(11,22,35,.18); text-align: center; }
.auth-panel img { width: 180px; height: 74px; object-fit: contain; }
.auth-panel p { margin: 22px 0 4px; color: var(--empire-blue-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.auth-panel h1 { margin: 0; color: var(--steel-950); font-size: 27px; }
.auth-panel > span { display: block; margin: 10px 0 25px; color: var(--steel-650); font-size: 14px; }
.auth-sign-in { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #0b5fc2; border-radius: 5px; background: var(--empire-blue); color: var(--white); font-weight: 800; box-shadow: 0 5px 12px rgba(13,127,242,.2); }
.auth-sign-in[hidden] { display: none; }
.auth-sign-in:hover { background: var(--empire-blue-dark); }
.auth-sign-in:disabled { cursor: wait; opacity: .7; }
.auth-google-mark { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 3px; background: var(--white); color: #1769d1; font: 800 14px/1 "Open Sans", sans-serif; }
.auth-panel > small { display: block; margin-top: 18px; color: var(--steel-500); font-size: 11px; }
.auth-error { margin-top: 14px; border-left: 3px solid var(--red); background: var(--red-soft); color: var(--red); padding: 10px 12px; font-size: 12px; font-weight: 700; text-align: left; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 68px minmax(0, 1fr); }
.sidebar { position: sticky; z-index: 40; top: 76px; width: 68px; height: calc(100vh - 76px); display: flex; flex-direction: column; overflow: hidden; background: #f8fafc; color: #172334; border-right: 1px solid #cbd6df; box-shadow: 3px 0 10px rgba(15,23,42,.06); transition: width .18s ease, box-shadow .18s ease; }
.sidebar:hover, .sidebar:focus-within { width: 228px; box-shadow: 8px 0 24px rgba(15,23,42,.16); }
.sidebar nav { min-width: 228px; display: grid; gap: 4px; padding: 12px 8px; }
.sidebar nav button { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 14px; border: 0; border-radius: 5px; background: transparent; color: #263647; padding: 7px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; text-align: left; }
.sidebar nav button:hover { background: #e8f3ff; color: #075db7; }
.sidebar nav button.active { background: var(--empire-blue); color: var(--white); box-shadow: 0 4px 10px rgba(13,127,242,.2); }
.nav-icon { flex: 0 0 27px; display: block; min-width: 27px; height: 27px; background: currentColor; -webkit-mask: var(--nav-icon) center / 20px 20px no-repeat; mask: var(--nav-icon) center / 20px 20px no-repeat; }
.nav-label { overflow: hidden; opacity: 0; text-overflow: ellipsis; transition: opacity .12s ease; }
.sidebar:hover .nav-label, .sidebar:focus-within .nav-label { opacity: 1; transition-delay: .05s; }
.user-block { display: flex; gap: 9px; align-items: center; justify-content: flex-end; min-width: 156px; padding-left: 14px; border-left: 1px solid rgba(16,110,234,.16); background: var(--white); }
.user-block > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #e9f2ff; color: #0b4fb3; font-weight: 800; }
.user-block strong, .user-block small { display: block; }
.user-block strong { font-size: 13px; }
.user-block small { color: var(--steel-650); font-size: 10px; margin-top: 2px; }
.sidebar .user-block { flex: 0 0 60px; min-width: 228px; justify-content: flex-start; margin-top: auto; padding: 9px 18px; border-top: 1px solid #dce4ea; border-left: 0; background: #f8fafc; }
.sidebar .user-block > div { opacity: 0; white-space: nowrap; transition: opacity .12s ease; }
.sidebar:hover .user-block > div, .sidebar:focus-within .user-block > div { opacity: 1; transition-delay: .05s; }
.user-signout { width: 32px; height: 32px; display: grid; place-items: center; margin-left: auto; border: 0; border-radius: 4px; background: transparent; color: var(--steel-650); opacity: 0; }
.user-signout .nav-icon { min-width: 22px; width: 22px; height: 22px; }
.sidebar:hover .user-signout, .sidebar:focus-within .user-signout { opacity: 1; }
.user-signout:hover { background: #e5edf4; color: var(--empire-blue-dark); }

.main { min-width: 0; }
.topbar { position: sticky; z-index: 50; top: 0; width: calc(100% + 68px); min-height: 76px; margin-left: -68px; display: grid; grid-template-columns: 126px 180px minmax(300px, 640px) 1fr; gap: 15px; align-items: center; padding: 8px 18px; background: rgba(255,255,255,.98); border-top: 5px solid var(--empire-blue); border-bottom: 1px solid var(--steel-300); box-shadow: 0 3px 12px rgba(11,22,35,.07); }
.topbar-brand { min-width: 0; display: flex; align-items: center; }
.topbar-brand img { width: 116px; height: 47px; object-fit: contain; object-position: left center; }
.page-heading p, .record-header p, .form-dialog header p { margin: 0 0 3px; color: var(--empire-blue-dark); font-size: 10px; text-transform: uppercase; font-weight: 800; }
.form-dialog header > div { min-width: 0; }
.form-dialog header p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-heading h1 { margin: 0; font-size: 23px; line-height: 1.15; }
.global-search-wrap { position: relative; }
.global-search-wrap > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.global-search-wrap > input { width: 100%; min-height: 40px; border: 1px solid #b9c6cf; border-radius: 6px; padding: 8px 12px 8px 36px; background: #f8fafb; box-shadow: inset 0 1px 2px rgba(11,22,35,.04); }
.global-search-wrap::before { content: ""; position: absolute; left: 14px; top: 12px; width: 10px; height: 10px; border: 2px solid var(--steel-500); border-radius: 50%; }
.global-search-wrap::after { content: ""; position: absolute; left: 25px; top: 23px; width: 7px; height: 2px; background: var(--steel-500); transform: rotate(45deg); }
.search-results { position: absolute; z-index: 50; top: 44px; left: 0; right: 0; max-height: 70vh; overflow: auto; background: var(--white); border: 1px solid var(--steel-300); box-shadow: var(--shadow); border-radius: 4px; }
.search-results section + section { border-top: 1px solid var(--steel-200); }
.search-results h3 { margin: 0; padding: 8px 12px 4px; font-size: 10px; color: var(--steel-500); text-transform: uppercase; }
.search-results button { display: flex; justify-content: space-between; gap: 14px; width: 100%; border: 0; background: transparent; padding: 8px 12px; text-align: left; }
.search-results button:hover { background: #eef7fd; }
.search-results button span { color: var(--steel-650); font-size: 12px; }
.search-empty { padding: 18px; color: var(--steel-650); text-align: center; }
.quick-actions, .section-actions, .record-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.quick-actions button { white-space: nowrap; }
.save-status { display: inline-flex; align-items: center; gap: 6px; min-width: 104px; color: var(--steel-600); font-size: 11px; white-space: nowrap; }
.save-status > span { width: 8px; height: 8px; border-radius: 50%; background: #89959f; }
.save-status[data-state="saving"] > span, .save-status[data-state="loading"] > span { background: #d69c12; animation: save-pulse 1s infinite alternate; }
.save-status[data-state="saved"] > span { background: #168052; }
.save-status[data-state="error"] { color: var(--red); }
.save-status[data-state="error"] > span { background: var(--red); }
.save-status button { border: 0; background: transparent; color: var(--empire-blue); padding: 0; font-size: 11px; font-weight: 700; }
@keyframes save-pulse { to { opacity: .35; } }

.primary, .secondary, .text-button, .back-button, .dialog-close { border-radius: 5px; font-weight: 700; min-height: 34px; padding: 7px 12px; }
.primary { border: 1px solid var(--empire-blue); background: var(--empire-blue); color: var(--white); box-shadow: 0 4px 10px rgba(13,127,242,.2); }
.primary:hover { background: var(--empire-blue-dark); border-color: var(--empire-blue-dark); transform: translateY(-1px); }
.secondary { border: 1px solid #b9c6cf; background: var(--white); color: var(--steel-800); box-shadow: 0 2px 5px rgba(11,22,35,.06); }
.secondary:hover { background: var(--steel-100); }
.text-button, .back-button, .dialog-close { border: 0; background: transparent; color: var(--empire-blue-dark); padding: 4px 7px; min-height: 28px; }
.back-button { grid-column: 1; justify-self: start; }

.view { padding: 12px 18px 28px; }
.view-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.job-today-strip { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.job-summary-stat { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border: 1px solid var(--steel-200); border-radius: 4px; background: var(--white); padding: 8px 12px; text-align: left; }
.job-summary-stat span { color: var(--steel-650); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.job-summary-stat strong { font-size: 18px; }
.job-summary-stat.danger { border-left: 4px solid var(--red); }
.workload-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.workload-controls { display: flex; align-items: flex-end; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.workload-controls label { display: grid; gap: 3px; color: var(--steel-650); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.workload-controls select { min-height: 31px; max-width: 150px; border: 1px solid var(--steel-300); border-radius: 3px; background: var(--white); padding: 4px 7px; color: var(--steel-800); }
.surface { min-width: 0; background: var(--white); border: 1px solid #d4dce2; border-radius: 7px; box-shadow: var(--shadow-soft); }
.surface > h3 { margin: 0; padding: 15px 16px 8px; font-size: 15px; }
.surface > h4, .surface > p { margin-left: 16px; margin-right: 16px; }
.section-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 14px; border-bottom: 1px solid var(--steel-200); background: #f8fafb; border-radius: 7px 7px 0 0; }
.section-head h2 { margin: 0; font-size: 16px; }
.section-head p { margin: 3px 0 0; color: var(--steel-650); font-size: 11px; }
.content-grid { display: grid; gap: 16px; margin-top: 16px; }
.two-column { grid-template-columns: minmax(0, 3fr) minmax(290px, 2fr); }
.record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: 1 / -1; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 9px; }
.today-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.today-intro h2 { margin: 0; font-size: 19px; }
.today-intro p { margin: 3px 0 0; color: var(--steel-650); font-size: 12px; }
.today-metrics { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.today-queue { margin-top: 16px; }
.metric { min-height: 82px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; border: 1px solid var(--steel-200); border-radius: 5px; background: var(--white); padding: 12px; text-align: left; }
.metric:hover { border-color: var(--empire-blue); box-shadow: 0 2px 8px rgba(8,103,178,.1); }
.metric span { color: var(--steel-650); font-size: 11px; font-weight: 700; }
.metric strong { font-size: 21px; }
.metric.danger { border-left: 4px solid var(--red); }

.table-scroll { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table thead th { position: sticky; z-index: 2; top: 0; background: #dcebf7; color: #29465d; padding: 9px 10px; border-bottom: 2px solid #8fbce0; text-align: left; text-transform: uppercase; font-size: 9px; white-space: nowrap; }
.data-table tbody td { padding: 9px 10px; border-bottom: 1px solid var(--steel-200); vertical-align: top; }
.data-table tbody tr:nth-child(even):not([class]) td { background: #fbfcfd; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-action]:not(.fab-job-row):hover td,
.data-table tbody tr[data-row-action]:not(.fab-job-row):hover td { background: var(--empire-blue-soft); cursor: pointer; }
.data-table strong, .data-table small { display: block; }
.data-table small { margin-top: 3px; color: var(--steel-650); font-size: 10px; }
.data-table .compact-select { max-width: 150px; }
.jobs-table { min-width: 1120px; }
.estimate-table { min-width: 1280px; }
.production-table { min-width: 1080px; }
.production-table th, .production-table td { padding-left: 7px; padding-right: 7px; }
.production-table .row-actions { min-width: 92px; flex-wrap: nowrap; }
.workload-table { min-width: 2160px; font-size: 11px; }
.workload-table th, .workload-table td { padding: 7px 8px; }
.workload-table .notes-cell { max-width: 190px; white-space: normal; }
.workload-table .row-actions { min-width: 92px; flex-wrap: nowrap; }
.materials-table { min-width: 1900px; }
.materials-reference-hero { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 0; padding: 18px 20px; border-top: 5px solid var(--empire-blue); border-radius: 7px 7px 0 0; background: var(--steel-950); color: var(--white); box-shadow: var(--shadow); }
.materials-reference-hero p { margin: 0 0 3px; color: #65b4ff; font-size: 10px; font-weight: 800; }
.materials-reference-hero h2 { margin: 0; font-size: 22px; }
.materials-reference-hero span { display: block; margin-top: 5px; color: #bfd0dd; font-size: 12px; }
.materials-reference-hero .secondary { border-color: #6d8190; background: transparent; color: #edf7ff; box-shadow: none; }
.materials-reference-hero .secondary:hover { background: rgba(255,255,255,.09); }
.materials-reference-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; border: 1px solid #c9d4dc; border-top: 0; border-radius: 0 0 7px 7px; background: var(--white); box-shadow: var(--shadow-soft); }
.materials-reference-meta span { min-height: 45px; display: flex; align-items: baseline; gap: 6px; padding: 11px 14px; border-right: 1px solid var(--steel-200); color: var(--steel-650); font-size: 11px; }
.materials-reference-meta span:last-child { border-right: 0; }
.materials-reference-meta strong { color: var(--empire-blue-dark); font-size: 16px; }
.materials-surface { overflow: hidden; }
.materials-table-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 13px; border-bottom: 1px solid var(--steel-300); background: #f8fafb; }
.materials-controls { display: flex; align-items: end; gap: 10px; }
.materials-controls label { display: grid; gap: 3px; color: var(--steel-650); font-size: 9px; font-weight: 750; }
.materials-controls select { min-width: 165px; min-height: 33px; border: 1px solid #b8c5ce; border-radius: 4px; background: var(--white); padding: 4px 7px; color: var(--steel-900); font-size: 11px; font-weight: 600; }
.materials-controls > span { align-self: center; color: var(--steel-650); font-size: 10px; font-weight: 700; }
.materials-db-scroll { max-height: calc(100vh - 300px); }
.materials-db-table { min-width: 1040px; table-layout: fixed; font-size: 11px; }
.materials-db-table th:nth-child(1) { width: 285px; }
.materials-db-table th:nth-child(2) { width: 220px; }
.materials-db-table th:nth-child(3), .materials-db-table th:nth-child(4) { width: 125px; }
.materials-db-table th:nth-child(5) { width: 150px; }
.materials-db-table th:nth-child(6) { width: 140px; }
.materials-db-table th:nth-child(7) { width: 108px; }
.materials-db-table tbody td { height: 62px; padding: 8px 10px; vertical-align: middle; }
.materials-db-table .material-name strong { overflow: hidden; color: var(--steel-950); font-size: 12px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.materials-db-table .material-name small { color: var(--empire-blue-dark); font-weight: 800; }
.material-sell-price strong { color: var(--empire-blue-dark); font-size: 13px; }
.material-count-cell .count-current { color: var(--green); font-weight: 750; }
.material-count-cell .count-due { color: var(--amber); font-weight: 750; }
.material-count-summary { display: grid; gap: 3px; margin-bottom: 14px; border-left: 5px solid var(--empire-blue); background: var(--empire-blue-soft); padding: 12px 14px; }
.material-count-summary strong { font-size: 14px; }
.material-count-summary span, .material-count-summary small { color: var(--steel-650); }
.inventory-ledger { min-width: 940px; }
.inventory-in { color: var(--green); }
.inventory-out { color: var(--red); }
.job-material-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--steel-200); }
.job-material-summary > div { padding: 10px 16px; border-right: 1px solid var(--steel-200); }
.job-material-summary > div:last-child { border-right: 0; }
.job-material-summary span, .job-material-summary strong { display: block; }
.job-material-summary span { color: var(--steel-650); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.job-material-summary strong { margin-top: 4px; font-size: 17px; }
.job-material-table { min-width: 900px; }
.job-material-table td:first-child { max-width: 310px; }
.job-material-table td:first-child span { display: block; margin-top: 3px; }
.compact-action { min-height: 29px; padding: 4px 9px; font-size: 10px; }
.material-form-summary, .material-issue-summary { display: grid; gap: 4px; margin: 10px 0 14px; border-left: 4px solid var(--empire-blue); background: #eef7fd; padding: 10px 12px; }
.material-form-summary span, .material-issue-summary span { color: var(--steel-650); font-size: 11px; }
.material-price-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; border-top: 1px solid var(--steel-200); }
.material-price-preview > div { padding: 12px; border-right: 1px solid var(--steel-200); }
.material-price-preview > div:last-child { border-right: 0; }
.material-price-preview span, .material-price-preview strong { display: block; }
.material-price-preview span { color: var(--steel-650); font-size: 10px; font-weight: 750; }
.material-price-preview strong { margin-top: 5px; font-size: 18px; }
.workload-scroll { max-height: calc(100vh - 265px); }
.risk-row td:first-child { border-left: 3px solid var(--red); }
.production-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 8px; padding: 7px 12px; border: 1px solid #c7d3dd; border-radius: 6px; background: var(--white); box-shadow: 0 3px 10px rgba(15,23,42,.06); }
.production-toolbar-controls { min-width: 0; display: flex; align-items: stretch; gap: 18px; }
.production-filter-group { min-width: 0; display: grid; align-content: center; }
.status-filter-group { padding-left: 18px; border-left: 2px solid #d5dee5; }
.department-schedules, .queue-filters { display: flex; align-items: center; gap: 3px; border: 1px solid #d2dce4; border-radius: 6px; padding: 3px; }
.department-schedules { background: #f2f7fd; border-color: #c9dbec; }
.queue-filters { background: #f4f6f8; }
.department-schedules button, .queue-filters button { min-height: 36px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #405466; padding: 7px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.department-schedules button { display: inline-flex; align-items: center; gap: 7px; }
.department-schedules button:hover, .queue-filters button:hover { background: #f0f6fc; color: #0b4fb3; }
.department-schedules button.active { border-color: #106eea; background: #106eea; color: var(--white); box-shadow: 0 3px 8px rgba(16,110,234,.18); }
.department-schedules button span { min-width: 20px; border-radius: 10px; background: #edf2f6; color: #607484; padding: 1px 6px; font-size: 9px; line-height: 1.5; text-align: center; }
.department-schedules button.active span { background: rgba(255,255,255,.2); color: var(--white); }
.queue-filters button { background: transparent; }
.queue-filters button.active { border-color: var(--steel-800); background: var(--steel-800); color: var(--white); box-shadow: 0 3px 8px rgba(39,55,70,.18); }
.production-job-count { flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 5px; padding-right: 4px; color: #607484; }
.production-job-count strong { color: #0f172a; font-size: 16px; }
.production-job-count span { font-size: 12px; font-weight: 800; text-transform: uppercase; }
.production-toolbar-summary { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.job-layout-toggle { display: inline-flex; align-items: center; gap: 3px; border: 1px solid #d2dce4; border-radius: 6px; background: #f4f6f8; padding: 3px; }
.job-layout-toggle button { min-height: 32px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #405466; padding: 5px 10px; font-size: 11px; font-weight: 800; }
.job-layout-toggle button:hover { background: #edf4fb; color: #0b4fb3; }
.job-layout-toggle button.active { border-color: var(--empire-blue); background: var(--empire-blue); color: #fff; box-shadow: 0 2px 6px rgba(8,103,178,.2); }
.fab-card-surface { padding: 2px; }
.job-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.job-card { min-width: 0; overflow: hidden; border: 1px solid rgba(32,48,60,.22); border-left: 5px solid color-mix(in srgb, var(--fab-row-color) 62%, #15202b); border-radius: 8px; background: var(--fab-row-color); color: var(--fab-row-ink); box-shadow: 0 5px 14px rgba(15,23,42,.12); cursor: pointer; transition: box-shadow .14s ease, transform .14s ease; }
.job-card:hover { box-shadow: 0 8px 20px rgba(15,23,42,.18); transform: translateY(-2px); }
.job-card:focus { outline: 3px solid rgba(8,103,178,.32); outline-offset: 2px; }
.job-card.risk-card { border-left-color: var(--red); }
.job-card-header { min-height: 72px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 13px 10px; border-bottom: 1px solid rgba(32,48,60,.17); }
.job-card-header > div { min-width: 0; display: grid; gap: 3px; }
.job-card-number { font-family: "Poppins", "Segoe UI", Arial, sans-serif; font-size: 18px; font-weight: 850; white-space: nowrap; }
.job-card-customer { overflow: hidden; color: var(--fab-row-ink); font-size: 13px; font-weight: 800; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.job-card-status { flex: 0 0 158px; }
.job-card-body { min-height: 96px; padding: 12px 13px; }
.job-card-reference { display: block; overflow: hidden; margin-bottom: 6px; font-size: 12px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.job-card-body p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--fab-row-ink); font-size: 12px; font-weight: 600; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.job-card-meta { display: grid; grid-template-columns: 1.15fr 1fr .48fr; margin: 0; border-top: 1px solid rgba(32,48,60,.16); border-bottom: 1px solid rgba(32,48,60,.16); }
.job-card-meta > div { min-width: 0; padding: 9px 10px; border-right: 1px solid rgba(32,48,60,.14); }
.job-card-meta > div:last-child { border-right: 0; }
.job-card-meta dt { color: var(--fab-row-muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.job-card-meta dd { overflow: hidden; margin: 3px 0 0; color: var(--fab-row-ink); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.job-card-meta dd span { color: var(--fab-row-muted); font-size: 10px; }
.job-card-meta small { display: block; overflow: hidden; margin-top: 2px; color: var(--fab-row-muted); font-size: 9px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.job-card .warning-text { color: var(--fab-row-ink) !important; }
.job-card-footer { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 12px; }
.job-card-footer > span { color: var(--fab-row-muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.job-card-empty { padding: 20px; border: 1px solid #d2dce4; border-radius: 7px; background: #fff; }
.delivery-command { overflow: hidden; border: 1px solid #cbd6df; border-radius: 7px; background: var(--white); box-shadow: var(--shadow-soft); }
.delivery-command-head { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 18px; border-top: 5px solid var(--empire-blue); border-bottom: 1px solid #d8e1e8; }
.delivery-command-head p { margin: 0 0 2px; color: var(--empire-blue-dark); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.delivery-command-head h2 { margin: 0; font-size: 21px; }
.delivery-command-head > div > span { display: block; margin-top: 3px; color: var(--steel-650); font-size: 12px; }
.delivery-command-counts { display: flex; align-items: stretch; border: 1px solid #d5dfe6; border-radius: 6px; background: #f7f9fb; }
.delivery-command-counts div { min-width: 84px; display: grid; justify-items: center; padding: 7px 12px; }
.delivery-command-counts div + div { border-left: 1px solid #d5dfe6; }
.delivery-command-counts strong { font-size: 17px; }
.delivery-command-counts span { color: var(--steel-650); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.delivery-queue-head, .delivery-queue-row { display: grid; grid-template-columns: minmax(260px, 1.35fr) minmax(220px, 1fr) 126px 174px 160px; gap: 12px; align-items: center; }
.delivery-queue-head { padding: 9px 14px 5px; color: #526371; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.delivery-queue { display: grid; gap: 8px; padding: 0 10px 12px; }
.delivery-queue-row { min-height: 82px; padding: 10px 12px; border: 1px solid #d2dce4; border-left: 5px solid var(--empire-blue); border-radius: 6px; background: #fff; box-shadow: 0 3px 8px rgba(15,23,42,.07); }
.delivery-queue-row.is-complete { border-left-color: var(--green); background: #f8fbf9; opacity: .78; }
.delivery-job, .delivery-destination, .delivery-date { min-width: 0; display: grid; gap: 2px; }
.delivery-job button { width: max-content; border: 0; background: transparent; color: var(--empire-blue-dark); padding: 0; font-size: 14px; font-weight: 800; }
.delivery-job strong, .delivery-destination strong, .delivery-date strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.delivery-job span, .delivery-destination span, .delivery-date span { overflow: hidden; color: var(--steel-650); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.delivery-job small, .delivery-destination small { color: var(--green); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.delivery-status-select { width: 100%; min-height: 36px; border: 1px solid #b9c6cf; border-radius: 5px; background: #f8fafb; padding: 5px 8px; font-weight: 700; }
.delivery-document-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.delivery-pdf-button, .delivery-create-button { min-height: 34px; border-radius: 5px; padding: 6px 10px; font-size: 11px; font-weight: 800; }
.delivery-pdf-button { border: 1px solid var(--empire-blue); background: var(--empire-blue); color: #fff; }
.delivery-create-button { border: 1px solid #9db1c0; background: #fff; color: var(--empire-blue-dark); }
.delivery-empty { display: grid; justify-items: center; gap: 5px; padding: 48px 20px; color: var(--steel-650); }
.delivery-empty strong { color: var(--steel-800); }
.fab-sheet { overflow: visible; border: 0; background: transparent; box-shadow: none; }
.fab-sheet-scroll { max-height: none; overflow-x: auto; overflow-y: visible; padding: 0 2px 5px; }
.fab-table { width: 100%; min-width: 1110px; border-collapse: separate; border-spacing: 0 8px; table-layout: fixed; font-size: 14px; }
.fab-table .fab-col-job { width: 122px; }
.fab-table .fab-col-project { width: auto; }
.fab-table .fab-col-date { width: 112px; }
.fab-table .fab-col-time { width: 82px; }
.fab-table .fab-col-status { width: 184px; }
.fab-table .fab-col-docs { width: 96px; }
.fab-table .fab-col-tech { width: 154px; }
.fab-table .fab-col-hours { width: 62px; }
.fab-table th { height: 30px; background: transparent; color: #526371; border: 0; padding: 3px 12px 5px; font-family: "Poppins", "Segoe UI", Arial, sans-serif; font-size: 10px; font-weight: 700; text-align: left; }
.data-table.fab-table thead th { background: #f6f7fb; color: #526371; border-bottom: 0; padding: 3px 12px 5px; }
.fab-table thead th { position: sticky; top: 0; z-index: 4; }
.fab-table th:first-child, .fab-table td:first-child { position: sticky; left: 0; z-index: 3; }
.fab-table th:nth-child(2), .fab-table td:nth-child(2) { position: sticky; left: 122px; z-index: 2; }
.fab-table thead th:first-child, .fab-table thead th:nth-child(2) { z-index: 6; }
.fab-table th:last-child { border-right: 0; }
.fab-table .fab-job-row { filter: drop-shadow(0 3px 5px rgba(15,23,42,.11)); }
.fab-table .fab-job-row td { height: 72px; padding: 8px 12px; background: var(--fab-row-color); color: var(--fab-row-ink); border-top: 1px solid rgba(32,48,60,.18); border-right: 1px solid rgba(32,48,60,.14); border-bottom: 1px solid rgba(32,48,60,.22); vertical-align: middle; }
.fab-table .fab-job-row td:first-child { border-left: 5px solid color-mix(in srgb, var(--fab-row-color) 62%, #15202b); border-radius: 7px 0 0 7px; }
.fab-table .fab-job-row td:last-child { border-right: 1px solid rgba(32,48,60,.18); border-radius: 0 7px 7px 0; }
.data-table.fab-table tbody .fab-job-row:hover td { background: var(--fab-row-color); cursor: pointer; }
.fab-docs { white-space: nowrap; }
.fab-doc-indicator { width: 35px; height: 42px; display: inline-grid; place-items: center; align-content: center; gap: 0; position: relative; margin-right: 3px; border: 1px solid rgba(32,48,60,.28); border-radius: 4px; background: rgba(255,255,255,.42); color: var(--fab-row-ink); padding: 0; font-family: inherit; text-align: center; }
.fab-docs button.fab-doc-indicator { cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
.fab-docs button.fab-doc-indicator:hover { border-color: #075db7; box-shadow: 0 3px 8px rgba(11,22,35,.18); transform: translateY(-1px); }
.fab-doc-indicator > span { font-size: 16px; line-height: 1; }
.fab-doc-indicator small { margin: 2px 0 0; color: inherit; font-size: 8px; font-weight: 900; line-height: 1; }
.fab-doc-indicator.is-missing { opacity: .26; filter: grayscale(1); }
.fab-doc-indicator.is-draft { opacity: .72; filter: grayscale(.7); }
.fab-doc-indicator.is-current { border-color: rgba(6,86,42,.62); background: rgba(255,255,255,.86); color: #073b20; opacity: 1; }
.fab-doc-indicator.is-current::after,
.fab-doc-indicator.is-stale::after,
.fab-doc-indicator.is-draft::after { width: 14px; height: 14px; display: grid; place-items: center; position: absolute; top: -5px; right: -5px; border-radius: 50%; color: #fff; font-size: 9px; font-weight: 900; }
.fab-doc-indicator.is-current::after { content: "\2713"; background: #08783f; }
.fab-doc-indicator.is-stale { border-color: #bd7b00; background: #fff4cf; color: #624100; opacity: 1; }
.fab-doc-indicator.is-stale::after { content: "!"; background: #c17b00; }
.fab-doc-indicator.is-draft::after { content: ""; width: 8px; height: 8px; top: -3px; right: -3px; background: #6d7f8d; }
.fab-table .fab-job-row:focus { outline: 3px solid rgba(8,103,178,.28); outline-offset: -3px; }
.fab-job-number strong { color: var(--fab-row-ink); font-family: "Poppins", "Segoe UI", Arial, sans-serif; font-size: 16px; font-weight: 800; white-space: nowrap; }
.fab-job-info { min-width: 0; white-space: normal; }
.fab-job-info strong, .fab-job-info span, .fab-job-info small { display: block; }
.fab-row-customer { overflow: hidden; color: var(--fab-row-ink); font-family: "Poppins", "Segoe UI", Arial, sans-serif; font-size: 16px; font-weight: 800; line-height: 1.15; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.fab-row-reference { display: block !important; overflow: hidden; margin-top: 2px; color: var(--fab-row-ink); font-size: 12px; font-weight: 800; line-height: 1.15; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.fab-row-description { display: block !important; overflow: hidden; margin-top: 2px !important; color: var(--fab-row-ink) !important; font-size: 12px !important; font-weight: 600; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.fab-due-date strong, .fab-due-time strong { color: var(--fab-row-ink); font-size: 13px; line-height: 1.3; white-space: nowrap; }
.fab-due-date small { display: block; margin-top: 4px; color: var(--fab-row-ink); font-size: 10px; font-weight: 700; opacity: .82; }
.fab-job-row .fab-due-date .warning-text { color: var(--fab-row-ink) !important; }
.fab-due-time strong { white-space: nowrap; }
.fab-inline-date, .fab-inline-time, .fab-inline-team { width: 100%; min-width: 0; border: 1px solid rgba(54,72,84,.55); border-radius: 3px; background: rgba(255,255,255,.94); color: var(--steel-950); font: inherit; }
.fab-inline-date { min-height: 30px; padding: 3px 5px; font-size: 11px; font-weight: 800; }
.fab-inline-time { min-height: 30px; padding: 4px; font-size: 12px; font-weight: 800; }
.fab-status { width: 100%; max-width: none !important; min-height: 38px; background: #fff; border-color: #7d8d99; border-radius: 5px; padding: 5px 8px; color: var(--steel-950); font-family: "Poppins", "Segoe UI", Arial, sans-serif; font-size: 12px; font-weight: 700; }
.fab-assigned-tech strong, .fab-assigned-tech small { overflow: hidden; color: var(--fab-row-ink); text-overflow: ellipsis; white-space: nowrap; }
.fab-assigned-tech strong { font-size: 12px; }
.fab-assigned-tech small { margin-top: 3px; color: var(--fab-row-muted); font-size: 9px; }
.fab-hours { text-align: center; }
.fab-hours strong { color: var(--fab-row-ink); font-size: 13px; }
.fab-team span, .fab-team strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fab-team span { color: var(--fab-row-muted); font-size: 9px; font-weight: 800; line-height: 1.2; text-transform: uppercase; }
.fab-team strong { margin: 2px 0 4px; color: var(--fab-row-ink); font-size: 12px; line-height: 1.2; }
.fab-team strong:last-child { margin-bottom: 0; }
.fab-inline-team { display: block; height: 23px; margin: 1px 0 3px; padding: 2px 4px; font-size: 10px; font-weight: 700; }
.fab-multiline { white-space: pre-line; line-height: 1.42; }
.danger-link { color: var(--red); }
.stored-pdf-link { border: 0; background: transparent; color: var(--empire-blue-dark); padding: 2px 0; font-weight: 800; text-decoration: underline; }
.low-stock td { background: #fffaf0; }
.compact-select { min-height: 29px; border: 1px solid var(--steel-300); border-radius: 3px; background: var(--white); padding: 4px 6px; font-size: 11px; }
.warning-text { color: var(--red) !important; font-weight: 700; }

.badge { display: inline-flex; align-items: center; width: fit-content; min-height: 23px; padding: 3px 7px; border: 1px solid var(--steel-300); border-radius: 3px; background: var(--steel-100); color: var(--steel-800); font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge-active, .badge-accepted, .badge-completed, .badge-won, .badge-ready { color: var(--green); border-color: #acd5be; background: var(--green-soft); }
.badge-high, .badge-rush, .badge-overdue, .badge-on-hold, .badge-lost, .badge-declined { color: var(--red); border-color: #efb3ad; background: var(--red-soft); }
.badge-sent, .badge-viewed, .badge-quote-sent, .badge-in-progress { color: var(--empire-blue-dark); border-color: #a8cde7; background: #edf7fd; }
.badge-review-required, .badge-order-material, .badge-material-incoming, .badge-follow-up-due { color: var(--amber); border-color: #e5c987; background: var(--amber-soft); }
.record-file-state { width: fit-content; margin-top: 4px !important; border-radius: 3px; padding: 2px 5px; font-size: 8px !important; font-weight: 800; text-transform: uppercase; }
.record-file-state.is-current { background: var(--green-soft); color: var(--green); }
.record-file-state.is-stale { background: var(--amber-soft); color: var(--amber); }
.record-file-state.is-draft { background: var(--steel-100); color: var(--steel-650); }
.record-file-state.is-missing { background: var(--red-soft); color: var(--red); }

.record-header { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 0; padding: 14px 16px; background: var(--white); border: 1px solid #d4dce2; border-top: 4px solid var(--empire-blue); border-bottom: 0; border-radius: 7px 7px 0 0; box-shadow: var(--shadow-soft); }
.record-header h2 { margin: 0; font-size: 19px; }
.record-tabs { display: flex; gap: 0; overflow-x: auto; background: var(--white); border: 1px solid #d4dce2; border-top-color: var(--steel-100); border-radius: 0 0 7px 7px; margin-bottom: 16px; box-shadow: var(--shadow-soft); }
.record-tabs button { min-height: 39px; border: 0; border-right: 1px solid var(--steel-200); border-bottom: 3px solid transparent; background: var(--white); color: var(--steel-650); padding: 8px 14px; font-size: 11px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.record-tabs button.active { color: var(--empire-blue-dark); border-bottom-color: var(--empire-blue); background: var(--empire-blue-soft); }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; padding: 4px 16px 16px; }
.detail-list > div { padding: 8px 0; border-bottom: 1px solid var(--steel-100); }
.detail-list dt { color: var(--steel-650); font-size: 10px; text-transform: uppercase; font-weight: 700; }
.detail-list dd { margin: 3px 0 0; font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 16px 16px; }
.customer-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mini-stats > div { border-left: 1px solid var(--steel-200); padding: 6px 12px; }
.mini-stats > div:first-child { border-left: 0; }
.mini-stats span, .mini-stats strong { display: block; }
.mini-stats span { color: var(--steel-650); font-size: 10px; }
.mini-stats strong { margin-top: 4px; font-size: 17px; }
.notice { margin: 10px 16px; border-left: 4px solid var(--empire-blue); background: #eef7fd; padding: 9px 11px; }
.notice.danger { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.inline-field { margin: 0 16px 8px; }

.segmented { display: inline-flex; border: 1px solid var(--steel-300); border-radius: 4px; overflow: hidden; }
.segmented button { min-height: 33px; border: 0; border-right: 1px solid var(--steel-300); background: var(--white); padding: 6px 12px; color: var(--steel-650); font-weight: 700; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--steel-800); color: var(--white); }
.kanban { display: grid; grid-template-columns: repeat(11, 250px); gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.kanban-column { min-height: 530px; background: #e9eef1; border: 1px solid var(--steel-300); border-radius: 5px; }
.kanban-column > header { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 9px 10px; border-bottom: 1px solid var(--steel-300); }
.kanban-column > header strong { font-size: 11px; }
.kanban-column > header span { display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; background: var(--white); font-size: 10px; }
.kanban-column > div { padding: 8px; }
.kanban-card { display: grid; gap: 5px; margin-bottom: 8px; padding: 10px; background: var(--white); border: 1px solid var(--steel-300); border-radius: 4px; box-shadow: 0 1px 2px rgba(21,32,43,.05); }
.card-link { border: 0; background: transparent; color: var(--steel-950); padding: 0; text-align: left; font-weight: 800; }
.card-link:hover { color: var(--empire-blue-dark); text-decoration: underline; }
.kanban-card span, .kanban-card small { color: var(--steel-650); font-size: 10px; }
.kanban-card select { width: 100%; border: 1px solid var(--steel-300); border-radius: 3px; padding: 4px; font-size: 10px; }
.column-empty { text-align: center; color: var(--steel-500); font-size: 11px; }

.estimate-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 15px; }
.estimate-summary { align-self: start; position: sticky; top: 98px; }
.estimate-summary h3 { border-bottom: 1px solid var(--steel-200); padding: 13px 14px; }
.summary-ledger { padding: 7px 14px 13px; }
.summary-ledger > div { display: flex; justify-content: space-between; gap: 18px; padding: 7px 0; border-bottom: 1px solid var(--steel-100); }
.summary-ledger > div.strong { margin-top: 3px; border-top: 1px solid var(--steel-300); font-weight: 800; }
.summary-ledger > div.total { color: var(--empire-blue-dark); font-size: 16px; }
.cost-key { display: flex; gap: 14px; padding: 10px 14px; background: var(--steel-050); color: var(--steel-650); font-size: 10px; }
.cost-key i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; }
.cost-key i.cost { background: var(--steel-650); }
.cost-key i.sell { background: var(--empire-blue); }
.profit-block { margin: 8px 16px 14px; padding: 18px; background: var(--green-soft); border-left: 4px solid var(--green); }
.profit-block.at-risk { background: var(--red-soft); border-color: var(--red); }
.profit-block span, .profit-block strong, .profit-block small { display: block; }
.profit-block strong { margin: 4px 0; font-size: 27px; }
.next-action-block { display: grid; gap: 5px; margin: 8px 16px 14px; padding: 16px; border-left: 4px solid var(--empire-blue); background: #eef7fd; }
.next-action-block.at-risk { border-color: var(--red); background: var(--red-soft); }
.next-action-block span { color: var(--steel-650); font-size: 11px; }
.variance-bar { height: 9px; margin: 15px 16px 3px; background: var(--steel-200); overflow: hidden; }
.variance-bar span { display: block; height: 100%; background: var(--empire-blue); }
.muted-line { color: var(--steel-650); font-size: 11px; }

.record-list { display: grid; }
.record-list > div, .record-list > button { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; min-height: 48px; border: 0; border-bottom: 1px solid var(--steel-200); background: transparent; padding: 8px 14px; text-align: left; }
.record-list > button:hover { background: #f2f8fc; }
.record-list small { color: var(--steel-650); }
.record-reference { padding-left: 0; text-align: left; }
.job-copy { padding: 0 16px 16px; }
.job-copy strong { display: block; margin-top: 10px; color: var(--steel-650); font-size: 10px; text-transform: uppercase; }
.job-copy p { margin: 4px 0 10px; line-height: 1.5; }
.job-overview-form { display: grid; gap: 12px; margin-top: 16px; }
.job-editor { overflow: hidden; }
.job-editor-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .9fr); margin: 0; padding: 0; border: 0; min-width: 0; }
.job-form-group { min-width: 0; padding: 16px 18px 18px; }
.job-form-group + .job-form-group { border-left: 1px solid var(--steel-200); background: #f8fafb; }
.job-form-group > h3 { margin: 0 0 13px; color: var(--empire-blue-dark); font-size: 12px; }
.job-group-grid { gap: 12px 14px; }
.job-form-primary textarea { min-height: 76px; }
.job-form-production .field:last-child { align-self: end; }
.job-closeout { overflow: hidden; }
.job-closeout > summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 16px; cursor: pointer; color: var(--steel-800); font-size: 12px; font-weight: 800; }
.job-closeout > summary:hover { background: #f7fafc; }
.job-closeout > summary strong { color: var(--empire-blue-dark); font-size: 15px; }
.job-closeout[open] > summary { border-bottom: 1px solid var(--steel-200); }
.job-closeout-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 16px; border: 0; }
.job-closeout-grid .field textarea { min-height: 64px; }
.job-overview-stats { margin: 0 16px 16px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 2px; min-width: 145px; }
.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 12px 1fr; gap: 8px; border: 0; border-bottom: 1px solid var(--steel-200); background: transparent; padding: 10px 14px; text-align: left; }
.activity-row.interactive:hover { background: #f2f8fc; }
.activity-row strong, .activity-row small { display: block; }
.activity-row small { margin-top: 3px; color: var(--steel-650); }
.activity-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--empire-blue); }
.timeline { padding: 15px 18px; }
.timeline article { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 9px; padding-bottom: 16px; }
.timeline article::before { content: ""; position: absolute; left: 5px; top: 9px; bottom: -3px; width: 1px; background: var(--steel-300); }
.timeline article:last-child::before { display: none; }
.timeline article > span { z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid var(--empire-blue); border-radius: 50%; background: var(--white); }
.timeline p { margin: 3px 0; color: var(--steel-650); }
.timeline small { color: var(--steel-500); font-size: 10px; }

.production-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; background: var(--white); border: 1px solid var(--steel-200); border-radius: 5px; }
.production-summary > div { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-right: 1px solid var(--steel-200); }
.production-summary > div:last-child { border-right: 0; }
.production-summary span { color: var(--steel-650); font-size: 10px; text-transform: uppercase; font-weight: 700; }
.production-summary strong { font-size: 17px; }
.production-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 310px); align-items: start; gap: 10px; overflow-x: auto; padding-bottom: 12px; }
.production-column { min-height: 560px; background: #e8edf0; border: 1px solid var(--steel-300); border-radius: 5px; }
.production-column > header { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 9px 11px; border-bottom: 1px solid var(--steel-300); }
.production-column > header strong { font-size: 11px; text-transform: uppercase; }
.production-column > header span { display: grid; place-items: center; min-width: 23px; height: 23px; border-radius: 50%; background: var(--white); font-size: 10px; font-weight: 800; }
.production-column > div { padding: 8px; }
.production-card { margin-bottom: 8px; padding: 10px; background: var(--white); border: 1px solid var(--steel-300); border-left: 4px solid var(--empire-blue); border-radius: 4px; cursor: pointer; }
.production-card:hover { box-shadow: 0 2px 9px rgba(21,32,43,.12); }
.production-card.at-risk { border-left-color: var(--red); }
.production-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.production-card > span { display: block; margin-top: 5px; color: var(--steel-650); font-size: 10px; }
.production-card h3 { margin: 3px 0 9px; font-size: 13px; }
.production-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.production-card-grid small { color: var(--steel-500); font-size: 9px; text-transform: uppercase; }
.production-card-grid strong { display: block; margin-top: 2px; color: var(--steel-800); font-size: 10px; text-transform: none; }
.material-readiness { margin-top: 9px; padding: 5px 7px; border-radius: 3px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.material-readiness.ready { background: var(--green-soft); color: var(--green); }
.material-readiness.missing { background: var(--amber-soft); color: var(--amber); }
.warning-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.warning-tags span { border: 1px solid #efb3ad; border-radius: 3px; background: var(--red-soft); color: var(--red); padding: 3px 5px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.production-actions { align-items: flex-start; gap: 12px; }
.queue-filters { flex-wrap: wrap; }
.readiness { display: inline-flex; padding: 3px 6px; border: 1px solid var(--steel-300); border-radius: 3px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.readiness.ready { color: var(--green); border-color: #acd5be; background: var(--green-soft); }
.readiness.missing { color: var(--amber); border-color: #e5c987; background: var(--amber-soft); }

.task-layout { grid-template-columns: minmax(0, 1fr) 280px; }
.task-table { min-width: 1050px; }
.rules-panel { align-self: start; }
.rules-panel > p { color: var(--steel-650); font-size: 11px; }
.rule-list { border-top: 1px solid var(--steel-200); }
.rule-list > div { padding: 10px 14px; border-bottom: 1px solid var(--steel-200); }
.rule-list strong, .rule-list span { display: block; }
.rule-list strong { font-size: 11px; }
.rule-list span { margin-top: 3px; color: var(--steel-650); font-size: 10px; }
.rule-count { display: flex; align-items: baseline; gap: 8px; padding: 13px 14px; background: var(--steel-050); }
.rule-count strong { color: var(--empire-blue-dark); font-size: 22px; }
.rule-count span { color: var(--steel-650); font-size: 10px; }

.empty-state { padding: 30px 18px; text-align: center; color: var(--steel-650); }
.empty-state strong { color: var(--steel-800); }
.empty-state p { margin: 5px 0 0; font-size: 12px; }

.form-dialog { width: min(900px, calc(100vw - 36px)); max-height: calc(100vh - 30px); padding: 0; border: 1px solid #7fa6c5; border-radius: 8px; box-shadow: 0 26px 75px rgba(4,12,20,.36); }
.form-dialog.source-dialog { width: min(980px, calc(100vw - 28px)); }
.form-dialog::backdrop { background: rgba(21,32,43,.48); }
.form-dialog form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 32px); }
.form-dialog header, .form-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 18px; }
.form-dialog header { background: var(--white); border-top: 5px solid var(--empire-blue); border-bottom: 1px solid #9fc2df; color: var(--steel-950); box-shadow: 0 4px 12px rgba(11,22,35,.08); }
.form-dialog header .dialog-heading { flex: 0 1 240px; min-width: 130px; }
.dialog-header-controls { display: flex; justify-content: center; flex: 1 1 auto; min-width: 0; }
.dialog-header-controls:empty { display: none; }
.dialog-header-controls .job-entry-department { width: auto; padding: 0; border: 0; background: transparent; }
.dialog-header-controls .job-entry-department > strong { display: none; }
.dialog-header-controls .job-entry-department label span { min-width: 96px; min-height: 32px; padding: 5px 10px; }
.form-dialog footer { background: var(--white); }
.form-dialog header h2 { margin: 0; font-size: 18px; }
.form-dialog header p { margin: 0 0 2px; color: var(--empire-blue-dark); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.form-dialog header .dialog-close { min-height: 30px; border: 1px solid #9fc2df; background: #eef6ff; color: var(--empire-blue-dark); }
.form-dialog header .dialog-close:hover { border-color: var(--empire-blue); background: #dcecff; color: var(--empire-blue-dark); }
.form-dialog footer { justify-content: flex-end; border-top: 1px solid var(--steel-200); box-shadow: 0 -8px 18px rgba(21,32,43,.05); }
.form-dialog footer { flex-wrap: wrap; }
.job-workspace-footer-spacer { flex: 1 1 auto; }
.form-dialog.job-workspace-document footer .job-workspace-back { margin-right: auto; border-color: #9fc2df; color: #0b4fb3; }
.form-dialog footer .destructive { border: 1px solid #d8a19c; background: #fff5f3; color: #a1281e; }
.form-dialog footer .destructive:hover { border-color: #b42318; background: #ffe8e5; }
.form-dialog.job-workspace-document header h2::before { content: "Document / "; color: #607484; font-weight: 600; }
.dialog-body { overflow-y: auto; padding: 18px; background: #f3f7fa; }
.source-dialog .dialog-body { padding: 0; background: #f4f7f9; }
.form-section-title { grid-column: 1 / -1; margin: 16px 0 0; padding: 9px 12px; border: 1px solid #0871d5; border-radius: 5px 5px 0 0; background: var(--empire-blue); color: #fff; font-size: 11px; }
.form-section-title:first-child { margin-top: 0; }
.form-disclosure { margin-top: 12px; border: 1px solid #b8cad8; border-radius: 5px; background: #fbfdff; overflow: hidden; }
.form-disclosure > summary { min-height: 39px; display: flex; align-items: center; padding: 8px 12px; cursor: pointer; color: var(--empire-blue-dark); background: #edf5fb; font-size: 10px; font-weight: 850; }
.form-disclosure > summary:hover { color: var(--empire-blue); }
.form-disclosure-body { padding: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; border: 1px solid #b8cad8; border-top: 0; border-radius: 0 0 5px 5px; background: #fbfdff; padding: 12px 14px; }
.form-disclosure-body > .form-grid { border: 0; background: transparent; padding: 0; }
.field { min-width: 0; display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; align-content: start; gap: 8px; }
.field > span { color: #34536b; font-size: 10px; font-weight: 800; text-align: right; }
.field input, .field select, .field textarea { width: 100%; min-height: 36px; border: 1px solid #aebfcb; border-radius: 4px; background: #fff; padding: 7px 9px; color: var(--steel-950); box-shadow: inset 0 1px 1px rgba(11,22,35,.025); }
.field input:focus, .field select:focus, .field textarea:focus, .source-control:focus, .source-table input:focus, .source-table select:focus { outline: 2px solid rgba(8,103,178,.2); outline-offset: 0; border-color: var(--empire-blue); background: var(--white); }
.field textarea { min-height: 68px; resize: vertical; }
.field:has(textarea) { align-items: start; }
.field:has(textarea) > span { padding-top: 9px; }
.check-field { display: flex; align-items: center; gap: 7px; min-height: 36px; font-weight: 700; }
.check-field input { width: 17px; height: 17px; accent-color: var(--empire-blue); }
.line-live-summary { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 20px; margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--empire-blue); background: #eef7fd; }
.line-live-summary span { color: var(--steel-650); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.line-live-summary strong { font-size: 19px; color: var(--empire-blue-dark); }
.line-live-summary small { grid-column: 1 / -1; color: var(--steel-650); }
.form-hint { margin: 12px 0 0; color: var(--steel-650); font-size: 11px; }
.source-form { display: grid; gap: 0; background: #e6edf3; padding-bottom: 1px; }
.job-entry-department { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 12px; border-bottom: 1px solid #aebdca; background: #f8fafb; }
.job-entry-department > strong { color: #40525f; font-size: 10px; }
.job-entry-department > div { display: inline-flex; border: 1px solid #aebdca; border-radius: 5px; overflow: hidden; }
.job-entry-department label { position: relative; cursor: pointer; }
.job-entry-department input { position: absolute; opacity: 0; pointer-events: none; }
.job-entry-department label span { min-width: 108px; min-height: 32px; display: flex; align-items: center; justify-content: center; gap: 7px; border-right: 1px solid #aebdca; background: #fff; color: #40525f; padding: 5px 12px; font-size: 11px; font-weight: 800; }
.job-entry-department label:last-child span { border-right: 0; }
.job-entry-department label small { color: #71808b; font-size: 9px; }
.job-entry-department input:checked + span { background: var(--empire-blue); color: #fff; box-shadow: inset 0 -3px 0 #075db7; }
.job-entry-department input:checked + span small { color: #dceeff; }

@media (max-width: 760px) {
  .form-dialog header { flex-wrap: wrap; }
  .dialog-header-controls { order: 3; flex-basis: 100%; }
  .dialog-header-controls .job-entry-department,
  .dialog-header-controls .job-entry-department > div { width: 100%; }
  .dialog-header-controls .job-entry-department label { flex: 1; }
  .dialog-header-controls .job-entry-department label span { min-width: 0; }
}
.source-card { margin: 12px 12px 0; border: 1px solid #9eb8cc; border-radius: 7px; background: #fbfdff; overflow: hidden; box-shadow: 0 4px 11px rgba(11,22,35,.075); }
.source-card + .source-card { border-top: 1px solid #aebdca; }
.source-card > h3 { margin: 0; padding: 10px 14px; border-bottom: 1px solid #075db7; color: var(--white); background: var(--empire-blue); font-size: 11px; }
.source-card-body { padding: 12px; background: #fbfdff; }
.source-entry-grid { display: grid; grid-template-columns: 90px minmax(150px, 1fr) 90px minmax(150px, 1fr); align-items: center; gap: 9px 10px; }
.source-entry-grid-single { margin-bottom: 11px; }
.source-label { color: #34536b; font-size: 10px; font-weight: 800; text-align: right; }
.source-control, .source-table input, .source-table select, .source-totals input { width: 100%; min-width: 0; min-height: 36px; border: 1px solid #aebfcb; border-radius: 4px; background: #fff; padding: 6px 8px; color: #15202b; box-shadow: inset 0 1px 1px rgba(11,22,35,.025); }
textarea.source-control { resize: vertical; }
.source-wide-label { grid-column: 1; }
.source-wide-control { grid-column: 2 / -1; }
.source-date-time { display: grid; grid-template-columns: minmax(120px, 1fr) 90px; gap: 6px; }
.job-entry-grid, .job-entry-assignment-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; align-items: stretch; }
.job-entry-field { min-width: 0; display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; align-content: start; gap: 8px; }
.job-entry-field > span { color: #34536b; font-size: 10px; font-weight: 800; text-align: right; }
.job-entry-span-1 { grid-template-columns: 82px minmax(0, 1fr); }
.job-entry-span-1 > span { white-space: nowrap; }
.job-entry-field:has(textarea) { align-items: start; }
.job-entry-field:has(textarea) > span { padding-top: 9px; }
.job-entry-field .source-control { width: 100%; }
.job-entry-field textarea.source-control { min-height: 54px; resize: vertical; }
.job-entry-span-1 { grid-column: span 1; }
.job-entry-span-2 { grid-column: span 2; }
.job-entry-span-4 { grid-column: 1 / -1; }
.job-shipping-card[hidden], .job-entry-field[hidden] { display: none !important; }
.source-job-context { display: grid; grid-template-columns: 125px minmax(240px, 1fr) minmax(120px, .55fr) minmax(145px, .65fr); gap: 0; background: #e9f4ff; border-bottom: 1px solid #a9cce8; box-shadow: 0 3px 10px rgba(11,22,35,.08); }
.source-job-context > div { min-width: 0; display: grid; align-content: center; gap: 2px; min-height: 66px; padding: 10px 14px; border-right: 1px solid #c9dfed; }
.source-job-context > div:last-of-type { border-right: 0; }
.source-job-context span { color: #526571; font-size: 9px; font-weight: 800; }
.source-job-context strong { overflow: hidden; color: #14222d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.source-job-context small { overflow: hidden; color: #526571; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.source-job-context .source-context-id { border-left: 5px solid var(--empire-blue); }
.source-job-context .source-context-id strong { color: var(--empire-blue-dark); font-size: 16px; }
.source-form > .form-disclosure { margin: 12px 12px 0; border: 1px solid #c3ced6; border-radius: 6px; background: #fff; box-shadow: 0 3px 9px rgba(11,22,35,.06); }
.source-form > .form-disclosure > summary { min-height: 39px; padding: 8px 14px; }
.source-form > .form-disclosure > .form-disclosure-body { padding: 2px 18px 14px; }
.source-card-body > .form-disclosure { margin-top: 10px; }
.source-form-options { display: flex; align-items: center; gap: 18px; padding: 9px 18px; border-top: 1px solid var(--steel-200); background: #fff; }
.source-table-wrap { overflow-x: auto; }
.source-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.source-table th { padding: 6px 8px; background: #e7ecef; border: 1px solid #bdc7ce; color: #344753; font-size: 9px; text-align: left; text-transform: uppercase; }
.source-table td { padding: 3px; border: 1px solid #cbd3d8; }
.source-table th:last-child, .source-table td:last-child { width: 42px; text-align: center; }
.source-table input, .source-table select { border: 0; min-height: 29px; }
.source-table textarea { width: 100%; min-width: 0; resize: vertical; }
.source-repeat-table { overflow: visible; }
.source-repeat-table .source-table { border-collapse: separate; border-spacing: 6px; }
.source-repeat-table .source-table th { border: 1px solid #9fc2f4; border-radius: 6px; background: #dbe8fb; padding: 10px 9px; color: #132d54; text-align: center; }
.source-repeat-table .source-table th:first-child { text-align: left; }
.source-repeat-table .source-table td { border: 1px solid #d2def0; border-radius: 6px; background: #f5f8fd; padding: 6px; vertical-align: middle; }
.source-repeat-table .source-table input,
.source-repeat-table .source-table select,
.source-repeat-table .source-table textarea { min-height: 38px; border: 1px solid #c3d0dc; border-radius: 4px; background: #fff; padding: 7px 8px; }
.source-repeat-poItems .source-table th:first-child { width: 56%; }
.source-repeat-poItems .source-table th:nth-child(2) { width: 10%; }
.source-repeat-poItems .source-table th:nth-child(3) { width: 15%; }
.source-repeat-poItems .source-table th:nth-child(4) { width: 15%; }
.source-repeat-poItems .source-table th:last-child { width: 48px; }
.source-repeat-poItems .source-table td:not(:first-child) input { text-align: right; }
.source-repeat-woMaterials .source-table th:first-child { width: 56%; }
.source-repeat-woMaterials .source-table th:nth-child(2) { width: 10%; }
.source-repeat-woMaterials .source-table th:nth-child(3) { width: 29%; }
.source-repeat-woMaterials .source-table th:last-child { width: 48px; }
.source-repeat-woProcesses .source-table th:first-child { width: 23%; }
.source-repeat-woProcesses .source-table th:nth-child(2) { width: 62%; }
.source-repeat-woProcesses .source-table th:nth-child(3) { width: 9%; }
.source-repeat-woProcesses .source-table th:last-child { width: 48px; }
.source-repeat-woProcesses [name="processHours"] { text-align: center; }
.source-repeat-woProcesses .source-table { border-spacing: 4px; }
.source-repeat-woProcesses .source-table th { padding: 7px 8px; }
.source-repeat-woProcesses .source-table td { padding: 3px; }
.source-repeat-woProcesses .source-table textarea { height: 38px; min-height: 38px; resize: none; overflow-y: auto; }
.source-form[data-form-kind="purchase-order"] > .source-job-context + .source-card .source-control { border-color: #c3d0dc; border-radius: 4px; background: #f5f8fd; }
.source-add-row { margin: 7px 6px 0; min-height: 31px; border: 1px solid #b8cdf0; border-radius: 6px; background: #f0f6ff; color: var(--empire-blue-dark); padding: 5px 10px; font-size: 10px; font-weight: 800; }
.source-remove-row { width: 28px; height: 28px; border: 1px solid #b8cdf0; border-radius: 3px; background: #f0f6ff; color: var(--empire-blue-dark); font-weight: 900; }
.source-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 12px; margin-top: 10px; color: var(--steel-650); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.source-total strong { min-width: 100px; color: var(--steel-950); font-size: 16px; text-align: right; }
.source-card-body > .source-total:not(.quote-items-total) { width: max-content; max-width: 100%; margin-left: auto; border: 1px solid #9fc2f4; border-radius: 7px; background: #e8f1ff; padding: 7px 12px; color: var(--empire-blue-dark); text-transform: none; }
.quote-items-editor .source-table-wrap { overflow: visible; }
.quote-items-editor .source-table { border-collapse: separate; border-spacing: 6px; }
.quote-items-editor .source-table th { border: 1px solid #9fc2f4; border-radius: 6px; background: #dbe8fb; padding: 10px 9px; color: #132d54; text-align: center; }
.quote-items-editor .source-table th:first-child { width: 48%; text-align: left; }
.quote-items-editor .source-table th:nth-child(2) { width: 10%; }
.quote-items-editor .source-table th:nth-child(3) { width: 16%; }
.quote-items-editor .source-table th:nth-child(4) { width: 16%; }
.quote-items-editor .source-table th:last-child { width: 64px; }
.quote-items-editor .source-table td { border: 1px solid #d2def0; border-radius: 6px; background: #f5f8fd; padding: 6px; vertical-align: middle; }
.quote-items-editor .source-table input,
.quote-items-editor .source-table textarea { min-height: 38px; border: 1px solid #c3d0dc; border-radius: 4px; background: #fff; padding: 7px 8px; }
.quote-items-editor .source-table td:not(:first-child) input { text-align: right; }
.quote-items-editor .quote-item-extension { border-style: dashed; background: #f2f7ff; color: #14222d; font-weight: 850; }
.quote-items-editor .source-table td:last-child { text-align: center; }
.quote-items-editor .source-remove-row { border-color: #b8cdf0; background: #f0f6ff; color: var(--empire-blue-dark); }
.quote-items-editor .source-add-row { margin: 7px 6px 0; border-color: #b8cdf0; border-radius: 6px; background: #f0f6ff; }
.quote-items-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 8px 6px 0; }
.quote-items-footer .source-checks { margin: 0; }
.quote-items-total { width: max-content; max-width: 100%; margin: 0; border: 1px solid #9fc2f4; border-radius: 7px; background: #e8f1ff; padding: 7px 12px; color: var(--empire-blue-dark); font-size: 13px; text-transform: none; }
.quote-items-total strong { min-width: 0; color: #075bd2; font-size: 20px; }
.source-checks { display: flex; align-items: center; gap: 22px; margin-top: 10px; }
.source-totals { width: min(360px, 100%); display: grid; gap: 5px; margin: 12px 0 0 auto; }
.source-totals label { display: grid; grid-template-columns: 1fr 130px; align-items: center; gap: 10px; color: var(--steel-650); font-size: 10px; font-weight: 800; text-align: right; text-transform: uppercase; }
.source-totals label:last-child { padding-top: 5px; border-top: 2px solid var(--empire-blue); color: var(--steel-950); }
.source-upload { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(260px, 1fr); gap: 12px; align-items: stretch; border: 1px dashed #93a5b1; background: #f9fbfc; padding: 10px; }
.source-upload > label { position: relative; min-height: 58px; display: grid; place-content: center; gap: 3px; color: var(--empire-blue-dark); text-align: center; cursor: pointer; }
.source-upload > label span { color: var(--steel-650); font-size: 10px; }
.source-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.source-file-list { display: grid; align-content: center; gap: 5px; color: var(--steel-650); font-size: 10px; }
.stored-file-list, .pending-file-list { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.attachment-chip { min-width: 0; max-width: 100%; min-height: 27px; flex: 0 0 auto; display: inline-flex; align-items: stretch; overflow: hidden; border: 1px solid #9fc2f4; border-radius: 4px; background: #eef6ff; color: var(--empire-blue-dark); }
.attachment-chip-open, .attachment-chip > span { min-width: 0; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: transparent; color: inherit; padding: 5px 8px; font-size: 9px; font-weight: 850; text-align: left; }
.attachment-chip-open:hover { background: #dcecff; }
.attachment-chip small { display: inline-flex; align-items: center; border-left: 1px solid #c3d8e8; padding: 0 6px; color: #60788b; font-size: 8px; white-space: nowrap; }
.attachment-chip-remove { width: 26px; flex: 0 0 26px; border: 0; border-left: 1px solid #c3d8e8; background: transparent; color: #9a1e1e; padding: 0; font-size: 10px; font-weight: 900; }
.attachment-chip-remove:hover { background: #ffe8e5; }
.job-file-empty { color: #6d8495; font-size: 9px; }
.job-entry-status-line { display: grid; grid-template-columns: 86px minmax(110px, auto) 1fr; align-items: center; gap: 10px; margin: -1px 0 11px; border: 1px solid #b9cfe1; border-left: 4px solid var(--empire-blue); background: #eef7fd; padding: 8px 10px; }
.job-entry-assignment-grid .job-entry-status-line { grid-column: span 2; min-width: 0; min-height: 57px; margin: 0; }
.job-entry-status-line span { color: #526571; font-size: 9px; font-weight: 800; }
.job-entry-status-line strong { font-size: 11px; }
.job-entry-status-line small { color: #526571; font-size: 10px; text-align: right; }
.job-document-register { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.job-document-icon { font-size: 27px; text-align: center; }
.job-document-collection { min-width: 0; min-height: 92px; display: grid; align-content: start; gap: 9px; border: 1px solid #9eb8cc; border-left: 5px solid var(--empire-blue); border-radius: 5px; background: #f4f9fd; padding: 9px 11px; color: var(--empire-blue-dark); }
.job-document-collection-head { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.job-document-collection-head > div:not(.job-document-collection-actions) { min-width: 0; display: grid; gap: 2px; }
.job-document-collection-head small { color: var(--empire-blue-dark); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.job-document-collection-head strong { overflow: hidden; color: #587185; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.job-document-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-left: 52px; }
.job-document-item { min-width: 0; max-width: 100%; display: inline-flex; overflow: hidden; border: 1px solid #83afd2; border-radius: 4px; background: #fff; box-shadow: 0 1px 2px rgba(11,22,35,.06); }
.job-document-item:hover { border-color: var(--empire-blue); }
.job-document-file { min-width: 0; display: inline-flex; align-items: center; gap: 7px; border: 0; background: #fff; padding: 5px 8px; color: var(--empire-blue-dark); }
.job-document-file:hover { background: #eaf4ff; }
.job-document-file b { border-radius: 2px; background: #d92121; padding: 3px 4px; color: #fff; font-size: 7px; letter-spacing: 0; line-height: 1; }
.job-document-item.is-draft .job-document-file b { background: #748695; }
.job-document-item.is-stale { border-color: #d59a28; background: #fffbef; }
.job-document-item.is-stale .job-document-file { background: #fffbef; color: #7a5000; }
.job-document-item.is-stale .job-document-file:hover { background: #fff3cc; }
.job-document-item.is-stale .job-document-file b { background: #c17b00; }
.job-document-item.is-stale .job-document-edit { border-left-color: #e4bf70; background: #fff0ba; color: #714900; }
.job-document-item.is-stale .job-document-edit:hover { background: #ffe69a; }
.job-document-file span { max-width: 170px; overflow: hidden; font-size: 10px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.job-document-file em { border-left: 1px solid #bdd2e2; padding-left: 7px; color: #587185; font-size: 8px; font-style: normal; font-weight: 750; white-space: nowrap; }
.job-document-edit { flex: 0 0 auto; border: 0; border-left: 1px solid #bdd2e2; background: #eef6ff; color: var(--empire-blue-dark); padding: 5px 8px; font-size: 8px; font-weight: 850; }
.job-document-edit:hover { background: #dcecff; }
.job-document-remove { width: 27px; flex: 0 0 27px; border: 0; border-left: 1px solid #e1b4af; background: #fff8f7; color: #a1281e; padding: 0; font-size: 13px; font-weight: 900; }
.job-document-remove:hover { background: #ffe3df; color: #7f1710; }
.job-document-empty { color: #6d8495; font-size: 10px; }
.job-document-summary { padding-left: 52px; color: #587185; font-size: 9px; font-weight: 750; }
.job-document-collection:has(.job-document-item.is-stale) { border-color: #d2a247; border-left-color: #c17b00; background: #fffaf0; }
.job-document-collection-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.job-document-collection-actions button { min-height: 27px; border: 1px solid #9fc2f4; border-radius: 4px; background: #eef6ff; color: var(--empire-blue-dark); padding: 4px 8px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.job-document-collection-actions button:hover { border-color: var(--empire-blue); background: #dcecff; }
.job-entry-files { margin-top: 10px; padding-top: 9px; border-top: 1px solid #c8d7e2; }
.job-file-toolbar { min-height: 32px; display: flex; align-items: center; gap: 10px; }
.job-file-toolbar > label { min-height: 30px; display: inline-flex; align-items: center; gap: 6px; position: relative; border: 1px solid #9fc2f4; border-radius: 4px; background: #eef6ff; color: var(--empire-blue-dark); padding: 4px 9px; cursor: pointer; }
.job-file-toolbar > label:hover { border-color: var(--empire-blue); background: #dcecff; }
.job-file-toolbar > label span { font-size: 14px; }
.job-file-toolbar > label strong { font-size: 9px; }
.job-file-toolbar input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.job-file-toolbar .source-file-list { min-width: 0; min-height: 0; flex: 1 1 auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: #587185; }
.job-file-toolbar .stored-file-list, .job-file-toolbar .pending-file-list { display: contents; }
.checkbox-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.checkbox-list .check-field { border: 1px solid var(--steel-200); background: var(--white); padding: 8px 10px; }
.line-entry-grid, .po-line-entry-grid { display: grid; gap: 6px; margin-bottom: 12px; }
.line-entry-grid { grid-template-columns: minmax(240px, 1fr) 100px 130px; }
.po-line-entry-grid { grid-template-columns: minmax(210px, 1fr) 90px 90px 120px; }
.line-entry-grid > span, .po-line-entry-grid > span { color: var(--steel-650); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.line-entry-grid input, .po-line-entry-grid input { min-width: 0; min-height: 34px; border: 1px solid var(--steel-300); border-radius: 3px; background: var(--white); padding: 6px 8px; }
.document-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px; border-bottom: 1px solid var(--steel-200); }
.document-action-grid button { min-height: 72px; display: grid; align-content: center; gap: 4px; border: 1px solid var(--steel-300); border-left: 4px solid var(--empire-blue); border-radius: 4px; background: var(--white); padding: 10px 12px; text-align: left; }
.document-action-grid button:hover { background: #eef7fd; border-color: var(--empire-blue); }
.document-action-grid button strong { color: var(--steel-950); font-size: 12px; }
.document-action-grid button span { color: var(--steel-650); font-size: 10px; }
.document-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px; border-bottom: 1px solid var(--steel-200); }
.document-status-panel { min-height: 124px; display: flex; flex-direction: column; gap: 7px; border: 1px solid var(--steel-300); border-top: 3px solid var(--empire-blue); border-radius: 4px; background: #fff; padding: 11px; }
.document-status-panel > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.document-status-panel > div:first-child > span:first-child { color: var(--steel-650); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.document-status-panel > strong { color: var(--steel-950); font-size: 15px; }
.document-status-panel > small { min-height: 28px; color: var(--steel-650); font-size: 10px; }
.document-status-panel > div:last-child { display: flex; gap: 6px; margin-top: auto; }
.document-status-panel button { min-height: 30px; padding: 5px 9px; }
.document-table { min-width: 980px; }
.document-table .row-actions { min-width: 225px; flex-wrap: nowrap; }
.settings-list { padding: 4px 16px 10px; }
.settings-list > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--steel-100); }
.settings-list span { color: var(--steel-650); }
.settings-actions { display: flex; gap: 7px; padding: 10px 16px 16px; }
.fab-sort { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.fab-sort select { border: 1px solid #aab4ba; border-radius: 2px; background: rgba(255,255,255,.82); color: #17232d; font: inherit; }
.fab-sort select { min-height: 30px; padding: 3px 6px; }
.completion-warning { margin: 0 0 16px; border: 1px solid #d99a22; border-left-width: 4px; background: #fff8e7; padding: 12px 14px; }
.completion-warning strong { display: block; margin-bottom: 6px; }
.completion-warning ul { margin: 0; padding-left: 19px; }
.completion-blocker { margin: 0 0 16px; border: 1px solid #b42318; border-left-width: 4px; background: #fff0ee; padding: 12px 14px; }
.completion-blocker strong, .completion-blocker span { display: block; }
.completion-blocker ul { margin: 6px 0; padding-left: 19px; }
.customer-match-status { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; border: 1px solid #d99a22; border-left-width: 4px; background: #fff8e7; padding: 9px 11px; }
.customer-match-status[hidden], .customer-create-confirm[hidden] { display: none; }
.customer-match-status span { color: var(--steel-650); font-size: 11px; }
.customer-create-confirm { grid-column: 1 / -1; }
.conversion-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--steel-200); margin-bottom: 14px; }
.conversion-summary > div { display: grid; gap: 3px; padding: 10px; border-right: 1px solid var(--steel-200); border-bottom: 1px solid var(--steel-200); }
.conversion-summary span { color: var(--steel-650); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.backup-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; }
.backup-toolbar p { margin: 0; color: var(--steel-650); }
.backup-list { display: grid; gap: 6px; }
.backup-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--steel-200); padding: 9px 10px; }
.backup-row > div { display: grid; gap: 2px; }
.backup-row > div:last-child { display: flex; gap: 6px; }
.backup-row span { color: var(--steel-650); font-size: 10px; }
.version-list { display: grid; gap: 6px; }
.version-list button { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; width: 100%; border: 1px solid var(--steel-200); border-radius: 3px; background: #fff; padding: 10px; text-align: left; }
.pilot-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--steel-200); }
.pilot-checklist > div { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; min-height: 38px; padding: 6px 14px; border-bottom: 1px solid var(--steel-200); }
.pilot-checklist > div:nth-child(odd) { border-right: 1px solid var(--steel-200); }
.pilot-checklist > div > span { font-weight: 800; color: #168052; }
.report-actions { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.report-metrics { grid-template-columns: repeat(6, minmax(130px, 1fr)); margin-bottom: 14px; }
.document-reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--steel-200); }
.document-reference-grid > div { padding: 9px 10px; background: var(--steel-050); }
.document-reference-grid dt { color: var(--steel-650); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.document-reference-grid dd { margin: 4px 0 0; font-weight: 700; }

.document-preview { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--steel-300); border-radius: 4px; box-shadow: 0 20px 60px rgba(21,32,43,.3); }
.document-preview::backdrop { background: rgba(21,32,43,.58); }
.document-preview-toolbar { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 14px; border-bottom: 1px solid var(--steel-300); background: var(--steel-950); color: var(--white); }
.document-preview-toolbar > div { display: flex; gap: 7px; }
.document-preview-body { overflow: auto; padding: 18px; background: #dfe4e8; }
.document-preview-stage { position: relative; margin: 0 auto; background: var(--white); box-shadow: 0 4px 20px rgba(21,32,43,.15); }
.document-preview-frame { position: absolute; inset: 0 auto auto 0; display: block; border: 0; background: var(--white); transform-origin: top left; }
.document-preview.stored-pdf-preview-dialog { width: min(1120px, calc(100vw - 32px)); height: calc(100vh - 24px); }
.stored-pdf-preview-dialog .document-preview-body { height: calc(100vh - 75px); padding: 0; overflow: hidden; background: #525659; }
.stored-pdf-frame { display: block; width: 100%; height: 100%; border: 0; background: #525659; }
.customer-document { width: 100%; max-width: 820px; min-height: 1030px; margin: 0 auto; padding: 42px 48px 34px; background: var(--white); color: #18222b; box-shadow: 0 4px 20px rgba(21,32,43,.15); font-family: Arial, sans-serif; }
.document-letterhead { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-bottom: 22px; border-bottom: 4px solid var(--empire-blue); }
.document-letterhead img { width: 185px; max-height: 92px; object-fit: contain; object-position: left center; }
.document-letterhead > div { text-align: right; }
.document-letterhead strong, .document-letterhead span { display: block; }
.document-letterhead strong { font-size: 19px; color: var(--empire-blue-dark); }
.document-letterhead span { margin-top: 5px; color: var(--steel-650); font-size: 11px; }
.document-addresses { display: grid; grid-template-columns: 1.2fr 1fr; gap: 35px; padding: 24px 0; }
.document-addresses small, .document-project small, .document-note small { display: block; margin-bottom: 6px; color: var(--empire-blue-dark); font-size: 9px; font-weight: 800; }
.document-addresses strong, .document-addresses span { display: block; margin-bottom: 4px; }
.document-addresses dl { display: grid; grid-template-columns: 1fr 1.2fr; margin: 0; font-size: 10px; }
.document-addresses dt, .document-addresses dd { margin: 0; padding: 3px 0; }
.document-addresses dt { color: var(--steel-650); }
.document-addresses dd { text-align: right; font-weight: 700; }
.document-project { padding: 14px 16px; border-left: 4px solid var(--empire-blue); background: var(--steel-050); }
.document-project h1 { margin: 0 0 7px; font-size: 18px; }
.document-project p, .document-note p { margin: 0; line-height: 1.5; font-size: 11px; }
.document-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 22px 0; border: 1px solid var(--steel-300); background: var(--steel-300); }
.document-meta-grid > div { min-height: 58px; padding: 10px; background: var(--white); }
.document-meta-grid small, .document-meta-grid strong { display: block; }
.document-meta-grid small { margin-bottom: 5px; color: var(--steel-650); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.document-meta-grid strong { font-size: 10px; }
.document-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.document-two-column .document-project { margin: 0; }
.document-instructions { margin-top: 12px; min-height: 110px; }
.document-signoff { display: grid; grid-template-columns: 1.4fr .7fr 1.2fr; gap: 24px; margin-top: 50px; font-size: 9px; font-weight: 700; }
.document-signoff div { display: grid; gap: 22px; }
.document-signoff span { border-bottom: 1px solid var(--steel-650); }
.delivery-signature { display: grid; grid-template-columns: 1fr 1.4fr .8fr; gap: 25px; margin-top: 70px; }
.delivery-signature div { display: grid; gap: 28px; color: var(--steel-650); font-size: 9px; text-transform: uppercase; }
.delivery-signature strong { border-bottom: 1px solid var(--steel-650); }
.document-lines { width: 100%; margin-top: 22px; border-collapse: collapse; font-size: 10px; }
.document-lines th { padding: 8px; background: var(--steel-800); color: var(--white); text-align: left; }
.document-lines th:nth-last-child(-n+3), .document-lines td:nth-last-child(-n+3) { text-align: right; }
.document-lines td { padding: 10px 8px; border-bottom: 1px solid var(--steel-200); vertical-align: top; }
.document-lines td strong, .document-lines td small { display: block; }
.document-lines td small { margin-top: 4px; color: var(--steel-650); }
.document-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 35px; margin-top: 24px; }
.document-note { margin-bottom: 14px; }
.document-totals > div { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; border-bottom: 1px solid var(--steel-200); }
.document-totals .total { margin-top: 5px; padding: 11px 0; border-top: 3px solid var(--empire-blue); color: var(--empire-blue-dark); font-size: 15px; }
.customer-document > footer { margin-top: 42px; padding-top: 12px; border-top: 1px solid var(--steel-300); color: var(--steel-650); font-size: 9px; text-align: center; }

.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 360px; transform: translateY(18px); opacity: 0; pointer-events: none; background: var(--steel-950); color: var(--white); border-left: 4px solid var(--empire-blue); border-radius: 4px; box-shadow: var(--shadow); padding: 11px 14px; transition: .16s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: var(--red); }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 112px 150px minmax(260px, 540px) 1fr; gap: 10px; padding-left: 14px; padding-right: 14px; }
  .topbar-brand img { width: 104px; }
  .save-status { min-width: auto; }
  .save-status strong { display: none; }
  .metric-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .estimate-layout { grid-template-columns: 1fr; }
  .estimate-summary { position: static; }
  .task-layout { grid-template-columns: 1fr; }
  .workload-toolbar { align-items: stretch; flex-direction: column; }
  .workload-controls { justify-content: flex-start; }
  .production-toolbar { align-items: flex-start; }
  .production-toolbar-controls { align-items: flex-start; flex-wrap: wrap; }
  .production-toolbar-summary { align-self: stretch; justify-content: flex-end; }
  .production-filter-group { flex-wrap: wrap; }
  .report-metrics { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
}

@media (max-width: 900px) {
  body { min-width: 760px; }
  .app-shell { grid-template-columns: 60px minmax(0, 1fr); }
  .sidebar { width: 60px; }
  .sidebar:hover, .sidebar:focus-within { width: 214px; }
  .sidebar nav { min-width: 214px; }
  .sidebar .user-block { min-width: 214px; padding-left: 14px; }
  .sidebar nav button, .sidebar-tools button { padding-left: 8px; }
  .topbar { width: calc(100% + 60px); margin-left: -60px; grid-template-columns: 96px 122px minmax(220px, 1fr) auto; gap: 8px; padding-left: 11px; padding-right: 11px; }
  .topbar-brand img { width: 90px; }
  .page-heading h1 { font-size: 20px; }
  .quick-actions { gap: 5px; }
  .quick-actions .save-status { display: none; }
  .quick-actions button { padding-left: 9px; padding-right: 9px; }
  .view { padding: 14px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(125px, 1fr)); }
  .today-metrics { grid-template-columns: repeat(2, minmax(125px, 1fr)); }
  .job-today-strip { grid-template-columns: repeat(2, minmax(125px, 1fr)); }
  .two-column, .record-grid { grid-template-columns: 1fr; }
  .job-editor-body { grid-template-columns: 1fr; }
  .job-form-group + .job-form-group { border-top: 1px solid var(--steel-200); border-left: 0; }
  .job-entry-grid, .job-entry-assignment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-entry-field { grid-column: span 1; }
  .job-entry-assignment-grid .job-entry-status-line { grid-column: span 2; }
  .job-document-register { grid-template-columns: 1fr; }
  .job-closeout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-two { grid-column: auto; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .production-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .production-summary > div:nth-child(2) { border-right: 0; }
  .production-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--steel-200); }
  .document-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  @page { size: letter; margin: .35in; }
  body { min-width: 0; background: var(--white); }
  body > * { display: none !important; }
  body > .document-preview[open] { position: static; display: block !important; width: auto; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; box-shadow: none; }
  .document-preview-toolbar { display: none !important; }
  .document-preview-body { padding: 0; background: var(--white); }
  .customer-document { width: auto; max-width: none; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
}
.quote-department-badge {
  display: inline-flex;
  align-items: center;
  min-width: 74px;
  padding: 5px 9px;
  border: 1px solid #9fc8f5;
  border-radius: 4px;
  background: #eef6ff;
  color: #075ea8;
  font-size: 12px;
  font-weight: 800;
}

.quote-department-commercial {
  border-color: #b6c0cb;
  background: #f3f5f7;
  color: #344454;
}

.quote-department-curb {
  border-color: #9bcbb1;
  background: #edf8f1;
  color: #17643d;
}

.quotes-table td:first-child strong {
  white-space: nowrap;
}


/* Spreadsheet-style work order editor */
.form-dialog.simple-document-dialog {
  width: min(1050px, calc(100vw - 32px));
  border: 0;
  border-radius: 28px;
  overflow: hidden;
}
.form-dialog.simple-document-dialog header {
  min-height: 72px;
  padding: 13px 24px;
  border-top: 0;
  border-bottom: 0;
  box-shadow: none;
}
.form-dialog.simple-document-dialog header .dialog-heading {
  flex: 1 1 auto;
}
.form-dialog.simple-document-dialog header p {
  display: none;
}
.form-dialog.simple-document-dialog header h2 {
  font-size: 24px;
  font-weight: 500;
}
.form-dialog.simple-document-dialog.job-workspace-document header h2::before {
  content: none;
}
.form-dialog.simple-document-dialog header .dialog-close {
  width: 48px;
  height: 48px;
  min-height: 48px;
  flex: 0 0 48px;
  border: 3px solid #0b69a5;
  border-radius: 50%;
  background: #fff;
  padding: 0;
  color: #46545d;
  font-size: 0;
}
.form-dialog.simple-document-dialog header .dialog-close::after {
  content: "×";
  font-size: 31px;
  font-weight: 300;
  line-height: 1;
}
.form-dialog.simple-document-dialog .dialog-body {
  padding: 0 26px;
  background: #fff;
}
.form-dialog.simple-document-dialog footer {
  min-height: 52px;
  padding: 8px 26px 14px;
  border-top: 0;
  box-shadow: none;
}
.form-dialog.simple-document-dialog footer button {
  min-height: 31px;
  padding: 5px 12px;
  font-size: 10px;
}
.work-order-reference-form {
  gap: 0;
  background: #fff;
  padding-bottom: 12px;
}
.work-order-reference-form .source-card {
  margin: 0 12px 12px;
  border-color: #0871d5;
  box-shadow: none;
}
.work-order-reference-form .source-card > h3 {
  padding: 11px 13px;
  background: linear-gradient(180deg, #1688f0, #0758d9);
  text-transform: uppercase;
}
.work-order-reference-form .source-card-body {
  padding: 11px 14px 13px;
}
.work-order-reference-form .source-entry-grid {
  grid-template-columns: 105px minmax(180px, 1fr) 105px minmax(180px, 1fr);
  gap: 10px 12px;
}
.work-order-reference-form .source-label {
  color: #182431;
  text-align: left;
}
.work-order-reference-form .source-control {
  min-height: 34px;
}
.work-order-reference-form .source-entry-grid > textarea.source-wide-control {
  min-height: 72px;
}
.work-order-reference-form .form-disclosure {
  margin-top: 11px;
  box-shadow: none;
}
.work-order-reference-form .form-disclosure > summary {
  min-height: 34px;
}
.work-order-reference-form > .form-disclosure {
  margin: 0 12px 12px;
}
.work-order-project-notes {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid #b8cdf0;
  border-radius: 7px;
  background: #f5f8fd;
}
.work-order-project-notes .source-label {
  grid-column: 1;
  padding: 9px 10px;
  background: #dbe8fb;
  text-transform: uppercase;
}
.work-order-project-notes .source-wide-control {
  grid-column: 1;
  min-height: 72px;
  border: 0;
  border-top: 1px solid #b8cdf0;
  border-radius: 0;
  background: #f8faff;
}
.work-order-instructions {
  position: relative;
}
.work-order-instructions .work-order-total {
  min-height: 31px;
  margin: -38px 6px 0 auto;
  padding: 5px 11px;
  font-size: 11px;
}
.work-order-instructions .work-order-total strong {
  min-width: 55px;
  color: #075bd2;
  font-size: 13px;
}
.work-order-reference-form .source-repeat-table .source-table {
  border-spacing: 4px;
}
.work-order-reference-form .source-repeat-table .source-table th {
  padding: 8px;
}
.work-order-reference-form .source-repeat-table .source-table td {
  padding: 4px;
}
.work-order-reference-form .source-repeat-table .source-table input,
.work-order-reference-form .source-repeat-table .source-table select,
.work-order-reference-form .source-repeat-table .source-table textarea {
  min-height: 34px;
}
.work-order-reference-form .source-repeat-woProcesses .source-table textarea {
  height: 34px;
  min-height: 34px;
}
@media (max-width: 760px) {
  .form-dialog.simple-document-dialog {
    width: calc(100vw - 12px);
    border-radius: 16px;
  }
  .form-dialog.simple-document-dialog header {
    min-height: 58px;
    padding: 8px 14px;
  }
  .form-dialog.simple-document-dialog header h2 {
    font-size: 20px;
  }
  .form-dialog.simple-document-dialog header .dialog-close {
    width: 40px;
    height: 40px;
    min-height: 40px;
    flex-basis: 40px;
  }
  .form-dialog.simple-document-dialog .dialog-body {
    padding: 0 6px;
  }
  .form-dialog.simple-document-dialog footer {
    padding: 8px 12px 12px;
  }
  .work-order-reference-form .source-entry-grid {
    grid-template-columns: 90px minmax(0, 1fr);
  }
  .work-order-reference-form .source-entry-grid > .source-label,
  .work-order-reference-form .source-entry-grid > .source-control,
  .work-order-reference-form .source-entry-grid > .source-date-time {
    grid-column: auto;
  }
  .work-order-reference-form .source-entry-grid > .source-wide-label {
    grid-column: 1;
  }
  .work-order-reference-form .source-entry-grid > .source-wide-control {
    grid-column: 2;
  }
  .work-order-instructions .work-order-total {
    margin: 8px 6px 0 auto;
  }
}


/* Reference-style Job Edit editor */
.form-dialog.simple-document-dialog:has(.job-entry-reference-form) {
  width: min(1050px, calc(100vw - 32px));
}
.job-entry-reference-form {
  gap: 0;
  background: #fff;
  padding-bottom: 12px;
}
.job-entry-reference-form .source-card {
  margin: 0 12px 12px;
  border-color: #0871d5;
  box-shadow: none;
}
.job-entry-reference-form .source-card > h3 {
  padding: 11px 13px;
  background: linear-gradient(180deg, #1688f0, #0758d9);
  text-transform: uppercase;
}
.job-entry-reference-form .source-card-body {
  padding: 12px 14px 13px;
}
.job-entry-reference-form .job-entry-grid,
.job-entry-reference-form .job-entry-assignment-grid {
  gap: 10px 12px;
}
.job-entry-reference-form .job-entry-field {
  grid-template-columns: 96px minmax(0, 1fr);
}
.job-entry-reference-form .job-entry-span-1 {
  grid-template-columns: 86px minmax(0, 1fr);
}
.job-entry-reference-form .job-entry-field > span {
  color: #182431;
  text-align: left;
}
.job-entry-reference-form .source-control {
  min-height: 34px;
}
.job-entry-reference-form .job-entry-field textarea.source-control {
  min-height: 72px;
}
.job-entry-reference-form .job-entry-assignment-grid .source-control {
  min-height: 36px;
}
.job-entry-reference-form .job-shipping-card[hidden] + .source-card {
  margin-top: 0;
}
.job-entry-reference-form .job-document-register {
  gap: 8px;
}
.job-entry-reference-form .job-document-collection {
  box-shadow: none;
}
.form-dialog.simple-document-dialog:has(.job-entry-reference-form) .dialog-header-controls {
  max-width: 440px;
  justify-content: flex-end;
}
.form-dialog.simple-document-dialog:has(.job-entry-reference-form) .dialog-header-controls .job-entry-department {
  width: 100%;
}
.form-dialog.simple-document-dialog:has(.job-entry-reference-form) .dialog-header-controls .job-entry-department > div {
  width: 100%;
}
.form-dialog.simple-document-dialog:has(.job-entry-reference-form) .dialog-header-controls .job-entry-department label {
  flex: 1 1 0;
}
.form-dialog.simple-document-dialog:has(.job-entry-reference-form) .dialog-header-controls .job-entry-department label span {
  min-width: 0;
  min-height: 34px;
  padding: 5px 9px;
}
.form-dialog.simple-document-dialog:has(.job-entry-reference-form) footer {
  padding-top: 7px;
}
@media (max-width: 760px) {
  .form-dialog.simple-document-dialog:has(.job-entry-reference-form) header {
    flex-wrap: wrap;
  }
  .form-dialog.simple-document-dialog:has(.job-entry-reference-form) header .dialog-heading {
    flex: 1 1 calc(100% - 56px);
  }
  .form-dialog.simple-document-dialog:has(.job-entry-reference-form) .dialog-header-controls {
    order: 3;
    max-width: none;
    flex-basis: 100%;
  }
  .job-entry-reference-form .job-entry-grid,
  .job-entry-reference-form .job-entry-assignment-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .job-entry-reference-form .job-entry-field,
  .job-entry-reference-form .job-entry-span-1,
  .job-entry-reference-form .job-entry-span-2,
  .job-entry-reference-form .job-entry-span-4 {
    grid-column: 1;
    grid-template-columns: 92px minmax(0, 1fr);
  }
}
