:root {
  --navy: #14253d;
  --navy-2: #1e3657;
  --blue: #2f6fad;
  --blue-soft: #eaf2fa;
  --ink: #182230;
  --muted: #687487;
  --line: #dce2e9;
  --paper: #ffffff;
  --bg: #f4f6f8;
  --green: #2c7a52;
  --green-soft: #e8f5ee;
  --amber: #9a6500;
  --amber-soft: #fff4d6;
  --red: #a33a3a;
  --red-soft: #fdecec;
  --shadow: 0 8px 28px rgba(20,37,61,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
.app-shell { display: grid; grid-template-columns: 245px minmax(0,1fr); min-height: 100vh; }
.sidebar { background: var(--navy); color: white; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.brand { padding: 4px 10px 22px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 18px; }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: .2px; }
.brand p { margin: 5px 0 0; color: #c5d4e7; font-size: 12px; }
.nav { display: grid; gap: 5px; }
.nav a { color: #dbe6f3; padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.nav a:hover, .nav a.active { background: var(--navy-2); color: white; text-decoration: none; }
.sidebar-footer { position: absolute; left: 16px; right: 16px; bottom: 18px; color: #b9c8da; font-size: 12px; }
.main { min-width: 0; }
.topbar { height: 66px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 20; }
.topbar .title { font-size: 18px; font-weight: 750; }
.topbar .user { color: var(--muted); font-size: 14px; }
.content { padding: 25px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 26px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 9px 13px; background: var(--blue); color: white; font-weight: 700; cursor: pointer; font-size: 14px; }
.btn:hover { opacity: .92; text-decoration: none; }
.btn.secondary { color: var(--ink); background: white; border-color: var(--line); }
.btn.danger { background: var(--red); }
.btn.small { padding: 6px 9px; font-size: 12px; }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(5, minmax(0,1fr)); }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.card { background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card.pad { padding: 18px; }
.stat { padding: 17px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 650; }
.stat .value { margin-top: 7px; font-size: 30px; font-weight: 800; }
.stat .detail { margin-top: 4px; color: var(--muted); font-size: 12px; }
.section-title { display: flex; justify-content: space-between; align-items: center; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.section-title h3 { margin: 0; font-size: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: #fbfcfd; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: #eef1f4; color: #596575; }
.progress { height: 8px; background: #e8edf2; border-radius: 99px; overflow: hidden; min-width: 100px; }
.progress span { display: block; height: 100%; background: var(--blue); }
.form-card { max-width: 920px; padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
input, select, textarea { width: 100%; border: 1px solid #cbd3dc; border-radius: 8px; padding: 10px 11px; background: white; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47,111,173,.18); border-color: var(--blue); }
textarea { min-height: 105px; resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 170px; }
.flash { border-radius: 8px; padding: 11px 13px; margin-bottom: 15px; background: var(--green-soft); color: var(--green); border: 1px solid #cce7d8; font-weight: 650; }
.flash.error { background: var(--red-soft); color: var(--red); border-color: #f4cccc; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: linear-gradient(135deg, #14253d 0%, #254b74 100%); }
.login-card { width: min(430px,100%); background: white; border-radius: 16px; padding: 30px; box-shadow: 0 20px 70px rgba(0,0,0,.25); }
.login-card h1 { margin: 0; font-size: 25px; }
.login-card p { color: var(--muted); margin: 7px 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; margin-top: 4px; }
.job-hero { padding: 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.job-hero h2 { margin: 0 0 5px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: 13px; margin-top: 12px; }
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); padding: 0 10px; overflow-x: auto; background: white; }
.tabs a { padding: 12px 10px; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover, .tabs a.active { color: var(--blue); border-bottom-color: var(--blue); text-decoration: none; }
.detail-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.7fr); gap: 16px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 15px; padding: 15px 17px; }
.kv .k { color: var(--muted); font-size: 12px; font-weight: 700; }
.kv .v { font-size: 13px; }
.timeline { padding: 10px 17px 15px; }
.timeline-item { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 8px 0; }
.timeline-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-top: 5px; }
.timeline-item .time { color: var(--muted); font-size: 11px; margin-top: 3px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.quick-form { padding: 15px 17px; border-top: 1px solid var(--line); background: #fbfcfd; }
.quick-form .row { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: 8px; }
.gallery { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 15px; }
.photo { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: white; }
.photo img { width: 100%; height: 160px; object-fit: cover; display: block; background: #e9edf2; }
.photo .caption { padding: 9px; font-size: 12px; }
.photo .caption strong { display: block; margin-bottom: 3px; }
.week-board { display: grid; grid-template-columns: repeat(7,minmax(150px,1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.day-column { background: white; border: 1px solid var(--line); border-radius: 10px; min-height: 220px; }
.day-column h4 { margin: 0; padding: 11px; border-bottom: 1px solid var(--line); font-size: 13px; }
.event-card { margin: 9px; padding: 9px; border-left: 4px solid var(--blue); background: var(--blue-soft); border-radius: 6px; font-size: 12px; }
.event-card strong { display: block; margin-bottom: 3px; }
.note { background: var(--amber-soft); color: #725014; border: 1px solid #f0dda8; border-radius: 9px; padding: 12px; font-size: 13px; }
.mobile-menu { display: none; }
@media (max-width: 1150px) {
  .grid.stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .gallery { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; }
  .sidebar-footer { position: static; margin: 20px 10px 0; }
  .nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .topbar { position: static; }
  .grid.stats, .grid.two, .grid.three, .detail-layout, .form-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quick-form .row { grid-template-columns: 1fr; }
  .page-head { align-items: stretch; flex-direction: column; }
}
@media (max-width: 520px) {
  .content { padding: 14px; }
  .topbar { padding: 0 14px; }
  .nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gallery { grid-template-columns: 1fr; }
  .job-hero { flex-direction: column; }
}

/* v0.3 workflow refinements */
.form-card.wide { max-width: none; }
.field-help { display:block; margin-top:5px; color:var(--muted); font-size:11px; font-weight:500; }
.inline-check { display:flex; align-items:center; gap:8px; font-weight:650; }
.inline-check input { width:auto; }
.filter-check { background:white; border:1px solid var(--line); border-radius:8px; padding:8px 10px; margin:0; }
.row-actions { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.row-actions form { margin:0; }
.multi-picker { position:relative; width:100%; }
.multi-picker summary { list-style:none; cursor:pointer; width:100%; min-height:42px; border:1px solid #cbd3dc; border-radius:8px; padding:10px 34px 10px 11px; background:white; color:var(--ink); position:relative; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.multi-picker summary::-webkit-details-marker { display:none; }
.multi-picker summary::after { content:'▾'; position:absolute; right:11px; top:9px; color:var(--muted); }
.multi-picker[open] summary { border-color:var(--blue); outline:2px solid rgba(47,111,173,.18); }
.multi-picker-panel { position:absolute; z-index:60; left:0; right:0; margin-top:5px; background:white; border:1px solid var(--line); box-shadow:0 14px 36px rgba(20,37,61,.18); border-radius:10px; padding:10px; min-width:280px; }
.multi-picker-options { max-height:260px; overflow:auto; margin-top:8px; }
.check-option { display:flex; gap:9px; align-items:flex-start; padding:8px; margin:0; border-radius:7px; cursor:pointer; font-weight:500; }
.check-option:hover { background:var(--blue-soft); }
.check-option input { width:auto; margin-top:3px; }
.check-option span { display:grid; }
.check-option small { color:var(--muted); margin-top:2px; }
.empty.compact { padding:14px 8px; }
.conflict-card { border-color:#e4a4a4; margin-bottom:16px; }
.conflict-list { display:grid; gap:8px; margin:12px 0; }
.conflict-list > div { padding:10px; border:1px solid #efc4c4; background:var(--red-soft); border-radius:8px; }
.event-card.additional-stop { border-left-color:var(--amber); background:var(--amber-soft); }
.event-time { font-weight:750; margin-bottom:3px; }
.assignment-stack { display:grid; gap:2px; margin-top:5px; }
.assignment-stack span { display:block; font-weight:650; }
.timeline-note { border-radius:0; border-left:0; border-right:0; }
.drop-zone { border:2px dashed #9eb4cc; border-radius:12px; padding:28px; text-align:center; background:#f7fbff; cursor:pointer; transition:.15s ease; }
.drop-zone.dragging { border-color:var(--blue); background:var(--blue-soft); transform:scale(1.005); }
.drop-zone input[type=file] { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.drop-zone strong, .drop-zone span { display:block; }
.drop-zone span { color:var(--muted); font-size:12px; margin-top:6px; }
.file-list { margin-top:12px; font-size:12px; font-weight:650; color:var(--blue); word-break:break-word; }
.pdf-tile { height:160px; display:grid; place-items:center; background:#eef1f4; font-weight:800; color:var(--ink); }
.crew-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; padding:16px; }
.crew-card { border:1px solid var(--line); border-radius:10px; padding:14px; background:#fbfcfd; }
.crew-card .multi-picker-panel { position:static; box-shadow:none; margin-top:6px; }
.muted-row { opacity:.65; }
@media (max-width:850px) { .crew-grid { grid-template-columns:1fr; } .multi-picker-panel { position:static; box-shadow:none; } }

/* v0.4 unified timeline and task workflow */
.complete-form { margin:0; }
.complete-check { display:inline-flex; align-items:center; gap:7px; margin:0; padding:7px 10px; border:1px solid #b8c4d1; border-radius:8px; background:white; color:var(--ink); cursor:pointer; font-weight:750; font-size:12px; white-space:nowrap; }
.complete-check:hover { border-color:var(--green); background:var(--green-soft); }
.complete-check input { width:16px; height:16px; margin:0; accent-color:var(--green); }
.complete-check.is-complete { border-color:#9bc9af; background:var(--green-soft); color:var(--green); }
.complete-check.compact { padding:5px 7px; font-size:11px; }
.completed-row { opacity:.68; background:#fafcfb; }
.completed-row strong { text-decoration:line-through; }
.schedule-task-state { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:7px; }

/* v0.5 date-prioritized job work queue */
.muted-text { color:var(--muted); }
.job-view-switch { display:inline-flex; gap:3px; padding:4px; margin-bottom:14px; border:1px solid var(--line); border-radius:10px; background:white; }
.job-view-switch a { padding:8px 12px; border-radius:7px; color:var(--muted); font-size:13px; font-weight:800; }
.job-view-switch a:hover, .job-view-switch a.active { background:var(--navy); color:white; text-decoration:none; }
.job-queue-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:5px 0 18px; }
.queue-summary-card { min-height:112px; padding:16px; border:1px solid var(--line); border-top:4px solid var(--blue); border-radius:11px; background:white; box-shadow:var(--shadow); }
.queue-summary-card span, .queue-summary-card small { display:block; }
.queue-summary-card span { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.queue-summary-card strong { display:block; margin:6px 0 2px; font-size:29px; }
.queue-summary-card small { color:var(--muted); }
.queue-summary-card.past-due { border-top-color:var(--red); }
.queue-summary-card.today { border-top-color:var(--green); }
.queue-summary-card.upcoming { border-top-color:var(--blue); }
.queue-summary-card.unscheduled { border-top-color:#7b8794; }
.job-queue-stack, .builder-groups { display:grid; gap:16px; }
.job-queue-section { overflow:hidden; }
.job-queue-section .section-title small { display:block; margin-top:4px; color:var(--muted); font-size:12px; }
.queue-past-due { border-top:4px solid var(--red); }
.queue-today { border-top:4px solid var(--green); }
.queue-upcoming { border-top:4px solid var(--blue); }
.queue-unscheduled { border-top:4px solid #7b8794; }
.queue-count { min-width:34px; padding:5px 9px; border-radius:999px; background:#eef1f4; text-align:center; font-size:12px; font-weight:850; }
.job-queue-table th:first-child, .job-queue-table td:first-child { width:190px; }
.job-date-cell strong, .job-date-cell small { display:block; }
.job-date-cell small { margin-top:5px; color:var(--muted); max-width:210px; }
.date-context { display:inline-block; margin-top:5px; padding:3px 7px; border-radius:999px; font-size:10px; font-weight:850; }
.date-context.past_due { background:var(--red-soft); color:var(--red); }
.date-context.today { background:var(--green-soft); color:var(--green); }
.date-context.upcoming { background:var(--blue-soft); color:var(--blue); }
.date-context.unscheduled { background:#eef1f4; color:#596575; }
.job-queue-row.past_due td:first-child { box-shadow:inset 4px 0 0 var(--red); }
.job-queue-row.today td:first-child { box-shadow:inset 4px 0 0 var(--green); }
.job-queue-row.upcoming td:first-child { box-shadow:inset 4px 0 0 var(--blue); }
.job-queue-row.unscheduled td:first-child { box-shadow:inset 4px 0 0 #7b8794; }
.builder-section { border-top:4px solid var(--navy-2); }
@media (max-width:1100px) { .job-queue-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:650px) { .job-queue-summary { grid-template-columns:1fr; } .job-view-switch { display:flex; } .job-view-switch a { flex:1; text-align:center; } }

/* v0.6 simplified weekly schedule and printable field schedule */
.schedule-page-head { margin-bottom:12px; }
.schedule-head-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.schedule-summary-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.schedule-summary-strip > div { padding:13px 15px; border:1px solid var(--line); border-radius:10px; background:white; box-shadow:var(--shadow); }
.schedule-summary-strip strong, .schedule-summary-strip span { display:block; }
.schedule-summary-strip strong { font-size:23px; line-height:1; }
.schedule-summary-strip span { margin-top:5px; color:var(--muted); font-size:11px; font-weight:750; }
.schedule-agenda { display:grid; gap:12px; }
.schedule-day { overflow:visible; }
.schedule-day.schedule-today { border-left:5px solid var(--green); }
.schedule-day-head { display:flex; align-items:center; justify-content:space-between; padding:12px 15px; border-bottom:1px solid var(--line); background:#f8fafb; }
.schedule-day-head > div { display:flex; align-items:baseline; gap:9px; }
.schedule-day-name { font-size:14px; font-weight:850; }
.schedule-day-head strong { color:var(--muted); font-size:12px; }
.schedule-day-items { display:grid; }
.schedule-agenda-item { display:grid; grid-template-columns:105px minmax(230px,1.45fr) minmax(170px,1fr) minmax(170px,1fr) 150px; gap:14px; align-items:center; padding:13px 15px; border-bottom:1px solid var(--line); background:white; }
.schedule-agenda-item:last-child { border-bottom:0; }
.schedule-agenda-item:hover { background:#fbfcfd; }
.schedule-agenda-item.is-complete { opacity:.68; background:#fafcfb; }
.schedule-agenda-item.additional-stop { box-shadow:inset 4px 0 0 var(--amber); }
.schedule-time-block strong, .schedule-time-block span, .schedule-time-block small { display:block; }
.schedule-time-block strong { font-size:13px; }
.schedule-time-block span, .schedule-time-block small { margin-top:2px; color:var(--muted); font-size:10px; }
.schedule-item-title { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin-bottom:4px; }
.schedule-item-title > strong { font-size:14px; }
.schedule-job-link { display:block; font-weight:750; }
.schedule-work-block small { display:block; margin-top:3px; color:var(--muted); }
.schedule-who-block, .schedule-where-block { min-width:0; }
.schedule-who-block strong, .schedule-where-block strong, .schedule-who-block small { display:block; overflow-wrap:anywhere; }
.schedule-who-block strong, .schedule-where-block strong { font-size:12px; }
.schedule-who-block small { margin-top:3px; color:var(--muted); font-size:10px; }
.schedule-label { display:block; margin-bottom:4px; color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.07em; text-transform:uppercase; }
.schedule-complete-block { display:flex; flex-direction:column; align-items:stretch; gap:6px; }
.schedule-complete-block .complete-check { justify-content:center; }
.schedule-item-more { position:relative; }
.schedule-item-more > summary { cursor:pointer; list-style:none; padding:6px 8px; border:1px solid var(--line); border-radius:7px; color:var(--muted); text-align:center; font-size:11px; font-weight:800; background:white; }
.schedule-item-more > summary::-webkit-details-marker { display:none; }
.schedule-item-more[open] > summary { border-color:var(--blue); color:var(--blue); }
.schedule-more-panel { position:absolute; z-index:70; right:0; top:36px; width:330px; padding:12px; border:1px solid var(--line); border-radius:10px; background:white; box-shadow:0 15px 36px rgba(20,37,61,.2); }
.schedule-more-panel p { margin:0 0 10px; color:var(--muted); font-size:12px; }
.schedule-open-day { padding:18px 15px; color:var(--muted); font-size:12px; }
.schedule-add-panel { margin-top:16px; overflow:visible; }
.schedule-add-panel > summary { display:flex; justify-content:space-between; align-items:center; gap:15px; cursor:pointer; list-style:none; padding:15px 17px; }
.schedule-add-panel > summary::-webkit-details-marker { display:none; }
.schedule-add-panel > summary div { display:grid; gap:3px; }
.schedule-add-panel > summary span:not(.btn) { color:var(--muted); font-size:11px; }
.schedule-add-body { padding:0 17px 17px; border-top:1px solid var(--line); }
.schedule-add-body form { padding-top:15px; }
.job-assignment-cell { min-width:180px; }
.job-assignment-names { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:4px; }
.job-assignment-names span { display:inline-block; padding:3px 7px; border-radius:999px; background:var(--blue-soft); color:var(--blue); font-size:10px; font-weight:850; }
.job-assignment-cell small { display:block; margin-top:3px; color:var(--muted); line-height:1.3; }
.assignment-unassigned { display:inline-block; padding:3px 7px; border-radius:999px; background:#eef1f4; color:#596575; font-size:10px; font-weight:850; }
@media (max-width:1180px) {
  .schedule-agenda-item { grid-template-columns:90px minmax(220px,1.5fr) minmax(150px,1fr) minmax(150px,1fr); }
  .schedule-complete-block { grid-column:2 / -1; flex-direction:row; justify-content:flex-end; }
  .schedule-more-panel { right:0; }
}
@media (max-width:850px) {
  .schedule-summary-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .schedule-head-actions { justify-content:flex-start; }
  .schedule-agenda-item { grid-template-columns:90px 1fr; gap:9px 12px; }
  .schedule-who-block, .schedule-where-block { grid-column:2; }
  .schedule-complete-block { grid-column:2; justify-content:flex-start; }
  .schedule-more-panel { position:static; width:auto; margin-top:6px; box-shadow:none; }
}
@media (max-width:560px) {
  .schedule-summary-strip { grid-template-columns:1fr 1fr; }
  .schedule-agenda-item { grid-template-columns:1fr; }
  .schedule-time-block, .schedule-work-block, .schedule-who-block, .schedule-where-block, .schedule-complete-block { grid-column:1; }
  .schedule-day-head > div { display:grid; gap:2px; }
}

/* v0.7 mobile phone test and responsive field view */
.topbar-left, .topbar-tools, .brand-row { display:flex; align-items:center; }
.topbar-left { min-width:0; gap:11px; }
.topbar-tools { gap:14px; }
.brand-row { justify-content:space-between; gap:12px; }
.mobile-menu-button, .mobile-nav-close { display:none; }
.phone-preview-link { font-size:12px; font-weight:800; color:var(--blue); }
.mobile-nav-backdrop { display:none; }

@media (max-width:900px) {
  body.nav-open { overflow:hidden; }
  .app-shell { display:block; min-height:100vh; }
  .main { width:100%; }
  .sidebar {
    position:fixed;
    z-index:120;
    top:0;
    left:0;
    width:min(86vw,320px);
    height:100dvh;
    transform:translateX(-105%);
    transition:transform .2s ease;
    overflow-y:auto;
    box-shadow:18px 0 45px rgba(0,0,0,.24);
  }
  body.nav-open .sidebar { transform:translateX(0); }
  .mobile-nav-backdrop {
    position:fixed;
    z-index:110;
    inset:0;
    background:rgba(12,22,35,.48);
  }
  body.nav-open .mobile-nav-backdrop { display:block; }
  .mobile-menu-button {
    display:inline-flex;
    align-items:center;
    gap:6px;
    min-height:40px;
    padding:7px 9px;
    border:1px solid var(--line);
    border-radius:8px;
    background:white;
    color:var(--ink);
    font-weight:800;
  }
  .mobile-menu-button span:first-child { font-size:19px; line-height:1; }
  .mobile-menu-text { font-size:12px; }
  .mobile-nav-close {
    display:inline-grid;
    place-items:center;
    width:38px;
    height:38px;
    border:1px solid rgba(255,255,255,.25);
    border-radius:8px;
    background:transparent;
    color:white;
    font-size:25px;
    cursor:pointer;
  }
  .sidebar-footer { position:static; margin-top:28px; }
  .topbar {
    min-height:58px;
    height:auto;
    padding:9px 12px;
    gap:9px;
  }
  .topbar .title { min-width:0; font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .topbar-tools { gap:8px; }
  .topbar .user { display:none; }
  .phone-preview-link { display:none; }
  .content { padding:12px; }
  .page-head { display:grid; gap:12px; }
  .page-head > div:last-child, .page-head .schedule-head-actions { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:7px; }
  .page-head h2 { font-size:22px; }
  .btn { min-height:42px; padding:9px 12px; }
  .btn.small { min-height:38px; padding:7px 9px; }
  input, select, textarea { min-height:44px; font-size:16px; }
  input[type="checkbox"], input[type="radio"] { min-height:0; }
  .form-grid { grid-template-columns:1fr; }
  .form-grid .full { grid-column:1; }
  .form-actions, .row-actions { flex-wrap:wrap; }
  .filters { display:grid; grid-template-columns:1fr 1fr; }
  .filters input, .filters select { width:100%; min-width:0; }
  .filters input:first-of-type { grid-column:1 / -1; }
  .grid.stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .grid.two, .grid.three, .detail-layout { grid-template-columns:1fr; }
  .job-hero { display:grid; gap:14px; }
  .job-hero .row-actions { justify-content:flex-start; }
  .job-meta { grid-template-columns:1fr; }
  .tabs { overflow-x:auto; flex-wrap:nowrap; -webkit-overflow-scrolling:touch; }
  .tabs a { flex:0 0 auto; min-height:42px; display:flex; align-items:center; }
  .quick-form, .card.pad, .form-card { padding:14px; }
  .section-title { align-items:flex-start; gap:10px; }
  .gallery { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .drop-zone { min-height:170px; padding:22px 12px; }
  .table-wrap { border-radius:0 0 12px 12px; -webkit-overflow-scrolling:touch; }
  table { min-width:720px; }
  th, td { padding:10px; }

  /* Jobs become readable touch cards instead of a wide spreadsheet. */
  .job-queue-table { min-width:0; }
  .job-queue-table thead { display:none; }
  .job-queue-table tbody, .job-queue-table tr, .job-queue-table td { display:block; width:100%; }
  .job-queue-table tr { padding:13px; border-bottom:1px solid var(--line); }
  .job-queue-table tr:last-child { border-bottom:0; }
  .job-queue-table td { position:relative; padding:8px 0 8px 104px; border:0; min-height:34px; box-shadow:none !important; }
  .job-queue-table td::before { position:absolute; left:0; top:9px; width:94px; color:var(--muted); font-size:10px; font-weight:850; letter-spacing:.04em; text-transform:uppercase; }
  .job-queue-table td:nth-child(1)::before { content:"Next date"; }
  .job-queue-table td:nth-child(2)::before { content:"Job"; }
  .job-queue-table td:nth-child(3)::before { content:"Builder"; }
  .job-queue-table td:nth-child(4)::before { content:"Stage"; }
  .job-queue-table td:nth-child(5)::before { content:"Open work"; }
  .job-queue-table td:nth-child(6)::before { content:"Scheduled to"; }
  .job-queue-table td:nth-child(7)::before { content:"Actions"; }
  .job-queue-table td:last-child { padding-bottom:2px; }
  .job-queue-table .job-date-cell { border-left:4px solid #7b8794; padding-left:104px; }
  .job-queue-row.past_due .job-date-cell { border-left-color:var(--red); }
  .job-queue-row.today .job-date-cell { border-left-color:var(--green); }
  .job-queue-row.upcoming .job-date-cell { border-left-color:var(--blue); }
  .job-assignment-cell { min-width:0; }
  .job-queue-summary { grid-template-columns:1fr 1fr; gap:8px; }
  .queue-summary-card { min-height:92px; padding:12px; }
  .queue-summary-card strong { font-size:24px; }
}

@media (max-width:520px) {
  .mobile-menu-text { display:none; }
  .content { padding:10px; }
  .grid.stats { grid-template-columns:1fr 1fr; gap:9px; }
  .stat { padding:13px; }
  .stat .value { font-size:25px; }
  .filters { grid-template-columns:1fr; }
  .filters input:first-of-type { grid-column:1; }
  .job-queue-summary { grid-template-columns:1fr 1fr; }
  .gallery { grid-template-columns:1fr; }
  .schedule-summary-strip { grid-template-columns:1fr 1fr; }
  .schedule-head-actions .btn { flex:1 1 44%; }
  .job-view-switch { width:100%; }
  .job-queue-table td { padding-left:92px; }
  .job-queue-table td::before { width:82px; }
}
.mobile-photo-actions { display:none; }
@media (max-width:900px) {
  .mobile-photo-actions { display:flex; align-items:center; flex-wrap:wrap; gap:9px; margin-top:11px; }
  .mobile-photo-actions span { color:var(--muted); font-size:11px; }
  .mobile-camera-upload { position:relative; overflow:hidden; }
  .mobile-camera-upload input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
}

/* v0.8 mobile detection, integrated issues, and Sales Proposal material intake */
.mobile-client .phone-preview-link { display:none; }
.compact-drop-zone { min-height:130px; }
.material-import-box { margin-bottom:14px; }
.material-import-history { display:flex; flex-wrap:wrap; gap:7px; align-items:center; margin:12px 0; padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:#f8fafb; font-size:12px; }
.bulk-material-bar { display:grid; grid-template-columns:auto minmax(150px,1fr) minmax(150px,1fr) minmax(150px,1fr) auto; gap:10px; align-items:end; margin:14px 0; padding:12px; border:1px solid var(--line); border-radius:10px; background:#f8fafb; }
.bulk-material-bar label { margin:0; }
.inline-material-form { min-width:145px; }
.other-source-field[hidden] { display:none !important; }
.proposal-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.proposal-summary > div { display:grid; gap:4px; }
.proposal-summary span, .proposal-summary a { font-size:13px; }
.proposal-import-controls { display:grid; grid-template-columns:minmax(230px,1.2fr) minmax(165px,1fr) minmax(165px,1fr) minmax(165px,1fr) auto; gap:10px; align-items:end; padding:14px; }
.selection-buttons { display:flex; flex-wrap:wrap; gap:7px; }
.proposal-lines-table input[type="text"], .proposal-lines-table input:not([type]) { min-width:90px; }
.proposal-lines-table td:nth-child(3) input { min-width:360px; }
.muted-row { opacity:.7; background:#fafafa; }
.collapsed-form summary, .material-import-box summary { cursor:pointer; font-weight:850; }

@media (max-width:1100px) {
  .bulk-material-bar { grid-template-columns:1fr 1fr; }
  .bulk-material-bar .btn { align-self:end; }
  .proposal-import-controls { grid-template-columns:1fr 1fr; }
  .selection-buttons { grid-column:1 / -1; }
  .proposal-summary { grid-template-columns:1fr 1fr; }
}

@media (max-width:700px) {
  .bulk-material-bar, .proposal-import-controls, .proposal-summary { grid-template-columns:1fr; }
  .selection-buttons { grid-column:1; }
  .material-import-history { display:grid; }
}

/* Force the phone layout for a real mobile user-agent even when a browser reports
   an unusually large CSS viewport. The ordinary desktop CSS remains untouched. */
body.mobile-client .app-shell, body.mobile-layout .app-shell { display:block; min-height:100vh; }
body.mobile-client .main, body.mobile-layout .main { width:100%; }
body.mobile-client .sidebar, body.mobile-layout .sidebar {
  position:fixed; z-index:120; top:0; left:0; width:min(86vw,320px); height:100dvh;
  transform:translateX(-105%); transition:transform .2s ease; overflow-y:auto;
  box-shadow:18px 0 45px rgba(0,0,0,.24);
}
body.mobile-client.nav-open .sidebar, body.mobile-layout.nav-open .sidebar { transform:translateX(0); }
body.mobile-client .mobile-menu-button, body.mobile-layout .mobile-menu-button { display:inline-flex; align-items:center; gap:6px; }
body.mobile-client .mobile-nav-close, body.mobile-layout .mobile-nav-close { display:inline-grid; }
body.mobile-client.nav-open .mobile-nav-backdrop, body.mobile-layout.nav-open .mobile-nav-backdrop { display:block; position:fixed; z-index:110; inset:0; background:rgba(12,22,35,.48); }
body.mobile-client .content, body.mobile-layout .content { padding:12px; }
body.mobile-client .topbar .user, body.mobile-layout .topbar .user { display:none; }
body.mobile-client .phone-preview-link, body.mobile-layout .phone-preview-link { display:none; }
body.mobile-client .form-grid, body.mobile-layout .form-grid { grid-template-columns:1fr; }
body.mobile-client .form-grid .full, body.mobile-layout .form-grid .full { grid-column:1; }
body.mobile-client .tabs, body.mobile-layout .tabs { overflow-x:auto; flex-wrap:nowrap; -webkit-overflow-scrolling:touch; }
body.mobile-client .gallery, body.mobile-layout .gallery { grid-template-columns:1fr; }
body.mobile-client .mobile-photo-actions, body.mobile-layout .mobile-photo-actions { display:flex; }

/* v0.8.1 persistent material worksheet */
.material-section-title { align-items:flex-start; }
.material-title-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.material-actions-menu { position:relative; }
.material-actions-menu > summary { list-style:none; cursor:pointer; }
.material-actions-menu > summary::-webkit-details-marker { display:none; }
.material-actions-menu[open] > summary { background:#e8eef5; }
.material-actions-panel { position:absolute; z-index:30; right:0; top:calc(100% + 8px); width:min(420px, calc(100vw - 40px)); padding:14px; border:1px solid var(--line); border-radius:10px; background:white; box-shadow:0 14px 30px rgba(22,34,48,.16); }
.material-actions-panel > small { display:block; color:var(--muted); margin:3px 0 10px; }
.material-actions-panel .drop-zone { margin-bottom:10px; }
.bulk-material-tools { margin:12px 0; border:1px solid var(--line); border-radius:10px; background:#f8fafb; }
.bulk-material-tools > summary { cursor:pointer; padding:11px 13px; font-weight:800; }
.bulk-material-tools .bulk-material-bar { margin:0; border:0; border-top:1px solid var(--line); border-radius:0 0 10px 10px; }
.persistent-material-table select, .persistent-material-table input { min-width:130px; }
.persistent-material-table td:nth-child(2) { min-width:260px; }
.compact-other-field { margin-top:6px; }
.compact-other-field input { min-width:130px; }
.material-row-actions { display:flex; gap:6px; align-items:center; }
.material-row-actions form { margin:0; }
.proposal-intake-card { overflow:hidden; }
.proposal-intake-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:16px; border-bottom:1px solid var(--line); }
.proposal-intake-head h3 { margin:0 0 4px; }
.proposal-intake-head p { margin:0; color:var(--muted); }
.proposal-selection-buttons { padding:12px 16px 0; }
.persistent-proposal-table td:nth-child(3) input { min-width:340px; }
.persistent-proposal-table select { min-width:150px; }
.persistent-proposal-table small { display:block; margin-top:4px; color:var(--muted); }
.proposal-intake-footer { display:flex; gap:8px; justify-content:flex-end; align-items:center; padding:14px 16px; border-top:1px solid var(--line); }

@media (max-width:700px) {
  .material-title-actions { width:100%; justify-content:space-between; }
  .material-actions-menu { position:static; }
  .material-actions-panel { position:fixed; left:12px; right:12px; top:72px; width:auto; max-height:calc(100vh - 92px); overflow:auto; }
  .proposal-intake-head { flex-direction:column; }
  .proposal-intake-head .btn { width:100%; }
  .proposal-intake-footer { flex-direction:column; align-items:stretch; }
  .proposal-intake-footer .btn { width:100%; text-align:center; }
}

/* v0.9 — The Graveyard and Zombie Mode */
.graveyard-nav { color: #d8c5ff !important; }
.graveyard-nav span { font-size: 12px; margin-right: 4px; }
.zombie-skull {
  display: inline-block;
  margin-left: 5px;
  font-size: 10px;
  line-height: 1;
  vertical-align: 2px;
  color: #5b3d72;
}
.zombie-row { box-shadow: inset 4px 0 0 #6f4b86; }
.zombie-row td { background: linear-gradient(90deg, rgba(111,75,134,.07), transparent 22%); }
.zombie-schedule-item { box-shadow: inset 4px 0 0 #6f4b86; }
.zombie-form-notice,
.zombie-detail-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid #6f4b86;
  border-radius: 10px;
  background: #f4eef8;
  color: #2f2138;
}
.zombie-form-notice > span { font-size: 16px; }
.zombie-detail-banner { justify-content: space-between; }
.zombie-detail-banner > div { flex: 1; display: grid; gap: 2px; }
.zombie-detail-banner strong { font-size: 18px; }
.zombie-detail-banner span { color: #5a4c61; }
.zombie-banner-skull { font-size: 28px; }
.zombie-put-down { background: #34263d; border-color: #34263d; }
.zombie-job-card { border-color: #b49ac3; }

.graveyard-page {
  position: relative;
  padding-bottom: 24px;
  color: #e9e2ef;
}
.graveyard-header {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 34px 42px;
  border: 1px solid #33263c;
  border-radius: 16px;
  background:
    radial-gradient(circle at 82% 24%, rgba(238,224,190,.18) 0 8%, transparent 9%),
    linear-gradient(180deg, #17101d 0%, #26182e 62%, #121018 100%);
  box-shadow: inset 0 -35px 70px rgba(0,0,0,.45);
}
.graveyard-header::after {
  content: "†   †      †   †       †";
  position: absolute;
  bottom: -9px;
  left: 0;
  right: 0;
  text-align: center;
  letter-spacing: 40px;
  color: #07070a;
  font-size: 54px;
  opacity: .85;
}
.graveyard-title-block { position: relative; z-index: 3; max-width: 720px; }
.graveyard-kicker { display: block; color: #bda6c9; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.graveyard-title-block h2 {
  margin: 6px 0 4px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 500;
  letter-spacing: .02em;
  text-shadow: 0 3px 0 #000;
}
.graveyard-title-block p { max-width: 650px; margin: 0; color: #c9becf; }
.graveyard-count {
  position: relative;
  z-index: 3;
  display: grid;
  min-width: 115px;
  padding: 16px;
  border: 1px solid #5b4766;
  border-radius: 999px 999px 12px 12px;
  text-align: center;
  background: rgba(10,8,13,.58);
}
.graveyard-count strong { font-family: Georgia, serif; font-size: 36px; }
.graveyard-count span { color: #bdaec4; font-size: 12px; }
.graveyard-moon { position: absolute; right: 7%; top: 4px; font-size: 105px; color: #e5d9ba; opacity: .65; transform: rotate(-14deg); }
.graveyard-bats { position: absolute; z-index: 2; top: 24px; left: 47%; font-size: 18px; opacity: .72; transform: rotate(-4deg); }
.graveyard-fog { position: absolute; left: -10%; width: 120%; height: 52px; border-radius: 50%; background: rgba(220,214,230,.08); filter: blur(12px); }
.fog-one { bottom: 28px; }
.fog-two { bottom: 4px; transform: translateX(12%); opacity: .6; }
.graveyard-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid #33263c;
  border-radius: 12px;
  background: #1b1420;
}
.graveyard-search { display: flex; gap: 8px; flex: 1; }
.graveyard-search input { max-width: 430px; color: #ece5f0; background: #0e0b11; border-color: #4b3a54; }
.graveyard-search-button { background: #5d3c70; border-color: #5d3c70; }
.graveyard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.tombstone-card {
  position: relative;
  min-height: 430px;
  padding: 38px 22px 27px;
  border: 2px solid #4d4551;
  border-bottom-width: 8px;
  border-radius: 48% 48% 9px 9px / 15% 15% 9px 9px;
  background:
    linear-gradient(110deg, rgba(255,255,255,.055), transparent 30%),
    repeating-linear-gradient(170deg, transparent 0 33px, rgba(0,0,0,.06) 34px 35px),
    #2d2b31;
  color: #e2dfe5;
  box-shadow: 0 10px 0 #111017, 0 15px 25px rgba(0,0,0,.35), inset 0 0 35px rgba(0,0,0,.25);
}
.tombstone-card::before,
.tombstone-card::after { content: ""; position: absolute; width: 24px; height: 8px; bottom: -12px; background: #15151a; border-radius: 50%; }
.tombstone-card::before { left: 12%; transform: rotate(15deg); }
.tombstone-card::after { right: 12%; transform: rotate(-15deg); }
.tombstone-top { text-align: center; font-size: 24px; color: #a99eae; }
.tombstone-inscription { text-align: center; font-family: Georgia, 'Times New Roman', serif; }
.tombstone-inscription > span { display: block; margin-top: 2px; letter-spacing: .28em; font-size: 13px; color: #a89dac; }
.tombstone-inscription h3 { margin: 8px 0 4px; font-size: 25px; color: #f1edf3; }
.tombstone-inscription strong { display: block; min-height: 38px; font-size: 15px; }
.tombstone-inscription p { margin: 6px 0 0; color: #b9b2bd; font-family: inherit; font-size: 13px; }
.tombstone-epitaph { margin: 18px 0; padding: 12px 9px; border-top: 1px solid #4c4650; border-bottom: 1px solid #4c4650; text-align: center; color: #bbb2bf; font-family: Georgia, serif; font-style: italic; font-size: 13px; }
.tombstone-details { display: grid; gap: 8px; }
.tombstone-details > div { display: grid; grid-template-columns: 66px 1fr; gap: 8px; }
.tombstone-details span { color: #9d94a2; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.tombstone-details strong { font-size: 12px; font-weight: 500; }
.tombstone-actions { display: grid; gap: 9px; margin-top: 17px; }
.graveyard-record-button { justify-content: center; color: #eee8f1; background: #48404d; border-color: #615768; }
.resurrection-panel { border: 1px solid #5b4569; border-radius: 9px; background: rgba(18,13,22,.72); }
.resurrection-panel summary { cursor: pointer; padding: 10px 12px; text-align: center; color: #d4b7e4; font-weight: 600; }
.resurrection-panel form { display: grid; gap: 8px; padding: 0 12px 12px; }
.resurrection-panel label { color: #c6bbc9; font-size: 12px; }
.resurrection-panel input,
.resurrection-panel select,
.resurrection-panel textarea { color: #f1eaf4; background: #100c13; border-color: #51405a; }
.resurrection-panel textarea { min-height: 72px; }
.resurrection-panel small { color: #9e92a4; }
.resurrection-button { margin-top: 4px; justify-content: center; background: #725087; border-color: #8b69a0; letter-spacing: .08em; }
.tombstone-grass { position: absolute; bottom: -24px; left: 0; right: 0; text-align: center; color: #17191a; letter-spacing: 15px; font-size: 24px; overflow: hidden; }
.empty-graveyard { padding: 55px 24px; border: 1px solid #3a2d42; border-radius: 14px; text-align: center; background: #18121d; }
.empty-graveyard > div { font-size: 52px; }
.empty-graveyard h3 { font-family: Georgia, serif; font-size: 28px; }
.graveyard-footer { margin-top: 36px; padding: 16px; border-top: 1px solid #3f3048; text-align: center; color: #afa2b5; font-family: Georgia, serif; }
.graveyard-detail-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid #493650;
  border-radius: 12px;
  color: #e9e1ed;
  background: linear-gradient(100deg, #171119, #2c1d32);
}
.graveyard-detail-banner > div:not(.graveyard-detail-moon) { display: grid; gap: 3px; flex: 1; }
.graveyard-detail-banner strong { font-family: Georgia, serif; font-size: 22px; }
.graveyard-detail-banner span { color: #bdaec3; }
.graveyard-detail-moon { font-size: 36px; color: #d9cda9; }
.graveyard-back-button { background: #4b3855; border-color: #60466b; }
.graveyard-job-card { border-color: #55475a; }
.graveyard-rest-card { background: #f3eff4; }
.graveyard-epitaph { font-family: Georgia, serif; font-style: italic; color: #66586b; }

@media (max-width: 1050px) {
  .graveyard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .graveyard-header { grid-template-columns: 1fr; padding: 28px 22px 70px; }
  .graveyard-count { justify-self: start; margin-top: 18px; }
  .graveyard-moon { right: 0; opacity: .32; }
  .graveyard-bats { left: auto; right: 10px; }
  .graveyard-toolbar, .graveyard-search { align-items: stretch; flex-direction: column; }
  .graveyard-search input { max-width: none; }
  .graveyard-grid { grid-template-columns: 1fr; padding: 0 4px; }
  .tombstone-card { min-height: 0; }
  .zombie-detail-banner, .graveyard-detail-banner { align-items: stretch; flex-direction: column; }
}

/* v0.9.2 multi-stop installer route ordering */
.schedule-route-group { border-top:1px solid var(--line); background:#fbfcfd; }
.schedule-route-head { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 15px; border-bottom:1px solid var(--line); background:var(--blue-soft); }
.schedule-route-head > div { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px; }
.schedule-route-head strong { font-size:12px; }
.schedule-route-head span { color:var(--blue); font-size:12px; font-weight:850; }
.schedule-route-head small { color:var(--muted); font-size:10px; }
.schedule-route-group .schedule-agenda-item { background:#fff; }
.schedule-route-group .schedule-agenda-item.route-ordered-item { box-shadow:inset 3px 0 0 var(--blue); }
.schedule-other-work-label { padding:8px 15px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:#f7f8fa; color:var(--muted); font-size:10px; font-weight:850; letter-spacing:.06em; text-transform:uppercase; }
.route-priority-form { margin-top:8px; }
.route-priority-form label { display:block; margin-bottom:3px; color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.04em; text-transform:uppercase; }
.route-priority-form select { width:92px; padding:5px 7px; border:1px solid var(--line); border-radius:7px; background:white; color:var(--ink); font-size:11px; font-weight:800; }
.route-stop-badge { display:inline-block; padding:3px 7px; border-radius:999px; background:var(--blue); color:white; font-size:9px; font-weight:900; }
@media (max-width:850px) {
  .schedule-route-head { align-items:flex-start; flex-direction:column; gap:4px; }
  .route-priority-form select { width:120px; }
}

/* v0.9.3 — Quick Tasks and Next Day Review */
.quick-task-panel {
  margin-top: 18px;
  padding: 18px;
  border-top: 4px solid #2d6a8a;
}
.quick-task-head,
.review-item-summary,
.review-finish-bar,
.review-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.quick-task-head h3,
.review-work h3,
.empty-review-card h3 {
  margin: 0 0 4px;
}
.quick-task-head p,
.review-intro span,
.review-finish-bar span,
.empty-review-card p {
  margin: 0;
  color: var(--muted, #64748b);
}
.quick-task-mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f2f7;
  color: #184c67;
  font-size: 24px;
  flex: 0 0 auto;
}
.quick-task-form { margin-top: 16px; }
.quick-task-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #e8f2f7;
  color: #184c67;
  white-space: nowrap;
}
.next-review-nav::before {
  content: "↺";
  display: inline-block;
  margin-right: 7px;
}
.review-intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-left: 4px solid #2d6a8a;
  background: #f3f8fb;
  border-radius: 8px;
}
.review-list {
  display: grid;
  gap: 14px;
}
.review-item {
  overflow: hidden;
}
.review-item.reviewed {
  border-left: 4px solid #2c7a4b;
}
.review-item-summary {
  padding: 16px;
  border-bottom: 1px solid #d8dee7;
}
.review-date-time {
  width: 150px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.review-work {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.review-current-state {
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
}
.review-current-state span,
.review-work small,
.review-current-state small {
  color: #64748b;
  font-size: 13px;
}
.review-update-form {
  padding: 16px;
  background: #fafbfd;
}
.review-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, .8fr) minmax(260px, 1.6fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.review-notes-field { min-width: 0; }
.review-finish-bar {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  margin-top: 18px;
  padding: 16px;
  align-items: center;
  border-top: 4px solid #2d6a8a;
}
.review-finish-bar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.review-finish-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.empty-review-card { padding: 22px; }

@media (max-width: 980px) {
  .review-form-grid { grid-template-columns: 1fr 1fr; }
  .review-notes-field { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .quick-task-head,
  .review-item-summary,
  .review-finish-bar,
  .review-page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .review-date-time,
  .review-current-state { width: auto; min-width: 0; text-align: left; }
  .review-form-grid { grid-template-columns: 1fr; }
  .review-notes-field { grid-column: auto; }
  .review-finish-bar { position: static; }
  .review-finish-actions { justify-content: stretch; }
  .review-finish-actions .btn { width: 100%; }
}

/* v0.9.7 — blocked schedule queue, two-stop ordering, and calmer action continuity */
.schedule-summary-strip { grid-template-columns:repeat(5,minmax(0,1fr)); }
.blocked-summary-chip { border-color:#e6b5b5 !important; background:#fff9f9 !important; }
.blocked-summary-chip strong { color:#9e2f2f; }
.schedule-blocked-zone { margin-bottom:16px; overflow:hidden; border:1px solid #e6b5b5; border-left:5px solid #b44444; }
.schedule-blocked-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:14px 16px; background:#fff7f7; border-bottom:1px solid #efcccc; }
.schedule-blocked-head h3 { margin:2px 0 4px; }
.schedule-blocked-head p { margin:0; max-width:820px; color:var(--muted); font-size:12px; }
.blocked-kicker { display:block; color:#9e2f2f; font-size:9px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.schedule-blocked-list { display:grid; }
.schedule-blocked-job { background:white; border-bottom:1px solid var(--line); }
.schedule-blocked-job:last-child { border-bottom:0; }
.schedule-blocked-job-head { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:11px 15px; background:#fcfcfd; }
.schedule-blocked-job-head > div { min-width:0; }
.schedule-blocked-job-head strong { display:inline-block; margin-right:8px; }
.schedule-blocked-job-head small { display:block; margin-top:3px; color:var(--muted); }
.blocked-held-count { flex:0 0 auto; padding:4px 8px; border-radius:999px; background:#f6e8e8; color:#8e3030; font-size:10px; font-weight:850; }
.schedule-blocker-items { display:grid; }
.schedule-blocker-row { display:grid; grid-template-columns:minmax(240px,1.6fr) minmax(150px,.8fr) auto; gap:14px; align-items:center; padding:12px 15px; border-top:1px solid var(--line); }
.blocker-main strong, .blocker-main span, .blocker-meta span { display:block; }
.blocker-reason { margin-top:4px; color:#8e3030; font-weight:750; }
.blocker-meta { display:grid; gap:3px; color:var(--muted); font-size:11px; }
.blocker-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:6px; }
.blocker-actions form { margin:0; }
.route-priority-form select { min-width:105px; }

@media (max-width:1100px) {
  .schedule-summary-strip { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:850px) {
  .schedule-summary-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .schedule-blocked-head, .schedule-blocked-job-head { align-items:flex-start; flex-direction:column; }
  .schedule-blocker-row { grid-template-columns:1fr; }
  .blocker-actions { justify-content:flex-start; }
}
@media (max-width:560px) {
  .schedule-summary-strip { grid-template-columns:1fr 1fr; }
  .schedule-blocked-zone { border-left-width:4px; }
  .blocker-actions .btn, .blocker-actions form, .blocker-actions form .btn { width:100%; }
}

/* v0.9.8 — continuing tasks */
.schedule-progress-note{display:block;margin-top:4px;color:var(--muted);line-height:1.3}
.continue-task-btn{margin-top:6px;white-space:nowrap}
.task-progress-note,.task-remaining-note{overflow-wrap:anywhere}


/* v0.9.9 — nested blockers and drag-to-reschedule */
.schedule-blocker-items {
  margin: 0 14px 12px 34px;
  border: 1px solid #efd3d3;
  border-left: 4px solid #c96767;
  border-radius: 0 9px 9px 9px;
  overflow: hidden;
  background: #fffafa;
  position: relative;
}
.schedule-blocker-items::before {
  content: "";
  position: absolute;
  left: -22px;
  top: -1px;
  width: 18px;
  height: 18px;
  border-left: 2px solid #d9aaaa;
  border-bottom: 2px solid #d9aaaa;
  border-bottom-left-radius: 8px;
}
.schedule-blocker-row { padding: 10px 12px; background: #fffafa; }
.blocker-child-label {
  display: block;
  margin-bottom: 3px;
  color: #a85555;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.drag-schedule-hint { color: var(--blue); font-weight: 750; }
.schedule-agenda-item[draggable="true"] { cursor: grab; }
.schedule-agenda-item[draggable="true"]:active { cursor: grabbing; }
.schedule-agenda-item.schedule-dragging { opacity: .42; outline: 2px dashed var(--blue); outline-offset: -3px; }
.schedule-day.schedule-drop-target {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 2px rgba(55, 112, 176, .18);
  background: #f7fbff;
}
.schedule-day.schedule-drop-target .schedule-day-head { background: #edf6ff; }
.schedule-day.schedule-drop-target .schedule-open-day::after {
  content: " Drop here to reschedule";
  color: var(--blue);
  font-weight: 800;
}
@media (max-width:850px) {
  .schedule-blocker-items { margin-left: 20px; margin-right: 10px; }
  .drag-schedule-hint { display: none; }
  .schedule-agenda-item[draggable="true"] { cursor: default; }
}

/* v0.10.0 operational command-center dashboard */
.command-head { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; margin-bottom:18px; }
.command-head h2 { margin:3px 0 6px; font-size:28px; letter-spacing:-.02em; }
.command-head p { margin:0; max-width:760px; color:var(--muted); }
.command-kicker { color:var(--blue); font-size:11px; font-weight:850; letter-spacing:.09em; text-transform:uppercase; }
.command-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.command-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.command-metric { display:block; position:relative; overflow:hidden; min-height:106px; padding:16px 17px; border:1px solid var(--line); border-radius:12px; background:var(--paper); box-shadow:var(--shadow); color:var(--ink); }
.command-metric::before { content:''; position:absolute; inset:0 auto 0 0; width:4px; background:var(--blue); }
.command-metric:hover { text-decoration:none; border-color:#c7d2df; transform:translateY(-1px); }
.command-metric strong, .command-metric span, .command-metric small { display:block; }
.command-metric strong { font-size:29px; line-height:1; letter-spacing:-.03em; }
.command-metric span { margin-top:8px; font-size:12px; font-weight:850; text-transform:uppercase; letter-spacing:.045em; }
.command-metric small { margin-top:4px; color:var(--muted); }
.command-metric.attention::before, .command-metric.halted::before { background:var(--red); }
.command-metric.today::before { background:var(--blue); }
.command-metric.ready::before { background:var(--green); }
.command-layout { display:grid; grid-template-columns:minmax(0,1.75fr) minmax(300px,.75fr); gap:16px; align-items:start; }
.command-primary, .command-secondary { display:grid; gap:16px; min-width:0; }
.command-panel { overflow:hidden; border:1px solid var(--line); border-radius:13px; background:white; box-shadow:var(--shadow); scroll-margin-top:86px; }
.command-panel-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px; border-bottom:1px solid var(--line); background:#fbfcfd; }
.command-panel-head.compact { padding:14px 16px; }
.command-panel-head h3 { margin:2px 0 0; font-size:17px; letter-spacing:-.01em; }
.command-panel-head > a { font-size:12px; font-weight:800; }
.command-eyebrow { display:block; font-size:9px; line-height:1; font-weight:900; text-transform:uppercase; letter-spacing:.11em; color:var(--muted); }
.command-eyebrow.danger { color:var(--red); }
.command-eyebrow.active { color:var(--blue); }
.command-eyebrow.waiting { color:var(--amber); }
.command-eyebrow.ready { color:var(--green); }
.command-eyebrow.neutral { color:#647181; }
.panel-note { color:var(--muted); font-size:11px; font-weight:650; }
.attention-stack, .today-stack, .ready-stack, .next-action-stack, .recent-stack { display:grid; }
.attention-item { display:grid; grid-template-columns:32px minmax(0,1fr); gap:12px; padding:14px 16px; border-bottom:1px solid var(--line); }
.attention-item:last-child { border-bottom:0; }
.attention-item:hover { background:#fcfdfe; }
.attention-mark { display:grid; place-items:center; width:28px; height:28px; margin-top:1px; border-radius:8px; background:#eef2f6; color:#596575; font-size:13px; font-weight:900; }
.attention-item.danger .attention-mark { background:var(--red-soft); color:var(--red); }
.attention-item.warning .attention-mark { background:var(--amber-soft); color:var(--amber); }
.attention-body { min-width:0; }
.attention-title-line { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.attention-title-line > div { display:flex; flex-wrap:wrap; align-items:center; gap:7px; min-width:0; }
.attention-title-line small { color:var(--muted); white-space:nowrap; }
.attention-context { margin-top:4px; color:var(--muted); font-size:12px; }
.dashboard-blocker { margin-top:9px; margin-left:2px; padding:9px 11px; border-left:3px solid var(--red); border-radius:0 8px 8px 0; background:#fff8f8; color:#6f2f2f; font-size:12px; }
.dashboard-blocker span { display:block; margin-bottom:3px; color:var(--red); font-size:9px; font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
.dashboard-inline-actions { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin-top:10px; }
.dashboard-inline-actions form { margin:0; }
.command-empty { padding:26px 18px; text-align:center; color:var(--muted); }
.command-empty strong, .command-empty span { display:block; }
.command-empty strong { color:var(--ink); }
.command-empty span { margin-top:4px; font-size:12px; }
.command-empty.good { background:#fbfefc; }
.today-row { display:grid; grid-template-columns:116px minmax(220px,1.35fr) minmax(165px,.9fr) auto; gap:14px; align-items:center; padding:14px 16px; border-bottom:1px solid var(--line); }
.today-row:last-child { border-bottom:0; }
.today-row:hover { background:#fbfcfd; }
.today-row.done { opacity:.68; background:#fafcfb; }
.today-time strong, .today-time small, .today-work small, .today-assignment strong, .today-assignment small { display:block; }
.today-time strong { font-size:12px; }
.today-time small, .today-work small, .today-assignment small { margin-top:3px; color:var(--muted); font-size:10px; }
.today-title { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:3px; }
.today-title > strong { font-size:13px; }
.today-work > a, .today-work > span { font-size:12px; font-weight:700; }
.today-assignment strong { font-size:11px; }
.today-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.today-actions form { margin:0; }
.waiting-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.waiting-column { min-width:0; }
.waiting-column + .waiting-column { border-left:1px solid var(--line); }
.waiting-column h4 { margin:0; padding:11px 15px; border-bottom:1px solid var(--line); background:#fffdf8; color:#6f5b31; font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
.waiting-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:12px 15px; border-bottom:1px solid var(--line); color:var(--ink); }
.waiting-row:last-child { border-bottom:0; }
.waiting-row:hover { background:#fbfcfd; text-decoration:none; }
.waiting-row > div { min-width:0; }
.waiting-row strong, .waiting-row small { display:block; }
.waiting-row strong { font-size:12px; }
.waiting-row small { margin-top:4px; color:var(--muted); font-size:10px; line-height:1.35; }
.mini-empty { padding:18px 15px; color:var(--muted); font-size:12px; }
.ready-row { display:grid; grid-template-columns:minmax(190px,1fr) minmax(190px,1fr) auto; gap:14px; align-items:center; padding:13px 16px; border-bottom:1px solid var(--line); }
.ready-row:last-child { border-bottom:0; }
.ready-row:hover { background:#fbfcfd; }
.ready-main > strong, .ready-main small, .ready-next span, .ready-next strong, .ready-next small { display:block; }
.ready-main > a { margin-right:6px; }
.ready-main small { margin-top:4px; color:var(--muted); font-size:10px; }
.ready-next span { color:var(--muted); font-size:9px; font-weight:850; text-transform:uppercase; letter-spacing:.055em; }
.ready-next strong { margin-top:2px; font-size:12px; }
.ready-next small { margin-top:2px; color:var(--muted); font-size:10px; }
.ready-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:6px; }
.sticky-panel { position:sticky; top:82px; }
.next-action { padding:13px 15px; border-bottom:1px solid var(--line); }
.next-action:last-child { border-bottom:0; }
.next-action-top { display:grid; grid-template-columns:9px minmax(0,1fr); gap:9px; align-items:start; }
.priority-dot { width:8px; height:8px; margin-top:5px; border-radius:50%; background:#98a2ae; }
.priority-dot.critical, .priority-dot.high { background:var(--red); }
.priority-dot.normal { background:var(--blue); }
.next-action-top strong, .next-action-top a, .next-action-top small { display:block; }
.next-action-top strong { font-size:12px; }
.next-action-top a, .next-action-top small { margin-top:3px; font-size:10px; }
.next-action-meta { display:flex; justify-content:space-between; gap:8px; margin:8px 0 0 18px; color:var(--muted); font-size:10px; }
.next-action-meta .late { color:var(--red); font-weight:800; }
.next-action .dashboard-inline-actions { margin-left:18px; margin-top:7px; }
.text-action { border:0; padding:0; background:none; color:var(--blue); font-size:10px; font-weight:800; cursor:pointer; }
.text-action:hover { text-decoration:underline; }
.recent-item { display:grid; grid-template-columns:9px minmax(0,1fr); gap:10px; padding:12px 15px; border-bottom:1px solid var(--line); }
.recent-item:last-child { border-bottom:0; }
.recent-dot { width:7px; height:7px; margin-top:5px; border-radius:50%; background:#98a7b8; }
.recent-item strong, .recent-item a, .recent-item small { display:block; }
.recent-item strong { font-size:11px; }
.recent-item a { margin-top:2px; font-size:10px; font-weight:750; }
.recent-item p { margin:4px 0; color:var(--muted); font-size:10px; line-height:1.35; }
.recent-item small { color:#87919d; font-size:9px; }
@media (max-width:1180px) {
  .command-layout { grid-template-columns:1fr; }
  .command-secondary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sticky-panel { position:static; }
}
@media (max-width:900px) {
  .command-head { flex-direction:column; }
  .command-actions { justify-content:flex-start; }
  .command-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .today-row { grid-template-columns:100px minmax(0,1fr) minmax(140px,.8fr); }
  .today-actions { grid-column:2 / -1; justify-content:flex-start; }
  .ready-row { grid-template-columns:1fr 1fr; }
  .ready-actions { grid-column:1 / -1; justify-content:flex-start; }
}
@media (max-width:650px) {
  .command-strip, .command-secondary, .waiting-grid { grid-template-columns:1fr; }
  .waiting-column + .waiting-column { border-left:0; border-top:1px solid var(--line); }
  .today-row { grid-template-columns:1fr; gap:8px; }
  .today-actions { grid-column:auto; }
  .today-assignment { padding-top:6px; border-top:1px dashed var(--line); }
  .ready-row { grid-template-columns:1fr; }
  .ready-actions { grid-column:auto; justify-content:flex-start; }
  .attention-title-line { flex-direction:column; gap:4px; }
}

/* v0.10.3 first-login account setup */
.login-stack { width:min(460px,100%); display:grid; gap:16px; }
.login-stack .login-card { width:100%; }
.initial-user-card { border-top:4px solid var(--green); }
.initial-user-card h2 { margin:2px 0 5px; font-size:22px; }
.initial-user-card > p { margin:0 0 20px; }
.initial-user-kicker { margin-bottom:4px; color:var(--green); font-size:10px; font-weight:900; letter-spacing:.12em; }
.initial-user-note { margin-top:14px; text-align:center; }
@media (max-width:520px) {
  .login-page { padding:16px; align-items:start; }
  .login-stack { margin-top:12px; }
  .login-card { padding:22px; border-radius:13px; }
}

/* v0.10.4 — polished application shell + Foundry brand watermark */
:root {
  --navy: #111c29;
  --navy-2: #1a2a3b;
  --navy-3: #22384f;
  --blue: #356f9f;
  --blue-soft: #eaf2f8;
  --ink: #17212b;
  --muted: #657384;
  --line: #d9e1e7;
  --line-strong: #c9d3dc;
  --paper: #ffffff;
  --bg: #eff3f5;
  --green: #39745a;
  --green-soft: #eaf4ee;
  --amber: #9a6b18;
  --amber-soft: #fff6df;
  --red: #a44949;
  --red-soft: #fceded;
  --shadow: 0 1px 2px rgba(17, 28, 41, .04), 0 9px 28px rgba(17, 28, 41, .055);
  --shadow-hover: 0 2px 4px rgba(17, 28, 41, .06), 0 14px 34px rgba(17, 28, 41, .08);
}

html { background: var(--bg); }
body {
  background:
    radial-gradient(circle at 92% 4%, rgba(53,111,159,.055), transparent 26rem),
    linear-gradient(180deg, #f5f7f8 0, var(--bg) 260px);
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
}

.app-shell { grid-template-columns: 258px minmax(0,1fr); }
.sidebar {
  background: linear-gradient(180deg, #101b28 0%, #132231 55%, #101b28 100%);
  padding: 20px 14px;
  border-right: 1px solid rgba(255,255,255,.035);
  box-shadow: 8px 0 30px rgba(17,28,41,.08);
  z-index: 50;
}
.brand { padding: 4px 8px 20px; margin-bottom: 16px; border-bottom-color: rgba(255,255,255,.11); }
.brand-lockup { display:flex; align-items:center; min-width:0; gap:11px; }
.brand-monogram {
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  flex:0 0 38px;
  border:1px solid rgba(255,255,255,.17);
  border-radius:11px;
  background:linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.045));
  color:#fff;
  box-shadow:inset 0 1px rgba(255,255,255,.06);
  font-size:11px;
  font-weight:900;
  letter-spacing:.06em;
}
.brand h1 { font-size:17px; font-weight:780; letter-spacing:-.01em; }
.brand p { margin-top:4px; color:#9eb0c2; font-size:10px; letter-spacing:.035em; }
.nav { gap:4px; }
.nav a {
  position:relative;
  padding:10px 11px 10px 14px;
  border:1px solid transparent;
  border-radius:9px;
  color:#c8d5e1;
  font-size:13px;
  font-weight:650;
  transition:background .14s ease, border-color .14s ease, color .14s ease, transform .14s ease;
}
.nav a:hover {
  background:rgba(255,255,255,.065);
  border-color:rgba(255,255,255,.06);
  color:white;
  text-decoration:none;
  transform:translateX(1px);
}
.nav a.active {
  background:linear-gradient(90deg, rgba(74,130,177,.30), rgba(255,255,255,.055));
  border-color:rgba(126,171,208,.18);
  color:white;
  box-shadow:inset 0 1px rgba(255,255,255,.035);
}
.nav a.active::before {
  content:"";
  position:absolute;
  left:-1px;
  top:8px;
  bottom:8px;
  width:3px;
  border-radius:0 4px 4px 0;
  background:#7fa8c8;
}
.nav .graveyard-nav.active::before { background:#ad7d7d; }
.sidebar-footer { left:22px; right:18px; color:#91a5b8; line-height:1.55; }
.sidebar-footer small { font-size:10px; }
.sidebar-signout { display:inline-block; margin-top:7px; color:#dce6ee; font-weight:700; }
.workspace-state { display:flex; align-items:center; gap:7px; color:#c8d7e2; font-size:11px; font-weight:750; }
.workspace-dot, .system-dot { width:7px; height:7px; border-radius:50%; background:#6fb38d; box-shadow:0 0 0 3px rgba(111,179,141,.12); }

.main { position:relative; min-height:100vh; isolation:isolate; }
.topbar {
  height:70px;
  padding:0 30px;
  background:rgba(255,255,255,.92);
  border-bottom:1px solid rgba(201,211,220,.78);
  box-shadow:0 1px 0 rgba(255,255,255,.8), 0 5px 18px rgba(17,28,41,.035);
  backdrop-filter:blur(13px);
  -webkit-backdrop-filter:blur(13px);
}
.topbar .title { color:#1a2632; font-size:17px; font-weight:780; letter-spacing:-.01em; }
.topbar-tools { gap:11px; }
.system-status {
  display:flex;
  align-items:center;
  gap:7px;
  padding:6px 9px;
  border:1px solid #dbe6df;
  border-radius:999px;
  background:#f7fbf8;
  color:#4f6d5c;
  font-size:10px;
  font-weight:800;
  letter-spacing:.03em;
}
.phone-preview-link {
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:#4d6174;
  font-size:11px;
  transition:.14s ease;
}
.phone-preview-link:hover { border-color:#b9c8d5; background:#f8fafb; color:var(--ink); text-decoration:none; }
.topbar .user { display:flex; align-items:center; gap:8px; color:#4b5968; font-size:12px; font-weight:700; }
.user-avatar {
  display:grid;
  place-items:center;
  width:29px;
  height:29px;
  border-radius:50%;
  background:#e8eef3;
  border:1px solid #d3dde5;
  color:#40576b;
  font-size:11px;
  font-weight:850;
}

.content { position:relative; z-index:2; padding:28px 30px 62px; max-width:1660px; }
.page-head, .command-head { margin-bottom:18px; }
.page-head h2, .command-head h2 { color:#17232f; letter-spacing:-.025em; }
.page-head h2 { font-size:27px; font-weight:790; }
.page-head p, .command-head p { color:#697786; line-height:1.48; }
.command-kicker { color:#587e9d; }

.card, .command-panel, .command-metric, .schedule-summary-strip > div {
  border-color:rgba(211,220,227,.95);
  box-shadow:var(--shadow);
}
.card { border-radius:14px; }
.card:hover { border-color:#d0d9e1; }
.card.pad { padding:19px; }
.section-title {
  min-height:52px;
  padding:14px 17px;
  background:linear-gradient(180deg,#fff,#fbfcfd);
  border-bottom-color:#e1e6eb;
}
.section-title h3 { color:#202c37; font-size:15px; font-weight:790; letter-spacing:-.01em; }
.section-title > span, .section-title > small { color:#74808d; font-size:11px; }

.btn {
  min-height:36px;
  border-radius:8px;
  padding:8px 13px;
  background:linear-gradient(180deg, #3c78aa, #326995);
  box-shadow:0 1px 2px rgba(20,53,80,.14), inset 0 1px rgba(255,255,255,.12);
  font-size:12px;
  font-weight:760;
  transition:transform .11s ease, box-shadow .11s ease, background .11s ease, border-color .11s ease;
}
.btn:hover { opacity:1; transform:translateY(-1px); box-shadow:0 4px 12px rgba(34,76,109,.15); }
.btn:active { transform:translateY(0); box-shadow:0 1px 2px rgba(34,76,109,.12); }
.btn.secondary {
  border-color:#d3dce4;
  background:linear-gradient(180deg,#fff,#f8fafb);
  color:#394956;
  box-shadow:0 1px 2px rgba(17,28,41,.035);
}
.btn.secondary:hover { border-color:#bcc9d3; background:#fff; }
.btn.danger { background:linear-gradient(180deg,#ac5656,#974545); }
.btn.small { min-height:29px; padding:5px 9px; font-size:10px; }

input, select, textarea {
  border-color:#cdd7df;
  border-radius:8px;
  background:#fff;
  box-shadow:inset 0 1px 1px rgba(17,28,41,.025);
  transition:border-color .12s ease, box-shadow .12s ease;
}
input:hover, select:hover, textarea:hover { border-color:#bac7d1; }
input:focus, select:focus, textarea:focus {
  outline:none;
  border-color:#6e9abd;
  box-shadow:0 0 0 3px rgba(53,111,159,.12);
}
label { color:#3e4c5a; font-size:12px; font-weight:750; }

.flash { border-radius:10px; box-shadow:0 2px 10px rgba(17,28,41,.04); }
.filters { padding:10px; border:1px solid var(--line); border-radius:11px; background:rgba(255,255,255,.72); }

.table-wrap { border-radius:0 0 13px 13px; }
table { background:#fff; }
th {
  padding-top:10px;
  padding-bottom:10px;
  background:#f8fafb;
  color:#74808c;
  border-bottom-color:#dbe2e8;
  font-size:10px;
  font-weight:850;
  letter-spacing:.065em;
}
td { border-bottom-color:#e6eaee; }
tbody tr { transition:background .11s ease; }
tbody tr:hover { background:#fafcfd; }

.badge { border:1px solid rgba(53,111,159,.08); font-size:10px; letter-spacing:.01em; }
.progress { height:7px; background:#e7edf1; }

.job-hero { padding:21px 22px 0; border-radius:15px; overflow:hidden; }
.job-hero h2 { font-size:24px; letter-spacing:-.02em; }
.job-meta { color:#71808e; }
.tabs {
  gap:4px;
  padding:12px 14px 11px;
  border-top:1px solid #edf0f3;
  border-bottom:0;
  background:#f7f9fa;
}
.tabs a {
  padding:8px 11px;
  border:1px solid transparent;
  border-radius:8px;
  color:#667382;
  border-bottom-width:1px;
  font-size:11px;
}
.tabs a:hover { color:#314e67; background:#fff; border-color:#dce3e8; text-decoration:none; }
.tabs a.active {
  color:#223b50;
  background:#fff;
  border-color:#cfd9e1;
  box-shadow:0 1px 4px rgba(17,28,41,.06);
}

.quick-form { background:#fafcfd; border-top-color:#e1e6eb; }
.drop-zone {
  border-color:#b8c8d5;
  background:linear-gradient(180deg,#fbfdff,#f4f8fb);
  box-shadow:inset 0 1px rgba(255,255,255,.9);
}
.drop-zone:hover { border-color:#7da4c3; background:#f7fbfe; }
.drop-zone.dragging { border-color:var(--blue); background:#eef6fb; }

.gallery { grid-template-columns:repeat(4,minmax(190px,1fr)); gap:14px; padding:17px; }
.photo {
  position:relative;
  overflow:visible;
  border-color:#d7e0e6;
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 3px rgba(17,28,41,.045);
  transition:transform .13s ease, box-shadow .13s ease, border-color .13s ease;
}
.photo:hover { z-index:12; transform:translateY(-1px); border-color:#c3d0da; box-shadow:var(--shadow-hover); }
.photo > a:first-child { display:block; overflow:hidden; border-radius:11px 11px 0 0; }
.photo img { height:175px; border-radius:11px 11px 0 0; }
.photo .caption { padding:11px 12px 12px; line-height:1.4; }
.photo .caption strong { color:#50606f; font-size:10px; text-transform:uppercase; letter-spacing:.055em; }
.photo-name { display:inline-block; max-width:100%; color:#25313c; font-weight:650; overflow-wrap:anywhere; }
.photo .caption small { color:#84909b; }

.pdf-link { color:inherit; text-decoration:none; }
.pdf-link:hover { text-decoration:none; }
.pdf-tile {
  height:175px;
  padding:18px;
  align-content:center;
  gap:8px;
  background:
    linear-gradient(145deg, rgba(75,103,125,.045), rgba(255,255,255,.72)),
    #f3f6f8;
  color:#243341;
  border-bottom:1px solid #e0e6eb;
}
.pdf-file-mark {
  display:grid;
  place-items:center;
  width:50px;
  height:60px;
  margin:0 auto 3px;
  border:1px solid #c7d3dc;
  border-radius:7px 7px 7px 2px;
  background:#fff;
  color:#9b4d4d;
  box-shadow:0 3px 12px rgba(17,28,41,.08);
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
}
.pdf-file-name {
  display:block;
  width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:center;
  font-size:11px;
  font-weight:750;
}
.pdf-tile small { display:block; color:#7c8995; text-align:center; font-size:9px; font-weight:700; }
.pdf-hover-preview {
  display:none;
  position:fixed;
  z-index:999;
  width:360px;
  height:440px;
  overflow:hidden;
  border:1px solid #becbd5;
  border-radius:12px;
  background:#fff;
  box-shadow:0 22px 60px rgba(17,28,41,.28), 0 4px 14px rgba(17,28,41,.12);
  pointer-events:none;
  transform:translateY(4px);
  opacity:0;
  transition:opacity .1s ease, transform .1s ease;
}
.pdf-hover-preview.pdf-preview-open { display:grid; grid-template-rows:auto 1fr auto; opacity:1; transform:translateY(0); }
.pdf-preview-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  min-width:0;
  padding:10px 12px;
  border-bottom:1px solid #dce3e8;
  background:#f8fafb;
}
.pdf-preview-head strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#24323f; font-size:11px; }
.pdf-preview-head span { flex:0 0 auto; color:#7d8994; font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.pdf-hover-preview iframe { width:100%; height:100%; border:0; background:#eef1f3; }
.pdf-preview-foot { padding:8px 11px; border-top:1px solid #dce3e8; background:#fff; color:#75828e; font-size:9px; text-align:center; }

.schedule-summary-strip > div, .command-metric { border-radius:13px; }
.command-metric { transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.command-metric:hover { box-shadow:var(--shadow-hover); }
.command-panel { border-radius:14px; }
.command-panel-head { background:linear-gradient(180deg,#fff,#f9fbfc); }
.attention-item:hover, .today-row:hover, .ready-row:hover, .waiting-row:hover { background:#f9fbfc; }
.schedule-day { border-radius:13px; }
.schedule-day-head { background:linear-gradient(180deg,#fbfcfd,#f7f9fa); }
.schedule-agenda-item { transition:background .12s ease, box-shadow .12s ease; }
.schedule-agenda-item:hover { background:#f8fbfd; }

.foundry-watermark {
  position:fixed;
  right:30px;
  bottom:20px;
  z-index:3;
  width:198px;
  height:128px;
  background:url('foundry_watermark.png') center / contain no-repeat;
  opacity:.034;
  pointer-events:none;
  user-select:none;
  filter:saturate(.88);
}

/* Login gets the same finished-product treatment without changing login behavior. */
.login-page {
  position:relative;
  overflow-x:hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(100,145,178,.18), transparent 25rem),
    linear-gradient(135deg, #0f1a26 0%, #173047 58%, #1c3a52 100%);
}
.login-card {
  border:1px solid rgba(255,255,255,.66);
  border-radius:17px;
  box-shadow:0 24px 75px rgba(5,15,25,.32);
}
.login-card h1 { letter-spacing:-.025em; }
.login-card > p { line-height:1.45; }
.login-foundry-watermark {
  position:fixed;
  right:28px;
  bottom:20px;
  width:210px;
  height:136px;
  background:url('foundry_watermark.png') center / contain no-repeat;
  opacity:.16;
  filter:invert(1) grayscale(1) brightness(2.2);
  pointer-events:none;
}

@media (max-width:1100px) {
  .gallery { grid-template-columns:repeat(3,minmax(180px,1fr)); }
  .foundry-watermark { width:165px; height:108px; right:18px; bottom:12px; }
}
@media (max-width:900px) {
  .app-shell { display:block; }
  .sidebar { box-shadow:12px 0 38px rgba(5,15,25,.28); }
  .topbar { height:62px; padding:0 16px; }
  .system-status { display:none; }
  .content { padding:18px 14px 48px; }
  .gallery { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:12px; }
  .photo img, .pdf-tile { height:150px; }
  .pdf-hover-preview { display:none !important; }
  .foundry-watermark { width:125px; height:82px; right:10px; bottom:7px; opacity:.035; }
}
@media (max-width:560px) {
  .topbar-tools { gap:7px; }
  .phone-preview-link { display:none; }
  .topbar .user > span:last-child { display:none; }
  .user-avatar { width:27px; height:27px; }
  .page-head h2 { font-size:23px; }
  .gallery { grid-template-columns:1fr; }
  .photo img, .pdf-tile { height:190px; }
  .login-foundry-watermark { width:130px; height:84px; right:10px; bottom:8px; opacity:.10; }
}
@media print {
  .foundry-watermark, .login-foundry-watermark, .system-status { display:none !important; }
}

/* v0.10.5 — phone-first material load / delivery chain of custody */
.delivery-nav { display:flex !important; align-items:center; justify-content:space-between; gap:8px; }
.nav-alert-count {
  display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px;
  border-radius:999px; background:#a94646; color:#fff; font-size:10px; font-weight:850;
  box-shadow:0 1px 4px rgba(0,0,0,.14);
}
.driver-page-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-end; margin-bottom:18px; }
.driver-page-head h2 { margin:4px 0 5px; font-size:28px; letter-spacing:-.025em; }
.driver-page-head p { margin:0; color:#6f7c88; }
.driver-section { margin:0 0 22px; }
.driver-section-head { display:flex; justify-content:space-between; align-items:end; gap:12px; margin:0 0 10px; }
.driver-section-head h3 { margin:0 0 2px; font-size:16px; }
.driver-section-head small { color:#7b8792; }
.driver-job-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.driver-job-card {
  display:flex; flex-direction:column; min-height:206px; padding:17px; border:1px solid #d7e0e6;
  border-radius:14px; background:#fff; box-shadow:0 2px 10px rgba(17,28,41,.055); color:inherit; text-decoration:none;
}
.driver-job-card:hover { text-decoration:none; border-color:#bccbd7; box-shadow:0 7px 22px rgba(17,28,41,.085); }
.driver-job-card.active-run { border-color:#a9c5d9; background:linear-gradient(180deg,#fbfdff,#f4f9fc); }
.driver-card-top { display:flex; justify-content:space-between; align-items:center; gap:8px; color:#7a8792; font-size:10px; font-weight:750; text-transform:uppercase; letter-spacing:.055em; }
.driver-job-card h3 { margin:16px 0 4px; font-size:18px; line-height:1.22; color:#1e2c38; }
.driver-job-card p { margin:0; color:#7a8793; font-size:12px; }
.driver-material-count, .driver-card-progress { display:flex; align-items:baseline; gap:7px; margin:auto 0 13px; padding-top:18px; }
.driver-material-count strong, .driver-card-progress strong { font-size:26px; color:#2b4b63; }
.driver-material-count span, .driver-card-progress span { color:#788591; font-size:11px; }
.driver-primary-btn { width:100%; min-height:42px; display:grid; place-items:center; }
.driver-open-label { margin-top:auto; color:#356f9f; font-size:12px; font-weight:750; }
.driver-complete-state { margin-top:auto; padding:11px; border-radius:9px; background:#edf6f0; color:#38714c; text-align:center; font-weight:750; font-size:12px; }
.driver-status-pill { display:inline-flex; align-items:center; width:max-content; padding:5px 9px; border-radius:999px; background:#eaf2f8; color:#315d7b; font-size:10px; font-weight:850; letter-spacing:.035em; text-transform:uppercase; }
.driver-alert-stack { display:grid; gap:8px; }
.driver-alert { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 14px; border:1px solid #dae1e6; border-left:4px solid #7595ad; border-radius:11px; background:#fff; }
.driver-alert.warning { border-left-color:#bd8138; background:#fffaf2; }
.driver-alert.danger { border-left-color:#ad4f4f; background:#fff6f5; }
.driver-alert strong { display:block; font-size:12px; }
.driver-alert span { display:block; color:#7b8792; font-size:10px; margin-top:2px; }
.driver-alert p { margin:5px 0 0; color:#465563; font-size:12px; }
.driver-legacy-jobs { margin-top:16px; padding:12px 14px; border:1px dashed #cbd4da; border-radius:10px; background:#f9fafb; color:#687682; }
.driver-legacy-jobs summary { cursor:pointer; font-size:12px; font-weight:750; }
.driver-legacy-list { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.driver-legacy-list a { padding:6px 8px; border-radius:7px; background:#fff; border:1px solid #e1e6ea; font-size:11px; }
.delivery-material-note { display:flex; gap:8px; align-items:center; margin:10px 17px; padding:10px 12px; border-radius:9px; background:#f5f7f8; color:#6c7985; font-size:11px; }
.delivery-material-note strong { color:#394957; }
.delivery-history-strip { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin:10px 17px; padding:9px 11px; border-radius:9px; background:#f7fafc; font-size:10px; }
.delivery-history-strip a { padding:4px 7px; border:1px solid #dae3e9; border-radius:999px; background:#fff; text-decoration:none; }

.driver-delivery-shell { max-width:860px; margin:0 auto; }
.driver-delivery-head { margin-bottom:14px; padding:18px 20px; border:1px solid #d8e1e7; border-radius:14px; background:#fff; box-shadow:0 2px 10px rgba(17,28,41,.05); }
.driver-back-link { display:inline-block; margin-bottom:12px; font-size:11px; font-weight:750; }
.driver-delivery-head h2 { margin:10px 0 3px; font-size:25px; letter-spacing:-.02em; }
.driver-delivery-head p { margin:0 0 6px; color:#6d7b88; }
.driver-delivery-head small { color:#86919b; }
.driver-work-card { padding:18px; border:1px solid #d8e1e7; border-radius:14px; background:#fff; box-shadow:0 2px 10px rgba(17,28,41,.05); }
.driver-step-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding-bottom:13px; border-bottom:1px solid #e8ecef; }
.driver-step-head span, .driver-photo-card > div > span { display:block; color:#70808d; font-size:9px; font-weight:900; letter-spacing:.12em; }
.driver-step-head h3, .driver-photo-card h3 { margin:2px 0 0; font-size:20px; }
.driver-progress-number { display:grid; place-items:center; min-width:62px; height:42px; padding:0 10px; border-radius:10px; background:#fff5e8; color:#956024; font-size:18px; font-weight:900; }
.driver-progress-number.complete { background:#edf7f0; color:#39704d; }
.driver-warning-banner, .driver-success-banner { display:flex; flex-direction:column; gap:2px; margin:13px 0; padding:11px 12px; border-radius:10px; font-size:11px; }
.driver-warning-banner { background:#fff6e9; border:1px solid #f0d5ac; color:#855a24; }
.driver-success-banner { background:#eef7f1; border:1px solid #cfe4d6; color:#3e6d4e; font-weight:750; }
.driver-warning-banner span { opacity:.84; }
.driver-item-stack { display:grid; gap:10px; margin:13px 0 17px; }
.driver-item { padding:14px; border:1px solid #dce3e8; border-radius:12px; background:#fff; transition:border-color .12s, background .12s; }
.driver-item.done { border-color:#bed9c6; background:#f7fcf8; }
.driver-item.problem { border-color:#e4b7b2; background:#fff8f7; }
.driver-item.exception { border-color:#e7d4b6; background:#fffbf5; }
.driver-item-copy { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.driver-item-copy h4 { margin:0; flex:1 1 300px; font-size:15px; }
.driver-item-copy p { margin:0; color:#7f8a94; font-size:11px; }
.driver-item-current { padding:4px 7px; border-radius:999px; background:#edf1f4; color:#596875; font-size:9px; font-weight:850; text-transform:uppercase; }
.driver-button-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
.driver-button-grid.two-button { grid-template-columns:repeat(2,minmax(0,1fr)); }
.driver-button-grid form { margin:0; }
.driver-action { width:100%; min-height:45px; border:1px solid #ccd6dd; border-radius:9px; background:#f8fafb; color:#50606d; font-size:11px; font-weight:850; cursor:pointer; }
.driver-action.loaded { background:#eef7f1; border-color:#cce0d2; color:#39714c; }
.driver-action.missing { background:#fff4f2; border-color:#e7c3bf; color:#984c47; }
.driver-action.neutral { background:#f5f7f9; color:#5f6c77; }
.driver-action.selected { outline:2px solid currentColor; outline-offset:1px; }
.driver-finish-btn { width:100%; min-height:51px; font-size:13px; font-weight:900; letter-spacing:.015em; }
.driver-ready-card { text-align:center; padding:32px 22px; }
.driver-big-check { display:grid; place-items:center; width:58px; height:58px; margin:0 auto 12px; border-radius:50%; background:#eaf6ee; color:#39744d; font-size:28px; font-weight:900; }
.driver-ready-card h3 { margin:0 0 5px; font-size:22px; }
.driver-ready-card p { color:#6e7b86; }
.driver-exception-summary { display:grid; gap:5px; max-width:580px; margin:16px auto; text-align:left; }
.driver-exception-summary div { display:flex; justify-content:space-between; gap:12px; padding:8px 10px; border-radius:8px; background:#fff7ed; font-size:11px; }
.driver-photo-card { margin:18px 0; padding:16px; border:1px solid #cbd9e3; border-radius:12px; background:linear-gradient(180deg,#f8fbfd,#f2f7fa); }
.driver-photo-card p { margin:4px 0 12px; color:#6f7d89; font-size:11px; }
.driver-photo-card form { display:grid; grid-template-columns:auto 1fr auto; gap:8px; align-items:center; }
.driver-camera-btn { display:grid; place-items:center; min-height:42px; padding:0 14px; border-radius:9px; background:#315f80; color:#fff; font-size:11px; font-weight:850; cursor:pointer; }
.driver-camera-btn input { position:absolute; opacity:0; pointer-events:none; width:1px; height:1px; }
.driver-photo-caption { min-height:42px; }
.driver-photo-count, .driver-photo-required { margin-top:9px; font-size:10px; font-weight:750; }
.driver-photo-count { color:#3e7652; }
.driver-photo-required { color:#9b5a35; }

@media (max-width:900px) {
  .driver-job-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .driver-delivery-shell { max-width:100%; }
}
@media (max-width:620px) {
  .driver-page-head h2 { font-size:24px; }
  .driver-job-grid { grid-template-columns:1fr; }
  .driver-job-card { min-height:180px; }
  .driver-work-card { padding:12px; border-radius:12px; }
  .driver-delivery-head { padding:14px; }
  .driver-delivery-head h2 { font-size:21px; }
  .driver-item { padding:12px; }
  .driver-button-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .driver-action { min-height:52px; font-size:12px; }
  .driver-button-grid.two-button .driver-action { min-height:56px; }
  .driver-photo-card form { grid-template-columns:1fr; }
  .driver-camera-btn, .driver-photo-card .btn { min-height:48px; }
  .driver-alert { align-items:flex-start; flex-direction:column; }
  .driver-alert form, .driver-alert button { width:100%; }
  .material-title-actions { flex-wrap:wrap; }
}

/* v0.10.6 - forgiving driver workflow */
.driver-cancel-load-form {
  margin-top: 14px;
}
.driver-cancel-load-btn {
  appearance: none;
  border: 1px solid rgba(120, 53, 15, .28);
  background: #fffaf2;
  color: #8a4b18;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.driver-cancel-load-btn:hover {
  background: #fff3df;
  border-color: rgba(120, 53, 15, .42);
}
@media (max-width: 720px) {
  .driver-cancel-load-btn {
    width: 100%;
    min-height: 46px;
  }
}


/* v0.11.2 - owner view, change requests, team chat */
.owner-readonly-pill {
  display:inline-flex; align-items:center; min-height:30px; padding:0 10px;
  border:1px solid #d8c594; border-radius:999px; background:#fff9e8;
  color:#785c18; font-size:10px; font-weight:850; text-decoration:none; white-space:nowrap;
}
.owner-readonly-pill:hover { text-decoration:none; background:#fff4ce; }
.owner-view-banner {
  display:flex; align-items:flex-start; gap:10px; margin:0 0 15px; padding:11px 13px;
  border:1px solid #e2d4a6; border-left:4px solid #b9953e; border-radius:10px;
  background:#fffaf0; color:#66551f; font-size:11px;
}
.owner-view-banner strong { flex:0 0 auto; color:#5e4a13; }
.owner-view-banner a { font-weight:800; }
.nav-alert-count.chat-count { background:#355f7b; }
.nav-alert-count.request-count { background:#9d7630; }

.request-page-head p, .chat-page-head p { max-width:720px; }
.request-layout {
  display:grid; grid-template-columns:minmax(280px, .72fr) minmax(0, 1.55fr);
  gap:16px; align-items:start;
}
.request-create-card { position:sticky; top:78px; padding:18px; }
.section-heading { margin-bottom:14px; }
.section-heading h3 { margin:3px 0 0; font-size:19px; }
.eyebrow { color:#7c8892; font-size:9px; font-weight:900; letter-spacing:.12em; }
.request-form { display:grid; gap:11px; }
.request-form .field { margin:0; }
.request-send-btn { width:100%; min-height:44px; }
.request-list { display:grid; gap:10px; }
.request-list-head { display:flex; align-items:end; justify-content:space-between; gap:10px; padding:0 2px 2px; }
.request-list-head h3 { margin:0; font-size:17px; }
.request-list-head span { color:#89949d; font-size:10px; }
.request-card {
  padding:15px 16px; border:1px solid #dce3e8; border-left:4px solid #8598a7;
  border-radius:12px; background:#fff; box-shadow:0 2px 9px rgba(17,28,41,.045);
}
.request-card.status-open { border-left-color:#b98b38; }
.request-card.status-in-review { border-left-color:#4f7894; }
.request-card.status-completed { border-left-color:#4e805d; }
.request-card.status-declined { border-left-color:#9c5f5a; opacity:.84; }
.request-card-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.request-card-top > div { display:flex; flex-wrap:wrap; gap:6px; }
.request-card-top time { color:#8a959e; font-size:9px; }
.request-status, .request-priority {
  display:inline-flex; align-items:center; min-height:22px; padding:0 8px;
  border-radius:999px; font-size:8px; font-weight:900; letter-spacing:.055em; text-transform:uppercase;
}
.request-status { background:#eef3f6; color:#4b6374; }
.request-priority { background:#f6f3ec; color:#766342; }
.request-card h4 { margin:10px 0 3px; font-size:16px; }
.request-job-link, .request-general { display:inline-block; margin-bottom:8px; font-size:10px; font-weight:750; }
.request-general { color:#85919b; }
.request-body { white-space:pre-wrap; margin:5px 0 9px; color:#40505d; font-size:12px; line-height:1.5; }
.request-meta { color:#8a959d; font-size:9px; }
.request-response {
  margin-top:11px; padding:10px 11px; border-radius:9px; background:#f2f7fa; border:1px solid #dce7ed;
}
.request-response strong { display:block; margin-bottom:3px; color:#405f74; font-size:9px; text-transform:uppercase; letter-spacing:.07em; }
.request-response p { margin:0; white-space:pre-wrap; font-size:11px; color:#455764; }
.request-review-form {
  display:grid; grid-template-columns:150px minmax(0,1fr) auto; gap:8px; align-items:end;
  margin-top:12px; padding-top:12px; border-top:1px solid #edf0f2;
}
.request-review-form .field { margin:0; }
.request-review-form .btn { min-height:39px; }
.request-empty { min-height:130px; }

.chat-shell {
  display:grid; grid-template-columns:minmax(0,1fr) 250px; gap:16px; align-items:start;
}
.chat-window {
  overflow:hidden; border:1px solid #d7e0e6; border-radius:14px; background:#fff;
  box-shadow:0 2px 12px rgba(17,28,41,.055);
}
.chat-header {
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:12px 15px; border-bottom:1px solid #e8edf0; background:#fafcfd;
}
.chat-header > div { display:flex; align-items:center; gap:7px; }
.chat-header small { color:#89959e; font-size:9px; }
.chat-messages {
  height:min(58vh, 570px); min-height:360px; overflow-y:auto; padding:15px;
  background:linear-gradient(180deg,#fbfcfd,#f7f9fa);
}
.chat-empty {
  display:grid; place-items:center; align-content:center; height:100%; text-align:center; color:#84919b;
}
.chat-empty strong { color:#566673; font-size:13px; }
.chat-empty span { margin-top:4px; font-size:10px; }
.chat-message { max-width:72%; margin:0 0 10px; }
.chat-message.mine { margin-left:auto; }
.chat-message-head { display:flex; gap:8px; align-items:baseline; margin:0 4px 3px; }
.chat-message-head strong { font-size:9px; color:#586a77; }
.chat-message-head time { font-size:8px; color:#98a2aa; }
.chat-message-body {
  width:max-content; max-width:100%; padding:9px 11px; border:1px solid #dce4e9;
  border-radius:11px 11px 11px 3px; background:#fff; color:#344450;
  font-size:12px; line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere;
}
.chat-message.mine .chat-message-head { justify-content:flex-end; }
.chat-message.mine .chat-message-body {
  margin-left:auto; border-color:#c9dce8; border-radius:11px 11px 3px 11px;
  background:#edf5fa; color:#29465a;
}
.chat-composer {
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:12px;
  border-top:1px solid #e6ebee; background:#fff;
}
.chat-composer textarea { resize:none; min-height:52px; }
.chat-composer .btn { min-width:86px; }
.chat-note-card {
  padding:16px; border:1px solid #dde4e8; border-radius:12px; background:#fff;
}
.chat-note-card h3 { margin:4px 0 6px; font-size:16px; }
.chat-note-card p { margin:0; color:#687784; font-size:11px; line-height:1.5; }

.owner-initial-card { border-top:4px solid #a48740; }

@media (max-width:900px) {
  .owner-readonly-pill { display:none; }
  .request-layout, .chat-shell { grid-template-columns:1fr; }
  .request-create-card { position:static; }
  .chat-note-card { display:none; }
}
@media (max-width:620px) {
  .owner-view-banner { flex-direction:column; gap:4px; }
  .request-review-form { grid-template-columns:1fr; }
  .chat-messages { min-height:360px; height:56vh; padding:11px; }
  .chat-message { max-width:88%; }
  .chat-composer { grid-template-columns:1fr; }
  .chat-composer .btn { min-height:45px; }
}

.request-routing-note { margin-top:11px; padding-top:10px; border-top:1px solid #edf0f2; color:#7d8992; font-size:10px; font-weight:650; }

/* v0.13.0 - notifications + Sales Corner */
.nav-alert-count.notification-count { background:#9a3f38; }
.notification-page-head p, .sales-page-head p, .sales-job-head p { max-width:760px; }
.notification-list { display:grid; gap:9px; }
.notification-card {
  display:grid; grid-template-columns:32px minmax(0,1fr) auto; gap:12px; align-items:start;
  padding:13px 14px; border:1px solid #dce3e8; border-radius:11px; background:#fff;
  box-shadow:0 2px 8px rgba(17,28,41,.035);
}
.notification-card.unread { border-left:4px solid #527994; background:#fbfdff; }
.notification-card.install-request { border-left-color:#a56f2f; background:#fffdf8; }
.notification-card.read { opacity:.72; }
.notification-icon {
  display:grid; place-items:center; width:28px; height:28px; border-radius:50%;
  background:#edf3f7; color:#42657c; font-weight:900;
}
.notification-card.install-request .notification-icon { background:#f7eedf; color:#8a5b23; }
.notification-meta { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.notification-category { font-size:8px; font-weight:900; letter-spacing:.07em; text-transform:uppercase; color:#617685; }
.notification-meta time { color:#98a2a9; font-size:8px; }
.notification-main h3 { margin:4px 0 3px; font-size:14px; }
.notification-main p { margin:0; color:#586975; font-size:11px; line-height:1.45; }
.notification-footer { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-top:7px; color:#8b969e; font-size:9px; }
.notification-footer a { font-weight:800; }
.notification-read-form { margin:0; }
.notification-empty { min-height:150px; display:grid; place-items:center; align-content:center; gap:4px; text-align:center; }
.notification-empty span { color:#83909a; font-size:10px; }

.sales-start-card {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(300px,.7fr); gap:16px; align-items:center;
  padding:16px 18px; margin-bottom:18px;
}
.sales-start-card > div { display:grid; gap:3px; }
.sales-start-card > div strong { font-size:15px; }
.sales-start-card > div span { color:#74818b; font-size:10px; line-height:1.45; }
.sales-start-card form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.sales-pipeline { margin-top:10px; }
.sales-job-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.sales-job-card {
  display:flex; flex-direction:column; min-height:220px; padding:15px; border:1px solid #dce3e7;
  border-top:4px solid #8999a5; border-radius:12px; background:#fff; box-shadow:0 2px 9px rgba(17,28,41,.04);
}
.sales-job-card.active-sale { border-top-color:#527a63; }
.sales-job-card.install-requested { border-top-color:#3f6f89; }
.sales-card-top { display:flex; justify-content:space-between; gap:8px; align-items:center; }
.sales-so { color:#87929b; font-size:9px; font-weight:800; }
.sales-job-card h3 { margin:11px 0 2px; font-size:17px; line-height:1.2; }
.sales-project-name { margin:0 0 10px; color:#7b8790; font-size:10px; }
.sales-mini-steps { display:grid; grid-template-columns:repeat(5,1fr); gap:3px; margin:12px 0 10px; }
.sales-mini-steps span {
  display:grid; place-items:center; min-height:34px; padding:3px; border:1px solid #e1e6e9; border-radius:6px;
  background:#f7f9fa; color:#909aa1; text-align:center; font-size:7px; font-weight:850; line-height:1.2;
}
.sales-mini-steps span.done { border-color:#c9ddd0; background:#f0f7f2; color:#4f7159; }
.sales-job-card > small { color:#8b6b45; line-height:1.4; }
.sales-open-btn { margin-top:auto; width:100%; text-align:center; }
.sales-empty { grid-column:1/-1; min-height:160px; display:grid; place-items:center; align-content:center; gap:4px; }
.sales-empty span { color:#89949c; font-size:10px; }

.back-link { display:inline-block; margin-bottom:5px; font-size:10px; font-weight:800; }
.sales-status-banner {
  display:flex; gap:10px; align-items:flex-start; margin:0 0 14px; padding:11px 13px; border-radius:10px;
  border:1px solid #e0d8be; border-left:4px solid #b28a3d; background:#fffbf1; color:#695a31; font-size:10px;
}
.sales-status-banner.active { border-color:#cbded1; border-left-color:#527a63; background:#f3f8f4; color:#4f6656; }
.sales-status-banner strong { flex:0 0 auto; }
.sales-step-stack { display:grid; gap:12px; }
.sales-step {
  display:grid; grid-template-columns:42px minmax(0,1fr); gap:14px; padding:16px 17px;
  border-left:4px solid #c9d0d5;
}
.sales-step.complete { border-left-color:#5d8266; }
.sales-step.current { border-left-color:#4e7792; }
.sales-step.locked { opacity:.64; background:#fafbfb; }
.sales-step-number {
  display:grid; place-items:center; width:36px; height:36px; border-radius:50%;
  background:#eef2f4; color:#687a87; font-size:14px; font-weight:900;
}
.sales-step.complete .sales-step-number { background:#edf6ef; color:#4e7558; }
.sales-step.current .sales-step-number { background:#edf4f8; color:#3f6c87; }
.sales-step-heading { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:12px; }
.sales-step-heading h3 { margin:0; font-size:17px; }
.sales-step-heading p { margin:3px 0 0; color:#76828b; font-size:10px; line-height:1.45; }
.sales-step-state {
  flex:0 0 auto; display:inline-flex; align-items:center; min-height:23px; padding:0 8px; border-radius:999px;
  background:#eef2f4; color:#63727c; font-size:8px; font-weight:900; letter-spacing:.045em; text-transform:uppercase;
}
.sales-step.complete .sales-step-state { background:#edf6ef; color:#4e7558; }
.sales-step.current .sales-step-state { background:#edf4f8; color:#3f6c87; }
.sales-missing { margin:-2px 0 12px; padding:8px 10px; border-radius:8px; background:#fff6e9; color:#7c5b2f; font-size:10px; font-weight:700; }
.sales-info-form { display:grid; gap:12px; }
.sales-upload-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:end; margin-top:10px; }
.sales-upload-form .drop-zone { margin:0; }
.sales-choice-form { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.sales-choice {
  display:flex; gap:6px; align-items:center; min-height:38px; padding:0 10px; border:1px solid #dbe2e6;
  border-radius:8px; background:#fff; font-size:10px; font-weight:750; cursor:pointer;
}
.sales-choice input { width:auto; margin:0; }
.sales-complete-line {
  display:flex; justify-content:space-between; gap:12px; align-items:center; margin:4px 0 8px; padding:9px 10px;
  border:1px solid #d6e5db; border-radius:8px; background:#f4f9f5; color:#506759; font-size:10px;
}
.sales-complete-line span { color:#7c8a81; }
.sales-activation-card {
  display:flex; justify-content:space-between; gap:16px; align-items:center; padding:17px 18px;
  border:1px solid #dce3e7; border-left:5px solid #b9c1c7; border-radius:12px; background:#fff;
}
.sales-activation-card.ready { border-left-color:#a9772e; background:#fffaf1; }
.sales-activation-card.complete { border-left-color:#527a63; background:#f5f9f6; }
.sales-activation-card h3 { margin:3px 0; font-size:18px; }
.sales-activation-card p { margin:0; color:#75818a; font-size:10px; }
.sales-activation-card button[disabled] { opacity:.45; cursor:not-allowed; }
.sales-locked-note { color:#8a959c; font-size:10px; font-style:italic; }
.sales-install-requested { display:grid; gap:2px; padding:11px 12px; border:1px solid #c9e0d0; border-radius:9px; background:#f0f8f2; color:#4e7158; }
.sales-install-requested span { font-size:10px; color:#72847a; }
.sales-install-btn { min-width:170px; min-height:44px; }

@media (max-width:1100px) {
  .sales-job-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .notification-card { grid-template-columns:30px minmax(0,1fr); }
  .notification-read-form { grid-column:2; }
  .sales-start-card { grid-template-columns:1fr; }
  .sales-start-card form { grid-template-columns:1fr; }
  .sales-job-grid { grid-template-columns:1fr; }
  .sales-step { grid-template-columns:34px minmax(0,1fr); padding:13px; gap:10px; }
  .sales-step-number { width:32px; height:32px; }
  .sales-step-heading { flex-direction:column; gap:6px; }
  .sales-upload-form { grid-template-columns:1fr; }
  .sales-choice-form { align-items:stretch; flex-direction:column; }
  .sales-choice { width:100%; }
  .sales-activation-card { align-items:flex-start; flex-direction:column; }
  .sales-activation-card form, .sales-activation-card button, .sales-install-btn { width:100%; }
  .sales-complete-line { align-items:flex-start; flex-direction:column; gap:2px; }
}
.sales-order-material-strip { display:flex; gap:9px; align-items:center; flex-wrap:wrap; margin:11px 0; padding:9px 10px; border:1px solid #d7e2e8; border-radius:8px; background:#f6fafc; color:#536875; font-size:10px; }
.sales-order-material-strip a { margin-left:auto; font-weight:800; }
@media (max-width:620px) { .sales-order-material-strip a { margin-left:0; width:100%; } }
.notification-count[hidden] { display:none !important; }
.notification-count-new { animation:notificationPulse .7s ease-out 2; }
@keyframes notificationPulse { 0%{transform:scale(1)} 50%{transform:scale(1.2)} 100%{transform:scale(1)} }

/* v0.14.0 - salesperson-owned Sales Corner + lost-sale handling */
.sales-person-sections { display:grid; gap:22px; }
.sales-person-section { padding-top:2px; }
.sales-person-heading { padding:0 2px 8px; border-bottom:1px solid #e7ebee; margin-bottom:12px; }
.sales-person-heading .eyebrow { margin-bottom:2px; }
.sales-person-heading h3 { margin:0; font-size:20px; }
.sales-start-form { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.sales-start-form select { min-width:135px; }
.sales-start-form input { min-width:240px; flex:1 1 280px; }
.sales-job-card.cancelled-sale { opacity:.78; border-style:dashed; background:#fbfbfb; }
.sales-cancel-summary { display:flex; flex-direction:column; gap:2px; margin:8px 0 12px; padding:8px 10px; border-radius:8px; background:#f7eeee; color:#7e4545; font-size:10px; }
.sales-cancel-summary span { color:#9b7777; font-size:9px; }
.sales-cancelled-banner { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:14px; padding:16px 18px; border-left:5px solid #9b5753; background:#fff7f6; }
.sales-cancelled-banner h3 { margin:3px 0 2px; }
.sales-cancelled-banner p { margin:0; color:#775b59; }
.sales-cancel-card { margin-top:4px; padding:17px 18px; border:1px solid #e4c9c6; background:#fffafa; }
.sales-cancel-card h3 { margin:4px 0 4px; }
.sales-cancel-card p { margin:0; max-width:760px; color:#6c7075; font-size:11px; }
.sales-cancel-card form { display:grid; grid-template-columns:minmax(170px,220px) minmax(220px,1fr) auto; gap:8px; align-items:end; margin-top:12px; }
.sales-initial-card .initial-user-kicker { color:#4e7088; }
.legacy-sales-section { opacity:.92; }

@media (max-width: 760px) {
  .sales-start-form { display:grid; grid-template-columns:1fr; width:100%; }
  .sales-start-form select, .sales-start-form input, .sales-start-form .btn { width:100%; min-width:0; }
  .sales-cancel-card form { grid-template-columns:1fr; }
  .sales-cancelled-banner { align-items:flex-start; flex-direction:column; }
}
