/* Siyaneh's look: one place for colors, type and the page frame (menu on the left, page title on top).
   Loaded last, so it wins over the older per-page styles in index.html and the scripts.

   Colors: petrol for the menu and main actions, a hi-vis amber "work tag" for where you are and what's waiting,
   a cool stone background so white cards and forms stand out. An LLC's own color still tints its invoice screen. */
/* IBM Plex Sans, shipped with Siyaneh (fonts/, SIL Open Font License): one file covers every weight */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url("/fonts/plex_sans.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url("/fonts/plex_sans_ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 100 700; font-display: swap;
  src: url("/fonts/plex_sans_italic.woff2") format("woff2"); }
:root {
  --side: #16313a;  --side-2: #1d3d47;  --side-ink: #c3d0d3;  --side-dim: #7f979d;
  --tag: #f0a43a;   --tag-ink: #3a2603;
  --navy: #1e5566;  --navy-2: #276a7e;           /* the main action color (an LLC's invoice screen uses its own) */
  --ink: #1b2427;   --muted: #5f6b6e;  --line: #d9dfdc;  --line-2: #e7ebe8;
  --bg: #eff1ee;    --card: #fff;      --soft: #e9eeec;
  --ok: #1d7048;    --warn: #9a4a12;   --bad: #b02a2a;
  --side-w: 236px;
  --radius: 8px;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font: 14px/1.5 "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink); background: var(--bg);
  font-variant-numeric: tabular-nums;
}
body.signed-in { padding-left: var(--side-w); }

/* ---- the menu ---------------------------------------------------------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
  background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 18px 12px 14px; overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: inherit; text-decoration: none; cursor: pointer; border-radius: 8px; }
.side-brand:hover .side-name { color: #fff; opacity: .85; }
.side-brand:focus-visible { outline: 2px solid var(--side-dim); outline-offset: 2px; }
.menu-btn { display: none; align-items: center; gap: 6px; background: transparent; color: #fff; border: 1px solid var(--side-2);
  border-radius: 8px; padding: 8px 12px; font-size: 14px; cursor: pointer; }
.menu-btn:hover { background: var(--side-2); }
.side-logo { width: 32px; height: 32px; flex: none; display: block; }
.side-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .16em; }
.side-tag { color: var(--side-dim); font-size: 11.5px; }
.side-nav { display: grid; gap: 18px; flex: 1; align-content: start; }
.nav-group { display: grid; gap: 1px; }
.nav-h { color: var(--side-dim); font-size: 12px; font-weight: 500; padding: 0 10px 5px; }
.side-nav button {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; background: transparent; border: 0; border-radius: 6px;
  color: var(--side-ink); font-weight: 500; font-size: 14px; padding: 7px 10px 7px 14px;
}
.side-nav button:hover { background: var(--side-2); color: #fff; }
.side-nav button.on { background: var(--side-2); color: #fff; font-weight: 600; }
.side-nav button.on::before {      /* the amber tag: you are here */
  content: ""; position: absolute; left: 3px; top: 7px; bottom: 7px; width: 4px; border-radius: 2px; background: var(--tag);
}
.side-nav button:focus-visible, .side-link:focus-visible { outline: 2px solid var(--tag); outline-offset: 1px; }
.nav-n {
  background: var(--tag); color: var(--tag-ink); border-radius: 9px; font-size: 11px; font-weight: 700;
  padding: 1px 7px; margin-left: 6px; line-height: 1.5;
}
.side-user { border-top: 1px solid rgba(255,255,255,.1); padding: 12px 8px 0; margin-top: 14px; display: grid; gap: 6px; }
.side-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #fff; font-weight: 500; }
.who-role { font-size: 11px; color: var(--side-ink); background: rgba(255,255,255,.1); padding: 1px 8px; border-radius: 9px; font-weight: 500; }
.side-link { background: transparent; border: 0; color: var(--side-ink); padding: 3px 6px 3px 0; font-size: 13px; }
.side-link:hover { background: transparent; color: #fff; text-decoration: underline; }

/* ---- page title bar ------------------------------------------------------ */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px 32px 16px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.ph-crumb { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.page-head h1 { margin: 1px 0 2px; font-size: 24px; line-height: 1.2; font-weight: 600; color: var(--ink); }
.page-head .sub { color: var(--muted); font-size: 13.5px; max-width: 72ch; }
.ph-acts { gap: 8px; }
.ph-acts button { background: #fff; }
.bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 36px; padding: 0; color: var(--ink); }
.bell .nav-n { position: absolute; top: -6px; right: -8px; margin: 0; }
#notifPanel { top: 86px; right: 28px; border-radius: 10px; }

/* ---- the content area ------------------------------------------------------ */
main, #jobsView, #techView, #empView, #reqView, #reportView, #rolesView, #auditView, #llcView, #acctView, #fuView, #findView {
  margin: 22px 32px 80px; max-width: 1280px; padding: 0;
}
main { max-width: 1060px; }
#picker { margin: 28px 32px; max-width: 640px; padding: 0; }
#picker h2 { font-size: 18px; font-weight: 600; }
.co { border-radius: var(--radius); padding: 13px 16px; font-weight: 500; border-color: var(--line); }
.co:hover { border-color: var(--navy); background: #fff; }
.co .last { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }

/* ---- type ----------------------------------------------------------------- */
h2, h3 { letter-spacing: 0; }
.card { border-radius: var(--radius); border-color: var(--line); padding: 18px 20px; }
.card h2 { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.hint { color: var(--muted); }
label { font-weight: 500; color: #4a5558; font-size: 12.5px; }
a { color: var(--navy); }
a:hover { color: var(--navy-2); }

/* ---- controls ------------------------------------------------------------- */
input, textarea, select { border-color: #cfd6d3; border-radius: 6px; padding: 8px 10px; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--navy) 30%, transparent); outline-offset: 0; border-color: var(--navy); }
button { border-radius: 6px; border-color: #cfd6d3; padding: 7px 13px; font-weight: 500; }
button:hover { background: var(--soft); }
button:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
button.primary { background: var(--navy); border-color: var(--navy); font-weight: 600; }
button.primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
button.danger { background: var(--bad); border-color: var(--bad); }
.chip { border-radius: 999px; padding: 5px 13px; font-weight: 500; background: #fff; border-color: #cfd6d3; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { opacity: .65; }
dialog { border-radius: 12px; border-color: var(--line); box-shadow: 0 18px 50px rgba(16,30,36,.22); }
dialog::backdrop { background: rgba(16,30,36,.42); }
.doc-switch { border-radius: 8px; border-color: #cfd6d3; }
.doc-switch button { font-weight: 500; }

/* ---- tables ----------------------------------------------------------------- */
.jtable, .rpt-table { border-color: var(--line); border-radius: var(--radius); }
.jtable th, .rpt-table th, .roles-table th, .d-row.head {
  text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--muted); background: #f6f7f5;
}
.jtable td { border-color: var(--line-2); }
.jtable tr.jrow:hover td { background: #f5f8f7; }
.jtable tr.yrow td { background: #eef2f0; color: var(--ink); }
.roles-table tr.grp td { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); background: #eef2f0; }
.rpt-filters label.lab, .fnd-dist small { text-transform: none; letter-spacing: 0; }
.jsec h3 { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--ink); }

/* ---- jobs board ------------------------------------------------------------- */
.jobs-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.jobs-top .hello { font-size: 15px; color: var(--muted); }
.jobs-top .hello b { color: var(--ink); font-weight: 600; }
#jAlerts:not(:empty) {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--tag); border-radius: var(--radius);
  padding: 4px 16px 6px; display: grid;
}
#jAlerts:not(:empty)::before { content: "Needs attention"; font-weight: 600; font-size: 14px; padding: 10px 0 4px; }
#jAlerts > div { background: transparent !important; border: 0 !important; border-top: 1px solid var(--line-2) !important;
  border-radius: 0 !important; margin: 0 !important; padding: 9px 0 !important; box-shadow: none !important; }
#jAlerts > div:first-child { border-top: 0 !important; }
#jAlerts ul { margin: 4px 0 0 18px; }
.pipe { border-radius: var(--radius); border-color: var(--line); padding: 14px 16px; margin: 0; }
.pipe-head { color: var(--ink); }
.pipe-card { border-color: var(--line-2); border-radius: 7px; background: #fbfcfb; }
.pipe-card:hover { border-color: #9db3ad; }
.pipe-card.on { border-color: var(--navy); background: #eef5f6; box-shadow: inset 0 0 0 1px var(--navy); }
.tile { border-radius: var(--radius); border-color: var(--line); }
.tile:hover { border-color: #9db3ad; }
.tile .val { color: var(--ink); font-weight: 600; }
.jobs-toolbar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 10px; }
.jobs-toolbar .row { justify-content: space-between; }
.jobs-toolbar input, .jobs-toolbar select { padding: 6px 9px; }

/* ---- sign-in ---------------------------------------------------------------- */
.login-card { border-radius: 12px; border-color: var(--line); border-top: 5px solid var(--side); }
.login-card h1 { color: var(--side) !important; font-weight: 600; }

/* ---- small screens: the menu becomes a bar across the top -------------------- */
@media (max-width: 900px) {
  body.signed-in { padding-left: 0; }
  .side { position: static; width: auto; padding: 12px 14px; }
  .side-brand { padding-bottom: 10px; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
  .nav-h { padding: 0 4px 0 0; }
  .side-nav button { width: auto; padding: 6px 10px 6px 12px; }
  .side-user { flex-direction: row; display: flex; align-items: center; justify-content: space-between; }
  /* the menu folds away on phones: the logo and a Menu button; the links open below it */
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-brand { flex: 1; padding-bottom: 0; }
  .menu-btn { display: inline-flex; }
  .side-nav, .side-user { display: none; flex: 0 0 100%; width: 100%; }
  .side.open .side-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; margin-top: 12px; }
  .side.open .nav-group { display: grid; gap: 2px; align-content: start; }
  .side.open .nav-h { padding: 0 10px 4px; }
  .side.open .side-nav button { width: 100%; text-align: left; }
  .side.open .side-user { display: flex; margin-top: 10px; }
  /* job stages on phones: cards keep a readable width and the row scrolls sideways */
  .pipe-card { flex: 0 0 132px; }
  .page-head { padding: 16px; }
  main, #jobsView, #techView, #empView, #reqView, #reportView, #rolesView, #auditView, #llcView, #acctView, #fuView, #findView, #picker { margin: 16px 16px 60px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* "Disable" and similar in lists: still red, but not the loudest thing on every row */
.llc-card button.danger, #empView td button.danger, .jtable td button.danger {
  background: #fff; color: var(--bad); border-color: #e2b4b4; font-weight: 500;
}
.llc-card button.danger:hover, #empView td button.danger:hover, .jtable td button.danger:hover { background: #fbeeee; }
.llc-card { border-radius: var(--radius); border-color: var(--line); }

/* ---- icons ---------------------------------------------------------------- */
.ico { width: 15px; height: 15px; vertical-align: -3px; flex: none; }
.warn-txt .ico, .hint .ico { width: 13px; height: 13px; vertical-align: -2px; }

/* ---- waiting for the server --------------------------------------------- */
#loadBar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--tag), transparent); background-size: 40% 100%; background-repeat: no-repeat; }
#loadBar.on { opacity: 1; animation: loadslide 1s linear infinite; }
@keyframes loadslide { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ---- messages in the corner ---------------------------------------------- */
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: grid; gap: 8px; max-width: min(420px, 92vw); }
.toast { display: flex; gap: 9px; align-items: flex-start; background: var(--ink); color: #fff; border-radius: 8px; padding: 11px 14px;
  font-size: 13.5px; box-shadow: 0 10px 30px rgba(16,30,36,.25); cursor: pointer; transition: opacity .5s, transform .5s; }
.toast .ico { color: #7fd3a5; margin-top: 2px; }
.toast.error { background: #5c1d1d; } .toast.error .ico { color: #ffb4a8; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---- question boxes -------------------------------------------------------- */
#askDlg { width: min(460px, 94vw); padding: 22px 22px 18px; }
.ask-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.ask-body { color: var(--muted); white-space: pre-line; font-size: 13.5px; margin-bottom: 4px; }
#askDlg input { margin-top: 10px; }
.ask-acts { justify-content: flex-end; margin-top: 18px; }

/* ---- "More" menus ------------------------------------------------------------ */
details.more { position: relative; display: inline-block; }
details.more > summary { list-style: none; cursor: pointer; border: 1px solid #cfd6d3; border-radius: 6px; padding: 6px 10px 6px 12px;
  background: #fff; font-weight: 500; display: inline-flex; gap: 4px; align-items: center; user-select: none; white-space: nowrap; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary:hover { background: var(--soft); }
details.more[open] > summary { background: var(--soft); }
.more-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 1000; min-width: 190px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 12px 30px rgba(16,30,36,.16); padding: 5px; display: grid; }
.more-pop button, .more-pop a { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 5px; white-space: nowrap;
  color: var(--ink); font-size: 13.5px; text-decoration: none; }
.more-pop button:hover, .more-pop a:hover { background: var(--soft); }
.more-pop .danger, .more-pop button.danger { background: transparent; color: var(--bad); border: 0; font-weight: 500; }
.more-pop .danger:hover { background: #fbeeee; }
.more-pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 2px; }

/* ---- the invoice screen ----------------------------------------------------- */
main .two { align-items: start; }
main .doc-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; margin: -8px 0; }

/* ---- the jobs list ------------------------------------------------------------- */
.jobs-list td { padding: 10px 10px; }
.jobs-list .nw { white-space: nowrap; }
.jobs-list td:nth-child(5) { white-space: normal; overflow-wrap: break-word; min-width: 84px; max-width: 150px; }
.jobs-list td:nth-child(4) { max-width: 220px; overflow-wrap: anywhere; }
.jobs-list td:nth-child(3) { max-width: 110px; }
.jobs-list th.money-h { text-align: right; }
.jobs-list td.money { min-width: 172px; }   /* (wide enough for "Materials paid" on one line) */
.jobs-list .mrow { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; line-height: 1.55; }
.jobs-list .mrow span { color: var(--muted); white-space: nowrap; }
.jobs-list .mrow b { white-space: nowrap; }
.jobs-list .mrow b { font-weight: 600; }
.jobs-list .sub .ico { width: 12px; height: 12px; vertical-align: -1px; }
td.empty, .empty { padding: 28px 18px; text-align: center; color: var(--muted); }
#jTiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ---- a job: its own page, beside the menu, with tabs ------------------------------- */
#jobDlg.job-page { position: fixed; inset: 0 0 0 var(--side-w); width: auto; max-width: none; height: 100vh; max-height: none;
  margin: 0; border: 0; border-radius: 0; padding: 0; background: var(--bg); box-shadow: -8px 0 30px rgba(16,30,36,.12); overflow: hidden; }
#jobDlg.job-page[open] { display: flex; flex-direction: column; }
dialog.job-page::backdrop { background: rgba(16,30,36,.25); }
.job-page .jd-head { position: static; display: block; padding: 14px 32px 0; background: #fff; border-bottom: 1px solid var(--line); }
.jd-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.jd-top h2 { margin: 0 4px 0 2px; font-size: 22px; font-weight: 600; color: var(--ink); }
.jd-wo { font-size: 17px; font-weight: 600; color: var(--ink); padding: 2px 10px; border: 1px solid var(--line, #d9dde2); border-radius: 6px; background: var(--card, #fff); }
.jd-wo .jd-wo-l { font-size: 11.5px; font-weight: 500; color: var(--muted, #667); text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.jd-back { border: 0; background: transparent; color: var(--muted); padding: 4px 6px 4px 0; display: inline-flex; align-items: center; gap: 2px; }
.jd-back:hover { background: transparent; color: var(--ink); }
.jd-back .ico.back { transform: rotate(90deg); }
.jd-sub { margin: 6px 0 2px; font-size: 13px; }
.jd-tabs { display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; }
.jd-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; padding: 12px 20px 11px;
  color: var(--muted); font-weight: 500; font-size: 16px; white-space: nowrap; }
.jd-tabs button:hover { color: var(--ink); background: transparent; }
.jd-tabs button.on { color: var(--ink); border-bottom-color: var(--tag); font-weight: 600; }
.jd-tabs .n { margin-left: 7px; font-size: 12.5px; background: var(--soft); color: var(--muted); border-radius: 9px; padding: 1px 7px; }
@media (max-width: 700px) { .jd-tabs button { padding: 11px 14px 10px; font-size: 15px; } }
.job-page .jd-body { flex: 1; overflow-y: auto; padding: 20px 32px 60px; display: grid; gap: 16px; align-content: start; }
.job-page .jd-body > * { max-width: 1180px; }
.job-page .jsec { background: #fff; border-color: var(--line); border-radius: var(--radius); padding: 16px 18px; }
.job-page .jd-panel { display: grid; gap: 16px; }
.job-page .jd-panel[hidden] { display: none; }
.jd-col { display: grid; gap: 16px; align-content: start; }
.job-page .tracker { background: #fff; border-radius: var(--radius); }
.job-page .hist { max-height: none; }
.job-page .money-row a { font-weight: 600; text-decoration: none; }
@media (max-width: 900px) { #jobDlg.job-page { inset: 0; } .job-page .jd-head, .job-page .jd-body { padding-left: 16px; padding-right: 16px; } }
.job-page .jd-head:not(:has(.jd-top)) { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-bottom: 14px; }
.job-page .jd-head:not(:has(.jd-top)) h2 { font-size: 20px; font-weight: 600; color: var(--ink) !important; }

/* ---- row colors: what each job needs at a glance ------------------------------------- */
.jobs-list tr.jrow td:first-child { box-shadow: inset 4px 0 0 transparent; }
.jobs-list tr.jrow.tone-attention td { background: #fbe9e6; }
.jobs-list tr.tone-attention td:first-child { box-shadow: inset 4px 0 0 #c4402f; }
.jobs-list tr.jrow.tone-waiting td { background: #fff4da; }
.jobs-list tr.tone-waiting td:first-child { box-shadow: inset 4px 0 0 #e0a526; }
.jobs-list tr.jrow.tone-done td { background: #e9f5ed; }
.jobs-list tr.tone-done td:first-child { box-shadow: inset 4px 0 0 #2f8a5b; }
.jobs-list tr.jrow.tone-cancelled td { background: #f1f2f1; color: var(--muted); }
.jobs-list tr.tone-cancelled td:first-child { box-shadow: inset 4px 0 0 #a9b0ad; }
.jobs-list tr.jrow:hover td { filter: brightness(.96); }
.tone-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin: 0 2px 8px; }
.tone-legend .tl { display: inline-flex; align-items: center; gap: 6px; }
.tone-legend i { width: 12px; height: 12px; border-radius: 3px; background: #fff; border: 1px solid var(--line); }
.tone-legend b { color: var(--ink); font-weight: 600; margin-left: 2px; }
.tone-legend .tone-attention i { background: #fbe9e6; border-color: #c4402f; border-left-width: 4px; }
.tone-legend .tone-waiting i { background: #fff4da; border-color: #e0a526; border-left-width: 4px; }
.tone-legend .tone-done i { background: #e9f5ed; border-color: #2f8a5b; border-left-width: 4px; }
.tone-legend .tone-cancelled i { background: #f1f2f1; border-color: #a9b0ad; border-left-width: 4px; }
.tile .val .rtl { font-size: 17px; line-height: 1.35; white-space: nowrap; }
.tile .val small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 5px; }

/* the sign-in card: the SIYANEH mark and name */
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { width: 40px; height: 40px; flex: none; }
.login-brand span { font-weight: 700; letter-spacing: .16em; color: var(--side); }

/* ---- nothing wider than the window -------------------------------------------
   Wide tables scroll sideways inside their own box (core.js wraps them), and the
   page itself never does. Grid columns may shrink below their content's width. */
.table-scroll { overflow-x: auto; max-width: 100%; }
#reportView { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); }
@media (max-width: 900px) { #reportView { grid-template-columns: minmax(0, 1fr); } .rpt-list { position: static; } }
.rpt-main { grid-template-columns: minmax(0, 1fr); }
.rpt-main > *, #reportView > *, .acct-cols > *, .roles-wrap { min-width: 0; max-width: 100%; }
.tiles, #jTiles { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
.rpt-filters input#rfQ { min-width: 0; width: 100%; }
/* a temporary password is read out or typed by hand: show all of it, in letters that can't be confused */
#em_password { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; letter-spacing: 0; padding-left: 8px; padding-right: 8px; min-width: 0; }
.dash-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1200px) { .dash-2 { grid-template-columns: minmax(0, 1fr); } }
.dash-card { min-width: 0; }
@media (min-width: 900px) { .pw-cell { grid-column: span 2; } }

/* ---- the job's status in one line (tabs other than the Overview) ------------ */
.stage-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
.stage-line.mine { border-color: #e0a526; box-shadow: inset 3px 0 0 #e0a526; }
.stage-line .stage-label { font-weight: 600; color: var(--navy); }
.stage-line .sl-next { flex: 1 1 260px; min-width: 0; }
.stage-line .sl-owed { color: #9a3412; font-weight: 600; white-space: nowrap; }
.stage-line .sl-wait { color: #8a5a00; white-space: nowrap; }
.stage-line .ico { width: 14px; height: 14px; vertical-align: -2px; }
/* ---- Jobs page: money totals folded away ------------------------------------- */
.totals-toggle { margin: 10px 2px 0; font-size: 13px; }
.totals-toggle a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.totals-toggle a:hover { color: var(--ink); text-decoration: underline; }
.totals-toggle .ico { width: 14px; height: 14px; }
#jTiles { margin-top: 8px; }

/* ---- Jobs list on phones: stacked cards instead of the wide table ------------ */
.jcards { display: none; }
@media (max-width: 700px) {
  .jobs-list { display: none; }
  .jcards { display: grid; gap: 10px; }
  .jcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
    box-shadow: inset 4px 0 0 transparent; display: grid; gap: 4px; font-size: 14px; }
  .jcard:active { background: #f5f8f7; }
  .jcard.tone-attention { background: #fbe9e6; box-shadow: inset 4px 0 0 #c4402f; }
  .jcard.tone-waiting { background: #fff4da; box-shadow: inset 4px 0 0 #e0a526; }
  .jcard.tone-done { background: #e9f5ed; box-shadow: inset 4px 0 0 #2f8a5b; }
  .jcard.tone-cancelled { background: #f1f2f1; color: var(--muted); box-shadow: inset 4px 0 0 #a9b0ad; }
  .jc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .jc-wo { font-weight: 600; }
  .jc-status .sub { display: inline; margin-left: 6px; }
  .jc-money .mrow { display: flex; justify-content: space-between; font-size: 12.5px; }
  .jc-money .mrow span { color: var(--muted); }
}

/* ---- who has the job: one color per job role (list rows, phone cards, Active jobs cards, status badges) ---- */
:root {
  --own-originator: #7048c8; --own-originator-bg: #f3effc;
  --own-dispatcher: #2563c9; --own-dispatcher-bg: #edf3fd;
  --own-invoicer:   #0d8577; --own-invoicer-bg:   #e8f6f3;
  --own-ap:         #b8661a; --own-ap-bg:         #fdf2e6;
  --own-ar:         #b0377a; --own-ar-bg:         #fbedf5;
  --own-done:       #2f8a5b; --own-done-bg:       #e9f5ed;
  --own-cancelled:  #9aa3a0; --own-cancelled-bg:  #f1f2f1;
}
.jobs-list tr.jrow td { background: transparent; }
.jobs-list tr.jrow.own-originator td { background: var(--own-originator-bg); }
.jobs-list tr.jrow.own-dispatcher td { background: var(--own-dispatcher-bg); }
.jobs-list tr.jrow.own-invoicer td   { background: var(--own-invoicer-bg); }
.jobs-list tr.jrow.own-ar td         { background: var(--own-ar-bg); }
.jobs-list tr.jrow.own-done td       { background: var(--own-done-bg); }
.jobs-list tr.jrow.own-cancelled td  { background: var(--own-cancelled-bg); color: var(--muted); }
.jobs-list tr.jrow:hover td { filter: brightness(.97); }
.jobs-list tr.own-originator td:first-child { box-shadow: inset 5px 0 0 var(--own-originator); }
.jobs-list tr.own-dispatcher td:first-child { box-shadow: inset 5px 0 0 var(--own-dispatcher); }
.jobs-list tr.own-invoicer td:first-child   { box-shadow: inset 5px 0 0 var(--own-invoicer); }
.jobs-list tr.own-ar td:first-child         { box-shadow: inset 5px 0 0 var(--own-ar); }
.jobs-list tr.own-done td:first-child       { box-shadow: inset 5px 0 0 var(--own-done); }
.jobs-list tr.own-cancelled td:first-child  { box-shadow: inset 5px 0 0 var(--own-cancelled); }
.jcard.own-originator { background: var(--own-originator-bg); box-shadow: inset 5px 0 0 var(--own-originator); }
.jcard.own-dispatcher { background: var(--own-dispatcher-bg); box-shadow: inset 5px 0 0 var(--own-dispatcher); }
.jcard.own-invoicer   { background: var(--own-invoicer-bg);   box-shadow: inset 5px 0 0 var(--own-invoicer); }
.jcard.own-ar         { background: var(--own-ar-bg);         box-shadow: inset 5px 0 0 var(--own-ar); }
.jcard.own-done       { background: var(--own-done-bg);       box-shadow: inset 5px 0 0 var(--own-done); }
.jcard.own-cancelled  { background: var(--own-cancelled-bg);  box-shadow: inset 5px 0 0 var(--own-cancelled); color: var(--muted); }
/* status badges in the job's color */
.badge.own-badge { color: #fff; border: 0; }
.badge.own-originator { background: var(--own-originator); }
.badge.own-dispatcher { background: var(--own-dispatcher); }
.badge.own-invoicer   { background: var(--own-invoicer); }
.badge.own-ar         { background: var(--own-ar); }
.badge.own-done       { background: var(--own-done); }
.badge.own-cancelled  { background: var(--own-cancelled); }
/* the Active jobs cards: a colored top edge per job role */
.pipe-card.own-originator { border-top: 4px solid var(--own-originator); }
.pipe-card.own-dispatcher { border-top: 4px solid var(--own-dispatcher); }
.pipe-card.own-invoicer   { border-top: 4px solid var(--own-invoicer); }
.pipe-card.own-ap         { border-top: 4px solid var(--own-ap); }
.pipe-card.own-ar         { border-top: 4px solid var(--own-ar); }
.pipe-card.own-originator .pc-label { color: var(--own-originator); }
.pipe-card.own-dispatcher .pc-label { color: var(--own-dispatcher); }
.pipe-card.own-invoicer .pc-label   { color: var(--own-invoicer); }
.pipe-card.own-ap .pc-label         { color: var(--own-ap); }
.pipe-card.own-ar .pc-label         { color: var(--own-ar); }
/* the job's own status (Overview card and the one-line status) */
.stage-card.own-originator, .stage-line.own-originator { box-shadow: inset 5px 0 0 var(--own-originator); }
.stage-card.own-dispatcher, .stage-line.own-dispatcher { box-shadow: inset 5px 0 0 var(--own-dispatcher); }
.stage-card.own-invoicer,   .stage-line.own-invoicer   { box-shadow: inset 5px 0 0 var(--own-invoicer); }
.stage-card.own-ar,         .stage-line.own-ar         { box-shadow: inset 5px 0 0 var(--own-ar); }
.stage-card.own-done,       .stage-line.own-done       { box-shadow: inset 5px 0 0 var(--own-done); }
.stage-card.own-cancelled,  .stage-line.own-cancelled  { box-shadow: inset 5px 0 0 var(--own-cancelled); }
.stage-card.own-originator .stage-label, .stage-line.own-originator .stage-label { color: var(--own-originator); }
.stage-card.own-dispatcher .stage-label, .stage-line.own-dispatcher .stage-label { color: var(--own-dispatcher); }
.stage-card.own-invoicer .stage-label,   .stage-line.own-invoicer .stage-label   { color: var(--own-invoicer); }
.stage-card.own-ar .stage-label,         .stage-line.own-ar .stage-label         { color: var(--own-ar); }
.stage-card.own-done .stage-label,       .stage-line.own-done .stage-label       { color: var(--own-done); }
/* legend swatches */
.tone-legend .tl.own-originator i { background: var(--own-originator-bg); border-color: var(--own-originator); border-left-width: 4px; }
.tone-legend .tl.own-dispatcher i { background: var(--own-dispatcher-bg); border-color: var(--own-dispatcher); border-left-width: 4px; }
.tone-legend .tl.own-invoicer i   { background: var(--own-invoicer-bg);   border-color: var(--own-invoicer);   border-left-width: 4px; }
.tone-legend .tl.own-ar i         { background: var(--own-ar-bg);         border-color: var(--own-ar);         border-left-width: 4px; }
.tone-legend .tl.own-done i       { background: var(--own-done-bg);       border-color: var(--own-done);       border-left-width: 4px; }
.tone-legend .tl.own-cancelled i  { background: var(--own-cancelled-bg);  border-color: var(--own-cancelled);  border-left-width: 4px; }
/* needs attention / waiting: a flag on the job (the row color is who has it) */
.att-flag, .wait-flag { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.att-flag { color: #b42020; } .wait-flag { color: #8a5a00; }
.att-flag .ico, .wait-flag .ico { width: 12px; height: 12px; }

/* ---- Assign a technician (Visits & pay) ---------------------------------------------- */
.assign { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 14px 16px; margin: 10px 0 12px; }
.assign.first { border: 2px solid var(--own-dispatcher, #2563c9); box-shadow: 0 2px 10px rgba(37,99,201,.08); }
.as-head { display: flex; align-items: flex-start; gap: 10px; }
.as-head > div > b { font-size: 17px; color: var(--ink); }
.as-step { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px; }
.as-step select { width: auto; padding: 2px 6px; }
.as-n { width: 24px; height: 24px; border-radius: 50%; background: var(--own-dispatcher, #2563c9); color: #fff; display: inline-grid;
  place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.as-list { display: grid; gap: 6px; }
.as-tech { display: grid; grid-template-columns: 22px 1fr auto auto; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; color: inherit; cursor: pointer; }
.as-tech:hover:not([disabled]) { border-color: var(--own-dispatcher, #2563c9); background: #f4f8fe; }
.as-tech.sel { border-color: var(--own-dispatcher, #2563c9); background: #edf3fd; box-shadow: inset 0 0 0 1px var(--own-dispatcher, #2563c9); }
.as-tech.blocked { opacity: .6; cursor: not-allowed; }
.as-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #b6c0cc; }
.as-tech.sel .as-radio { border-color: var(--own-dispatcher, #2563c9); background: radial-gradient(var(--own-dispatcher, #2563c9) 45%, #fff 50%); }
.as-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.as-roles { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip-s { font-size: 11.5px; padding: 1px 7px; border-radius: 9px; background: #eef0f2; color: var(--muted); }
.chip-s.match { background: #e3f3e9; color: #1f7a48; font-weight: 600; }
.as-where { color: var(--muted); font-size: 13px; white-space: nowrap; }
.as-where b { color: var(--ink); margin-left: 8px; }
.as-load { color: var(--muted); font-size: 12.5px; white-space: nowrap; min-width: 80px; text-align: right; }
.as-more { font-size: 13px; padding: 4px 2px; }
.as-empty { padding: 12px; background: #fdf8ec; border: 1px solid #f0d9a8; border-radius: 8px; font-size: 13.5px; }
.as-when { gap: 8px; align-items: center; flex-wrap: wrap; }
button.big { font-size: 15px; padding: 10px 22px; }
@media (max-width: 700px) {
  .as-tech { grid-template-columns: 22px 1fr; }
  .as-where, .as-load { grid-column: 2; text-align: left; }
}
.as-cta { margin-top: 8px; }
.stage-line .as-cta { margin: 0; padding: 5px 12px; }
.as-empty { padding: 14px 16px; }
.as-empty-t { font-size: 15px; margin-bottom: 4px; }
.as-other { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--line);
  border-radius: 8px; font-size: 13.5px; color: var(--muted); }
.as-other span { flex: 1 1 220px; }
.as-other[hidden] { display: none; }

/* ---- a job: the tab on the left, the Work order panel on the right (same on every tab) ---------------------- */
.jd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.jd-main { display: grid; gap: 16px; min-width: 0; align-content: start; }
.jd-side { display: grid; gap: 12px; align-content: start; }
.jd-side > summary { display: none; }
.jd-side .jsec { margin: 0; }
.wo-card .kv { grid-template-columns: 96px 1fr; gap: 5px 10px; font-size: 13px; }
.wo-card .kv .pre { white-space: pre-line; }
.wo-more { margin-top: 10px; border-top: 1px solid var(--line-2, #eceeec); padding-top: 8px; }
.wo-more > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; }
.wo-more > summary::before { content: '▸ '; } .wo-more[open] > summary::before { content: '▾ '; }
.wo-more .kv { margin-top: 6px; }
@media (max-width: 1100px) {
  .jd-layout { grid-template-columns: 1fr; }
  .jd-side { order: -1; position: static; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; }
  .jd-side > summary { display: flex; gap: 10px; align-items: baseline; padding: 12px 14px; cursor: pointer; list-style: none; }
  .jd-side > summary::before { content: '▸'; color: var(--muted); } .jd-side[open] > summary::before { content: '▾'; }
  .jd-side[open] { padding-bottom: 12px; }
  .jd-side[open] > .jsec { margin: 0 12px; border: 0; padding: 0 2px; }
}
.wo-title { margin-top: 0; }
@media (min-width: 1101px) { .checkin-note { display: none; } }   /* (shown in the Work order panel beside it) */
@media (max-width: 1100px) { .wo-title { display: none; } }        /* (the folded panel's own title says it) */

/* ---- small labels above a field, for fields laid out in a row ------------------------------------------------- */
label.fl { display: inline-flex; flex-direction: column; gap: 3px; margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
label.fl > span i { font-style: normal; font-weight: 400; }
label.fl input, label.fl select { font-weight: 400; color: var(--ink); }
.fl-note { align-self: flex-end; padding-bottom: 9px; }
.row:has(> label.fl) { align-items: flex-end; }

/* ---- a job's attachments (job form, Work order panel) --------------------------------------------------------- */
.att-list { display: flex; flex-wrap: wrap; gap: 6px; }
.att { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border: 1px solid var(--line);
  border-radius: 7px; background: #fafbfc; font-size: 13px; }
.att a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att.pending { border-style: dashed; }
.att-x { padding: 0 4px; line-height: 1; font-size: 16px; }
.att-ic { font-size: 9.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 4px; border-radius: 3px; color: #fff; flex: none; }
.att-ic.pdf { background: #c4402f; } .att-ic.img { background: #2563c9; }
.att-add { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 7px 12px; border: 1px dashed var(--line);
  border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 13.5px; color: var(--ink); }
.att-add:hover { border-color: var(--navy); background: #f4f8fe; }
.jd-side .att-list { flex-direction: column; align-items: flex-start; }

/* ---- the job form: site time zone, picked from the site address --------------------------------------------- */
.tz-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.tz-row select { min-width: 200px; }
.tz-row #jfTzNote { padding-bottom: 10px; flex: 1 1 280px; }
.tz-row #jfTzNote .ico { width: 13px; height: 13px; vertical-align: -2px; }

/* ---- FM Clients page ------------------------------------------------------------------------------------------ */
.fmc-table td { vertical-align: top; }
.fmc-table td.pre { white-space: pre-line; }
.fmc-table .fmc-checkin { max-width: 280px; font-size: 12.5px; color: var(--ink); }
.fmc-table tr.fmc-hidden td { color: var(--muted); background: #f7f7f6; }
.danger-txt { color: var(--warn, #b42020) !important; }
#fmView { margin: 24px 32px 60px; }
@media (max-width: 900px) { #fmView { margin: 16px 16px 60px; } }

/* ---- a visit's before / after pictures: the add box says what it does --------------------------------------- */
.ph-add { width: 84px !important; height: 72px !important; display: flex !important; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; text-align: center; }
.ph-add .ph-plus { font-size: 22px; line-height: 1; }
.ph-add .ph-lbl { font-size: 11.5px; line-height: 1.2; color: var(--muted); }
/* drag and drop: the area lights up while pictures are dragged over it */
.ph-group[data-drop] { border: 2px dashed transparent; border-radius: 8px; padding: 4px 6px; margin: -6px -8px; transition: background .1s, border-color .1s; }
.ph-group.drop-on { border-color: var(--own-dispatcher, #2563c9); background: #edf3fd; }
.ph-group.drop-on .ph-add { border-color: var(--own-dispatcher, #2563c9); }
.ph-add .ph-or { font-size: 10.5px; color: var(--muted); opacity: .8; }
.ph-add { height: 80px !important; }

/* Spinning circle: buttons that are sending, and pictures that are uploading */
.spinner, button.spinning::before { content: ''; display: inline-block; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: btnspin .7s linear infinite; vertical-align: -2px; }
button.spinning::before { margin-right: 7px; }
button.spinning { cursor: progress; opacity: .9; }
button.spinning:disabled { opacity: .9; }
.ph-add.ph-busy { cursor: progress; border-style: solid; border-color: #9db8e8; background: #edf3fd; color: #2456a6; }
.ph-add.ph-busy .spinner { width: 20px; height: 20px; margin-bottom: 4px; }
/* "Payment requested": done, waiting for Accounts Payable */
button.req-sent, button.req-sent:disabled { background: #e8f5ec; color: #1d6b38; border-color: #b7dcc3; opacity: 1; cursor: default; }
button.req-sent svg { width: 14px; height: 14px; vertical-align: -2px; }
/* a visit just marked done lights up for a moment */
.visit.flash { animation: vflash 1.6s ease-out; }
@keyframes vflash { 0% { background: #e3f4e8; box-shadow: 0 0 0 3px #9fd3b0; } 100% { background: transparent; box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .spinner, button.spinning::before { animation-duration: 2s; } .visit.flash { animation: none; } }

/* A technician payment request that's over the job's NTE */
.over-nte { margin-top: 6px; padding: 7px 10px; border-radius: 6px; background: #fdeeee; border: 1px solid #f1c2c2; color: #8d1f1f; font-size: 13px; }
.over-nte svg { width: 14px; height: 14px; vertical-align: -2px; }
#nteAskDlg { max-width: 520px; width: calc(100% - 32px); }
#nteAskDlg textarea { width: 100%; }
#nteAskDlg .ask-title svg { width: 18px; height: 18px; vertical-align: -3px; color: #b42020; }
#nteAskDlg { padding: 22px 22px 18px; }

/* ---- floating notifications (they also stay in the bell) ------------------- */
#notifPop { position: fixed; top: 104px; right: 18px; z-index: 115; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.npop { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-left: 4px solid #2a6fdb;
  border-radius: 10px; padding: 12px 10px 12px 12px; box-shadow: 0 12px 32px rgba(16,30,36,.18); cursor: pointer; font-size: 13px;
  animation: npopin .35s ease-out; transition: opacity .3s, transform .3s; }
.npop:hover { box-shadow: 0 14px 36px rgba(16,30,36,.26); }
.npop.out { opacity: 0; transform: translateX(24px); }
.npop .npop-ico { flex: none; width: 18px; height: 18px; margin-top: 1px; color: #2a6fdb; }
.npop-main { flex: 1; min-width: 0; }
.npop-text { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.npop-w { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.npop-open { margin-top: 8px; padding: 4px 10px; font-size: 12.5px; }
.npop-x { flex: none; padding: 2px; line-height: 0; }
.npop-x svg { width: 15px; height: 15px; }
.npop-request { border-left-color: #c9591f; } .npop-request .npop-ico { color: #c9591f; }
.npop-paid { border-left-color: #1d8a4a; } .npop-paid .npop-ico { color: #1d8a4a; }
.npop-declined, .npop-mismatch { border-left-color: #b42020; } .npop-declined .npop-ico, .npop-mismatch .npop-ico { color: #b42020; }
.npop-more { justify-content: center; color: var(--muted); border-left-color: var(--line); padding: 8px; animation: none; }
@keyframes npopin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
#bellBtn.ring svg { animation: bellring .9s ease-in-out 2; transform-origin: 50% 10%; }
@keyframes bellring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-14deg); } 60% { transform: rotate(9deg); } 80% { transform: rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .npop { animation: none; } #bellBtn.ring svg { animation: none; } }
.npop.npop-warn { border-left-color: #b42020; background: #fff8f8; } .npop.npop-warn .npop-ico { color: #b42020; }

/* A quote's scope: one box, no clean-up button or preview */
body.scope-mode #btnCleanUp { display: none; }
body.scope-mode #previewBox { display: none !important; }
body.scope-mode #wordTools { margin-top: 10px; }
body.scope-mode #wordTools .wordbar { margin-top: 0; }
.left-out { margin-top: 10px; padding: 8px 12px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; color: var(--muted); }
.left-out ul { margin: 4px 0 0 18px; padding: 0; }
body.scope-mode #wordTools { display: flex; flex-direction: column; }
body.scope-mode #wordTools .wordbar { order: -1; }
body.scope-mode #wordTools details { order: 5; }

/* Charges: the incurred charges (already spent) are their own group, above the other charges */
.inc-box { margin-bottom: 14px; padding: 10px 12px; border: 1px dashed #c9d3df; border-radius: 8px; background: #fafbfd; }
.inc-box h3, .charges-h { font-size: 14px; margin: 0 0 6px; }
.inc-box table { margin-top: 4px; }
#incSubLine { margin-left: auto; font-weight: 600; color: var(--ink, #1f2933); }
.scope-prev { margin-top: 0; margin-bottom: 4px; border-color: #b8cbe3; }
.scope-prev li.chg { cursor: help; }

/* A labor line: technicians × hours per technician (the hours billed are worked out) */
.labor-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 5px; font-size: 12px; color: var(--muted); }
.labor-row label { display: flex; gap: 5px; align-items: center; margin: 0; font-size: 12px; font-weight: 500; }
.labor-row input { width: 64px; padding: 4px 6px; text-align: right; }
tr[data-kind=labor] .q { background: #f3f5f8; color: var(--muted); }
.labor-hrs { font-size: 11px; text-align: right; }
#itemsEmpty { padding: 8px 0 2px; }

/* "Save progress": a quote / invoice in progress can be resumed or discarded */
.draft-banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid #f0d49a; background: #fff8e8; border-radius: 8px; font-size: 13.5px; }
.draft-banner svg { width: 15px; height: 15px; vertical-align: -2px; }
.draft-banner .spacer { flex: 1; }
#draftSaved { margin-right: 6px; }
.scope-prev .dp-desc { margin: 0 0 6px; font-size: 13.5px; line-height: 1.45; color: #1f2933; }
.scope-prev .dp-desc.chg { background: #fff4d6; cursor: help; }
#descBox label { display: block; margin-bottom: 4px; }
.scope-prev .gl { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; padding: 0 4px; color: #1f2933; }
.scope-prev .gl.chg { background: #fff4d6; cursor: help; }
.scope-prev .dp-sub { font-size: 11px; color: var(--muted); margin: 6px 0 2px; text-transform: uppercase; letter-spacing: .04em; }
a.doc-file { font-size: 12.5px; white-space: nowrap; margin-right: 8px; }
td.nw a.doc-file { display: inline-block; margin: 0 8px 0 0; vertical-align: middle; }

/* A visit's steps, in order: the next one is highlighted (and is the visit's one button) */
.vsteps { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; margin: 8px 0 2px; font-size: 12px; }
.vstep { padding: 3px 9px; border-radius: 999px; background: #f1f3f6; color: var(--muted); white-space: nowrap; }
.vstep.ok { background: #e8f5ec; color: #1d6b38; }
.vstep.next { background: #fff4d6; color: #8a5a00; font-weight: 600; box-shadow: inset 0 0 0 1px #f0d49a; }
.vstep.skip { text-decoration: line-through; opacity: .7; }
.vstep-line { width: 14px; height: 2px; background: #dfe3e8; flex: none; }
.stage-cta { margin-top: 8px; }

/* Today: the visits that need the dispatcher now */
.today { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.today-h { padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.today-h svg { width: 15px; height: 15px; vertical-align: -2px; }
.today-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 14px; border-bottom: 1px solid #f0f2f5; border-left: 4px solid transparent; }
.today-row:last-child { border-bottom: 0; }
.today-what { flex: 1; min-width: 240px; display: grid; gap: 2px; font-size: 13.5px; }
.today-acts { display: flex; gap: 6px; }
.today-row.t-late, .today-row.t-over { border-left-color: #b42020; background: #fff8f8; }
.today-row.t-soon, .today-row.t-onsite { border-left-color: #c9891f; }
.today-row.t-confirm { border-left-color: #e0b44a; }
.today-row.t-later { border-left-color: #9db8e8; }
.row-next { font-weight: 600; font-size: 12.5px; color: #8a5a00; margin-bottom: 4px; line-height: 1.35; }
.jcard .row-next { margin-top: 2px; }
.msg-tech { display: inline-flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.msg-tech .hint { margin-right: 4px; }

/* Phones: a tighter job header, tabs that scroll sideways (not cut off), the next step kept at the bottom */
.m-next { display: none; }
@media (max-width: 700px) {
  .jd-top { gap: 6px; }
  .jd-top h2 { font-size: 19px; }
  .jd-top > .hint { display: none; }                           /* the LLC: in the work order panel */
  .jd-top .jd-wo-l { display: none; }
  .jd-top button { padding: 6px 10px; font-size: 13.5px; }
  .jd-sub { font-size: 12px; }
  .jd-tabs { flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .jd-tabs::-webkit-scrollbar { display: none; }
  .jd-tabs button { flex: none; padding: 10px 12px 9px; font-size: 14.5px; }
  .m-next { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
            background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(16,30,36,.1); }
  #jdBody:has(.m-next) { padding-bottom: 84px; }
  .m-next-in button { width: 100%; padding: 12px; font-size: 15px; }
  .stage-cta { display: none; }                                /* (the same button is at the bottom) */
}
@media (max-width: 700px) { .jd-top .hide-sm { display: none; } }

/* Save / Cancel bar: changes are kept on screen until Save (Cancel puts them back) */
.save-bar { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
            padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.save-bar.dirty { background: #fffaeb; border-color: #f0b429; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.save-bar.inline { position: static; box-shadow: none; padding: 8px 10px; margin-top: 8px; }
.vp-cancel { display: flex; justify-content: flex-end; margin-top: 6px; }
.rules-box label.chg { background: #fff4d6; border-radius: 4px; box-shadow: inset 0 0 0 1px #f0b429; }

/* A sign-off sheet: no steps of the work (only the job's description) */
body.no-steps #stepsBox, body.no-steps #lblSteps, body.no-steps label[for=work_text], body.no-steps #previewBox #bullets,
body.no-steps #btnPolish, body.no-steps #btnCleanUp, body.no-steps #suggestions, body.no-steps #leftOut, body.no-steps #orderNote { display: none !important; }

/* ---- whose turn it is, at the top of a job (on every tab) ---- */
.turn-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0 4px; padding: 8px 12px; border-radius: 10px;
  background: var(--soft, #f6f7f9); border: 1px solid var(--line); box-shadow: inset 5px 0 0 var(--line); font-size: 14px; }
.turn-strip .ts-role { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.turn-strip .ts-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; display: inline-block; }
.turn-strip .ts-next { color: var(--ink, #1d2430); }
.turn-strip .ts-sp { flex: 1; }
.turn-strip .ts-go { padding: 5px 12px; white-space: nowrap; }
.turn-strip .ts-wait { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.turn-strip .ts-you { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: #fff; background: #c97a10; border-radius: 99px; padding: 2px 10px; }
.turn-strip .ts-me { flex-basis: 100%; font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.turn-strip .ts-sides { flex-basis: 100%; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); }
.turn-strip.mine { border-color: #e0a63a; box-shadow: inset 5px 0 0 #e0a63a, 0 0 0 2px #fbe7bf; background: #fffaf0; }
.turn-strip.own-originator { box-shadow: inset 5px 0 0 var(--own-originator); } .turn-strip.own-originator .ts-role { color: var(--own-originator); }
.turn-strip.own-dispatcher { box-shadow: inset 5px 0 0 var(--own-dispatcher); } .turn-strip.own-dispatcher .ts-role { color: var(--own-dispatcher); }
.turn-strip.own-invoicer   { box-shadow: inset 5px 0 0 var(--own-invoicer); }   .turn-strip.own-invoicer .ts-role   { color: var(--own-invoicer); }
.turn-strip.own-ar         { box-shadow: inset 5px 0 0 var(--own-ar); }         .turn-strip.own-ar .ts-role         { color: var(--own-ar); }
.turn-strip.own-done       { box-shadow: inset 5px 0 0 var(--own-done); }       .turn-strip.own-done .ts-role       { color: var(--own-done); }
.turn-strip.own-cancelled  { box-shadow: inset 5px 0 0 var(--own-cancelled); }  .turn-strip.own-cancelled .ts-role  { color: var(--own-cancelled); }
.turn-strip.mine.own-originator, .turn-strip.mine.own-dispatcher, .turn-strip.mine.own-invoicer, .turn-strip.mine.own-ar { box-shadow: inset 5px 0 0 #e0a63a, 0 0 0 2px #fbe7bf; }
.turn-strip .ts-role b { color: var(--ink, #1d2430); }
/* the tab where the next step is: a dot (amber when it's yours) */
.jd-tabs button .turn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; margin-right: 6px; vertical-align: middle; }
.jd-tabs button.turn-tab.mine .turn-dot { background: #e08a00; box-shadow: 0 0 0 3px #fbe7bf; }
/* the very button to press (your turn), and the flash after "Do it" */
.next-act { box-shadow: 0 0 0 3px #f6c768 !important; position: relative; }
.next-act::after { content: "Next"; position: absolute; top: -9px; right: -6px; background: #e08a00; color: #fff; font-size: 10px; font-weight: 700;
  line-height: 1; padding: 2px 5px; border-radius: 99px; pointer-events: none; }
@keyframes nextFlash { 0%, 100% { box-shadow: 0 0 0 3px #f6c768; } 50% { box-shadow: 0 0 0 7px #fbe0a6; } }
.next-flash { animation: nextFlash .5s ease-in-out 3; }
@media (max-width: 700px) { .turn-strip { font-size: 13px; } .turn-strip .ts-go { flex-basis: 100%; } }
.stage-flow .sf-who { display: block; font-size: 11px; font-weight: 400; color: var(--muted); line-height: 1.2; }
.stage-flow .sf.me .sf-who { color: #b26a00; font-weight: 700; }

/* ---- the job form: what's still needed, on the fields themselves ---- */
.fw { display: flex; gap: 5px; align-items: center; font-size: 12.5px; margin-top: 4px; }
.fw.need { color: var(--warn); }
.fw.bad { color: var(--bad); font-weight: 600; }
.fw-need { border-color: #e7b46a !important; background: #fffaf0; }
.fw-bad { border-color: var(--bad) !important; box-shadow: 0 0 0 2px #f6d5d5; background: #fff7f7; }
.jf-left { margin-right: auto; font-size: 13px; }
.jf-left a { color: var(--warn); font-weight: 600; text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.jf-left a.bad { color: var(--bad); }
.jf-left .ok { color: var(--ok); font-weight: 600; display: inline-flex; gap: 5px; align-items: center; }
.fm-zero-ask { background: #fffaf0; border: 1px solid #f0d9a8; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.fm-zero-ask button { margin-left: 6px; }
/* ---- materials we buy for a job ---- */
.mat-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; background: #fff; }
.mat-card.pending { border-left: 4px solid var(--own-ap); }
.mat-card.purchased { border-left: 4px solid var(--ok); }
.mat-card.declined, .mat-card.withdrawn { opacity: .85; }
.mat-card .mat-items { white-space: pre-wrap; }
.mat-card .mat-price { font-weight: 700; }
.mat-card .mat-buy { margin-top: 6px; }
.mat-new { margin-top: 8px; }
.reqcard .mat-card { border: 0; padding: 0; margin: 0; }
.req-kinds { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.req-kinds button { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 8px 12px; font-weight: 600; color: var(--muted); }
.req-kinds button.on { color: var(--navy); border-bottom-color: #e0a63a; }
.req-kinds .n { margin-left: 6px; background: var(--own-ap); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 11px; }
/* ---- Finish job: under the visits, as wide as them, green ---- */
.finish-bar { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.finish-wide { display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; padding: 12px 16px; font-size: 15px; font-weight: 700;
  background: #2f8a5b; border-color: #2f8a5b; color: #fff; border-radius: 8px; }
.finish-wide:hover { background: #26744c; border-color: #26744c; }
.finish-wide.open { background: #26744c; }
.finish-wide .ico { width: 16px; height: 16px; }
.finish-desc { font-size: 13px; color: var(--muted); margin: 6px 2px 0; line-height: 1.45; }
/* ---- Finish job: Job complete first and clear; "the FM stopped it" behind a quiet link ---- */
.fj-box .fj-complete { display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; padding: 11px 16px;
  font-size: 15px; font-weight: 700; background: #2f8a5b; border-color: #2f8a5b; color: #fff; border-radius: 8px; }
.fj-box .fj-complete:hover { background: #26744c; border-color: #26744c; }
.fj-box .fj-alt { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; }
.fj-box .fj-alt a { color: var(--muted); }
.fj-box .stop-btn { background: #fff; color: var(--bad); border: 1px solid #e2b4b4; font-weight: 600; }
.fj-box .stop-btn:hover { background: #fdf3f3; }
.finish-sec .finish-bar { margin-top: 0; border-top: 0; padding-top: 0; }
.jd-refresh { display: inline-flex; align-items: center; gap: 4px; }
.jd-refresh .ico { width: 15px; height: 15px; }
.fm-remind { background: #fffaf0; border: 1px solid #f0d9a8; border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: 13.5px; }
.fm-remind .ico { width: 14px; height: 14px; vertical-align: -2px; }
