/* ==========================================================================
   Rotas · Delta Fibra — visual
   Organização: 1 cores · 2 base · 3 estrutura · 4 componentes · 5 rotas e mapa
                6 técnicos · 7 revisão · 8 diversos · 9 telas pequenas
   ========================================================================== */

/* 1 · Cores (claro e escuro) ------------------------------------------------ */
:root {
  --font: "Urbanist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --green: #0b8f4c; --green-dark: #08683a; --green-soft: #e3f4ea;
  --ink: #101614; --muted: #56625c; --faint: #7a8580;
  --bg: #f4f7f5; --surface: #ffffff; --surface-2: #f7faf8;
  --line: #e2e8e4; --line-2: #cfd8d2;
  --red: #c8372d; --red-soft: #fbe8e6; --amber: #a3640a; --amber-soft: #fdf1dc; --blue: #2f6fd6; --blue-soft: #e6eefb;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px #10161408, 0 8px 24px -14px #1016142e;
  --shadow-pop: 0 20px 50px -20px #10161466, 0 2px 8px #10161414;
  --map-filter: grayscale(.75) saturate(.75) brightness(1.06) contrast(.94);
  --solid: #101614; --solid-ink: #ffffff; --solid-line: #101614;
  --sidebar: 236px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --green: #2fbf74; --green-dark: #5fd896; --green-soft: #173527;
  --ink: #e9efeb; --muted: #a9b5ae; --faint: #86928b;
  --bg: #0e1311; --surface: #161d1a; --surface-2: #1b2420;
  --line: #26302b; --line-2: #34403a;
  --red: #f0806f; --red-soft: #3a1f1b; --amber: #e9b45a; --amber-soft: #3a2e17; --blue: #7aa7f0; --blue-soft: #1c2a40;
  --shadow: 0 1px 2px #0006, 0 10px 28px -16px #000c;
  --shadow-pop: 0 20px 50px -20px #000d, 0 0 0 1px #ffffff12;
  --map-filter: grayscale(.9) invert(.92) hue-rotate(180deg) brightness(.95) contrast(.88);
  --solid: #222c27; --solid-ink: #eef3f0; --solid-line: #34403a;
  color-scheme: dark;
}

:root[data-theme="dark"] .card, :root[data-theme="dark"] .kpi, :root[data-theme="dark"] .route-card, :root[data-theme="dark"] .tech-card { box-shadow: none; }
:root[data-theme="dark"] .step--go { background: linear-gradient(180deg, #17301f, var(--surface) 80%); border-color: #234a33; }
:root[data-theme="dark"] .btn--primary { color: #06140c; }
:root[data-theme="dark"] .btn--primary:hover:not(:disabled) { background: #45cf86; }
:root[data-theme="dark"] .step__n, :root[data-theme="dark"] .pick:has(input:checked) .avatar, :root[data-theme="dark"] .tech-card.is-on .avatar { color: #06140c; }
:root[data-theme="dark"] .toggle-chip:has(input:checked) { color: #06140c; }
:root[data-theme="dark"] .map-side, :root[data-theme="dark"] .map-badge, :root[data-theme="dark"] .map-legend { background: #161d1aee; border: 1px solid var(--line); backdrop-filter: blur(6px); }
:root[data-theme="dark"] .car-pin__name { background: #222c27; color: #eef3f0; }
:root[data-theme="dark"] .apply-change-row.is-warn { background: #241f14; }
:root[data-theme="dark"] .apply-change-row.is-bad, :root[data-theme="dark"] .apply-change-row.is-blocked { background: #2a1917; }
:root[data-theme="dark"] .apply-note { background: #1f2824; }
:root[data-theme="dark"] .apply-note--day { background: var(--blue-soft); }
:root[data-theme="dark"] .apply-note--shift { background: var(--amber-soft); }
:root[data-theme="dark"] .apply-read-btn { color: #1a1205; }
:root[data-theme="dark"] input[type=date] { color-scheme: dark; }

/* 2 · Base ------------------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; }
body { font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: var(--green-dark); }
code { font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow-wrap: anywhere; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
[hidden], .hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.hint { font-size: 14px; color: var(--muted); }
h1 { font-size: clamp(26px, 2.4vw, 34px); font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 22px; font-weight: 700; }

/* Abertura com a logo animada */
.splash { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; background: var(--bg); transition: opacity .5s ease, visibility .5s; }
.splash.is-done { opacity: 0; visibility: hidden; }
/* Logo animada (1,6 s): a fibra surge e os fios se desenham, depois pontos, disco, D, letras e o slogan. */
.splash__logo { width: min(560px, 82vw); height: auto; }
.splash__logo :is(#fiber, #disc, #letter-d, #dots circle, #tips circle, #wordmark path) { transform-box: fill-box; transform-origin: center; }
.splash__logo #fiber { animation: p2m-surge 520ms cubic-bezier(.34, 1.56, .64, 1) both; }
.splash__logo #strands path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: p2m-draw 480ms cubic-bezier(.22, .61, .36, 1) both; }
.splash__logo #strands path:nth-child(1) { animation-delay: 260ms; } .splash__logo #strands path:nth-child(2) { animation-delay: 300ms; } .splash__logo #strands path:nth-child(3) { animation-delay: 340ms; }
.splash__logo #strands path:nth-child(4) { animation-delay: 380ms; } .splash__logo #strands path:nth-child(5) { animation-delay: 420ms; } .splash__logo #strands path:nth-child(6) { animation-delay: 460ms; }
.splash__logo #strands path:nth-child(7) { animation-delay: 500ms; } .splash__logo #strands path:nth-child(8) { animation-delay: 540ms; } .splash__logo #strands path:nth-child(9) { animation-delay: 580ms; }
.splash__logo #tips circle { animation: p2m-pop 300ms cubic-bezier(.34, 1.56, .64, 1) both; }
.splash__logo #tips circle:nth-child(1) { animation-delay: 700ms; } .splash__logo #tips circle:nth-child(2) { animation-delay: 740ms; } .splash__logo #tips circle:nth-child(3) { animation-delay: 780ms; }
.splash__logo #tips circle:nth-child(4) { animation-delay: 820ms; } .splash__logo #tips circle:nth-child(5) { animation-delay: 860ms; } .splash__logo #tips circle:nth-child(6) { animation-delay: 900ms; }
.splash__logo #tips circle:nth-child(7) { animation-delay: 940ms; } .splash__logo #tips circle:nth-child(8) { animation-delay: 980ms; } .splash__logo #tips circle:nth-child(9) { animation-delay: 1020ms; }
.splash__logo #dots circle { animation: p2m-pop 420ms cubic-bezier(.34, 1.56, .64, 1) both; }
.splash__logo #dot-3 { animation-delay: 420ms; } .splash__logo #dot-1 { animation-delay: 500ms; } .splash__logo #dot-5 { animation-delay: 580ms; } .splash__logo #dot-2 { animation-delay: 640ms; } .splash__logo #dot-4 { animation-delay: 720ms; }
.splash__logo #disc { animation: p2m-disc 620ms cubic-bezier(.34, 1.4, .64, 1) 520ms both; }
.splash__logo #letter-d { animation: p2m-rise 520ms cubic-bezier(.22, 1, .36, 1) 740ms both; }
.splash__logo #letter-e { animation: p2m-rise 420ms cubic-bezier(.22, 1, .36, 1) 880ms both; }
.splash__logo #letter-l { animation: p2m-rise 420ms cubic-bezier(.22, 1, .36, 1) 950ms both; }
.splash__logo #letter-t { animation: p2m-rise 420ms cubic-bezier(.22, 1, .36, 1) 1020ms both; }
.splash__logo #letter-a { animation: p2m-rise 420ms cubic-bezier(.22, 1, .36, 1) 1090ms both; }
.splash__logo #tagline { clip-path: inset(0 100% 0 0); animation: p2m-wipe 460ms cubic-bezier(.22, .61, .36, 1) 1140ms both; }
:root[data-theme="dark"] .splash__logo :is(#wordmark, #tagline) path { fill: #ffffff; }
@keyframes p2m-surge { 0% { opacity: 0; transform: scale(.2); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
@keyframes p2m-draw { 0% { stroke-dashoffset: 1; opacity: 0; } 15% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes p2m-pop { 0% { opacity: 0; transform: scale(0); } 100% { opacity: 1; transform: scale(1); } }
@keyframes p2m-disc { 0% { opacity: 0; transform: scale(.55); } 100% { opacity: 1; transform: scale(1); } }
@keyframes p2m-rise { 0% { opacity: 0; transform: translateY(18px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes p2m-wipe { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 0 0 0); } }
@keyframes logo-in { from { opacity: 0; transform: scale(.86) translateY(8px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* 3 · Estrutura: menu lateral e páginas ------------------------------------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 1200; display: flex; flex-direction: column; gap: 4px; padding: 22px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar__logo { display: block; padding: 4px 8px 22px; }
.sidebar__logo img { width: 100%; max-width: 180px; display: block; animation: logo-in .9s .2s cubic-bezier(.2, .8, .2, 1) both; transition: transform .3s; }
.sidebar__logo:hover img { transform: scale(1.03); }
:root[data-theme="dark"] .sidebar__logo img { content: url("logo-delta-escura.png"); }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 16px; font-weight: 600; color: var(--muted); text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--green-soft); color: var(--green-dark); }
.sidebar__bottom { margin-top: auto; display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.sidebar__tool { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--muted); text-align: left; }
.sidebar__tool:hover { background: var(--surface-2); color: var(--ink); }
.status { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
.status__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.status__dot.is-on { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

.app { margin-left: var(--sidebar); padding: 28px clamp(16px, 2.4vw, 36px) 64px; max-width: calc(1500px + var(--sidebar)); }
.page { display: none; }
.page.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin-top: 6px; color: var(--muted); max-width: 680px; }

/* 4 · Componentes ------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card--flush { padding: 0; overflow: hidden; }
.card__title { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 650; font-size: 15px; background: var(--surface); border: 1px solid var(--line-2); white-space: nowrap; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--dark { background: var(--solid); color: var(--solid-ink); border-color: var(--solid-line); }
.btn--primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn--primary:hover:not(:disabled) { background: var(--green-dark); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--red); }
.btn--sm { height: 36px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
.btn--lg { height: 52px; font-size: 16px; }
.btn--wide { width: 100%; }
.button { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 650; border: 1px solid var(--line-2); background: var(--surface); }
.button-quiet { color: var(--muted); }
.link-btn { font-size: 14px; font-weight: 650; color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.icon-btn--sm { width: 32px; height: 32px; }
.pill-btn, .selected { border-radius: 999px; }
.pill-btn { height: 30px; padding: 0 12px; font-size: 13px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.pill-btn.is-on, .pill-btn.selected { background: var(--solid); color: var(--solid-ink); border-color: var(--solid-line); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 650; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.chip:empty { display: none; }
.chip--info { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.count { font-weight: 700; color: var(--green-dark); }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; height: 38px; border-radius: 10px; font-size: 14px; font-weight: 650; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.seg button:hover { color: var(--ink); border-color: var(--line-2); }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 650; color: var(--muted); }
.field input, .field select, .inline-controls select, select { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 550; }
.field input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.field--grow { flex: 1 1 260px; }
.field--inline { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 14px 0 4px; }
.form-row .field { flex: 1 1 220px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.form-actions .hint { margin-right: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.grid-2 .full { grid-column: 1 / -1; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); flex: 1 1 280px; max-width: 460px; }
.search input { border: 0; outline: 0; background: none; width: 100%; color: var(--ink); }
.more { margin-top: 22px; padding: 0; }
.more summary { display: flex; align-items: center; gap: 12px; padding: 18px 20px; cursor: pointer; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary > span { flex: 1; display: grid; }
.more summary small { font-size: 14px; color: var(--muted); }
.more__chev { transition: transform .25s; }
.more[open] .more__chev { transform: rotate(180deg); }
.more__body { padding: 0 20px 20px; }
.more--plain { margin-top: 18px; border-top: 1px solid var(--line); }
.more--plain summary { padding: 16px 0; }
.more--plain .more__body { padding: 0 0 6px; }
.empty-line { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 15px; }
.empty-shift { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 14px; }
.avatar, .tech-avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 750; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.avatar--lg { width: 44px; height: 44px; font-size: 14px; }
.tag { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); margin-right: 8px; }
.tag--urgent, .tag--bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.tag--warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 3000; max-width: min(560px, calc(100vw - 32px)); padding: 13px 18px; border-radius: 14px; background: var(--solid); color: var(--solid-ink); border: 1px solid var(--solid-line); font-size: 15px; font-weight: 600; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 5 · Rotas do dia e mapa ---------------------------------------------------- */
.date-nav { display: flex; align-items: center; gap: 8px; }
.date-nav__label { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; min-width: 190px; justify-content: space-between; cursor: pointer; }
.date-nav__label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.planner { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.steps { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.step { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.card.step + .card.step { margin-top: 0; }
.step__head { display: flex; gap: 12px; align-items: flex-start; }
.step__head b { display: block; font-size: 18px; }
.step__head small { display: block; font-size: 14px; color: var(--muted); }
.step__n { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-weight: 750; }
.step--team { flex: 1 1 0; min-height: 220px; }
.step--go { background: linear-gradient(180deg, var(--green-soft), var(--surface) 75%); }
.step__foot { display: flex; justify-content: space-between; gap: 10px; }
.pick-list { flex: 1 1 0; min-height: 80px; overflow: auto; display: grid; align-content: start; gap: 6px; padding: 2px; }
.pick { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick__name { font-size: 14px; font-weight: 650; line-height: 1.25; }
.pick:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.pick:has(input:checked) .avatar { background: var(--green); color: #fff; border-color: var(--green); }
.pick:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.planner__main { display: grid; gap: 12px; min-width: 0; align-content: start; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kpi span { font-size: 14px; font-weight: 650; color: var(--muted); }
.kpi b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.kpi--alert b { color: var(--red); }
.kpi--warn b { color: var(--amber); }
.map-card { position: relative; }
.map { width: 100%; height: clamp(420px, calc(100vh - 250px), 760px); background: #e8eeea; z-index: 0; }
.map--small { height: 300px; border-radius: var(--radius-sm); overflow: hidden; margin: 12px 0 4px; }
.leaflet-container { font-family: var(--font); }
.leaflet-tile-pane { filter: var(--map-filter); }
:root[data-theme="dark"] .map { background: #1b2420; }
.map-card .leaflet-top.leaflet-left { top: 58px; }
.map-card .leaflet-bar { border: 0; box-shadow: var(--shadow); border-radius: 10px; overflow: hidden; }
.map-top { position: absolute; top: 14px; left: 14px; right: 300px; z-index: 500; }
.map-badge { display: inline-flex; padding: 8px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); font-size: 14px; font-weight: 750; }
.map-side { position: absolute; top: 14px; right: 14px; z-index: 500; width: 270px; max-height: calc(100% - 28px); display: flex; flex-direction: column; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-pop); overflow: hidden; }
.map-side__head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.map-side__head strong { flex: 1; }
.map-tech-list { overflow: auto; padding: 8px; display: grid; gap: 4px; }
.map-list-empty { padding: 10px 6px; font-size: 14px; color: var(--muted); }
.map-tech-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; }
.map-tech-chip:hover { background: var(--surface-2); }
.map-tech-chip.selected { background: color-mix(in srgb, var(--route-color) 14%, transparent); box-shadow: inset 0 0 0 2px var(--route-color); }
.map-tech-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--route-color); flex: none; }
.map-tech-copy { display: grid; min-width: 0; }
.map-tech-copy strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-tech-copy small { font-size: 12px; color: var(--muted); }
.map-legend { position: absolute; left: 14px; bottom: 14px; z-index: 500; max-width: calc(100% - 310px); display: flex; gap: 14px; align-items: center; padding: 8px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; }
.map-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #2f80ed; margin-right: 6px; box-shadow: 0 0 0 2px #fff; }
.dot--base { background: #101614; }
.dot--urgent { background: #e5484d; }

/* pins do mapa */
.custom-div-icon { background: none; border: 0; }
.pin { position: relative; width: 34px; height: 44px; filter: drop-shadow(0 5px 7px #10161440); }
.pin__head { position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pin, #2f80ed); border: 3px solid #fff; }
.pin__label { position: absolute; left: 0; top: 0; width: 34px; height: 34px; display: grid; place-items: center; color: #fff; font: 750 12.5px/1 var(--font); letter-spacing: -.02em; }
.pin--office { width: 46px; height: 76px; }
.pin--office .pin__head { width: 46px; height: 46px; background: var(--green); }
.pin--office .pin__label { width: 46px; height: 46px; }
.pin--office .pin__label svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pin__tag { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); padding: 2px 8px; border-radius: 6px; background: var(--green); color: #fff; font: 750 11px/1.4 var(--font); letter-spacing: .06em; }
/* paradas da rota: bolinha numerada; manhã cheia, tarde vazada */
.stop-pin { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--pin); color: #fff; border: 2.5px solid #fff; box-shadow: 0 2px 6px #10161455; font: 800 13px/1 var(--font); letter-spacing: -.02em; transition: transform .15s; }
.stop-pin--pm { background: #fff; color: var(--pin); border: 3px solid var(--pin); }
.stop-pin.is-urgent { box-shadow: 0 0 0 3px #e5484d, 0 2px 8px #e5484d88; }
.leaflet-marker-icon:hover .stop-pin { transform: scale(1.15); }
.loose-pin { width: 16px; height: 16px; border-radius: 50%; background: #8b98a3; border: 2.5px solid #fff; box-shadow: 0 1px 4px #10161444; }
.loose-pin.is-urgent { width: 22px; height: 22px; display: grid; place-items: center; background: #e5484d; color: #fff; font: 800 12px/1 var(--font); }
.legend-stop { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: 6px; border-radius: 50%; background: #2f80ed; color: #fff; border: 2px solid #2f80ed; font: 800 10px/1 var(--font); font-style: normal; vertical-align: -3px; }
.legend-stop--pm { background: #fff; color: #2f80ed; }
.dot--loose { background: #8b98a3; }
.shift-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 10px 10px 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.shift-switch button { height: 30px; padding: 0 8px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); }
.shift-switch button:hover { color: var(--ink); }
.shift-switch button.is-on { background: var(--green); color: #fff; }
:root[data-theme="dark"] .shift-switch button.is-on { color: #06140c; }
.route-grid[data-shift="morning"] .route-shift[data-shift="afternoon"], .route-grid[data-shift="afternoon"] .route-shift[data-shift="morning"] { display: none; }
.car-pin { position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.car-pin__dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--car, #101614); border: 3px solid #fff; box-shadow: 0 6px 14px #10161455; }
.car-pin__dot svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.car-pin__name { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); padding: 1px 7px; border-radius: 6px; background: #fff; color: #101614; font: 750 11px/1.5 var(--font); white-space: nowrap; box-shadow: 0 2px 6px #10161433; }
.car-pin.is-stale { opacity: .5; }
.route-tooltip { padding: 8px 12px; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); font-family: var(--font); font-size: 13px; }
.route-tooltip::before { display: none; }
.route-tooltip b { display: block; font-size: 14px; }
.tt-chip { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; background: color-mix(in srgb, var(--route-color, #2f80ed) 18%, transparent); color: var(--route-color, #2f80ed); }
.tt-chip.urgent { background: #e5484d22; color: #c7363b; }

/* resultado por técnico */
.results { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.route-card { position: relative; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.route-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--route-color, var(--green)); }
.route-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.route-card-head .tech-avatar { width: 40px; height: 40px; background: var(--route-color, var(--ink)); color: #fff; border: 0; }
.route-title { flex: 1; min-width: 0; display: grid; }
.route-title strong { font-size: 17px; }
.route-title small { display: none; }
.route-total { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.route-shift { padding-top: 10px; margin-top: 10px; border-top: 1px dashed var(--line); }
.shift-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 13px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.shift-actions { display: flex; gap: 8px; text-transform: none; letter-spacing: 0; }
.stop-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.stop-num { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 750; background: var(--route-color, var(--ink)); color: #fff; }
.stop-num.is-urgent { background: #e5484d; }
.stop-info { flex: 1; min-width: 0; display: grid; gap: 1px; }
.stop-info strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-info small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-client { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-reason { color: var(--red); font-weight: 600; white-space: normal; }
.unassigned-card .stop-info small { white-space: normal; }
.stop-badge { font-size: 12px; font-weight: 750; padding: 3px 8px; border-radius: 999px; background: var(--red-soft); color: var(--red); }
.stop-badge--lock { background: var(--blue-soft); color: var(--blue); }
.stop-sheet { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.stop-sheet:hover { background: var(--blue); color: #fff; }
.apply-sheet { color: var(--blue); }
.stop-copy, .stop-remove { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; transition: background .15s, color .15s; }
.stop-copy { background: var(--green-soft); color: var(--green-dark); }
.stop-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stop-copy:hover { background: var(--green); color: #fff; }
.stop-copy.is-copied { background: var(--green); color: #fff; }
.stop-remove { font-size: 18px; color: var(--faint); background: var(--surface-2); }
.stop-remove:hover { background: var(--red-soft); color: var(--red); }
.kind-pill { display: inline-flex; align-items: center; gap: 4px; margin: 3px 4px 0 0; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: normal; justify-self: start; }
.kind-pill svg.i.sm { width: 13px; height: 13px; }
.time-pill { background: var(--green-soft); color: var(--green-dark); border-color: transparent; }
.time-pill.needs-review { background: var(--amber-soft); color: var(--amber); }
.shift-pill { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.conflict-pill { background: var(--red-soft); color: var(--red); border-color: transparent; }
.sector-pill { background: var(--surface-2); }
.loc-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.loc-pill.is-approx { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.loc-pill.is-missing { background: var(--red-soft); color: var(--red); border-color: transparent; }
.loc-fix { font-size: 13px; font-weight: 700; color: var(--green-dark); text-decoration: underline; }
.route-copy-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 14px; }
.route-copy { height: 44px; white-space: normal; line-height: 1.15; padding: 0 12px; }
.route-copy--link { background: var(--green-soft); color: var(--green-dark); border-color: transparent; }
.route-copy.is-copied { background: var(--green); color: #fff; border-color: var(--green); }
.metric-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red); font-weight: 800; }
.unassigned-card { --route-color: #e5484d; }
.removed-card { --route-color: #8b98a3; }
.removed-card .metric-icon { background: var(--surface-2); color: var(--muted); }
.removed-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.removed-actions .link-btn { font-size: 13px; }
.empty-state { grid-column: 1 / -1; display: grid; place-items: center; gap: 8px; text-align: center; padding: 40px 20px; border-radius: var(--radius); border: 1.5px dashed var(--line-2); color: var(--muted); }
.empty-state strong { font-size: 18px; color: var(--ink); }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--green-soft); color: var(--green-dark); }
.send-bar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 14px 14px 14px 22px; border-radius: 18px; background: var(--solid); color: var(--solid-ink); border: 1px solid var(--solid-line); box-shadow: var(--shadow-pop); }
.send-bar b { display: block; font-size: 17px; }
.send-bar span { font-size: 14px; opacity: .8; }

/* tabela de OS */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { position: sticky; top: 0; text-align: left; padding: 12px 14px; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.order-id { display: block; font-weight: 750; }
.order-client { display: block; font-size: 13px; font-weight: 650; }
.order-subject { display: block; font-size: 13px; color: var(--muted); }
.location-name { max-width: 340px; font-size: 13px; color: var(--muted); }
.order-time { white-space: nowrap; }
.suggested-assignee { font-weight: 650; }
.priority-pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.priority-pill.urgent { background: var(--red-soft); color: var(--red); }
.empty-cell { text-align: center; padding: 22px; color: var(--muted); }
.route-disclaimer { margin-top: 10px; font-size: 13px; }

/* 6 · Técnicos --------------------------------------------------------------- */
.tech-list { display: grid; gap: 10px; }
.tech-card { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: border-color .2s; }
.tech-card.is-on { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.tech-card__head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.tech-card.is-on .avatar { background: var(--green); color: #fff; border-color: var(--green); }
.tech-card__title { flex: 1; min-width: 0; display: grid; text-align: left; }
.tech-card__title strong { font-size: 16px; }
.tech-card__title small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tech-card__body { display: none; padding: 4px 16px 18px 74px; border-top: 1px solid var(--line); }
.tech-card.is-open .tech-card__body { display: grid; gap: 4px; }
.form-line { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.form-line:last-child { border-bottom: 0; }
.form-line__label { font-size: 14px; font-weight: 700; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle-chip { position: relative; display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; font-weight: 650; cursor: pointer; transition: background .15s, border-color .15s; }
.toggle-chip input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-chip:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; }
.toggle-chip:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.inline-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.inline-controls select { height: 38px; }
.phone { display: grid; gap: 4px; font-size: 14px; }
.phone-status { color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 650; color: var(--muted); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .2s; }
.switch:has(input:checked) .switch__track { background: var(--green); }
.switch:has(input:checked) .switch__track::after { transform: translateX(18px); }
.switch:has(input:checked) { color: var(--green-dark); }
.switch:has(input:focus-visible) .switch__track { outline: 2px solid var(--green); outline-offset: 2px; }
.account-list { display: grid; gap: 8px; margin-top: 8px; }
.account-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.account-row.is-off { opacity: .6; }
.account-row__who { flex: 1; min-width: 180px; display: grid; }
.account-row__who small { font-size: 13px; color: var(--muted); }
.account-row .row-actions { margin-top: 0; }
.tracking-warning { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--amber); font-size: 14px; font-weight: 600; }
.hidden-techs { margin-top: 6px; }
.hidden-tech { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.hidden-tech:last-child { border-bottom: 0; }
.hidden-tech b { flex: 1; font-size: 14px; }
.howto { display: grid; gap: 10px; padding-left: 22px; font-size: 15px; }
.howto li::marker { font-weight: 800; color: var(--green-dark); }

/* regras e configurações */
.rule-list { display: grid; gap: 8px; margin-top: 12px; }
.subject-rule-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
.subject-rule-row > span:first-child { flex: 1; display: grid; }
.subject-rule-row small { font-size: 13px; color: var(--muted); }
.subject-rule-tech { padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--green-soft); color: var(--green-dark); }
.settings .card + .card { margin-top: 16px; }
.settings + .card { margin-top: 16px; }
.system-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 8px; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.help-grid .card + .card { margin-top: 0; }
.help-list, .legend-list { display: grid; gap: 10px; padding-left: 18px; font-size: 15px; }
.legend-list { list-style: none; padding: 0; }
.faq { display: grid; gap: 6px; font-size: 15px; }
.faq dt { font-weight: 700; margin-top: 8px; }
.faq dd { color: var(--muted); }

/* 7 · Revisão antes de enviar (janelas) ------------------------------------- */
dialog { border: 0; padding: 0; background: none; color: inherit; max-width: none; max-height: none; }
dialog::backdrop { background: #0b100e80; backdrop-filter: blur(3px); }
.sheet { margin: auto; width: min(960px, calc(100vw - 32px)); height: min(880px, calc(100vh - 32px)); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-pop); overflow: hidden; }
.sheet[open] { animation: fade .3s ease; }
.sheet form { display: flex; flex-direction: column; height: 100%; padding: 24px 26px 0; overflow: auto; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet__head .hint { margin-top: 4px; font-size: 15px; }
.sheet__foot { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: auto; padding: 14px 0 20px; background: var(--surface); border-top: 1px solid var(--line); }
.sheet__foot .hint { flex: 1 1 100%; }
.sheet__foot .btn { height: 48px; padding: 0 22px; }
.review-list { display: grid; gap: 10px; align-content: start; padding-bottom: 12px; }
.apply-summary { position: sticky; top: -24px; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 16px; border-radius: 12px; background: var(--solid); color: var(--solid-ink); box-shadow: 0 0 0 1px var(--solid-line); font-size: 14px; }
.apply-summary b { font-size: 17px; }
.apply-summary .is-warn b { color: #f5c76b; }
.apply-summary .is-bad b { color: #f59a86; }
.apply-change-row { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.apply-change-row:has(.apply-check) { cursor: default; }
.apply-check { display: grid; place-items: center; width: 34px; height: 34px; margin: -5px 0 0 -7px; border-radius: 8px; cursor: pointer; }
.apply-check:hover { background: var(--surface-2); }
.apply-change-row input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--green); cursor: pointer; }
.apply-change-row.is-go { box-shadow: inset 4px 0 0 var(--green); }
.apply-change-row.is-ok { opacity: .65; }
.apply-change-row.is-warn { background: color-mix(in srgb, var(--amber-soft) 70%, var(--surface)); box-shadow: inset 4px 0 0 var(--amber); }
.apply-change-row.is-bad, .apply-change-row.is-blocked { background: color-mix(in srgb, var(--red-soft) 70%, var(--surface)); box-shadow: inset 4px 0 0 var(--red); }
#agenda-audit-dialog .apply-change-row { grid-template-columns: 0 1fr; cursor: default; }
.apply-change-main { display: grid; gap: 4px; min-width: 0; }
.apply-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.apply-row-top strong { font-size: 17px; }
.apply-status { margin-left: auto; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.apply-status.is-go { background: var(--green-soft); color: var(--green-dark); }
.apply-status.is-ok { background: var(--surface-2); color: var(--muted); }
.apply-status.is-warn { background: var(--amber-soft); color: var(--amber); }
.apply-status.is-bad { background: var(--red-soft); color: var(--red); }
.apply-subject { font-size: 15px; font-weight: 650; }
.apply-client { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; }
.apply-meta { font-size: 14px; color: var(--muted); }
.apply-change-current { font-size: 13px; color: var(--faint); }
.apply-remove { margin-left: 4px; font-size: 13px; font-weight: 700; color: var(--red); text-decoration: underline; }
.apply-note { display: grid; gap: 3px; margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.apply-note b { display: inline-flex; align-items: center; gap: 6px; }
.apply-note--time { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.apply-note--bad { color: var(--red); font-weight: 600; }
.apply-note--shift { background: var(--amber-soft); color: var(--amber); }
.apply-note--day { display: block; background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.apply-note--link select { margin-top: 6px; width: 100%; }
.apply-quote { display: block; margin-top: 3px; color: var(--ink); }
.apply-quote em { font-style: normal; font-weight: 700; color: var(--muted); }
.apply-quote.is-used { padding-left: 8px; border-left: 3px solid var(--amber); font-weight: 600; }
.apply-quote.is-old { opacity: .6; }
.apply-read-btn { justify-self: start; margin-top: 8px; height: 40px; padding: 0 16px; border-radius: 10px; background: var(--amber); color: #fff; font-weight: 700; }
.apply-read-done { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--green-dark); }
.apply-time-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--amber); }
.apply-field { display: inline-flex; align-items: center; gap: 6px; }
.apply-time-edit input, .apply-time-edit select { height: 38px; }
.apply-time-edit input { padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }
.apply-empty { padding: 24px; text-align: center; color: var(--muted); }

/* 8 · Aviso de técnico perto (rastreamento) --------------------------------- */
.live-alerts { position: fixed; right: 20px; bottom: 84px; z-index: 1900; max-width: min(440px, calc(100vw - 32px)); }
.live-alert { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 16px 18px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-pop), inset 0 0 0 2px var(--green); animation: fade .3s ease; }
.live-alert__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); }
.live-alert__body { display: grid; gap: 3px; min-width: 0; }
.live-alert__body b { font-size: 16px; }
.live-alert__body span { font-size: 14px; }
.live-alert__body small { font-size: 13px; color: var(--muted); }
.live-alert__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Ficha da OS */
#sheet-dialog .sheet__inner { height: 100%; overflow: auto; padding: 24px 26px; }
#sheet-dialog .sheet__head .row-actions { margin-top: 0; flex-wrap: nowrap; }
.sheet-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sheet-badge { padding: 5px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 750; background: var(--surface-2); color: var(--muted); }
.sheet-badge.is-ok { background: var(--green-soft); color: var(--green-dark); }
.sheet-badge.is-warn { background: var(--amber-soft); color: var(--amber); }
.sheet-badge.is-bad { background: var(--red-soft); color: var(--red); }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.sheet-grid--tight { gap: 2px 22px; margin-bottom: 8px; }
.sheet-grid section, .sheet-os { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
.sheet-os { margin-top: 14px; }
.sheet-grid h3, .sheet-os h3 { font-size: 15px; margin-bottom: 8px; }
.sheet-row { display: flex; gap: 10px; padding: 3px 0; font-size: 14px; }
.sheet-row span { min-width: 120px; color: var(--muted); }
.sheet-row b { font-weight: 650; overflow-wrap: anywhere; }
.sheet-history { margin-top: 8px; background: var(--surface); }
.sheet-history td, .sheet-history th { font-size: 13px; }
@media (max-width: 760px) { .sheet-grid { grid-template-columns: 1fr; } #sheet-dialog .sheet__head { flex-wrap: wrap; } }

/* Alerta de OS pendentes (Rotas do dia) */
.pending-alert { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); }
.pending-alert__icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: #fff; }
.pending-alert > span:nth-child(2) { flex: 1; display: grid; font-size: 14px; color: var(--ink); }
.pending-alert b { font-size: 16px; color: var(--amber); }

/* Quadro de OS em tela cheia: mapa à esquerda, colunas por técnico à direita */
body.board-open { overflow: hidden; }
.board { position: fixed; inset: 0; z-index: 2500; display: flex; flex-direction: column; background: var(--bg); }
.board__head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.board__title { font-size: 19px; margin-right: 6px; }
.board__summary { flex: 1; min-width: 160px; }
.board__body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(320px, 38%) 1fr; }
.board__map { height: 100%; min-height: 300px; z-index: 0; }
.board__columns { display: flex; gap: 12px; padding: 14px; overflow-x: auto; overflow-y: hidden; align-items: stretch; }
.board-col { flex: 0 0 290px; display: flex; flex-direction: column; min-height: 0; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); transition: border-color .15s, background .15s; }
.board-col.is-over { border-color: var(--route-color); background: color-mix(in srgb, var(--route-color) 10%, var(--surface-2)); }
.board-col__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.board-col__head b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-col__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--route-color); flex: none; }
.board-col__list { flex: 1; overflow-y: auto; padding: 10px; display: grid; align-content: start; gap: 8px; }
.board-drop { flex: 0 0 240px; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; padding: 20px; border-radius: var(--radius); border: 2px dashed var(--green); background: var(--green-soft); color: var(--green-dark); font-size: 14px; animation: fade .2s ease; }
.board-drop svg.i { width: 28px; height: 28px; }
.board-drop span { font-size: 13px; opacity: .8; }
.board-drop.is-over { background: var(--green); color: #fff; border-style: solid; }
.board-col__empty { padding: 18px 8px; text-align: center; font-size: 13px; color: var(--faint); border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); }
.board-card { display: grid; gap: 3px; padding: 11px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--route-color); cursor: grab; font-size: 13px; transition: box-shadow .15s, transform .15s; }
.board-card:hover { transform: translateY(-1px); box-shadow: inset 4px 0 0 var(--route-color), var(--shadow); }
.board-card.is-dragging { opacity: .45; }
.board-card.is-flash { box-shadow: inset 4px 0 0 var(--route-color), 0 0 0 3px var(--green); }
.board-card.is-pending { background: color-mix(in srgb, var(--amber-soft) 60%, var(--surface)); }
.board-card.is-moved { border-style: dashed; border-color: var(--green); }
.board-card.is-f { opacity: .6; cursor: default; }
.board-card strong { font-size: 14px; }
.board-card small { color: var(--muted); }
.board-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.board-card__subject { color: var(--muted); font-weight: 600; }
.board-card__actions { display: flex; gap: 6px; margin-top: 6px; }
.board-card__actions .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }
.board-status { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 750; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.board-status.is-ag { background: var(--blue-soft); color: var(--blue); }
.board-status.is-ex, .board-status.is-ds { background: var(--green-soft); color: var(--green-dark); }
.board-status.is-an { background: var(--amber-soft); color: var(--amber); }
.board-status.is-f { background: var(--surface-2); color: var(--faint); }
.board-flag { font-size: 12px; font-weight: 700; color: var(--amber); }
.board-flag--moved { color: var(--green-dark); }
.board-flag .link-btn { font-size: 12px; margin-left: 4px; }
.board-pin { width: 20px; height: 20px; border-radius: 50%; background: var(--pin); border: 3px solid #fff; box-shadow: 0 1px 5px #10161455; }
.board-pin.is-f { opacity: .45; }
.board-pin.is-pending { box-shadow: 0 0 0 3px #e5a500, 0 1px 6px #10161455; }
.sheet--small { width: min(520px, calc(100vw - 32px)); height: fit-content; max-height: calc(100vh - 32px); }
.sheet--small form { height: auto; gap: 14px; padding-bottom: 0; overflow-x: hidden; }
.sheet--small .field { min-width: 0; }
.sheet--small select, .sheet--small input, .sheet--small textarea { width: 100%; min-width: 0; }
.sheet--small .sheet__foot { margin-top: 4px; }
.sheet--small textarea { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); resize: vertical; font-size: 15px; font-weight: 500; }
@media (max-width: 900px) {
  .board__body { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .board-col { flex-basis: 260px; }
}

/* Modo apresentação: faixa fixa no topo e switch em Configurações */
.demo-banner { position: fixed; top: 0; left: var(--sidebar); right: 0; z-index: 1500; display: flex; align-items: center; gap: 12px; padding: 9px 20px; background: #f5c542; color: #2b2100; font-size: 14px; box-shadow: 0 2px 10px #0002; }
.demo-banner b { text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.demo-banner span { flex: 1; min-width: 0; }
.demo-banner .btn { background: #2b2100; color: #f5c542; border-color: #2b2100; }
body.is-demo .app { padding-top: 76px; }
.demo-setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

/* 9 · Telas menores ---------------------------------------------------------- */
@media (max-width: 1180px) {
  .planner { grid-template-columns: 1fr; }
  .steps { display: grid; }
  .step--team { min-height: 0; }
  .pick-list { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); max-height: 260px; flex: none; }
  .help-grid, .system-actions { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar { inset: auto 0 0 0; width: auto; height: 68px; flex-direction: row; align-items: center; justify-content: space-around; padding: 6px; border-right: 0; border-top: 1px solid var(--line); }
  .sidebar__logo, .sidebar__bottom { display: none; }
  .nav-item { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; justify-content: center; text-align: center; }
  .app { padding-bottom: 100px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .map-side { position: static; width: auto; max-height: 260px; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }
  .map-legend { position: static; max-width: none; border-radius: 0; box-shadow: none; flex-wrap: wrap; white-space: normal; }
  .grid-2 { grid-template-columns: 1fr; }
  .tech-card__body { padding-left: 16px; }
  .form-line { grid-template-columns: 1fr; gap: 6px; }
  .switch__text { display: none; }
  .demo-banner { left: 0; flex-wrap: wrap; padding: 8px 16px; }
  .demo-banner span { flex-basis: 100%; order: 3; font-size: 13px; }
  .toast { bottom: 84px; }
  .live-alerts { right: 16px; bottom: 150px; }
}
@media (max-width: 640px) {
  .route-grid { grid-template-columns: 1fr; }
  .send-bar { flex-direction: column; align-items: stretch; border-radius: 18px; bottom: 80px; }
  .sheet { width: calc(100vw - 16px); height: calc(100vh - 16px); }
  .sheet form { padding: 18px 18px 0; }
  .apply-summary { top: -18px; }
  .date-nav__label { min-width: 0; }
}
/* Quem pede "menos movimento" no sistema fica sem animações, menos a logo da abertura (1,6 s, pedida pela empresa). */
@media (prefers-reduced-motion: reduce) { *:not(.splash__logo, .splash__logo *) { animation: none !important; transition: none !important; } }
