:root {
  --ink: #1E2A33;
  --ink-2: #3A4852;
  --steel: #5F6C77;
  --steel-2: #8C97A0;
  --line: #DDE2E6;
  --line-2: #E9ECEF;
  --mist: #EDF0F2;
  --panel: #FFFFFF;
  --sidebar: #E4E8EB;
  --brass: #A6772A;
  --brass-2: #C79A4B;
  --brass-soft: #F4EAD7;
  --brass-ink: #6B4C16;
  --blue: #2F6FDB;  --blue-soft: #E4EDFB;
  --amber: #B7791F; --amber-soft: #FBF0DC;
  --green: #2E7D57; --green-soft: #E1F1E8;
  --red: #C23B2A;   --red-soft: #FBE5E2;
  --violet: #6B55C9; --violet-soft: #ECE8FA;
  --fs-navy: #1B3A5C;
  --r-lg: 14px; --r-md: 10px; --r-sm: 7px;
  --shadow-float: 0 10px 30px rgba(30,42,51,.14), 0 1px 3px rgba(30,42,51,.10);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--mist); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.1; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.muted { color: var(--steel); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; background:
  radial-gradient(1200px 500px at 50% -10%, #fff 0%, transparent 60%), var(--mist); }
.login-inner { width: 100%; max-width: 880px; }
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.mark { width: 42px; height: 42px; border-radius: 11px; background: var(--ink); display: grid; place-items: center; flex: none; }
.mark svg { width: 26px; height: 26px; }
.brand-name { font: 700 19px/1.1 var(--font-display); letter-spacing: -0.02em; }
.brand-sub { color: var(--steel); font-size: 13px; }
.login h1 { font-size: clamp(30px, 5vw, 46px); max-width: 16ch; margin-bottom: 12px; }
.login .lede { color: var(--ink-2); font-size: 17px; max-width: 56ch; margin: 0 0 28px; }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.role-grid.four { grid-template-columns: repeat(4, 1fr); }
.login-inner { max-width: 980px; }
.role { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.role:hover { border-color: var(--brass-2); transform: translateY(-1px); }
.role .who { font-weight: 650; font-size: 16px; }
.role .what { color: var(--steel); font-size: 13.5px; }
.role .av { margin-bottom: 6px; }
.login-foot { margin-top: 22px; display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.flow-strip { margin: 34px 0 0; display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.flow-strip span { font-size: 13px; color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); padding: 6px 11px; border-radius: 999px; }
.flow-strip i { width: 18px; height: 2px; background: var(--brass); display: inline-block; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100dvh; background: linear-gradient(to right, var(--sidebar) 236px, transparent 236px); }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.sidebar .brand-row { margin: 2px 8px 16px; gap: 10px; }
.sidebar .mark { width: 32px; height: 32px; border-radius: 8px; }
.sidebar .mark svg { width: 20px; height: 20px; }
.sidebar .brand-name { font-size: 15px; }
.sidebar .brand-sub { font-size: 11.5px; }
.nav-sec { font-size: 11.5px; font-weight: 600; color: var(--steel); padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink); font-size: 14px; }
.nav a:hover { background: rgba(30,42,51,.06); }
.nav a.on { background: var(--panel); box-shadow: 0 1px 2px rgba(30,42,51,.08); font-weight: 600; }
.nav a.on svg { color: var(--brass); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 10px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.side-foot .who { font-size: 13px; font-weight: 600; line-height: 1.2; }
.side-foot .role-t { font-size: 12px; color: var(--steel); }
.side-foot button { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(237,240,242,.82); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.ws { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 5px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.ws .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.live { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--steel); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.page { padding: 22px 28px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 220px; }
.page-head p { margin: 6px 0 0; color: var(--steel); }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; margin-bottom: 8px; color: var(--blue); cursor: pointer; background: none; border: 0; padding: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: #F7F8F9; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #2B3944; }
.btn.brass { background: var(--brass); color: #fff; border-color: var(--brass); }
.btn.brass:hover { background: #946A24; }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(30,42,51,.06); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { min-height: 48px; padding: 0 20px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: rgba(30,42,51,.07); }

/* ---------- Pills, badges, avatars ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.pill.brass { background: var(--brass-soft); color: var(--brass-ink); }
.pill.ink { background: var(--ink); color: #fff; }
.badge { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.badge.quiet { background: rgba(30,42,51,.12); color: var(--ink-2); }
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; }
.av.lg { width: 42px; height: 42px; font-size: 15px; }
.src { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--steel); }
.src svg { width: 15px; height: 15px; }
.src.wa svg { color: #1FA855; }
.src.em svg { color: var(--blue); }

/* ---------- Surfaces ---------- */
.panel { background: var(--panel); border-radius: var(--r-lg); border: 1px solid var(--line); }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel-h h2, .panel-h h3 { flex: 1; }
.panel-b { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* KPI strip: one continuous instrument panel, not separate cards */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px; }
.kpi { padding: 14px 16px; border-right: 1px solid var(--line-2); cursor: pointer; }
.kpi:last-child { border-right: 0; }
.kpi:hover { background: #FAFBFB; }
.kpi .v { font: 700 28px/1.1 var(--font-display); letter-spacing: -0.02em; margin-top: 4px; }
.kpi .l { font-size: 12.5px; color: var(--steel); display: flex; align-items: center; gap: 6px; }
.kpi .l i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.kpi .s { font-size: 12px; color: var(--steel); margin-top: 2px; }

/* Alerts */
.alert { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); align-items: flex-start; cursor: pointer; }
.alert:last-child { border-bottom: 0; }
.alert:hover { background: #FAFBFB; }
.alert .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.alert .ic.red { background: var(--red-soft); color: var(--red); }
.alert .ic.amber { background: var(--amber-soft); color: var(--amber); }
.alert .ic.brass { background: var(--brass-soft); color: var(--brass-ink); }
.alert .ic.violet { background: var(--violet-soft); color: var(--violet); }
.alert b { font-weight: 650; }
.alert .t { font-size: 14px; }
.alert .d { font-size: 13px; color: var(--steel); }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.fbar { display: grid; grid-template-columns: 96px 1fr 44px; gap: 10px; align-items: center; font-size: 13.5px; }
.fbar .track { height: 22px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.fbar .fill { height: 100%; background: var(--ink-2); border-radius: 6px; }
.fbar:last-child .fill { background: var(--brass); }
.fbar .n { text-align: right; font-weight: 650; }

/* ---------- The unbroken line (signature element) ---------- */
.chain { display: grid; grid-template-columns: repeat(6, 1fr); position: relative; padding: 4px 0 0; }
.chain::before { content: ""; position: absolute; left: calc(100% / 12); right: calc(100% / 12); top: 17px; height: 3px; background: var(--line); border-radius: 2px; }
.chain .fillbar { position: absolute; left: calc(100% / 12); top: 17px; height: 3px; background: var(--brass); border-radius: 2px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.chain .node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; color: var(--steel); min-width: 0; background: none; border: 0; padding: 0; cursor: default; }
.chain .node.link { cursor: pointer; }
.chain .node .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line); display: grid; place-items: center; z-index: 1; }
.chain .node .dot svg { width: 15px; height: 15px; }
.chain .node.done .dot { background: var(--brass); border-color: var(--brass); color: #fff; }
.chain .node.current .dot { border-color: var(--brass); color: var(--brass); box-shadow: 0 0 0 4px var(--brass-soft); }
.chain .node .nm { font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.chain .node .sh { display: none; }
.chain .node .id { font-size: 11px; color: var(--steel); word-break: break-all; }
.chain .node.link:hover .id { color: var(--blue); }
/* compact chain for list rows */
.mini-chain { display: inline-flex; align-items: center; gap: 0; }
.mini-chain b { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; }
.mini-chain b.on { background: var(--brass); }
.mini-chain i { width: 8px; height: 2px; background: var(--line); display: block; }
.mini-chain i.on { background: var(--brass); }

/* ---------- Tables / lists ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; background: rgba(30,42,51,.07); border-radius: 9px; padding: 2px; gap: 2px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--panel); box-shadow: 0 1px 3px rgba(30,42,51,.12); color: var(--ink); }
.seg .c { font-size: 11.5px; color: var(--steel); font-weight: 600; }
.search { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; height: 36px; min-width: 220px; flex: 1; max-width: 340px; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; }
.search svg { color: var(--steel-2); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--steel); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FAFBFB; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: #FAFBFB; }
.table .r { text-align: right; }
.t-title { font-weight: 600; }
.t-sub { font-size: 12.5px; color: var(--steel); }
.urgent-flag { color: var(--red); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }

.cards { display: none; }
.card-row { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.card-row:last-child { border-bottom: 0; }
.card-row .body { flex: 1; min-width: 0; }
.card-row .top { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.card-row .ttl { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 5px; }

/* key-value */
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--steel); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.msg { background: var(--mist); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; white-space: pre-wrap; }
.msg.wa { background: #E7F7EC; border-top-left-radius: 4px; }
.media { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.media .m { width: 96px; height: 96px; border-radius: 10px; overflow: hidden; position: relative; background: #DCE2E6; border: 1px solid var(--line); cursor: zoom-in; padding: 0; }
.media .m img, .media .m svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.media .m .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.25); color: #fff; }
.media .m .cap { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); padding: 10px 6px 4px; text-align: left; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--steel); font-size: 12px; }

.triage { border: 1px dashed var(--brass-2); background: #FFFCF6; border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px; }
.triage-h { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 8px; color: var(--brass-ink); }
.triage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.triage-grid div span { display: block; font-size: 12px; color: var(--steel); }
.triage-grid div b { font-weight: 650; }

/* ---------- Region board ---------- */
.regions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.region { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; min-width: 0; }
.region.ready { border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }
.region-h { padding: 12px 14px 10px; border-bottom: 1px solid var(--line-2); }
.region-h .nm { font-weight: 650; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.region-h .st { font-size: 12px; color: var(--steel); margin-top: 2px; }
.meter { display: flex; gap: 3px; margin-top: 10px; }
.meter b { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.meter b.on { background: var(--ink-2); }
.region.ready .meter b.on { background: var(--brass); }
.meter-l { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; color: var(--steel); }
.region-b { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.jchip { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 13px; background: #FBFBFC; cursor: pointer; text-align: left; width: 100%; min-width: 0; display: block; overflow: hidden; }
.jchip:hover { border-color: var(--steel-2); }
.jchip .a { font-weight: 600; display: flex; min-width: 0; justify-content: space-between; gap: 6px; }
.jchip .b { display: block; color: var(--steel); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jchip.urgent { border-color: var(--red); background: #FFF8F7; }
.region-f { padding: 8px; border-top: 1px solid var(--line-2); }

/* Schedule */
.sched { display: grid; grid-template-columns: 150px repeat(3, minmax(0,1fr)); font-size: 13px; }
.sched > div { border-bottom: 1px solid var(--line-2); padding: 10px; min-width: 0; }
.sched .hd { font-weight: 600; color: var(--steel); font-size: 12px; background: #FAFBFB; }
.sched .tech { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.slot { border-radius: 8px; padding: 6px 8px; margin-bottom: 5px; background: var(--blue-soft); color: var(--ink); cursor: pointer; font-size: 12.5px; }
.slot.onsite { background: var(--amber-soft); }
.slot.over { background: var(--red-soft); }
.slot.done { background: var(--green-soft); }
.slot b { font-weight: 650; display: block; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); padding: 9px 11px; font-size: 15px; outline: none; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
textarea.input { min-height: 80px; resize: vertical; }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.qlines { width: 100%; border-collapse: collapse; font-size: 14px; }
.qlines th { text-align: left; font-size: 12px; color: var(--steel); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.qlines td { padding: 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.qlines input { width: 100%; border: 1px solid transparent; border-radius: 7px; padding: 6px 8px; background: transparent; }
.qlines input:hover { border-color: var(--line); }
.qlines input:focus { border-color: var(--blue); outline: 0; background: #fff; }
.qlines .r, .qlines .r input { text-align: right; }
.qtotal { display: flex; justify-content: flex-end; gap: 24px; padding: 12px 6px 0; font-size: 15px; }
.qtotal b { font: 700 22px/1 var(--font-display); }
.ai-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; background: var(--brass-soft); color: var(--brass-ink); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.stock-ok { color: var(--green); font-size: 12px; font-weight: 600; }
.stock-low { color: var(--red); font-size: 12px; font-weight: 600; }

/* ---------- Document (quotation / invoice / report) ---------- */
.doc-wrap { background: #D9DEE2; padding: 24px; border-radius: var(--r-lg); overflow-x: auto; }
.doc { background: #fff; width: 100%; max-width: 794px; margin: 0 auto; padding: 44px 48px; color: #1b1f23; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.12); min-width: 0; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 18px; border-bottom: 3px solid var(--doc-c, var(--fs-navy)); }
.doc-logo { display: flex; align-items: center; gap: 10px; }
.doc-logo .lm { width: 40px; height: 40px; border-radius: 8px; background: var(--doc-c, var(--fs-navy)); display: grid; place-items: center; }
.doc-logo .lm svg { width: 24px; height: 24px; }
.doc-logo .ln { font: 800 20px/1 var(--font-display); letter-spacing: 0.02em; color: var(--doc-c, var(--fs-navy)); }
.doc-logo .ls { font-size: 10.5px; color: #5b646c; margin-top: 3px; }
.doc-title { text-align: right; }
.doc-title .tt { font: 700 22px/1 var(--font-display); color: var(--doc-c, var(--fs-navy)); letter-spacing: 0.04em; }
.doc-title .no { margin-top: 6px; font-size: 12.5px; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 20px 0; }
.doc-parties .lbl { font-size: 10.5px; font-weight: 700; color: #6b747c; letter-spacing: 0.05em; margin-bottom: 4px; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th { background: #F1F3F5; text-align: left; font-size: 11px; padding: 8px; color: #3d454c; }
.doc td { padding: 8px; border-bottom: 1px solid #E6E9EC; }
.doc .r { text-align: right; }
.doc-total { display: flex; justify-content: flex-end; margin-top: 12px; }
.doc-total table { width: 260px; }
.doc-total td { border: 0; padding: 4px 8px; }
.doc-total tr.gt td { font-weight: 800; font-size: 15px; border-top: 2px solid var(--doc-c, var(--fs-navy)); padding-top: 8px; }
.doc-foot { margin-top: 28px; font-size: 11px; color: #5b646c; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.doc-sec { margin-top: 20px; }
.doc-sec h4 { font-size: 11px; letter-spacing: 0.05em; color: #6b747c; margin: 0 0 8px; }
.doc-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.doc-photos figure { margin: 0; }
.doc-photos .ph { aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #e5e8eb; }
.doc-photos .ph img, .doc-photos .ph svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-photos figcaption { font-size: 10px; color: #6b747c; margin-top: 3px; }
.doc-check { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 20px; }
.doc-check li { padding: 3px 0 3px 20px; position: relative; break-inside: avoid; }
.doc-check li::before { content: "✓"; position: absolute; left: 2px; color: #2E7D57; font-weight: 800; }
.doc-check li.no::before { content: "–"; color: #999; }
.sig-box { border: 1px solid #DDE1E5; border-radius: 6px; height: 90px; display: grid; place-items: center; background: #FCFCFD; }
.sig-box img, .sig-box svg { max-height: 80px; max-width: 100%; }
.ref-note { background: #F4F6F8; border-left: 3px solid var(--doc-c, var(--fs-navy)); padding: 8px 12px; margin: 12px 0; font-size: 12px; }
.placeholder-note { font-style: italic; color: #8a939b; }

/* ---------- Sheet / modal / toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20,28,34,.38); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .18s ease; }
.sheet { background: var(--panel); border-radius: 16px; width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; box-shadow: var(--shadow-float); animation: rise .24s cubic-bezier(.2,.8,.2,1); }
.sheet.wide { max-width: 860px; }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.sheet-h h2 { flex: 1; font-size: 17px; }
.sheet-b { padding: 18px; }
.sheet-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: var(--panel); }
.grabber { display: none; }
.lightbox { max-width: 720px; width: 100%; background: #111; border-radius: 14px; overflow: hidden; }
.lightbox img, .lightbox svg { width: 100%; display: block; max-height: 78dvh; object-fit: contain; }
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-float); display: flex; gap: 10px; align-items: center; animation: rise .25s cubic-bezier(.2,.8,.2,1); max-width: calc(100vw - 32px); }
.toast svg { color: var(--brass-2); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(166,119,42,.5); } 50% { box-shadow: 0 0 0 8px rgba(166,119,42,0); } }
.flash { animation: pulse 1.2s ease 2; }

/* ---------- Tab bar (mobile) ---------- */
.tabbar { display: none; }
.more-list a { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line-2); color: var(--ink); font-size: 16px; }
.more-list a:last-child { border-bottom: 0; }
.more-list a svg { color: var(--brass); }

/* ---------- Technician app (iOS-style) ---------- */
.tech-stage { min-height: 100dvh; display: grid; grid-template-columns: auto minmax(0, 420px); gap: 48px; justify-content: center; align-items: center; padding: 32px 24px; }
.phone { width: 390px; height: 800px; border-radius: 54px; background: #0f1418; padding: 12px; box-shadow: 0 30px 60px rgba(20,28,34,.25); position: relative; }
.phone-screen { width: 100%; height: 100%; border-radius: 43px; overflow: hidden; position: relative; background: #F2F2F7; }
.phone-island { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 118px; height: 33px; border-radius: 20px; background: #0f1418; z-index: 50; }
.tech-side h1 { font-size: 34px; margin-bottom: 12px; }
.tech-side p { color: var(--ink-2); font-size: 16px; }
.qr-box { display: flex; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin: 20px 0; }
.qr-box #qr { width: 112px; height: 112px; flex: none; }
.qr-box #qr img, .qr-box #qr canvas { width: 112px !important; height: 112px !important; }
.steps-l { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14.5px; }
.steps-l li { margin-bottom: 6px; }

.ios { height: 100%; display: flex; flex-direction: column; background: #F2F2F7; color: #000; font-size: 17px; position: relative; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", sans-serif; }
.ios-scroll { flex: 1; overflow-y: auto; padding: 54px 0 110px; -webkit-overflow-scrolling: touch; }
.ios.full .ios-scroll { padding-top: calc(env(safe-area-inset-top, 0px) + 14px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); }
.ios-nav { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 0; min-height: 36px; }
.ios-nav .back { font-size: 17px; margin: 0; color: #007AFF; gap: 2px; }
.ios-large { padding: 4px 16px 10px; }
.ios-large h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.ios-large .sub { color: #6c6c70; font-size: 15px; margin-top: 2px; }
.ios-sec { color: #6c6c70; font-size: 13px; padding: 18px 32px 6px; }
.ios-group { background: #fff; border-radius: 12px; margin: 0 16px; overflow: hidden; }
.ios-cell { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 44px; position: relative; background: #fff; width: 100%; border: 0; text-align: left; cursor: pointer; font-size: 17px; }
.ios-cell + .ios-cell::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: #C6C6C8; }
.ios-cell .grow { flex: 1; min-width: 0; }
.ios-cell .t { font-size: 17px; }
.ios-cell .s { font-size: 14px; color: #6c6c70; overflow: hidden; text-overflow: ellipsis; }
.ios-cell .chev { color: #C4C4C7; }
.ios-cell .val { color: #6c6c70; font-size: 16px; }
.ios-job { display: flex; gap: 12px; }
.ios-job .time { width: 52px; flex: none; font-weight: 600; font-size: 15px; }
.ios-job .time span { display: block; color: #6c6c70; font-weight: 400; font-size: 13px; }
.ios-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; width: 100%; border: 0; border-radius: 14px; font-size: 17px; font-weight: 600; cursor: pointer; background: #007AFF; color: #fff; }
.ios-btn.brass { background: var(--brass); }
.ios-btn.green { background: #34C759; }
.ios-btn.gray { background: #E5E5EA; color: #007AFF; }
.ios-btn[disabled] { opacity: .4; cursor: not-allowed; }
.ios-pad { padding: 0 16px; }
.ios-card { background: #fff; border-radius: 16px; margin: 0 16px; padding: 16px; }
.ios-steps { display: flex; gap: 4px; padding: 0 16px 6px; }
.ios-steps b { flex: 1; height: 4px; border-radius: 2px; background: #D1D1D6; }
.ios-steps b.on { background: var(--brass); }
.ios-steplbl { padding: 0 16px 8px; font-size: 13px; color: #6c6c70; }
.check-cell { cursor: pointer; }
.check-cell .box { width: 24px; height: 24px; border-radius: 50%; border: 1.8px solid #C4C4C7; display: grid; place-items: center; flex: none; }
.check-cell.on .box { background: #34C759; border-color: #34C759; color: #fff; }
.check-cell .box svg { width: 14px; height: 14px; stroke-width: 3; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px; }
.photo-grid .ph, .photo-grid label { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #fff; display: grid; place-items: center; }
.photo-grid .ph img, .photo-grid .ph svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid label { border: 1.5px dashed #AEAEB2; color: #007AFF; cursor: pointer; font-size: 13px; text-align: center; gap: 4px; align-content: center; background: #fff; }
.photo-grid label svg { width: 26px; height: 26px; margin: 0 auto; }
.photo-grid input { display: none; }
.stamp { position: relative; }
.stamp .ts { position: absolute; left: 4px; bottom: 4px; right: 4px; font-size: 9px; color: #fff; background: rgba(0,0,0,.45); border-radius: 4px; padding: 2px 4px; }
.sig-pad { background: #fff; border-radius: 14px; margin: 0 16px; position: relative; height: 200px; touch-action: none; }
.sig-pad canvas { width: 100%; height: 100%; display: block; border-radius: 14px; }
.sig-pad .line { position: absolute; left: 20px; right: 20px; bottom: 44px; border-bottom: 1px solid #C6C6C8; pointer-events: none; }
.sig-pad .x { position: absolute; left: 20px; bottom: 48px; color: #AEAEB2; font-size: 20px; pointer-events: none; }
.sig-pad .hint { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #AEAEB2; font-size: 13px; pointer-events: none; }
.timer { font: 600 44px/1 var(--font-display); letter-spacing: -0.02em; text-align: center; }
.timer-sub { text-align: center; color: #6c6c70; font-size: 14px; margin-top: 4px; }
.ios-tabbar { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 64px; border-radius: 32px; background: rgba(255,255,255,.72); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 6px 24px rgba(0,0,0,.12), inset 0 0 0 .5px rgba(255,255,255,.8); display: flex; justify-content: space-around; align-items: center; z-index: 40; }
.ios.full .ios-tabbar { position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); }
.ios-tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: #6c6c70; cursor: pointer; min-width: 64px; padding: 6px 0; position: relative; }
.ios-tabbar button svg { width: 24px; height: 24px; }
.ios-tabbar button.on { color: var(--brass); }
.ios-tabbar .badge { position: absolute; top: 0; right: 12px; }
.ios-banner { margin: 0 16px 12px; border-radius: 14px; padding: 12px 14px; background: #fff; display: flex; gap: 10px; align-items: center; font-size: 15px; }
.ios-banner.over { background: #FFEDEA; color: #9B2C1F; }
.ios-done { text-align: center; padding: 30px 24px; }
.ios-done .big { width: 76px; height: 76px; border-radius: 50%; background: #34C759; color: #fff; display: grid; place-items: center; margin: 0 auto 16px; }
.ios-done .big svg { width: 40px; height: 40px; stroke-width: 3; }
.ios-field { width: 100%; border: 0; font-size: 17px; padding: 12px 16px; background: #fff; outline: 0; }
.ios textarea.ios-field { min-height: 88px; resize: none; font-family: inherit; }
.stepper { display: inline-flex; align-items: center; background: #E5E5EA; border-radius: 9px; }
.stepper button { width: 36px; height: 30px; border: 0; background: none; font-size: 20px; cursor: pointer; color: #000; }
.stepper span { min-width: 22px; text-align: center; font-weight: 600; font-size: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .regions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(3) { border-right: 0; }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line-2); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .tech-stage { grid-template-columns: 1fr; justify-items: center; }
  .tech-side { order: -1; max-width: 520px; }
}
@media (max-width: 820px) {
  body { font-size: 15.5px; }
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { display: none; }
  .topbar { padding: 10px 16px; padding-top: calc(env(safe-area-inset-top, 0px) + 10px); }
  .topbar .live span { display: none; }
  .page { padding: 12px 16px 120px; }
  h1 { font-size: 28px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .regions { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-right: 1px solid var(--line-2) !important; border-bottom: 1px solid var(--line-2); }
  .kpi:nth-child(2n) { border-right: 0 !important; }
  .kpi:nth-last-child(-n+2) { border-bottom: 0; }
  .kpi .v { font-size: 24px; }
  .hide-m { display: none !important; }
  .table-wrap { display: none; }
  .cards { display: block; }
  .search { max-width: none; min-width: 0; width: 100%; flex-basis: 100%; }
  .fields2 { grid-template-columns: 1fr; }
  .triage-grid { grid-template-columns: 1fr 1fr; }
  .chain .node .id { display: none; }
  .chain .node .nm { font-size: 11px; }
  .chain .node .lg { display: none; }
  .qlines:not(.plain) thead { display: none; }
  .qlines:not(.plain) tr { display: grid; grid-template-columns: 64px 1fr 1fr 36px; align-items: center; border-bottom: 1px solid var(--line-2); padding: 4px 0; }
  .qlines:not(.plain) td { border: 0; padding: 2px 4px; }
  .qlines:not(.plain) td:nth-child(1) { grid-column: 1 / 4; grid-row: 1; }
  .qlines:not(.plain) td:nth-child(5) { grid-column: 4; grid-row: 1; }
  .qlines:not(.plain) td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .qlines:not(.plain) td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .qlines:not(.plain) td:nth-child(4) { grid-column: 3 / 5; grid-row: 2; font-weight: 600; }
  .qlines:not(.plain) input { border-color: var(--line); background: #fff; }
  .chain .node .sh { display: inline; }
  .sched { grid-template-columns: 110px repeat(3, minmax(140px, 1fr)); overflow-x: auto; }
  .sched-wrap { overflow-x: auto; }
  .role-grid { grid-template-columns: 1fr; }
  .doc-wrap { padding: 8px; margin: 0 -8px; }
  .doc { padding: 22px 18px; font-size: 12px; }
  .doc-parties { grid-template-columns: 1fr; gap: 12px; }
  .doc-photos { grid-template-columns: repeat(3, 1fr); }
  .doc-check { columns: 1; }
  .doc-foot { grid-template-columns: 1fr; }
  .doc-head { flex-direction: column; }
  .doc-title { text-align: left; }
  .scrim { padding: 0; align-items: end; }
  .sheet { border-radius: 16px 16px 0 0; max-height: 92dvh; max-width: none; animation: slideup .28s cubic-bezier(.2,.8,.2,1); }
  .sheet-f { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); }
  .grabber { display: block; width: 36px; height: 5px; border-radius: 3px; background: #C6C6C8; margin: 6px auto 0; }
  .tabbar { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); height: 62px; border-radius: 31px; z-index: 60; justify-content: space-around; align-items: center; background: rgba(255,255,255,.74); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 8px 28px rgba(30,42,51,.16), inset 0 0 0 .5px rgba(255,255,255,.9); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--steel); min-width: 56px; padding: 6px 0; position: relative; }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--brass); }
  .tabbar .badge { position: absolute; top: -1px; right: 6px; min-width: 17px; height: 17px; font-size: 10.5px; }
  .toast-wrap { bottom: calc(env(safe-area-inset-bottom, 0px) + 86px); }
  .tech-stage { padding: 0; display: block; }
  .page-head .row-gap { width: 100%; }
}

/* ---------- v2 additions ---------- */
.infogrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; background: var(--mist); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; }
.infogrid span { display: block; font-size: 12px; color: var(--steel); }
.infogrid b { font-weight: 600; }
.tdots { display: inline-flex; gap: 3px; vertical-align: middle; }
.tdots i { width: 10px; height: 10px; border-radius: 50%; display: block; box-shadow: 0 0 0 1.5px #fff; }
.hqbox { background: var(--mist); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; justify-content: center; padding: 8px 10px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 5px 0; cursor: pointer; }
.chk input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brass); }
.alert.sel { background: var(--brass-soft); }
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 0 18px 14px; }
.site { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.site-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pill svg { width: 13px; height: 13px; }

/* calendar */
.cal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-title { font-size: 20px; min-width: 170px; text-align: center; }
.tfilter { display: flex; gap: 6px; flex-wrap: wrap; }
.tf { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 11px 4px 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.tf i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.tf.off { opacity: .45; background: transparent; }
.tf.off i { background: var(--steel-2) !important; }
.cal { overflow: hidden; margin-bottom: 16px; }
.cal-hd { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #FAFBFB; }
.cal-hd div { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--steel); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cd { min-height: 128px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px 5px; cursor: pointer; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cd:nth-child(7n) { border-right: 0; }
.cd.wk { background: #F7F8F9; }
.cd.hol { background: #EAF2FE; }
.cd.out { opacity: .45; }
.cd.sel { box-shadow: inset 0 0 0 2px var(--brass); }
.cdh { display: flex; align-items: baseline; gap: 6px; padding: 0 3px; min-width: 0; }
.dn { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cd.today .dn { background: var(--brass); color: #fff; border-radius: 999px; padding: 1px 7px; }
.hn { font-size: 10.5px; color: var(--blue); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ev { position: relative; display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; text-align: left; border: 0; border-radius: 6px; padding: 3px 6px 3px 9px; font-size: 11.5px; line-height: 1.25; cursor: pointer; background: color-mix(in srgb, var(--tint) 16%, #fff); color: var(--ink); overflow: hidden; }
.ev:hover { background: color-mix(in srgb, var(--tint) 28%, #fff); }
.ev .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--bar); }
.ev .tm { font-weight: 700; flex: none; }
.ev .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ev .cm, .ev .okm { flex: none; margin-left: auto; display: grid; }
.ev .cm svg { width: 12px; height: 12px; color: var(--violet); }
.ev .okm svg { width: 12px; height: 12px; color: var(--green); stroke-width: 2.6; }
.ev.completed { opacity: .72; }
.more-ev { border: 0; background: none; color: var(--blue); font-size: 11.5px; font-weight: 600; text-align: left; padding: 1px 6px; cursor: pointer; }
.dots { display: none; }
.pop { position: fixed; z-index: 150; width: 290px; background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-float); font-size: 13px; pointer-events: none; }
.pop-t { font-weight: 700; margin-bottom: 4px; }
.pop-s { color: #C9D1D7; margin-bottom: 2px; }
.pop-team { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }
.pop-team span { display: inline-flex; align-items: center; gap: 5px; }
.pop-team i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.pop-c { margin-top: 8px; display: flex; gap: 6px; color: #E4DCFF; }
.pop-c svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.lockbar { display: flex; gap: 10px; align-items: flex-start; background: var(--amber-soft); color: #6B4A0E; border-radius: var(--r-md); padding: 12px 14px; margin-top: 14px; font-size: 14px; }
.edit-box { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-top: 14px; }
.tpick { display: grid; gap: 6px; }
.tp { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.tp > input { width: 16px; height: 16px; accent-color: var(--brass); }
.tp i { width: 12px; height: 12px; border-radius: 50%; display: block; flex: none; }
.tpn { flex: 1; font-size: 14px; font-weight: 600; display: flex; flex-direction: column; }
.tpn small { font-weight: 400; color: var(--steel); font-size: 12px; }
.tp .lead { font-size: 12.5px; color: var(--steel); display: inline-flex; align-items: center; gap: 4px; }
.tp .lead input { accent-color: var(--brass); }
.cmt { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 8px; }
.cmt.done { opacity: .7; }
.cmt-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 14px; flex-wrap: wrap; }
.cmt-h .av { width: 24px; height: 24px; font-size: 10px; }
.cmt-h .btn, .cmt-h .pill { margin-left: auto; }
.cmt-b { font-size: 14px; }

/* billing, claims */
.disc { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--steel); white-space: nowrap; }
.disc input { width: 56px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; font-size: 14px; text-align: right; }
.stamp-paid { display: inline-block; border: 2px solid var(--green); color: var(--green); font-weight: 800; letter-spacing: .06em; font-size: 12px; padding: 4px 10px; border-radius: 6px; transform: rotate(-2deg); margin-bottom: 14px; }
.selrow td { background: var(--brass-soft); }
.who-cell { display: inline-flex; align-items: center; gap: 8px; }
.who-cell b { font-weight: 600; }
.trip { padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.trip-h { display: flex; align-items: center; gap: 10px; }
.trip-h .r { text-align: right; }
.route { margin: 8px 0 0 40px; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); border-left: 2px solid var(--line); }
.route li { padding: 2px 0 2px 12px; position: relative; }
.route li::before { content: ""; position: absolute; left: -5px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.vthumb { position: relative; }
.vthumb span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; background: rgba(0,0,0,.25); }
.doc-photos video, .media .m video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.lightbox video { width: 100%; display: block; max-height: 78dvh; }
.pub { max-width: 860px; margin: 0 auto; padding: 16px; }
.pub-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; flex-wrap: wrap; }

/* technician app additions */
.ios-btn.sm { min-height: 42px; font-size: 15px; border-radius: 12px; gap: 6px; text-decoration: none; }
.ios-btn svg { width: 19px; height: 19px; }
a.ios-btn { text-decoration: none; }
.day-card { margin-bottom: 12px; }
.ios-search { width: 100%; border: 0; border-radius: 10px; background: #E3E3E8; padding: 9px 12px; font-size: 16px; outline: none; }
.vbtn { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed #AEAEB2; background: #fff; color: #007AFF; font-size: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.vbtn svg { width: 26px; height: 26px; }
.photo-grid .vph video { width: 100%; height: 100%; object-fit: cover; }
.rec-scrim { position: absolute; z-index: 80; padding: 0; background: #000; display: block; }
.ios.full .rec-scrim, body > .rec-scrim { position: fixed; }
.rec { position: absolute; inset: 0; display: flex; flex-direction: column; }
.rec video { flex: 1; width: 100%; object-fit: cover; min-height: 0; background: #000; }
.rec-hint { position: absolute; top: 56px; left: 0; right: 0; text-align: center; color: #fff; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.rec-bar { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px calc(env(safe-area-inset-bottom, 0px) + 26px); background: #000; color: #fff; }
.rec-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; display: grid; place-items: center; cursor: pointer; }
.rec-btn { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: transparent; display: grid; place-items: center; cursor: pointer; }
.rec-btn span { width: 58px; height: 58px; border-radius: 50%; background: #FF3B30; transition: all .2s; }
.rec.on .rec-btn span, .on .rec-btn span { width: 28px; height: 28px; border-radius: 6px; opacity: .5; }
.rec-btn.ready span { opacity: 1 !important; }
.rec-t { width: 90px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

@media (max-width: 1180px) { .role-grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .role-grid.four { grid-template-columns: 1fr; }
  .cal-top { display: grid; grid-template-columns: minmax(0, 1fr); }
  .page { min-width: 0; }
  .cal-top .row-gap { justify-content: space-between; flex-wrap: nowrap; }
  .cal-title { font-size: 18px; min-width: 0; flex: 1; }
  .tfilter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .cd { min-height: 58px; padding: 4px 2px; align-items: center; }
  .cdh { justify-content: center; padding: 0; }
  .hn, .evs { display: none; }
  .dots { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; max-width: 34px; }
  .dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
  .dots b { font-size: 9px; line-height: 6px; color: var(--steel); }
  .cal-hd div { padding: 6px 2px; text-align: center; font-size: 11px; }
  .doc-sign { grid-template-columns: 1fr; }
  .sites { padding: 0 12px 12px; }
}

@keyframes slideup { from { transform: translateY(100%); } }
@media (max-width: 440px) {
  .ws .wsn { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .tabbar, .no-print, .page-head, .toast-wrap { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .doc-wrap { background: none; padding: 0; }
  .doc { box-shadow: none; padding: 0; max-width: none; }
}
