/* ADVANSYS Field Service demo. Tokens and components follow docs/mockups/base.css. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy:#13294b; --blue:#1f5fd6; --blue-soft:#e8f0fe; --blue-faint:#f2f6fe; --line:#e2e8f0; --muted:#64748b;
  --green:#15803d; --green-soft:#e9f1ec; --green-muted:#e9f1ec; --green-muted-line:#d3e3d8; --slate-soft:#dfe5ee; --slate-line:#cbd5e1; --amber:#b45309; --amber-soft:#fef3c7;
  --red:#b91c1c; --red-soft:#fee2e2; --bg:#f6f8fb; --ink:#0f172a; --input:#cbd5e1;
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 14px; font-feature-settings: "calt" 0; } /* calt off: Inter draws "2x" as "2×" */
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* components */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; border-radius:8px; font-weight:600; font-size:14px; padding:9px 14px; border:1px solid transparent; cursor:pointer; background:none; min-height:40px; white-space:nowrap; }
.btn-primary { background:var(--blue); color:#fff; }
.btn-ghost { background:#fff; border-color:var(--line); color:var(--ink); }
.btn-soft { background:var(--blue-faint); border-color:#d6e2fa; color:var(--navy); }
.btn-soft:hover { background:var(--blue-soft); }
.btn-green { background:var(--green); color:#fff; }
.btn-red { background:var(--red); color:#fff; }
.btn:disabled { opacity:.45; cursor:not-allowed; }
.btn:focus-visible, .chip:focus-within, .in:focus, .ta:focus { outline:2px solid #93c5fd; outline-offset:1px; }
.btn-lg { min-height:52px; font-size:16px; font-weight:700; }
.pill { display:inline-block; font-size:11px; font-weight:600; padding:3px 8px; border-radius:999px; letter-spacing:.02em; white-space:nowrap; }
.pill-blue { background:var(--blue-soft); color:var(--blue); }
.pill-green { background:var(--green-soft); color:var(--green); }
.pill-amber { background:var(--amber-soft); color:var(--amber); }
.pill-gray { background:#f1f5f9; color:#475569; }
.pill-red { background:var(--red-soft); color:var(--red); }
.card { background:#fff; border:1px solid var(--line); border-radius:12px; }
.muted { color:var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.in { border:1px solid var(--input); border-radius:8px; padding:9px 11px; font-size:14px; background:#fff; width:100%; min-height:40px; }
/* Date/time boxes: let them shrink to their column, and stop iPhone Safari
   from sizing and centering them on its own. */
input[type="date"].in, input[type="time"].in { min-width:0; max-width:100%; display:block; }
@media (max-width: 899px) {
  input[type="date"].in, input[type="time"].in { -webkit-appearance:none; appearance:none; text-align:left; }
  input[type="date"].in::-webkit-date-and-time-value, input[type="time"].in::-webkit-date-and-time-value { text-align:left; }
}
select.in { appearance:none; -webkit-appearance:none; padding-right:30px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E") no-repeat right 11px center; }
label.lbl { display:block; }
.lbl { font-size:12px; font-weight:700; color:#334155; text-transform:uppercase; letter-spacing:.05em; margin:16px 0 8px; }
.field-lbl { font-size:11.5px; font-weight:600; color:var(--muted); margin-bottom:4px; display:block; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:7px; }
.flash { background:var(--green-soft); color:var(--green); border:1px solid var(--green-muted-line); border-radius:10px; padding:10px 14px; font-weight:600; font-size:13px; }
h2.title { font-size:21px; font-weight:800; }
.draft-note { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:14px; }
.draft-note[hidden] { display:none; }
.flash-warn { background:var(--amber-soft); color:var(--amber); border-color:#fde68a; }
.row-between { display:flex; justify-content:space-between; align-items:center; gap:10px; }

/* chrome: desktop top bar */
.topbar { background:var(--navy); color:#fff; display:flex; align-items:center; gap:28px; padding:0 28px; height:58px; position:sticky; top:0; z-index:1000; }
.brand { font-weight:800; letter-spacing:.04em; font-size:17px; white-space:nowrap; }
.brand small { font-weight:500; opacity:.7; letter-spacing:0; margin-left:6px; font-size:15px; }
.nav { display:flex; height:100%; }
.nav a { color:#cbd5e1; font-size:14px; font-weight:500; margin-right:22px; display:flex; align-items:center; border-bottom:2px solid transparent; padding-top:2px; }
.nav a:hover { color:#fff; }
.nav a.on { color:#fff; border-bottom-color:#60a5fa; }
.user { margin-left:auto; font-size:13px; color:#cbd5e1; display:flex; align-items:center; gap:10px; white-space:nowrap; }
.user a:hover { color:#fff; }
.avatar { width:30px; height:30px; border-radius:50%; background:#3b82f6; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12px; }
.main { padding:22px 28px 28px; max-width:1400px; margin:0 auto; width:100%; }

/* chrome: phone */
.apphead { background:var(--navy); color:#fff; padding:14px 18px 16px; padding-top:calc(14px + env(safe-area-inset-top)); display:none; }
.apphead .t { font-size:19px; font-weight:700; }
.apphead .s { font-size:12px; opacity:.75; margin-top:2px; }
.apphead .back { font-size:13px; opacity:.8; display:inline-block; margin-bottom:4px; }
/* Desktop "‹ Tickets" (and Clients, Ticket #) above a page title: a clear way back to the list. */
.crumb-back { display:inline-flex; align-items:center; gap:4px; margin:0 6px 4px 0; padding:5px 12px 5px 10px; border-radius:999px;
              background:var(--blue-soft); color:var(--blue); font-weight:700; font-size:14px; text-decoration:none; vertical-align:middle; }
.crumb-back:hover { background:#dbe7fd; text-decoration:none; }
.tabbar { display:none; }
.desk-only { }
.phone-only { display:none; }

@media (max-width: 899px) {
  /* The app frame is pinned to the screen. iPhone Safari otherwise lets the page itself scroll once a list
     hits its end, which slides the header under the status bar and opens a gap below the tab bar. */
  html:has(.shell), html:has(.shell) body { height:100%; overflow:hidden; overscroll-behavior:none; }
  .shell { display:flex; flex-direction:column; position:fixed; inset:0; }
  .topbar, .desk-only { display:none !important; }
  .phone-only { display:revert; }
  .apphead { display:block; flex:none; }
  .apphead .row-between { align-items:flex-start; }
  .main { padding:12px 14px 20px; flex:1; min-height:0; overflow-y:auto; overscroll-behavior-y:contain; -webkit-overflow-scrolling:touch; }
  .main.flush { padding:0; overflow:hidden; position:relative; }
  .tabbar { flex:none; height:62px; padding-bottom:env(safe-area-inset-bottom); box-sizing:content-box; background:#fff; border-top:1px solid var(--line); display:flex; justify-content:space-around; align-items:stretch; font-size:11px; color:var(--muted); font-weight:600; }
  .tabbar a { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; }
  .tabbar svg { width:22px; height:22px; }
  .tabbar .on { color:var(--blue); }
  .btn { min-height:44px; }
}

/* login */
.login-wrap { min-height:100dvh; display:flex; align-items:center; justify-content:center; padding:24px 16px; background:var(--navy); }
.login-card { width:100%; max-width:400px; padding:28px 26px; }
.login-logo { text-align:center; margin-bottom:22px; }
.login-logo .b { font-weight:800; letter-spacing:.08em; font-size:28px; color:var(--navy); }
.login-logo .s { color:var(--muted); font-size:14px; margin-top:2px; }
.login-card form > div { margin-bottom:14px; }
.err { color:var(--red); font-size:13px; font-weight:600; }

/* jobs */
.seg { display:flex; background:#fff; border-radius:10px; border:1px solid var(--line); padding:3px; }
.seg a { flex:1; text-align:center; font-size:12.5px; font-weight:600; padding:8px 6px; border-radius:8px; color:var(--muted); }
.seg a.on { background:var(--blue-soft); color:var(--blue); }
.seg button { flex:1; border:0; background:none; cursor:pointer; text-align:center; font-size:12.5px; font-weight:600; padding:8px 14px; border-radius:8px; color:var(--muted); white-space:nowrap; }
.seg button.on { background:var(--blue-soft); color:var(--blue); }

/* route */
.route-desk { display:grid; grid-template-columns:1fr 380px; gap:16px; margin-top:14px; height:calc(100vh - 58px - 120px); min-height:480px; }
.map { width:100%; height:100%; border-radius:12px; border:1px solid var(--line); background:#eef0ea; }
.stops { overflow-y:auto; display:flex; flex-direction:column; gap:10px; }
.stop { padding:14px 16px; }
.stop { transition:border-color .2s, box-shadow .2s; }
.stop.selected { border-color:var(--blue); box-shadow:0 0 0 1px var(--blue); }
/* Laptop: the stop list scrolls and clips an outside ring unevenly, so the selected card gets a true 2px
   border instead (1px less padding keeps its size). */
@media (min-width: 900px) {
  .stop.selected { border-width:2px; box-shadow:none; padding:13px 15px; }
}
.stop-h { display:flex; gap:12px; align-items:center; }
.num { width:30px; height:30px; border-radius:50%; background:var(--blue); color:#fff; font-weight:800; display:flex; align-items:center; justify-content:center; flex:none; font-size:14px; }
.clock-log { padding:12px 16px; }
.clock-log-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--line); font-size:13.5px; }
.clock-log-dur { font-weight:700; font-variant-numeric:tabular-nums; }
.clock-log-end { display:flex; flex-direction:column; align-items:flex-end; gap:2px; flex:none; }
.linkbtn.clock-remove { color:var(--red); font-size:12px; padding:2px 0; }
.on-clock { padding:12px 16px; border-color:var(--green-muted-line); background:var(--green-muted); }
.on-clock-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding-top:8px; font-size:13.5px; }
.on-clock-row a { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.on-clock-row .js-timer { font-weight:700; font-variant-numeric:tabular-nums; color:var(--green); }
.on-clock-row .js-timer small, .stop-btns .js-timer small { font-size:inherit; }
.stop-btns .js-timer { font-variant-numeric:tabular-nums; }
.stop-btns { display:flex; gap:8px; margin-top:12px; }
.stop-btns > * { flex:1; }
.stop-btns form { display:flex; }
.stop-btns form .btn { flex:1; }
.num-marker span { display:flex; width:32px; height:32px; border-radius:50%; background:var(--blue); color:#fff; font-weight:800; font-size:14px; align-items:center; justify-content:center; border:3px solid #fff; box-shadow:0 2px 6px rgba(15,23,42,.35); font-family:Inter, sans-serif; }
.num.high, .num-marker.high span { background:var(--red); }
.num-marker.done span { width:26px; height:26px; background:#94a3b8; font-size:13px; border-width:2px; }
.pri-dot { display:inline-block; width:9px; height:9px; border-radius:50%; background:var(--red); margin-right:4px; vertical-align:0; }
.me-marker span { display:block; width:16px; height:16px; border-radius:50%; background:#2563eb; border:3px solid #fff; box-shadow:0 0 0 7px rgba(37,99,235,.22); }
@media (max-width: 899px) {
  .route-desk { display:block; height:100%; margin:0; min-height:0; }
  .route-desk .map { border-radius:0; border:0; }
  .stops { position:absolute; left:0; right:0; bottom:0; max-height:46%; background:#fff; border-radius:20px 20px 0 0; box-shadow:0 -6px 20px rgba(0,0,0,.1); padding:10px 14px 14px; z-index:1001; gap:8px; }
  .stops .grab { display:block; width:40px; height:5px; background:var(--input); border-radius:4px; margin:0 auto; }
  /* The handle: drag the sheet up over the map (list) or down (map); a tap steps between them. */
  .stops .grab-bar { display:block; flex:none; width:calc(100% + 28px); margin:-10px -14px -2px; padding:10px 0 10px; border:0; background:#fff; cursor:grab; touch-action:none;
                     position:sticky; top:-10px; z-index:3; }   /* stays at the top while the list scrolls under it */
  .stops.sheet-anim { transition:height .25s ease; }
  .stops.sheet-full { border-radius:0; }
  .stops .stop { border-radius:12px; padding:12px 14px; }
}

/* ticket */
.timer { text-align:center; padding:16px 0 10px; }
.timer .big { font-size:44px; font-weight:800; letter-spacing:-.02em; color:var(--navy); font-variant-numeric:tabular-nums; }
.timer .big small { font-size:20px; color:var(--muted); font-weight:700; }
.timer .big.range { font-size:28px; white-space:nowrap; padding:6px 0 4px; }
.task-row { display:flex; align-items:center; gap:6px; border-bottom:1px solid #f1f5f9; }
.task-row:last-of-type { border:0; }
.task { flex:1; display:flex; gap:12px; align-items:flex-start; padding:12px 0; font-size:14px; cursor:pointer; min-height:44px; }
.task-flag { width:30px; height:30px; border:1.5px solid #e2e8f0; border-radius:6px; background:none; color:#cbd5e1; font-size:15px; font-weight:800; line-height:1; cursor:pointer; flex:none; }
.task-flag:hover, .task-flag:focus-visible { color:var(--red); border-color:#fecaca; outline:none; }
.task-flag.on { background:var(--red); border-color:var(--red); color:#fff; }
@media (hover: none) { .task-flag { color:#94a3b8; } }
.task-del { width:30px; height:30px; border:0; border-radius:6px; background:none; color:#cbd5e1; font-size:18px; line-height:1; cursor:pointer; flex:none; }
.task-del:hover, .task-del:focus-visible { color:var(--red); background:var(--red-soft); outline:none; }
@media (hover: none) { .task-del { color:#94a3b8; } }
.task input { position:absolute; opacity:0; pointer-events:none; }
.box { width:22px; height:22px; border-radius:5px; border:2px solid var(--input); flex:none; display:flex; align-items:center; justify-content:center; color:#fff; font-size:13px; font-weight:800; }
.task input:checked + .box { background:var(--green); border-color:var(--green); }
.task input:checked + .box::after { content:"✓"; }
.task input:checked ~ .tt { color:var(--muted); text-decoration:line-through; }
.task input:focus-visible + .box { outline:2px solid #93c5fd; outline-offset:2px; }
.ticket-head { align-items:flex-end; margin-bottom:4px; }
.add-task { display:flex; gap:8px; margin-top:10px; }
.add-task .in { flex:1; }
.new-ticket { max-width:760px; }
.new-ticket textarea { resize:vertical; line-height:1.5; }
.nt-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr); gap:10px; }
@media (max-width: 899px) { .nt-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); } .nt-grid > :first-child { grid-column:span 2; } .ticket-head { margin-bottom:10px; flex-wrap:wrap; } .ticket-head > :first-child { flex-basis:100%; } .ticket-head > :nth-child(2) { margin-left:auto; } }
.ticket-grid { display:grid; grid-template-columns:380px 1fr; gap:16px; margin-top:14px; align-items:start; }
@media (max-width: 899px) {
  .ticket-grid { display:block; margin-top:0; }
  .clock-card { position:sticky; top:-12px; z-index:5; box-shadow:0 6px 14px rgba(15,23,42,.06); }
}

/* builder */
.builder { display:grid; grid-template-columns:1fr 470px; gap:20px; margin-top:14px; align-items:start; }
.timegrid { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1.2fr) minmax(0,.8fr) minmax(0,.8fr) minmax(0,.9fr); gap:10px; }
.chips { display:flex; flex-wrap:wrap; gap:7px; }
.chip { position:relative; font-size:12.5px; font-weight:600; padding:8px 11px; border-radius:7px; border:1px solid var(--input); background:#fff; color:#334155; cursor:pointer; user-select:none; }
.chip input { position:absolute; opacity:0; pointer-events:none; }
.chip:has(input:checked) { background:var(--blue); border-color:var(--blue); color:#fff; }
.mods { display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center; }
.chk { display:inline-flex; align-items:center; gap:7px; font-size:13.5px; font-weight:500; cursor:pointer; min-height:32px; }
.chk input { width:17px; height:17px; accent-color:var(--blue); }
.mod-text { display:flex; gap:8px; align-items:center; margin-top:8px; }
.mod-text .in { max-width:420px; }
.mod-lbl { font-size:13px; font-weight:600; min-width:72px; }
.mod-text .act-time { width:84px; flex:none; text-align:center; }
.mod-text .act-why { flex:1; max-width:none; }
@media (max-width: 899px) {
  .mod-text { flex-wrap:wrap; }
  .mod-text .act-why { flex-basis:100%; }
}
.wi { display:grid; grid-template-columns:160px 1fr 34px; gap:10px; margin-bottom:10px; align-items:start; }
.wi .letter { position:absolute; left:11px; top:10px; font-weight:700; color:var(--muted); font-size:13.5px; pointer-events:none; }
.wi .ta-wrap { position:relative; }
.ta { min-height:64px; line-height:1.45; font-size:13.5px; resize:vertical; padding-left:32px; display:block; }
.x { width:34px; height:40px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--muted); cursor:pointer; font-size:18px; line-height:1; }
.x:hover { color:var(--red); border-color:#fecaca; }
.phrase-wrap { position:relative; }
.linkbtn { background:none; border:0; font-weight:600; color:var(--blue); cursor:pointer; font-size:13px; text-transform:none; letter-spacing:0; padding:4px 0; }
.dd { position:absolute; right:0; top:28px; width:340px; max-width:calc(100vw - 28px); max-height:340px; overflow-y:auto; background:#fff; border:1px solid var(--input); border-radius:10px; box-shadow:0 12px 30px rgba(15,23,42,.18); padding:6px; z-index:50; text-transform:none; letter-spacing:0; }
.dd .h { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); padding:6px 10px; }
.dd button { display:block; width:100%; text-align:left; background:none; border:0; font-size:13px; font-weight:500; padding:8px 10px; border-radius:6px; cursor:pointer; color:var(--ink); white-space:pre-wrap; }
.dd button:hover, .dd button:focus { background:var(--blue-soft); color:var(--blue); outline:none; }
.preview { background:#0f1b31; color:#e2e8f0; border-radius:10px; padding:16px 18px; font-size:13px; line-height:1.6; min-height:90px; white-space:pre-wrap; word-break:break-word; }
.preview .k { color:#7dd3fc; font-weight:600; }
textarea.preview { width:100%; border:0; resize:vertical; min-height:180px; font:inherit; font-size:13px; outline:2px solid var(--amber); }
#checks:empty { display:none; }
.rule { display:flex; gap:9px; font-size:13px; padding:5px 0; color:#334155; }
.ok { color:var(--green); font-weight:800; }
.bad { color:var(--red); font-weight:800; }
.preview-card { padding:18px 20px; position:sticky; top:80px; }
@media (max-width: 1100px) { .builder { grid-template-columns:1fr; } .preview-card { position:static; } }
@media (max-width: 899px) {
  .timegrid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .timegrid .span2 { grid-column:span 2; }
  .wi { grid-template-columns:1fr 34px; }
  .wi .ta-wrap { grid-column:1 / span 2; }
  .builder { margin-top:0; gap:12px; }
  .save-bar { position:sticky; bottom:-20px; background:#fff; padding:10px 0 4px; }
}

/* dashboard */
.kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-top:16px; }
.kpi { padding:16px 18px; }
.kpi .v { font-size:30px; font-weight:800; margin-top:4px; color:var(--navy); }
.kpi .l { font-size:13px; color:var(--muted); font-weight:600; }
.two { display:grid; grid-template-columns:1.25fr 1fr; gap:16px; margin-top:16px; }
.ct { font-weight:800; font-size:15px; padding:16px 18px 10px; }
table.t { width:100%; border-collapse:collapse; font-size:13.5px; }
table.t th { text-align:left; font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; font-weight:700; padding:8px 18px; border-bottom:1px solid var(--line); }
table.t td { padding:11px 18px; border-bottom:1px solid #f1f5f9; }
table.t tr:last-child td { border-bottom:0; }
table.t a:hover { color:var(--blue); }
/* zebra rows: .zebra is striped by app.js (skips rows hidden by search); .stripes is plain CSS */
table.t.zebra tbody tr.alt td, table.t.stripes tbody tr:nth-child(even) td { background:var(--blue-faint); }
table.t.zebra tbody tr:hover td, table.t.stripes tbody tr:hover td { background:var(--blue-soft); }
.ticket-tools { display:flex; gap:10px; }
.new-ticket-btn { width:100%; margin-bottom:10px; }
@media (max-width: 899px) { .phone-only.new-ticket-btn, a.btn.phone-only { display:flex; } }
.table-scroll { overflow-y:auto; -webkit-overflow-scrolling:touch; }
.table-scroll.scrolling thead th { position:sticky; top:0; z-index:1; background:#fff; box-shadow:inset 0 -1px 0 var(--line); }
.ticket-tools input { flex:0 1 360px; min-width:0; }
.ticket-tools .day-filter { flex:none; }
.ticket-tools select { margin-left:auto; }
.ticket-tools select { width:auto; min-width:150px; }
@media (max-width: 899px) {
  .ticket-tools { flex-wrap:wrap; }
  .ticket-tools input { flex:1 1 0; }
  .ticket-tools select { min-width:0; flex:none; margin-left:0; }
  .ticket-tools .day-filter { order:3; flex:1 1 100%; }
  .in { font-size:16px; } /* 16px stops iPhone Safari zooming on focus */
}
.bar { height:10px; border-radius:6px; background:var(--blue); margin-top:5px; min-width:4px; }
@media (max-width: 899px) {
  .kpis { grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
  .kpi .v { font-size:24px; }
  .two { grid-template-columns:1fr; }
  table.t th, table.t td { padding:10px 12px; }
  /* Phone: the Tickets table fits the screen and never scrolls (or bounces) sideways. */
  .table-scroll { overflow-x:hidden; overscroll-behavior-x:none; touch-action:pan-y; }
  .tasks-under { margin-top:5px; }
}

/* report */
.filters { display:flex; gap:10px; align-items:end; margin-top:14px; flex-wrap:wrap; }
.filters .in { width:auto; font-size:13.5px; }
.block { margin-top:16px; }
.bh { display:flex; justify-content:space-between; align-items:center; padding:14px 20px; border-bottom:1px solid var(--slate-line); gap:10px; background:var(--slate-soft); }
.bh .pill { background:#fff; color:var(--navy); }
.bh-pills { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.bh .pill-gray { color:#64748b; }
table.t.green-head th, .table-scroll.scrolling table.t.green-head thead th { background:var(--green-muted); color:var(--navy); border-bottom-color:var(--green-muted-line); }
.bh .n { font-weight:800; font-size:16px; color:var(--navy); }
.rec { padding:12px 20px; border-bottom:1px solid #f1f5f9; font-size:13px; line-height:1.55; }
.rec:last-child { border:0; }
.rec .h { font-weight:700; color:var(--navy); }
.client-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight:700; letter-spacing:.03em; color:var(--navy); }
.ticket-ref { font-size:12px; font-weight:600; color:var(--blue); margin-left:4px; white-space:nowrap; }
.ticket-ref:hover { text-decoration:underline; }
.block { overflow:hidden; }
details.menu { position:relative; }
details.menu summary { list-style:none; }
details.menu summary::-webkit-details-marker { display:none; }
details.menu .dd { top:46px; width:200px; }
details.menu .dd a { display:block; font-size:13px; padding:9px 10px; border-radius:6px; }
details.menu .dd a:hover { background:var(--blue-soft); color:var(--blue); }
@media (max-width: 899px) {
  .rec, .bh { padding-left:14px; padding-right:14px; }
  /* Phone: two even rows, Client | Tech, then From | To. */
  .filters { display:grid; grid-template-columns:1fr 1fr; gap:10px 12px; }
  .filters > * { min-width:0; }
  .filters .in { width:100%; }
  .filters .f-client { order:1; } .filters .f-tech { order:2; } .filters .f-from { order:3; } .filters .f-to { order:4; }
}

/* client */
.client-grid { display:grid; grid-template-columns:360px 1fr; gap:16px; margin-top:14px; align-items:start; }
.small-map { height:220px; border-radius:10px; border:1px solid var(--line); margin-top:12px; }
.sec { padding:16px 18px; }
.sec + .sec { margin-top:14px; }
.sec h3 { font-size:15px; font-weight:800; margin-bottom:8px; }
.li { padding:10px 0; border-bottom:1px solid #f1f5f9; font-size:13.5px; }
.li:last-child { border:0; }
@media (max-width: 899px) { .client-grid { grid-template-columns:1fr; margin-top:0; } }

/* me / settings */
.me-list a, .me-list button { display:flex; justify-content:space-between; align-items:center; width:100%; padding:14px 16px; border-bottom:1px solid #f1f5f9; font-weight:600; background:none; border-left:0; border-right:0; border-top:0; cursor:pointer; text-align:left; font-size:14px; }
.me-list > :last-child { border-bottom:0; }
.tags { display:flex; flex-wrap:wrap; gap:6px; }

/* Hidden passwords */
.secret-chip { display:inline-flex; align-items:center; gap:2px; border:1px solid var(--slate-line); background:var(--slate-soft); color:var(--navy); border-radius:6px; padding:0 6px; font:inherit; font-size:.92em; line-height:1.5; cursor:pointer; vertical-align:baseline; }
.secret-chip.shown { background:var(--amber-soft); border-color:#f5d48a; }
.secret-strip { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.secret-strip .secret-chip { font-size:12.5px; padding:2px 8px; }
.pw-pop { margin:-2px 0 12px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:var(--blue-faint); display:flex; flex-direction:column; gap:8px; }
.pw-h { font-weight:700; font-size:13px; }
.pw-row { display:flex; gap:8px; }
.pw-row .in { flex:1; min-width:0; }
.pw-row .pw-eye { min-height:0; padding:6px 12px; font-size:12.5px; }
.pw-foot { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pw-foot .btn { min-height:36px; padding:6px 14px; font-size:13px; }
.pw-note { font-size:12px; }
#hide-btn { margin-right:14px; }
.modal-back { position:fixed; inset:0; background:rgba(15,23,42,.45); display:flex; align-items:center; justify-content:center; padding:16px; z-index:2000; }
.modal-back[hidden] { display:none; }
.modal { width:100%; max-width:360px; padding:18px; }
.modal-err { color:var(--red); font-size:12.5px; min-height:18px; margin-top:6px; }
.modal-btns { display:flex; gap:8px; justify-content:flex-end; margin-top:6px; }
@media (max-width: 899px) {
  .pw-foot .btn { flex:1; }
  .pw-foot > span { display:none; }
  .pw-foot #pw-old-btn { flex-basis:100%; text-align:left; }
}

/* Tech picker in the Tickets list: reads as plain text until hovered */
.tech-pick { appearance:none; -webkit-appearance:none; border:1px solid transparent; background:transparent; font:inherit; color:inherit; padding:3px 20px 3px 6px; margin:-4px 0 -4px -7px; border-radius:6px; cursor:pointer; max-width:100%;
  background-image:linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:calc(100% - 10px) 52%, calc(100% - 6px) 52%; background-size:4px 4px; background-repeat:no-repeat; background-color:transparent; }
.tech-pick:not(:hover):not(:focus) { background-image:none; }
.tech-pick:hover, .tech-pick:focus { border-color:var(--input); background-color:#fff; outline:none; }
.tech-tap { position:relative; display:table; }
.tech-tap .tech-pick { position:absolute; inset:0; width:100%; margin:0; padding:0; opacity:0; font-size:16px; }
.toast { position:fixed; left:50%; bottom:calc(24px + env(safe-area-inset-bottom)); transform:translate(-50%, 8px); background:var(--navy); color:#fff; font-size:13px; font-weight:600; padding:8px 14px; border-radius:999px; box-shadow:0 6px 18px rgba(15,23,42,.18); opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:2100; max-width:calc(100% - 32px); }
.toast.on { opacity:.94; transform:translate(-50%, 0); }
.toast.err { background:var(--red); }
@media (max-width: 899px) { .toast { bottom:calc(84px + env(safe-area-inset-bottom)); } }
.unassigned { color:var(--amber); font-style:italic; }
.take-form { display:inline-flex; align-items:baseline; }
.take-form .linkbtn { padding:0; }
.take-form { flex-wrap:wrap; column-gap:8px; row-gap:0; }
.take-form .linkbtn { white-space:nowrap; }
@media (max-width: 899px) { .phone-only.take-phone { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:6px 0 4px; } }
.take-phone .btn { min-height:38px; padding:6px 18px; font-size:14px; }
.stop-btns { position:relative; }
.clock-note { position:absolute; right:0; bottom:calc(100% + 8px); background:var(--navy); color:#fff; font-size:12.5px; font-weight:600; padding:6px 12px; border-radius:8px; box-shadow:0 4px 14px rgba(15,23,42,.2); white-space:nowrap; opacity:0; transform:translateY(4px); transition:opacity .25s, transform .25s; pointer-events:none; z-index:5; }
.clock-note::after { content:""; position:absolute; right:28px; top:100%; border:6px solid transparent; border-top-color:var(--navy); }
.clock-note.on { opacity:1; transform:none; }
/* Client labor history: one line per record, ticket number pinned right; tap the text to see it all */
.rec-line { display:flex; align-items:baseline; gap:12px; }
.rec-text { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; }
.rec-text.open { white-space:normal; }
.rec-line .ticket-ref { flex:none; margin-left:0; }
.client-grid > * { min-width:0; }
.clock-loc { font-size:12px; color:var(--muted); margin-top:2px; }
.clock-loc a { color:inherit; text-decoration:underline; text-decoration-color:var(--line); }
.clock-loc.far, .clock-loc.warn { color:var(--amber); font-weight:600; }
.clock-loc.synced { color:var(--navy); }
/* Clock taps saved on the phone with no signal, waiting to sync. */
.clock-pending { font-size:12px; font-weight:600; color:var(--amber); text-align:center; margin-top:4px; }
.net-bar { background:var(--amber-soft); color:var(--amber); border:1px solid #fcd34d; border-radius:10px; font-size:13px; font-weight:600; padding:8px 12px; margin-bottom:10px; }
.net-bar a { color:inherit; text-decoration:underline; }

/* Schedule: pick the day. ‹ and › step a day; the date box jumps to any day. */
.day-nav { display:flex; gap:6px; align-items:center; }
.day-nav .btn { padding:0 12px; height:40px; flex:none; }
.day-nav .day-step { font-size:20px; line-height:1; padding:0 13px; }
.day-pick { display:flex; flex:1; min-width:0; position:relative; }
.day-btn { width:190px; height:40px; display:flex; align-items:center; justify-content:space-between; gap:8px; cursor:pointer; font:inherit; font-size:14px; color:var(--ink); text-align:left; background:#fff; }
.day-btn span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.day-btn svg { flex:none; color:var(--muted); }
.stops > .day-nav .day-btn { width:100%; }
/* The month calendar; a blue dot under a day means that day has tickets. */
.day-cal { position:absolute; top:calc(100% + 6px); left:0; width:288px; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 12px 30px rgba(15,23,42,.2); padding:10px; z-index:1100; }
.cal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; font-size:14.5px; }
.cal-step { width:34px; height:34px; border:0; background:none; border-radius:8px; font-size:20px; line-height:1; cursor:pointer; color:var(--ink); }
.cal-step:hover { background:var(--blue-faint); }
.cal-grid { display:grid; grid-template-columns:repeat(7, 1fr); gap:2px; }
.cal-wd { font-size:11px; font-weight:700; color:var(--muted); text-align:center; padding:4px 0; }
.cal-day { display:flex; flex-direction:column; align-items:center; justify-content:center; height:38px; border-radius:8px; font-size:13.5px; color:var(--ink); text-decoration:none; font-variant-numeric:tabular-nums; }
.cal-day:hover { background:var(--blue-faint); }
.cal-day i { width:5px; height:5px; border-radius:50%; margin-top:2px; background:transparent; }
.cal-day.has i, .cal-dot { background:var(--blue); }
.cal-day.other { color:#94a3b8; }
.cal-day.today { color:var(--blue); font-weight:700; }
.cal-day.sel { background:var(--blue); color:#fff; font-weight:700; }
.cal-day.sel.has i { background:#fff; }
.cal-foot { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); margin-top:6px; padding-left:4px; }
.cal-dot { display:inline-block; width:6px; height:6px; border-radius:50%; }
@media (max-width: 899px) {
  .day-cal { position:fixed; top:50%; left:50%; transform:translate(-50%, -50%); width:min(320px, calc(100vw - 32px)); box-shadow:0 0 0 100vmax rgba(15,23,42,.35), 0 12px 30px rgba(15,23,42,.25); }
  .cal-day { height:42px; }
}
.route-closed { font-size:13.5px; padding:12px 16px 14px; }
.route-closed-row { display:block; padding-top:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.day-nav.phone-only { display:none; }
.route-tech.phone-only { display:none; }
@media (max-width: 899px) {
  .route-tech.phone-only { display:flex; align-items:center; gap:10px; flex:none; }
  .route-tech .field-lbl { margin:0; }
  .route-tech select { flex:1; min-width:0; height:40px; }
  .dash-more { margin-top:14px; }
}
@media (max-width: 899px) { .day-nav.phone-only { display:flex; } }
/* Admin Schedule map: where the tech tapped Clock In / Out. */
.tap-legend { font-size:12.5px; margin-top:2px; }
.tap-clock { display:inline-block; width:15px; height:15px; margin:0 3px 0 8px; vertical-align:-3px; border-radius:50%; }
.tap-in { color:#15803d; } .tap-out { color:#b91c1c; }
.tap-marker svg { display:block; width:24px; height:24px; filter:drop-shadow(0 1px 2px rgba(15,23,42,.45)); }
.tap-far svg, svg.tap-far { border-radius:50%; box-shadow:0 0 0 3px #f59e0b; }
.tap-far-text { color:#b45309; }
.leaflet-popup-content a { display:inline-block; margin-top:4px; }
.tap-legend svg.tap-far { margin-left:10px; margin-right:6px; }

/* Settings: lists the admin edits in place. Drag the dotted handle to reorder, Edit opens a small form under the row, × deletes. */
.sec-h { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.ed-count { font-size:12px; }
.ed-help { font-size:12.5px; margin:-4px 0 6px; }
.ed-note { margin:6px 0; font-size:13px; }
.ed-list { list-style:none; margin:0; padding:0; }
.ed-row { display:flex; align-items:center; flex-wrap:wrap; gap:6px 8px; padding:7px 0; border-top:1px solid var(--line); }
.ed-row:first-child { border-top:0; }
.ed-val { flex:1; min-width:0; font-size:13.5px; overflow-wrap:anywhere; }
.ed-text { font-size:13px; }
.ed-lock { font-size:11px; margin-left:6px; text-transform:uppercase; letter-spacing:.04em; }
.ed-tools { display:flex; align-items:center; gap:2px; flex:none; }
.ed-tools > form { display:inline; }
/* Delete sits before Edit; with an editor open it moves under Cancel. */
.ed-open-del { display:flex; justify-content:flex-end; }
.ed-row:has(details.ed[open]) .ed-tools > .del-form { display:none; }   /* the ▲▼× buttons only, not the Edit forms */
.icon-btn { border:0; background:none; width:28px; height:28px; border-radius:6px; cursor:pointer; color:var(--muted); font-size:12px; line-height:1; }
.icon-btn.del { color:#cbd5e1; display:inline-flex; align-items:center; justify-content:center; }   /* a light trash can */
.icon-btn:hover:not(:disabled) { background:var(--blue-faint); color:var(--ink); }
.icon-btn.del:hover { color:var(--red); background:var(--red-soft); }
.icon-btn:disabled { opacity:.25; cursor:default; }
.drag-handle { flex:none; display:flex; align-items:center; justify-content:center; width:22px; height:30px; margin-left:-6px;
               border:0; background:none; border-radius:6px; color:#cbd5e1; cursor:grab; touch-action:none; padding:0; }
.drag-handle svg { fill:currentColor; }
.drag-handle:hover, .drag-handle:focus-visible { color:var(--muted); background:var(--blue-faint); }
.sorting, .sorting * { cursor:grabbing !important; user-select:none; }
.ed-row.dragging { background:#fff; box-shadow:0 8px 22px rgba(15,23,42,.16); border-radius:10px; position:relative; z-index:2; }
.ed-row.dragging .drag-handle { color:var(--blue); }
details.ed > summary { list-style:none; cursor:pointer; padding:4px 6px; }
details.ed > summary::-webkit-details-marker { display:none; }
details.ed[open] > summary { color:var(--muted); text-align:right; }
details.ed .ed-close, details.ed[open] .ed-open { display:none; }
details.ed[open] .ed-close { display:inline; }
.ed-scroll { max-height:460px; overflow-y:auto; padding-right:4px; }
/* An open Edit spreads across the row, under the entry. */
.ed-row:has(details.ed[open]) { flex-wrap:wrap; }
.ed-row:has(details.ed[open]) .ed-tools { flex-wrap:wrap; flex-basis:100%; justify-content:flex-end; }
details.ed[open] { flex-basis:100%; order:5; }
.ed-tools details.ed[open] { position:relative; }
.ed-form { display:grid; gap:8px; padding:10px; margin:6px 0 2px; background:var(--blue-faint); border:1px solid var(--line); border-radius:10px; min-width:min(100%, 260px); }
.ed-form .btn { justify-self:start; }
.ed-add { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:8px; }
.ed-add .in { flex:1; min-width:160px; }
.ed-hint { font-size:12px; margin-top:4px; }
details.ed-new { margin-top:10px; }
details.ed-new > summary { display:inline-flex; }
.tpl-grid { display:grid; grid-template-columns:2fr 1.2fr 1fr; gap:8px; }
.tpl-items { display:grid; gap:6px; }
.tpl-item { display:grid; grid-template-columns:140px 1fr 28px; gap:6px; align-items:center; }
.user-grid { grid-template-columns:1fr 64px; }
.tpl-line { font-size:12.5px; overflow-wrap:anywhere; }
@media (max-width: 899px) {
  .tpl-grid { grid-template-columns:1fr 1fr; }
  .tpl-item { grid-template-columns:1fr 28px; }
  .tpl-item select { grid-column:1 / -1; }
}

/* Type-to-filter dropdown (select.js-combo) */
.combo { position:relative; }
.combo-in { padding-right:30px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E") no-repeat right 11px center; }
.combo-in:not(:placeholder-shown) { text-transform:uppercase; }
.combo-list { position:absolute; z-index:40; left:0; right:0; top:calc(100% + 4px); margin:0; padding:4px; list-style:none; background:#fff;
  border:1px solid var(--line); border-radius:10px; box-shadow:0 10px 28px rgba(15,23,42,.14); max-height:280px; overflow-y:auto; }
.combo-list li { padding:9px 12px; border-radius:7px; font-size:14px; cursor:pointer; user-select:none; }
.combo-list li b { font-weight:800; color:var(--blue); }
.combo-list li.on { background:var(--blue); color:#fff; }
.combo-list li.on b { color:#fff; text-decoration:underline; }
.combo-list .combo-none { color:var(--muted); cursor:default; }

/* Quick Ticket on the Schedule */
.quick { position:relative; }
.quick > summary { list-style:none; cursor:pointer; white-space:nowrap; }
.quick > summary::-webkit-details-marker { display:none; }
.quick-form { position:absolute; right:0; top:calc(100% + 8px); z-index:1200; width:340px; padding:16px; display:grid; gap:6px;
  box-shadow:0 14px 34px rgba(15,23,42,.18); text-align:left; }
.quick-form .field-lbl { margin-top:6px; }
.quick-h { display:grid; gap:2px; margin-bottom:4px; font-size:14px; }
.quick-h .muted { font-size:12.5px; }
.quick-note { font-size:12px; }
.quick-start { margin-top:10px; justify-self:end; min-width:110px; }
.quick-phone { margin:0 0 10px; }
.quick-phone > summary { width:100%; }
.quick-phone .quick-form { position:static; width:auto; margin-top:8px; box-shadow:none; }
.quick-clock { padding:14px 16px; margin-top:14px; display:grid; gap:12px; }
.quick-clock-h { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.quick-code { font-size:17px; color:var(--navy); margin-left:4px; }
.quick-timer { display:grid; justify-items:end; gap:4px; }
.quick-timer .big { font-size:26px; font-weight:800; color:var(--navy); font-variant-numeric:tabular-nums; }
.quick-timer .range { font-weight:700; color:var(--navy); }
.quick-clock-btns { display:flex; gap:8px; flex-wrap:wrap; }
.quick-clock-btns > form, .quick-clock-btns > .js-quick-start { flex:1 1 200px; display:flex; }
.quick-clock-btns > form > .btn, .quick-clock-btns > .js-quick-start { flex:1; }
.quick-discard { color:var(--muted); }
.quick-wait { font-size:12.5px; margin-top:8px; text-align:center; }

/* Booked for / Change date, Also open for, and the visit hint */
.book-card { margin-top:10px; padding:12px 16px; }
.book-change > summary { list-style:none; font-size:13px; white-space:nowrap; }
.book-change > summary::-webkit-details-marker { display:none; }
.book-form { margin-top:10px; }
.book-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.book-row .in { min-width:0; }
.book-row .btn { grid-column:1 / -1; grid-row:3; }
.book-row .vh-time-note { grid-column:2; grid-row:2; margin-top:-4px; }
.vh-time-note { font-size:11.5px; color:var(--blue); margin-top:4px; }
.visit-hint { position:relative; margin-top:10px; }
.vh-title { font-size:12.5px; color:var(--muted); margin-bottom:6px; }
.vh-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(148px, 1fr)); gap:6px; }
.vh-month { grid-column:1 / -1; font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-top:6px; }
.vh-month:first-child { margin-top:0; }
.vh-more { grid-column:1 / -1; justify-self:start; font-size:13px; padding:4px 0; }
.vh-day[hidden], .vh-month[hidden] { display:none; }
.vh-day { display:flex; flex-direction:column; align-items:flex-start; gap:1px; text-align:left; padding:7px 10px;
  border:1px solid var(--line); border-radius:8px; background:#fff; cursor:pointer; font:inherit; color:var(--ink); }
.vh-day:hover, .vh-day:focus-visible { border-color:#93b4ee; }
.vh-day.on { border-color:var(--blue); background:var(--blue-faint); }
.vh-date { font-weight:700; font-size:13px; }
.vh-who { font-size:11.5px; color:var(--muted); }
.vh-pop { position:absolute; z-index:60; width:min(340px, 100%); max-height:320px; overflow:auto; background:#fff;
  border:1px solid var(--line); border-radius:10px; box-shadow:0 12px 28px rgba(15,23,42,.16); padding:10px 12px; }
.vh-pop-h { font-weight:700; font-size:12.5px; color:var(--muted); margin-bottom:6px; }
.vh-t + .vh-t { border-top:1px solid var(--line); margin-top:8px; padding-top:8px; }
.vh-t-title { font-weight:700; font-size:13px; }
.vh-t-meta { font-size:12px; color:var(--muted); }
.vh-tasks { margin:4px 0 0; padding-left:17px; font-size:12.5px; }
.vh-tasks li.done { color:var(--muted); text-decoration:line-through; }
.vh-high { color:var(--red); font-weight:700; font-size:11.5px; }
.also-wrap { margin-top:12px; }
/* A folder tab on top of the card: the title and count, the same sand, overlapping the card's top border */
.also-tab { display:inline-flex; align-items:baseline; gap:10px; max-width:100%; padding:8px 16px 7px; background:#f7f0e2;
  border:1px solid #e5d8bd; border-bottom:0; border-radius:11px 11px 0 0; position:relative; top:1px; z-index:1; }
.also-title { font-weight:800; font-size:15px; color:var(--navy); }
.also-count { font-size:12px; font-weight:600; color:#6b5a3a; white-space:nowrap; }
.also-open { padding:10px 16px 12px; background:#f7f0e2; border-color:#e5d8bd; border-top-left-radius:0; }   /* warm sand */
.also-note { font-size:12.5px; margin:0 0 4px; }
.also-row { display:flex; gap:12px; align-items:flex-start; justify-content:space-between; padding:10px 0; border-top:1px solid #e5d8bd; }
.also-row:first-of-type { border-top:0; }
.also-main { min-width:0; font-size:13.5px; }
.also-main > a, .also-main > span { font-weight:600; }
.also-meta { font-size:12px; margin-top:2px; }
.also-high { color:var(--red); font-weight:600; }
.also-tasks > summary { font-size:12px; margin-top:4px; }
.also-tasks ul { margin:6px 0 0; padding-left:18px; font-size:12.5px; color:var(--ink); }
.also-tasks li.done { color:var(--muted); text-decoration:line-through; }
.also-side { flex:none; font-size:12px; }
.also-side .btn { min-height:34px; padding:6px 12px; font-size:13px; }
.later-open { display:block; font-size:12px; margin-top:6px; color:var(--blue); }
.also-more > summary { list-style:none; font-size:13px; padding:10px 0 2px; border-top:1px solid #e5d8bd; }
.also-more > summary::-webkit-details-marker { display:none; }
.also-more[open] > summary { display:none; }

/* Schedule stop: the ticket numbers read as links */
.stop-tickets { font-size:12.5px; margin-top:8px; line-height:1.6; display:grid; gap:2px; }
.stop-tickets a { color:inherit; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }   /* one ticket per line */
.stop-tickets .tk-num { color:var(--blue); text-decoration:underline; text-underline-offset:2px; font-size:14px; font-weight:600; }
.stop-tickets a:hover .tk-num { color:var(--navy); }

/* New Ticket: one box per task, with the ! flag */
.nt-tasks { display:grid; gap:6px; }
.nt-task { display:flex; gap:8px; align-items:center; }
.nt-task .in { flex:1; min-width:0; }
.nt-task .in.hi { border-color:#fecaca; background:#fff7f7; }
.nt-task .task-flag { width:36px; height:36px; }
.nt-note { font-size:12.5px; margin-top:6px; }

/* Ticket page: Close (with the no-labor question), Cancel ticket, and the cancelled note */
.head-btn { min-height:36px; padding:6px 12px; font-size:13px; }
.close-menu > summary { list-style:none; cursor:pointer; }
.close-menu > summary::-webkit-details-marker { display:none; }
details.menu .close-dd { width:260px; padding:12px; display:grid; gap:8px; }
.close-dd .close-q { font-size:13px; color:var(--ink); line-height:1.45; }
.close-dd .btn { width:100%; justify-content:center; text-align:center; }
.close-dd form { margin:0; }
.ticket-num { margin-left:6px; font-size:16px; font-weight:800; color:var(--navy); white-space:nowrap; }
.cancel-box { margin:-4px 0 10px; text-align:right; }
.cancel-box > summary { list-style:none; display:inline-block; margin-top:6px; font-size:12px; font-weight:400; color:#a3adbb; cursor:pointer; }
.cancel-box > summary::-webkit-details-marker { display:none; }
.cancel-box > summary:hover, .cancel-box[open] > summary { color:var(--muted); }
.cancel-form { text-align:left; margin-top:8px; padding:12px 14px; display:grid; gap:10px; }
.cancel-q { font-size:13px; color:var(--muted); line-height:1.5; }
.cancel-q b { color:var(--ink); }
.cancel-row { display:flex; gap:8px; flex-wrap:wrap; }
.cancel-row .in { flex:1 1 220px; min-width:0; }
.ticket-notice { margin-bottom:10px; }
.cancel-note { margin-bottom:10px; padding:10px 14px; border:1px solid var(--line); border-radius:10px; background:#f8fafc;
  color:var(--muted); font-size:13px; }
.show-cancelled { font-size:13px; white-space:nowrap; align-self:center; }
tr.is-cancelled td { color:var(--muted); }
tr.is-cancelled td a { color:var(--muted); text-decoration:line-through; }

/* Clients: add, remove, restore */
.cn-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
.cn-top { grid-template-columns:120px minmax(0,1fr); }
.cn-city { grid-template-columns:minmax(0,1fr) 70px 110px; margin-top:10px; }
.cn-code, .cn-state { text-transform:uppercase; }
.cn-map { height:260px; margin-top:4px; cursor:crosshair; }
.cn-status { font-size:12.5px; margin-top:6px; }
.cn-status.err { color:var(--red); }
.cn-actions { display:flex; gap:8px; margin-top:18px; }
.cn-actions .btn-primary { flex:1; }
@media (max-width:899px) { .cn-city { grid-template-columns:minmax(0,1fr) 64px 96px; } }
.removed-clients { margin-top:14px; }
.removed-clients > summary { list-style:none; font-size:13px; color:#a3adbb; font-weight:400; cursor:pointer; display:inline-block; }
.removed-clients > summary::-webkit-details-marker { display:none; }
.removed-clients[open] > summary { color:var(--muted); margin-bottom:8px; }
.removed-row { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.removed-row form .btn { min-height:34px; padding:5px 12px; font-size:13px; }
.client-removed { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.client-remove { margin-top:14px; }
.client-remove .cancel-form form .btn { width:auto; }
.removed-clients .card { padding:2px 16px; }
.removed-clients .removed-row:last-child { border:0; }
.client-remove .cancel-form { max-width:420px; margin-left:auto; }
.cp-row { width:100%; }
.cp-form .btn-primary { margin-top:10px; }

/* Settings tabs */
.settings-head { display:grid; gap:12px; justify-items:start; }
.settings-tabs { min-width:360px; }
.settings-tabs button { padding:9px 18px; font-size:13.5px; }
@media (max-width:899px) { .settings-head { justify-items:stretch; margin-bottom:12px; } .settings-tabs { min-width:0; } .settings-tabs button { padding:9px 6px; } }


/* Unfinished labor saved as a draft (ticket page) */
.draft-card { font-size:13px; }
.draft-card .draft-text { margin-top:8px; color:#334155; line-height:1.5; white-space:pre-wrap; }
.saved-draft-note { margin-top:12px; font-size:12.5px; }
