/* ============================================================
   device-layout.css — OfficeDeskOS v2.41.4
   Tablet and desktop layout structures.
   Loaded after app.css. All rules scoped to body.dev-tablet
   or body.dev-desktop so phone is completely unaffected.

   PRE-PAINT SELECTORS: html.dev-tablet-pre / html.dev-desktop-pre
   are set by an inline <head> script before CSS renders, so the
   correct layout fires at first paint (no flash to phone layout).
   app.js applyMode() runs afterward and sets body.dev-tablet /
   body.dev-desktop as the authoritative runtime class.
   ============================================================ */

/* ── Side navigation rail ────────────────────────────────────
   Persistent left rail for tablet and desktop.
   Phone uses the drawer (tab bar retired v3.66.2).            */

.sidenav {
  display: none; /* hidden on phone — drawer is used instead */
}

html.dev-tablet-pre body:not(.bt-shell) .sidenav,
html.dev-desktop-pre body:not(.bt-shell) .sidenav,
body.dev-tablet:not(.bt-shell) .sidenav,
body.dev-desktop:not(.bt-shell) .sidenav {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--dt-sidebar-w);
  background: var(--navy);
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  border-inline-end: 1px solid rgba(255,255,255,.07);
}

/* Brand area at top of rail */
.sidenav-brand {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .875rem .875rem .625rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.sidenav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.sidenav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  color: var(--bt-text-on-dark);
}
.sidenav-brand-text strong {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.sidenav-brand-text small {
  font-size: .6875rem;
  opacity: .55;
  font-weight: 500;
}

/* Nav links */
.sidenav-links {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: .5rem 0;
  gap: 2px;
}

.sidenav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .625rem .875rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  transition: background .12s, color .12s;
  position: relative;
  min-height: var(--dt-tap-min);
  cursor: pointer;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}
.sidenav-link:hover,
.sidenav-link:focus-visible {
  background: rgba(255,255,255,.08);
  color: var(--bt-text-on-dark);
  outline: none;
}
.sidenav-link.on {
  background: rgba(255,255,255,.14);
  color: var(--bt-text-on-dark);
  font-weight: 700;
}
.sidenav-link.on::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--red);
  border-radius: 0 2px 2px 0;
}
.sidenav-link .ic {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: .8;
}
.sidenav-link.on .ic {
  opacity: 1;
}
.sidenav-link .snav-badge {
  margin-inline-start: auto;
  font-size: .65rem;
  font-weight: 800;
  background: var(--red);
  color: var(--bt-text-on-dark);
  border-radius: 999px;
  padding: .05em .45em;
  min-width: 1.5em;
  text-align: center;
  line-height: 1.6;
}

.sidenav-section {
  padding: .5rem .875rem .2rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bt-text-on-dark-secondary);
  margin-top: .25rem;
}

/* Current job chip in sidenav bottom area */
.sidenav-cj {
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.1);
  padding: .75rem .875rem;
}
.sidenav-cj-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--bt-text-on-dark-secondary);
  margin-bottom: .3rem;
}
.sidenav-cj-chip {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  color: rgba(255,255,255,.9);
  text-decoration: none;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
  padding: .6rem .75rem;
  font-size: .8125rem;
  line-height: 1.3;
  transition: background .12s;
}
.sidenav-cj-chip:hover { background: rgba(255,255,255,.14); }
.sidenav-cj-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidenav-cj-status {
  font-size: .7rem;
  color: var(--bt-text-on-dark-secondary);
}
.sidenav-cj-none {
  font-size: .75rem;
  color: var(--bt-text-on-dark-secondary);
  font-style: italic;
}

/* Footer: profile + sign out */
.sidenav-foot {
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.1);
  padding: .5rem 0;
}

/* Width-based fallback: any viewport ≥ 768px that hasn't been
   explicitly classified as phone gets tablet-style layout.
   This fires even before JS runs and without device identification. */
@media (min-width: 768px) {
  body:not(.bt-shell):not(.dev-phone) .sidenav {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--dt-sidebar-w);
    background: var(--navy);
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    border-inline-end: 1px solid rgba(255,255,255,.07);
  }
  body:not(.bt-shell):not(.dev-phone) header.top {
    inset-inline-start: var(--dt-sidebar-w);
    width: calc(100% - var(--dt-sidebar-w));
  }
  body:not(.bt-shell):not(.dev-phone) header.top .brand { display: none; }
  body:not(.bt-shell):not(.dev-phone) header.top .top-inner { padding-inline: var(--dt-content-pad); }
  body:not(.bt-shell):not(.dev-phone) main.wrap {
    margin-inline-start: var(--dt-sidebar-w);
    max-width: none;
    padding-inline: var(--dt-content-pad);
    width: calc(100% - var(--dt-sidebar-w));
    box-sizing: border-box;
    min-width: 0;
  }
}

/* ── Top header adjustments ─────────────────────────────────
   On tablet/desktop the .top bar becomes narrower (just the
   breadcrumb/title area) since the brand lives in the rail.  */
html.dev-tablet-pre body:not(.bt-shell) header.top,
html.dev-desktop-pre body:not(.bt-shell) header.top,
body.dev-tablet:not(.bt-shell) header.top,
body.dev-desktop:not(.bt-shell) header.top {
  inset-inline-start: var(--dt-sidebar-w);
  width: calc(100% - var(--dt-sidebar-w));
}
html.dev-tablet-pre body:not(.bt-shell) header.top .brand,
html.dev-desktop-pre body:not(.bt-shell) header.top .brand,
body.dev-tablet:not(.bt-shell) header.top .brand,
body.dev-desktop:not(.bt-shell) header.top .brand {
  display: none; /* brand shown in sidenav instead */
}
html.dev-tablet-pre body:not(.bt-shell) header.top .top-inner,
html.dev-desktop-pre body:not(.bt-shell) header.top .top-inner,
body.dev-tablet:not(.bt-shell) header.top .top-inner,
body.dev-desktop:not(.bt-shell) header.top .top-inner {
  padding-inline: var(--dt-content-pad);
}

/* ── Main content shift ──────────────────────────────────── */
html.dev-tablet-pre body:not(.bt-shell) main.wrap,
html.dev-desktop-pre body:not(.bt-shell) main.wrap,
body.dev-tablet:not(.bt-shell) main.wrap,
body.dev-desktop:not(.bt-shell) main.wrap {
  margin-inline-start: var(--dt-sidebar-w);
  max-width: none;
  padding-inline: var(--dt-content-pad);
  /* Prevent main from exceeding viewport width when sidebar is fixed */
  width: calc(100% - var(--dt-sidebar-w));
  box-sizing: border-box;
  min-width: 0;    /* flex shrink fix: allows children to shrink below their content size */
}

/* ── Current job persistent header chip (tablet/desktop) ── */
.cj-header-chip {
  display: none;
}
body.dev-tablet .cj-header-chip,
body.dev-desktop .cj-header-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  padding: .3rem .75rem .3rem .5rem;
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none;
  margin-inline-start: auto;
  flex-shrink: 0;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cj-header-chip .ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .7;
}

/* ── Workflow Rail ────────────────────────────────────────────
   NO hidden overflow — the rail must show all steps without
   concealing any content behind overflow:hidden or scrollbar-
   hiding tricks.

   Landscape / desktop: all steps fit inline, they may wrap at
   most once (flex-wrap:wrap keeps them visible).

   Portrait tablet: shows only  prev → CURRENT → next  by
   hiding "other" steps via .wf-hide-portrait. A step-counter
   badge (.wf-portrait-count) tells the technician where they
   are in the full flow (e.g. "3 / 8").

   If PHP emits fewer steps than expected, the existing ones
   wrap naturally — nothing is ever clipped.
   ────────────────────────────────────────────────────────── */

.wf-rail {
  display: none;  /* hidden on phone — Next Step panel handles it */
}

body.dev-tablet .wf-rail,
body.dev-desktop .wf-rail {
  display: flex;
  flex-wrap: wrap;          /* steps wrap before overflowing — no hidden content */
  align-items: center;
  row-gap: .375rem;
  column-gap: 0;
  padding: .5rem var(--dt-content-pad);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  /* NO overflow:auto, NO scrollbar hiding */
}

/* Portrait tablet: hide non-adjacent steps to avoid wrapping mess */
@media (orientation: portrait) {
  body.dev-tablet .wf-hide-portrait { display: none !important; }
  body.dev-tablet .wf-portrait-count { display: flex !important; }
}
/* Landscape / desktop: show everything, hide the portrait counter */
@media (orientation: landscape) {
  body.dev-tablet .wf-hide-portrait { display: flex; }
  body.dev-tablet .wf-portrait-count { display: none !important; }
}
body.dev-desktop .wf-hide-portrait { display: flex; }
body.dev-desktop .wf-portrait-count { display: none !important; }

/* Step wrapper */
.wf-step {
  display: flex;
  align-items: center;
}

/* Step button — the visible pill/label */
.wf-step-btn {
  display: flex;
  align-items: center;
  gap: .375rem;
  padding: .3125rem .5rem;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--bt-text);
  background: transparent;
  border: none;
  cursor: default;
  white-space: nowrap;
  min-height: 36px;
  text-decoration: none;
}
.wf-step-btn.done {
  color: var(--ok);
}
.wf-step-btn.done .wf-dot { background: var(--ok); }
.wf-step-btn.active {
  color: var(--navy);
  background: var(--bg);
  font-weight: 800;
  cursor: default;
}
.wf-step-btn.active .wf-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(215,38,47,.18);
}
.wf-step-btn.upcoming {
  color: var(--bt-text-secondary);
  opacity: .5;
}

/* Dot inside each step */
.wf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
}

/* Arrow connector between steps */
.wf-arrow {
  width: 16px;
  height: 1px;
  background: var(--line);
  flex-shrink: 0;
  margin: 0 1px;
}

/* Portrait-mode step counter: "3 / 8" positioned at rail end */
.wf-portrait-count {
  display: none;        /* shown only in portrait via media query above */
  align-items: center;
  margin-inline-start: auto;
  font-size: .7rem;
  font-weight: 700;
  color: var(--bt-text-secondary);
  padding: 0 .25rem;
  white-space: nowrap;
}
.wf-portrait-of {
  font-weight: 400;
  opacity: .65;
}

/* ── My Day command center layout (tablet) ────────────────── */
body.dev-tablet .myday-command,
body.dev-desktop .myday-command {
  display: grid;
  gap: var(--dt-panel-gap);
}

@media (min-width: 768px) and (orientation: landscape) {
  body.dev-tablet .myday-command {
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr;
  }
  body.dev-tablet .myday-cj-zone { grid-column: 1; grid-row: 1; }
  body.dev-tablet .myday-queue-zone { grid-column: 1; grid-row: 2; }
  body.dev-tablet .myday-right-col { grid-column: 2; grid-row: 1 / 3; }
}

.myday-section-label {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--bt-text);
  padding: .5rem var(--dt-content-pad) .25rem;
}
body.dev-phone .myday-section-label {
  padding: .5rem .75rem .25rem;
}

/* ── Split-pane helpers (estimate builder, schedule) ──────── */
.split-pane {
  display: block;
}
body.dev-tablet .split-pane,
body.dev-desktop .split-pane {
  display: grid;
  grid-template-columns: var(--dt-split-left) var(--dt-split-right);
  gap: var(--dt-panel-gap);
  align-items: start;
}
@media (orientation: portrait) {
  body.dev-tablet .split-pane {
    grid-template-columns: 1fr;
  }
}
/* Both pane cells must not overflow their grid column */
.split-pane > * { min-width: 0; }
.split-right {
  position: sticky;
  top: calc(var(--dt-header-h) + .75rem);
  min-width: 0;
}

/* ── Pay alert: full-width across content area on tablet+ ── */
body.dev-tablet .pay-alert,
body.dev-desktop .pay-alert {
  margin-inline: calc(-1 * var(--dt-content-pad));
  border-radius: 0;
}

/* ── Flash messages ─────────────────────────────────────────
   On tablet/desktop the flash sits at content width, not
   full-viewport width.                                       */
body.dev-tablet .flash,
body.dev-desktop .flash {
  border-radius: var(--dt-card-radius);
  margin-bottom: var(--dt-panel-gap);
}

/* ── More sheet is never used on tablet/desktop ──────────── */
body.dev-tablet .more-sheet,
body.dev-desktop .more-sheet {
  display: none !important;
}

/* ── Resume chip (touch devices — My Day) ────────────────── */
.resume-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: .6rem 1rem;
  margin-bottom: .625rem;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
.resume-chip:hover { background: var(--navy-deep); }
.resume-icon { font-size: 1.1rem; flex-shrink: 0; }
.resume-text { flex: 1; }
.resume-text strong { display: block; }
.resume-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,.55);
  font-size: 1.2rem;
  line-height: 1;
  padding: .25rem .4rem;
  cursor: pointer;
  flex-shrink: 0;
  min-height: var(--dt-tap-min);
  display: flex;
  align-items: center;
}

/* ── My Day command center ────────────────────────────────── */
.myday-command {
  display: flex;
  flex-direction: column;
  gap: var(--dt-panel-gap, .75rem);
  padding: .75rem var(--dt-content-pad, .75rem);
}

/* On tablet+ the command center becomes a two-column grid */
body.dev-tablet .myday-command,
body.dev-desktop .myday-command {
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: auto;
  align-items: start;
  padding: var(--dt-panel-gap) var(--dt-content-pad);
  gap: var(--dt-panel-gap);
}

/* Main column takes the left cell; right + phone-only take the right */
body.dev-tablet .myday-main-col,
body.dev-desktop .myday-main-col {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: var(--dt-panel-gap);
  min-width: 0;   /* prevent grid cell from overflowing its column */
}
body.dev-tablet .myday-right-col,
body.dev-desktop .myday-right-col {
  grid-column: 2;
  grid-row: 1 / 99;  /* span all rows */
  display: flex;
  flex-direction: column;
  gap: var(--dt-panel-gap);
  position: sticky;
  top: calc(var(--dt-header-h) + .75rem);
  max-height: calc(100vh - var(--dt-header-h) - 1.5rem);
  overflow-y: auto;
  min-width: 0;
}

/* On phone: myday-command is a simple flex column */
body.dev-phone .myday-command {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  padding: .625rem .75rem;
}
body.dev-phone .myday-main-col {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

/* My Day header (title + date picker row) */
.myday-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .25rem;
}
.myday-hdr-title h1 { margin: 0; }
.myday-hdr-title p  { margin: .2rem 0 0; }
.myday-hdr-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.view-tabs-inline {
  display: inline-flex;
  gap: .25rem;
}
.view-tabs-inline a {
  padding: .3rem .75rem;
  border-radius: 6px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  background: var(--bg);
}
.view-tabs-inline a.on {
  background: var(--navy);
  color: #fff;
}

/* Current Job zone */
.myday-cj-zone {
  border-inline-start: 3px solid var(--red);
}
.myday-cj-badge {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}
.myday-cj-label {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--red);
}
.myday-cj-customer {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 .2rem;
}
body.dev-tablet .myday-cj-customer,
body.dev-desktop .myday-cj-customer {
  font-size: 1.5rem;
}
.myday-cj-title {
  color: var(--bt-text);
  margin: 0 0 .75rem;
  font-size: .9375rem;
}

/* Next action callout */
.myday-next-action {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: .625rem .875rem;
  margin: .5rem 0 .75rem;
}
.myday-na-label {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--bt-text);
  margin: 0 0 .2rem;
}
.myday-na-text {
  font-weight: 700;
  color: var(--bt-text-secondary);
  margin: 0;
  font-size: .9375rem;
}
body.dev-tablet .myday-na-text,
body.dev-desktop .myday-na-text {
  font-size: 1.0625rem;
}

/* Primary action button: larger on tablet */
body.dev-tablet .myday-cj-actions .btn,
body.dev-desktop .myday-cj-actions .btn {
  font-size: 1rem;
  padding: .75rem 1.25rem;
  min-height: 52px;
}

/* Queue zone */
.myday-queue-zone {
  display: flex;
  flex-direction: column;
  gap: var(--dt-panel-gap, .75rem);
}

/* Right-column panels: no extra padding needed, .panel handles it */
.myday-right-panel {}

/* Scrollbar style for right column (webkit) */
body.dev-tablet .myday-right-col::-webkit-scrollbar,
body.dev-desktop .myday-right-col::-webkit-scrollbar {
  width: 4px;
}
body.dev-tablet .myday-right-col::-webkit-scrollbar-thumb,
body.dev-desktop .myday-right-col::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}

/* v2.44.9: iPad My Day workflow orientation; shared with phone for continuity. */
.myday-field-progress{padding:14px 16px;margin:14px 0;background:var(--surface-2,#f3f6fa);border:1px solid var(--border,var(--line));border-radius:12px}
.myday-field-progress-head{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:.9rem}
.myday-field-progress-head span{font-size:.8rem;color:var(--bt-text-secondary);text-align:right}
.myday-field-progress-track{height:8px;border-radius:999px;background:#d9e2ef;overflow:hidden;margin:10px 0 8px}
.myday-field-progress-track span{display:block;height:100%;background:#1e3a5f;border-radius:inherit}
.myday-field-progress-next{margin:0;font-size:.88rem;font-weight:650}
@media(max-width:540px){.myday-field-progress{padding:12px}.myday-field-progress-head{align-items:flex-start;flex-direction:column;gap:3px}}

/* v2.45.0: technician-only jump navigation, using existing workflow actions. */
.field-job-jumps{display:flex;flex-wrap:wrap;align-items:center;gap:9px;margin:12px 0 16px}
.field-job-jumps a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 15px;border:1px solid var(--line,var(--line));border-radius:10px;background:var(--surface,#fff);color:inherit;text-decoration:none;font-weight:650;font-size:.9rem}
.field-job-jumps a:focus-visible{outline:3px solid #1e3a5f;outline-offset:2px}
.field-job-jumps .field-job-jump-main{background:#1e3a5f;border-color:#1e3a5f;color:#fff}
#job-estimates,#notes,#invoice,#next{scroll-margin-top:90px}
@media(max-width:540px){.field-job-jumps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.field-job-jumps a{padding:10px 6px}.field-job-jumps .field-job-jump-main{grid-column:1/-1}}

/* v2.45.6 employee scorecard responsive comparison */
.sc-controls{margin:1rem 0;max-width:540px}
.sc-controls label{display:block;font-weight:700;margin-bottom:.35rem}
.sc-search-row{display:flex;align-items:center;gap:.5rem}
.sc-search-row input{flex:1;min-width:0;min-height:44px;border:1px solid #b8c8db;border-radius:10px;padding:.7rem .85rem;background:#fff}
.sc-search-row button{min-height:44px}
.sc-controls #sc-count{margin:.4rem 0 0}
.sc-employee[hidden]{display:none!important}
@media(max-width:760px){
 .sc-wrap{overflow:visible;border:0;background:transparent}
 .sc-table{display:block;min-width:0;width:100%;border:0}
 .sc-table thead{display:none}
 .sc-table tbody{display:grid;gap:.85rem}
 .sc-table tr.sc-employee{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;border:1px solid #d7e2ee;border-radius:14px;background:#fff;overflow:hidden;box-shadow:0 2px 10px rgba(18,43,74,.05)}
 .sc-table tr.sc-employee[hidden]{display:none}
 .sc-table tr.sc-employee th,.sc-table tr.sc-employee td{position:static!important;display:block;min-width:0;white-space:normal;text-align:left!important;border:0;padding:.7rem .85rem;background:transparent}
 .sc-table tr.sc-employee th{grid-column:1/-1;background:#edf4fb!important;border-bottom:1px solid #d7e2ee;font-size:1rem}
 .sc-table tr.sc-employee td{border-bottom:1px solid var(--line)}
 .sc-table tr.sc-employee td:nth-child(even){border-right:1px solid var(--line)}
 .sc-table tr.sc-employee td::before{content:attr(data-label);display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.03em;color:var(--bt-text-secondary);font-weight:700;margin-bottom:.2rem}
 .sc-table tfoot{display:none}
}

/* v2.45.7 — Employee directory overview */
.employee-overview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}
.employee-overview-stat{min-width:0;background:var(--surface,#fff);border:1px solid var(--border,#dce4ec);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:5px}
.employee-overview-stat span{font-size:.83rem;color:var(--bt-text-secondary)}
.employee-overview-stat strong{font-size:1.8rem;line-height:1.2;font-variant-numeric:tabular-nums}
.employee-overview-stat a{font-size:.82rem}
.employee-directory-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}
.employee-directory-tools select{max-width:270px;min-height:44px}
.employee-directory-tools label,.employee-directory-tools span{font-size:.9rem}
#employee-directory-list [hidden]{display:none!important}
@media(max-width:850px){.employee-overview{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.employee-overview{gap:8px}.employee-overview-stat{padding:12px}.employee-overview-stat strong{font-size:1.5rem}.employee-directory-tools select{width:100%;max-width:none}}

/* v2.45.8 Employee profile quick overview */
.employee-profile-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;flex-wrap:wrap}.employee-profile-heading h2{margin:.15rem 0}.employee-profile-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin:1rem 0}.employee-profile-facts>div{border:1px solid var(--border,#dce5ef);border-radius:12px;padding:1rem;min-width:0}.employee-profile-facts span{display:block;font-size:.8rem;color:var(--bt-text-secondary);margin-bottom:.35rem}.employee-profile-facts strong{display:block;overflow-wrap:anywhere}.employee-profile-links{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.6rem}.employee-profile-links a{text-align:center;min-height:44px;display:flex;align-items:center;justify-content:center}@media(max-width:900px){.employee-profile-links{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:580px){.employee-profile-facts{grid-template-columns:1fr}.employee-profile-links{grid-template-columns:1fr}}

/* v2.45.9 — visible responsive navigation; no hidden horizontal navigation */
@media (max-width: 767px) {
  body:not(.present-mode) .tabs { display:flex; flex-wrap:wrap; overflow-x:visible; gap:.5rem; mask-image:none; -webkit-mask-image:none; }
  body:not(.present-mode) .tabs a { flex:1 1 auto; min-height:44px; display:inline-flex; align-items:center; justify-content:center; text-align:center; white-space:normal; overflow-wrap:anywhere; }
  body:not(.present-mode) .chips { display:flex; flex-wrap:wrap; overflow-x:visible; gap:.45rem; mask-image:none; -webkit-mask-image:none; scroll-snap-type:none; }
  body:not(.present-mode) .chips .chip-btn { flex:0 1 auto; min-height:44px; white-space:normal; overflow-wrap:anywhere; scroll-snap-align:none; }
  body:not(.present-mode) .an-periods { flex-wrap:wrap; overflow-x:visible; }
  body:not(.present-mode) .an-periods a { min-height:44px; display:inline-flex; align-items:center; }
}
@media (min-width:768px) and (max-width:1100px) {
  body:not(.present-mode) .tabs { flex-wrap:wrap; overflow-x:visible; }
  body:not(.present-mode) .tabs a { min-height:44px; display:inline-flex; align-items:center; white-space:normal; }
}

/* v2.46.0 — phone field-form legibility; no business-logic changes. */
@media (max-width: 600px) {
  /* Keep the subcontractor description and amount legible at 320px. */
  .sub-row { grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; padding: .75rem; border: 1px solid var(--line,var(--line)); border-radius: 12px; background: #fff; }
  .sub-row > input:first-child { grid-column: 1 / -1; min-width: 0; width: 100%; }
  .sub-row > .prefix { min-width: 0; width: 100%; }
  .sub-row > .prefix input { min-width: 0; width: 100%; }
  .sub-row > .rm-sub { min-width: 44px; min-height: 44px; justify-self: end; }
  /* Street, city and ZIP each get a complete row rather than narrow inputs. */
  .addr-row { grid-template-columns: minmax(0, 1fr); }
  .addr-row > * { min-width: 0; }
  /* Item name gets a complete line; price and Add remain adjacent below. */
  .pick-items li { grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; }
  .pick-items li .pi-name { grid-column: 1 / -1; min-width: 0; overflow-wrap: anywhere; }
  .pick-items li .pi-price { text-align: left; }
  .pick-items li .add-btn { min-height: 44px; }
  /* Prevent long customer-entered values from stretching form cards. */
  .panel input, .panel textarea, .panel select { max-width: 100%; }
  .panel, .card { min-width: 0; }
}

/* v2.46.1 — field notes and receipt-upload ergonomics */
.inline-add { align-items: stretch; }
.inline-add textarea { flex: 1 1 auto; min-width: 0; width: 100%; resize: vertical; min-height: 76px; }
.inline-add .btn-ghost { min-height: 44px; align-self: stretch; }
.mb-add .file-btn { min-height: 52px; display: flex; align-items: center; gap: .6rem; overflow-wrap: anywhere; }
.mb-add .file-btn:focus-within { outline: 3px solid #3478c0; outline-offset: 2px; }
@media (max-width: 600px) {
  .inline-add { flex-direction: column; }
  .inline-add textarea { min-height: 104px; }
  .inline-add .btn-ghost { width: 100%; }
  .mb-add .file-btn, .mb-add button[type=submit] { width: 100%; }
}

/* v2.47.1 — read-only technician job readiness */
.job-readiness { display:grid; gap:.75rem; }
.job-readiness .panel-head { margin-bottom:0; }
.job-readiness-meter { display:grid; gap:.4rem; }
.job-readiness-meter progress { width:100%; height:12px; accent-color:#197c68; }
.job-readiness-current { padding:.8rem 1rem; border-radius:10px; background:#eef5ff; border:1px solid #cbdcf4; margin:0; overflow-wrap:anywhere; }
.job-readiness-issues { margin:.2rem 0 .4rem; padding-left:1.4rem; display:grid; gap:.5rem; }
.job-readiness-issues li { overflow-wrap:anywhere; }
.job-readiness .btn-ghost { min-height:44px; width:fit-content; }
@media(max-width:600px){.job-readiness .btn-ghost { width:100%; }}

/* v2.47.4: Admin-only operational snapshot. */
.od-intelligence{margin:18px 0 22px;padding:18px;border:1px solid var(--border,#d9e2ee);border-radius:16px;background:var(--surface,#fff)}
.od-intelligence-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.od-intelligence-head h2{margin:3px 0 5px}.od-intelligence-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px 0}
.od-intelligence-item{display:flex;flex-direction:column;gap:8px;padding:16px;min-width:0;border:1px solid var(--border,#d9e2ee);border-radius:12px;text-decoration:none;color:inherit;background:var(--surface,#fff)}
.od-intelligence-item strong{font-size:clamp(1.25rem,2vw,1.8rem);overflow-wrap:anywhere}.od-intelligence-item small{color:var(--bt-text-secondary)}
.od-intelligence-item:focus-visible{outline:3px solid #1e3a5f;outline-offset:2px}
@media(max-width:950px){.od-intelligence-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:540px){.od-intelligence-grid{grid-template-columns:1fr}.od-intelligence{padding:12px}}

/* v2.47.7 — focused admin browser */
.od-admin-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 10px}
.od-admin-tab{appearance:none;border:1px solid #c8d5e6;background:#f4f7fb;color:var(--bt-text);border-radius:10px;padding:11px 15px;min-height:44px;font:inherit;font-weight:650;cursor:pointer}
.od-admin-tab[aria-pressed="true"]{background:#143c72;color:#fff;border-color:#143c72}
.od-admin-tab:focus-visible{outline:3px solid #2672ca;outline-offset:3px}
.od-admin-browser-head{display:flex;justify-content:space-between;gap:12px}
.od-admin-group[hidden], [data-admin-overview][hidden], .od-admin-group .row-link[hidden]{display:none!important}
@media(max-width:600px){.od-admin-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.od-admin-tab{width:100%;padding:12px 8px}.od-admin-browser{padding:14px}}

/* Workflow improvement round 1: technician-only persistent navigation to the authoritative action.
   This is a link, never a second submit control: no duplicate completion POSTs. */
#job-primary-action{scroll-margin-top:18px}
.field-next-dock{display:none}
@media(max-width:900px){
  body:has(.field-next-dock){padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
  .field-next-dock{position:fixed;z-index:90;left:12px;right:12px;bottom:calc(10px + env(safe-area-inset-bottom,0px));display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:60px;padding:10px 17px;background:#153d70;color:white;border:2px solid #fff;border-radius:14px;box-shadow:0 6px 24px rgba(12,34,63,.32);text-decoration:none;box-sizing:border-box}
  .field-next-dock span:first-child{min-width:0;display:grid;gap:2px}
  .field-next-dock small{font-size:10px;font-weight:700;letter-spacing:.09em;opacity:.82}
  .field-next-dock strong{font-size:16px;line-height:1.25;overflow-wrap:anywhere}
  .field-next-dock span:last-child{font-size:23px;flex-shrink:0}
  .field-next-dock:focus-visible{outline:3px solid #ffcc55;outline-offset:2px}
  .field-next-dock-hidden{display:none}
}
@media(min-width:901px){.field-next-dock{display:none!important}}

/* Workflow Round 1: keep the recommended action legible and accessible. */
#job-primary-action{scroll-margin-top:90px}
.myday-next-action{border-left:4px solid #245eaa}
.myday-cj-actions .ns-primary,.myday-cj-actions .btn{min-height:48px}
@media(max-width:540px){.myday-cj-actions{display:flex;flex-wrap:wrap;gap:9px}.myday-cj-actions>*{min-width:0;max-width:100%}.myday-cj-actions .btn,.myday-cj-actions .btn-ghost{min-height:44px;display:inline-flex;align-items:center;justify-content:center}}

/* Workflow Round 1 finish: completion is visible, readable and keyboard-safe. */
.job-ready-closeout .ns-main .btn{min-height:64px;white-space:normal;overflow-wrap:anywhere;text-align:center}
.job-ready-closeout .job-closeout-explainer{line-height:1.55}
.field-closeout .closeout-guide li{overflow-wrap:anywhere}
@media(max-width:900px){.field-closeout .closeout-guide{grid-template-columns:minmax(0,1fr)}.field-closeout .closeout-guide a{white-space:normal;text-align:center}}
@media(max-width:540px){.myday-cj-actions .ns-primary{flex:1 1 100%;order:-1;min-height:56px;font-weight:800}.myday-cj-actions .btn-ghost{flex:1 1 130px}.field-job-jumps{flex-wrap:wrap;white-space:normal}}

/* Workflow Round 1 completion: obvious guided action and accessible closeout. */
#closeout{scroll-margin-top:90px}
.myday-guided-link{min-height:48px;display:inline-flex;align-items:center;justify-content:center}
@media(max-width:700px){
 .myday-cj-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
 .myday-cj-actions>.btn,.myday-cj-actions>.btn-ghost,.myday-cj-actions>form{width:100%;max-width:100%;box-sizing:border-box}
 .myday-cj-actions>form button{width:100%;min-height:48px}
 .field-job-jumps{max-width:100%;overflow-wrap:anywhere}
 .field-job-jumps a{min-height:44px;display:inline-flex;align-items:center}
}


/* Workflow Round 7 Part 1 — narrow-phone and landscape closeout controls.
   Keep the action dock visible without obscuring content or horizontal overflow. */
@media (max-width: 420px) {
  .field-next-dock { left: 8px; right: 8px; gap: 8px; padding: 9px 12px; }
  .field-next-dock strong { font-size: 15px; }
  .field-next-dock span:last-child { font-size: 20px; }
  .field-next-dock, .field-next-dock * { min-width: 0; }
  .field-next-dock span:first-child { flex: 1 1 auto; }
  .job-ready-closeout .ns-main .btn { width: 100%; max-width: 100%; box-sizing: border-box; }
}
@media (max-width: 900px) and (orientation: landscape) and (max-height: 480px) {
  .field-next-dock { min-height: 48px; padding: 6px 12px; bottom: calc(4px + env(safe-area-inset-bottom,0px)); }
  .field-next-dock small { display: none; }
  body:has(.field-next-dock) { padding-bottom: calc(66px + env(safe-area-inset-bottom,0px)); }
}
@media (max-width: 900px) {
  /* Prevent the fixed shortcut from covering a destination reached via an anchor. */
  #job-primary-action, #closeout, #next, #invoice, #notes, #job-estimates { scroll-margin-top: 100px; scroll-margin-bottom: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  .field-next-dock, .field-next-dock * { animation: none !important; transition: none !important; }
}


/* Workflow Round 7 Part 2 — iOS form ergonomics and keyboard-safe action dock.
   Only applies to handheld viewport sizes; desktop form density is unchanged. */
@media (max-width: 900px) {
  /* iOS Safari zooms the viewport when focused text controls use smaller type. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select, textarea { font-size: max(16px, 1em); }
  /* Make the currently edited control visually distinguishable in the field. */
  input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #1e5aa8;
    outline-offset: 2px;
  }
  /* Avoid a fixed next-step link competing with the software keyboard. */
  body:has(input:focus, select:focus, textarea:focus) .field-next-dock {
    display: none;
  }
  /* Ensure field labels and form help do not force horizontal scrolling. */
  form label, form .help, form .muted { overflow-wrap: anywhere; }
}
@media (max-width: 420px) {
  /* Long customer-entered strings cannot widen field forms. */
  form input, form textarea, form select { min-width: 0; max-width: 100%; box-sizing: border-box; }
}

/* Workflow Round 7 Part 3 — technician navigation and accessible tap targets.
   Scope to field job surfaces; avoid changing desktop/admin density. */
@media (max-width: 900px) {
  .field-job-jumps a, .myday-guided-link, .myday-cj-actions a,
  .myday-cj-actions button { min-height: 44px; touch-action: manipulation; }
  .field-job-jumps a:focus-visible, .myday-guided-link:focus-visible,
  .myday-cj-actions a:focus-visible, .myday-cj-actions button:focus-visible {
    outline: 3px solid #1e5aa8; outline-offset: 3px;
  }
  /* Long translated labels and customer text must wrap instead of clipping. */
  .field-job-jumps a, .myday-guided-link, .myday-cj-actions a,
  .myday-cj-actions button { white-space: normal; overflow-wrap: anywhere; }
  .field-job-jumps { max-width: 100%; }
}
@media print {
  /* Never overlay printable job records with a floating technician shortcut. */
  .field-next-dock { display: none !important; }
  body:has(.field-next-dock) { padding-bottom: 0 !important; }
}


/* Workflow Round 7 Part 4 — mobile safe-area and accessible scroll destinations.
   Account for home indicator and sticky dock without changing desktop layout. */
@media (max-width: 900px) {
  .field-next-dock {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
  }
  body:has(.field-next-dock) {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  #closeout, #next, #job-primary-action, #invoice, #notes, #job-estimates {
    scroll-margin-top: 110px;
    scroll-margin-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 900px) and (orientation: landscape) and (max-height: 480px) {
  body:has(.field-next-dock) {
    padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  }
}
@media print {
  body:has(.field-next-dock) { padding-bottom: 0 !important; }
}

/* P1: secondary navigation stays available without competing with the single job action. */
.myday-more-options,.job-primary-more,.job-arrival-more{margin:.5rem 0;min-width:0}
.myday-more-options>summary,.job-primary-more>summary,.job-arrival-more>summary{cursor:pointer;min-height:48px;padding:.7rem .8rem;font-weight:700;display:flex;align-items:center;border:1px solid var(--line,var(--line));border-radius:10px}
.myday-more-links{display:grid;grid-template-columns:minmax(0,1fr);gap:.5rem;margin-top:.65rem}
.myday-more-links>a,.myday-more-links>form,.myday-more-links button{min-height:48px;max-width:100%;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere}
.myday-flow-status{margin:0;padding:.75rem;background:var(--surface,#fff);border-radius:10px;font-weight:700}
.myday-cj-actions>.ns-primary,.myday-cj-actions>form>.ns-primary,.stop .btn-row>.ns-primary,.stop .btn-row>form>.ns-primary{min-height:56px;width:100%;max-width:100%;box-sizing:border-box}
.myday-cj-actions,.stop .btn-row{min-width:0}
.myday-cj-actions .myday-more-options,.stop .btn-row .myday-more-options{width:100%}
