/* Shared brand system for office, crew, partner, and customer portals. */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #12181f;
  --dim: #5c6b7a;
  --navy: #102033;
  --line: #e6ebf0;
  --accent: #1f6feb;
  --orange: #1f6feb;
  --ok: #0f7b4c;
  --warn: #9a6700;
  --danger: #c4382c;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 51, 0.06);
  --shadow-pop: 0 18px 48px rgba(16, 32, 51, 0.16);
  --font: Inter, "Segoe UI", sans-serif;
  --step: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141b;
    --card: #17202a;
    --ink: #e8eef5;
    --dim: #9aabbc;
    --navy: #d7e3ef;
    --line: #2a3848;
    --accent: #6ea8ff;
    --orange: #6ea8ff;
    --ok: #3dbe86;
    --warn: #e6b450;
    --danger: #ff8d84;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-pop: 0 18px 48px rgba(0, 0, 0, 0.45);
  }
}

body[data-portal], body[data-view="private"] {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}
body[data-portal] h1,
body[data-portal] h2,
body[data-portal] h3,
body[data-view="private"] h1,
body[data-view="private"] h2 {
  font-family: var(--font);
  letter-spacing: -0.03em;
}
body[data-portal] .crew-btn,
body[data-view="private"] .crew-btn,
body[data-portal] button.crew-tab {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  box-shadow: none;
  transition: transform 0.12s ease, background 0.12s ease;
}
body[data-portal] .crew-btn:hover,
body[data-view="private"] .crew-btn:hover { transform: translateY(-1px); }
body[data-portal] .crew-btn:focus-visible,
body[data-view="private"] :focus-visible,
body[data-portal] :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body[data-portal] input,
body[data-portal] select,
body[data-portal] textarea,
body[data-view="private"] input,
body[data-view="private"] select,
body[data-view="private"] textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
body[data-portal] .detail-card,
body[data-portal] .job-card,
body[data-portal] .crew-person,
body[data-view="private"] .detail-card,
.portal .status-card,
.portal .move-card {
  background: var(--card);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
body[data-portal] .empty-state {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 20px;
  color: var(--dim);
}
.empty-mark { width: 48px; height: 48px; color: var(--accent); }
.nav-ico {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0 auto 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.chart-row { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: center; }
.chart-donut { width: 140px; height: 140px; }
.chart-bars { display: grid; grid-template-columns: repeat(7, 28px); gap: 8px; align-items: end; height: 96px; }
.chart-bars span { display: block; width: 28px; border-radius: 6px 6px 2px 2px; background: var(--accent); min-height: 4px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; color: var(--dim); font-size: 12px; }
.brand-modal {
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
}

body[data-portal="crew"] .crew-bottom {
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(16, 32, 51, 0.06);
}
body[data-portal="crew"] .crew-bottom .crew-tab {
  background: transparent;
  color: var(--navy);
  border-radius: 0;
  min-height: 64px;
}
body[data-portal="crew"] .crew-bottom .crew-tab[aria-pressed="true"] { color: var(--accent); background: transparent; }
body[data-portal="crew"] .job-card { min-height: 88px; font-size: 18px; }
.job-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr); gap: 20px; align-items: start; }
.job-rail { position: sticky; top: 16px; display: grid; gap: 12px; }
.stepper { display: flex; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); color: var(--dim); font-weight: 650; }
.stepper li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #e8eef6; color: var(--navy); font-size: 12px; }
.stepper li.is-done { color: var(--ok); }
.stepper li.is-done span { background: var(--ok); color: #fff; }
.offer-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.offer-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 8px; }
.offer-card header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.offer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.offer-actions .crew-btn { width: auto; min-height: 40px; padding: 0 14px; }
.move-stage { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; max-width: 1120px; }
.move-rail { position: sticky; top: 16px; }
.portal .move-rail .status-steps { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; padding: 8px 8px 8px 18px; list-style: none; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.portal .move-rail .status-steps li { position: relative; display: block; margin: 0; padding: 12px 12px 12px 22px; border: 0; border-radius: 0; background: transparent; color: var(--dim); text-align: left; font-size: 14px; font-weight: 650; line-height: 1.3; }
.portal .move-rail .status-steps li::before { content: ""; position: absolute; left: 0; top: 16px; display: block; width: 10px; height: 10px; margin: 0; border-radius: 50%; background: #d5dee8; animation: none; }
.portal .move-rail .status-steps li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 28px; width: 2px; height: calc(100% - 12px); background: #e4ebf2; }
.portal .move-rail .status-steps li.past { color: var(--ok); background: transparent; }
.portal .move-rail .status-steps li.past::before { background: var(--ok); }
.portal .move-rail .status-steps li.current { color: var(--ink); background: transparent; }
.portal .move-rail .status-steps li.current::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.16); animation: none; }
body[data-portal] .crew-app { min-height: 100vh; }
body[data-portal] aside.oc,
body[data-view] aside.oc { display: block; clear: both; position: relative; z-index: 1; }
body.office-detail aside.oc { display: none; }
.section-head { display: flex; align-items: center; gap: 8px; }
.section-head .nav-ico, .job-chip .nav-ico, .crew-btn .nav-ico { display: inline-block; width: 16px; height: 16px; margin: 0 6px 0 0; vertical-align: -3px; }
.pay-lines { display: grid; gap: 4px; }
.insurance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-grid button, .month-grid .pad, .month-grid .dow { min-height: 44px; border-radius: 10px; background: var(--card); }
.month-grid .dow { display: grid; place-items: center; color: var(--dim); font-size: 12px; background: transparent; }
body[data-portal="office"] .place-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 0 0 12px; padding: 12px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
body[data-portal="crew"] .crew-tabs,
body[data-portal="crew"] .crew-customer-nav { display: flex; flex-wrap: wrap; gap: 8px; }
body[data-portal="crew"] .crew-tabs .crew-tab,
body[data-portal="crew"] .crew-customer-nav .crew-tab { background: transparent; color: var(--navy); border-radius: 999px; box-shadow: none; width: auto; }
body[data-portal="crew"] .crew-tabs .crew-tab[aria-pressed="true"],
body[data-portal="crew"] .crew-customer-nav .crew-tab[aria-pressed="true"] { background: var(--navy); color: #fff; }
.move-main { display: grid; gap: 16px; }
.move-main .portal-card, .money-grid { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.who-row, .who-company { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: #f6f8fb; }
.portal-tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0 12px; background: var(--bg); }
.portal-tabs .crew-tab { background: transparent; color: var(--navy); border-radius: 999px; }
.portal-tabs .crew-tab[aria-pressed="true"] { background: var(--navy); color: #fff; }
.card-grid, #customer-list, #inbox-list, #locations-list, #crew-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.cal-modes, .crew-invite-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #e7eef6; }
.cal-modes .crew-tab, .crew-invite-switch .crew-tab { background: transparent; color: var(--navy); min-height: 36px; }
.cal-modes .crew-tab[aria-pressed="true"], .crew-invite-switch [aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
body[data-portal] input[type="date"],
body[data-portal] input[type="time"],
body[data-view="sample"] input[type="date"],
body[data-view="private"] input[type="date"],
body[data-view="live"] input[type="date"] {
  min-height: 44px;
  padding-left: 40px;
  background-repeat: no-repeat;
  background-position: 12px 50%;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%231f6feb' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>");
}
body[data-portal] input[type="time"] {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%231f6feb' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'><circle cx='12' cy='12' r='8'/><path d='M12 8v5l3 2'/></svg>");
}
label.check-line, .switch-row { display: flex; align-items: center; gap: 10px; }
label.check-line input[type="checkbox"], .switch-row input[type="checkbox"], #site-photo-public {
  appearance: none;
  width: 42px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: #c5d0dc;
  position: relative;
  cursor: pointer;
}
label.check-line input[type="checkbox"]::after, .switch-row input[type="checkbox"]::after, #site-photo-public::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
}
label.check-line input[type="checkbox"]:checked, .switch-row input[type="checkbox"]:checked, #site-photo-public:checked { background: var(--accent); }
label.check-line input[type="checkbox"]:checked::after, .switch-row input[type="checkbox"]:checked::after, #site-photo-public:checked::after { left: 21px; }
.sticky-bar { position: sticky; bottom: 12px; display: flex; gap: 8px; justify-content: flex-end; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-pop); }
.screen-wrap { max-width: 1120px; }
@media (max-width: 800px) {
  .job-layout, .move-stage { grid-template-columns: 1fr; }
  .job-rail, .move-rail { position: static; }
  .stepper { flex-direction: column; }
  .portal .move-rail .status-steps li { white-space: normal; }
}
body[data-portal="crew"] #clock-in,
body[data-portal="crew"] #clock-out { min-height: 64px; font-size: 20px; }

body[data-portal="partner"] .crew-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0 16px; }
body[data-portal="partner"] .crew-tab { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--navy); border-radius: 999px; }
body[data-portal="partner"] .crew-tab .nav-ico { display: inline-block; margin: 0; width: 16px; height: 16px; }
body[data-portal="partner"] .crew-tab[aria-pressed="true"] { background: var(--navy); color: #fff; }
body[data-portal="partner"] .page-head, body[data-portal="crew"] .page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 0 0 16px; }
body[data-portal="crew"] .job-card { display: grid; gap: 4px; width: 100%; text-align: left; padding: 16px; }

body[data-view="private"] .move-hero,
body[data-view="private"] .portal { color: var(--ink); }
body[data-view="private"] .status-steps li.current { background: var(--navy); color: #fff; }

@media (max-width: 800px) {
  .chart-row { grid-template-columns: 1fr; }
  body[data-portal="crew"] .crew-app { padding-bottom: 96px; }
  .map-hero, .map-art, body[data-portal] .property-map, body[data-portal] .property-map gmp-map-3d { min-height: 280px; height: 280px; }
}
.map-hero { position: relative; min-height: 420px; border-radius: 18px; overflow: hidden; background: #d7e6f5; }
.map-art { display: block; width: 100%; height: 420px; }
.map-hero-card { position: absolute; left: 16px; right: 16px; bottom: 16px; background: rgba(255,255,255,.94); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-pop); }
.map-kicker { margin: 0 0 4px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
body[data-portal] .property-map, body[data-portal] .property-map:has(a) { min-height: 460px; padding: 12px; background: #eef4fb; border: 0; border-radius: 18px; }
body[data-portal] .property-map gmp-map-3d { height: 420px; min-height: 420px; border-radius: 16px; }
body[data-portal] .crew-btn { transition: transform .12s ease; }
body[data-portal] .crew-btn:hover { transform: translateY(-1px); }
body[data-portal] .detail-card, body[data-portal] .offer-card { transition: transform .16s ease; }
body[data-portal] .detail-card:hover, body[data-portal] .offer-card:hover { transform: translateY(-2px); }
.pml-picker { position: fixed; z-index: 80; width: min(320px, calc(100vw - 16px)); padding: 12px; border-radius: 16px; background: #fff; color: #102033; box-shadow: 0 18px 48px rgba(16, 32, 51, 0.2); }
.pml-picker-bar, .pml-picker-time { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pml-picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; }
.pml-picker-grid button, .pml-picker-time button, .pml-picker-bar button { min-height: 36px; border: 0; border-radius: 8px; background: #eef3f8; color: #102033; }
.pml-picker-time { max-height: 220px; overflow: auto; justify-content: flex-start; flex-wrap: wrap; }
.form-step { margin: 0 0 16px; padding: 16px; border: 0; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.screen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
#payroll-panel .screen-grid { grid-template-columns: minmax(0, 640px); }
.payroll-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) auto; gap: 12px; align-items: end; }
.payroll-row h3 { margin: 0 0 6px; }
@media (max-width: 700px) {
  .payroll-row { grid-template-columns: 1fr; }
  #payroll-panel .screen-switch { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  #payroll-panel .screen-switch p { grid-column: 1 / -1; grid-row: 1; margin: 0; text-align: center; white-space: nowrap; }
  #payroll-panel #payroll-prev, #payroll-panel #payroll-next { width: 100%; }
  #calendar-panel:not([hidden]) { display: flex; flex-direction: column; }
  #calendar-panel .page-head { order: 0; }
  #calendar-panel .cal-board { order: 1; }
  #calendar-panel .cal-filters { order: 2; }
  #calendar-panel .desk-more, #calendar-panel .crew-status { order: 3; }
}
@media (min-width: 701px) {
  #calendar-panel:not([hidden]) { display: flex; flex-direction: column; }
  #calendar-panel .cal-toolbar { order: 1; }
  #calendar-panel .cal-board { order: 2; }
  #calendar-panel .cal-later,
  #calendar-panel .desk-more,
  #calendar-panel .crew-status { order: 3; }
}
.screen-switch { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.job-sticky { position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; margin: 0 0 16px; padding: 0 0 12px; background: #f4f7fb; }
.job-sticky h1 { margin: 8px 0 4px; font-size: clamp(28px, 3vw, 40px); }
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 460px; }
.job-actions .crew-btn { width: auto; }
.job-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.job-page .job-span, .job-page #rental-truck, .job-page #job-details, .job-page #house-section { grid-column: 1 / -1; }
.job-top { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.15fr); gap: 16px; align-items: stretch; }
.job-page .job-top > * { min-width: 0; }
.job-page .job-top.crew-truck-row > #crew-section { display: flex; flex-direction: column; }
.job-page .job-top.crew-truck-row > #crew-section > .detail-card { flex: 1 1 auto; }
.job-live-map { min-height: 0; }
.job-live-map.map-placeholder { min-height: 72px; margin-top: 8px; padding: 12px; border-radius: 12px; background: #e7eef6; color: #3d4d61; }
.job-page .who-row strong, .job-page .who-row p, .job-page .job-team-list, .job-page .face-card p, .job-page .truck-summary { white-space: normal; overflow: visible; text-overflow: unset; }
.truck-summary { font-size: 16px; }
.job-actions { display: flex; flex-flow: row wrap; align-items: center; justify-content: flex-start; gap: 8px; max-width: none; width: 100%; }
body[data-portal="office"] .job-page .job-actions .crew-btn,
body[data-portal="office"] .job-page .job-actions a.crew-btn { width: auto; flex: 0 0 auto; display: inline-flex; }
@media (max-width: 767px) {
  .job-grid, .job-top, .job-sticky, .job-page .job-top.crew-truck-row { display: flex; flex-direction: column; align-items: stretch; width: 100%; }
  .job-page .job-grid > *, .job-page .job-top > *, .job-page .detail-card { width: 100%; max-width: none; }
}
.crew-truck-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr); gap: 12px; align-items: start; }
.crew-truck-side { display: flex; flex-direction: column; gap: 12px; }
.job-page .job-top.crew-truck-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
@media (max-width: 767px) {
  .job-page .job-grid,
  .job-page .job-top.crew-truck-row,
  .job-page .job-sticky {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .job-page .job-grid > *,
  .job-page .job-top > *,
  .job-page #crew-section,
  .job-page #office-job-map,
  .job-page .detail-card {
    width: 100%;
    max-width: none;
    align-self: stretch;
    box-sizing: border-box;
  }
}
@media (max-width: 700px) {
  .crew-truck-row { display: flex; flex-direction: column; }
  .crew-truck-row #crew-section { order: 1; }
  .crew-truck-row .crew-truck-side { order: 2; display: flex; flex-direction: column; }
  .crew-truck-row #office-job-map { order: 1; }
  .crew-truck-row #rental-truck { order: 2; }
}
.trip-banner { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.trip-banner li { padding: 8px 10px; border-radius: 999px; background: #e7eef6; color: #5c6b7d; font-size: 13px; font-weight: 700; }
.trip-banner li.current { background: #102033; color: #fff; }
.trip-banner li.past { background: #d7e6f5; color: #102033; }
.office-reach { display: flex; gap: 8px; flex-wrap: wrap; }
.office-reach .crew-btn { width: auto; }
.house-frame { width: 100%; min-height: 320px; border: 0; border-radius: 16px; background: #d7e6f5; }
#share-pill { display: inline-flex; }
body[data-portal="office"] #settings-panel, body[data-portal="office"] #payroll-panel, body[data-portal="office"] #locations-panel { max-width: 1120px; }
body[data-portal="office"] .payroll-row, body[data-portal="office"] #locations-list .detail-card { border-radius: 18px; padding: 16px; background: var(--card); box-shadow: var(--shadow); }
.form-step legend { font-weight: 700; letter-spacing: -0.02em; padding: 0 4px; }
body[data-portal="office"] .kpi { min-height: 112px; border-radius: 18px; }
body[data-portal="office"] .kpi strong { font-size: 40px; }
body[data-portal="office"] .kpi-strip .kpi:first-child { background: #102033; color: #fff; }
body[data-portal="office"] .kpi-strip .kpi:first-child span { color: #c5d6e6; }
body[data-portal="crew"] .crew-home h2 { margin: 0; font-size: 40px; letter-spacing: -0.04em; }
body[data-portal="crew"] .crew-job-stack { display: grid; gap: 12px; }
body[data-portal="crew"] .job-card { border-radius: 20px; min-height: 96px; }
.move-hero { border-radius: 28px; }
.move-hero h1 { font-size: clamp(36px, 6vw, 56px); }
.btn-ico { display: inline-block; width: 16px; height: 16px; margin: 0 6px 0 0; vertical-align: -3px; }
