:root {
  --boreal-950: #030508;
  --boreal-900: #071310;
  --boreal-800: #0d211c;
  --em-600: #0d9e6f;
  --em-500: #10b981;
  --em-50: #e8f7f1;
  --cy-600: #059dba;
  --az-600: #1863dc;
  --vi-600: #6b5fd9;
  --amber: #f59e0b;
  --red: #d64545;
  --red-50: #fcecec;
  --paper-0: #ffffff;
  --paper-50: #f6f5f2;
  --paper-100: #eceae4;
  --ink-900: #151922;
  --ink-700: #323a48;
  --ink-600: #565f70;
  --ink-400: #8a93a3;
  --line: rgba(20, 20, 30, .10);
  --line-strong: rgba(20, 20, 30, .20);
  --shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 8px 24px rgba(20, 20, 40, .06);
  --grad: linear-gradient(115deg, #030508 0%, #064e3b 26%, #0d7f8f 52%, #1863dc 76%, #6b5fd9 100%);
  --grad-btn: linear-gradient(115deg, #0d9e6f, #0b8fa3 55%, #1863dc);
  --radius: 14px;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; font-size: 14px; color: var(--ink-900); background: var(--paper-50); -webkit-font-smoothing: antialiased; }
a { color: var(--az-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
svg { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.2em; }
.leaflet-container svg { width: auto; height: auto; vertical-align: baseline; }
.lock-note svg { width: 20px; height: 20px; }
.card-h h3 svg { width: 18px; height: 18px; color: var(--em-600); }
[hidden] { display: none !important; }

/* ------------------------------------------------ Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--grad); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; inset: auto -20% -40% -20%; height: 70%; background: radial-gradient(ellipse at center, rgba(16, 185, 129, .35), transparent 60%); pointer-events: none; }
.login-art .brand img { height: 64px; }
.login-art h1 { font-size: 40px; line-height: 1.1; max-width: 460px; font-weight: 800; }
.login-art p { opacity: .8; max-width: 420px; font-size: 15px; line-height: 1.6; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--paper-0); }
.login-form form { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 24px; margin-bottom: 6px; }
.login-form .sub { color: var(--ink-600); margin-bottom: 26px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 20px; min-height: 220px; }
  .login-art h1 { font-size: 26px; }
  .login-art p { display: none; }
}

/* ------------------------------------------------ Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: none; background: var(--boreal-950); color: #cfd6e2; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .2s; }
.sidebar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 180px; background: radial-gradient(ellipse at 20% 0%, rgba(16, 185, 129, .28), transparent 65%), radial-gradient(ellipse at 90% 10%, rgba(107, 95, 217, .25), transparent 60%); pointer-events: none; }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 26px; position: relative; }
.sb-brand img { height: 38px; }
.sb-brand b { display: block; color: #fff; letter-spacing: 2.4px; font-size: 13px; }
.sb-brand span { font-size: 11px; color: #8b95a7; letter-spacing: .3px; }
.sb-nav { flex: 1; padding: 0 12px; overflow-y: auto; position: relative; }
.sb-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #b7c0cf; font-weight: 500; margin-bottom: 2px; text-decoration: none; }
.sb-nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.sb-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb-nav a.on { background: linear-gradient(115deg, rgba(16, 185, 129, .22), rgba(24, 99, 220, .18)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.sb-nav a .pill { margin-left: auto; background: var(--em-500); color: #04130d; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.sb-sec { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: #5f6a7d; padding: 18px 12px 6px; }
.sb-user { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; gap: 10px; align-items: center; position: relative; }
.sb-user .av { width: 36px; height: 36px; border-radius: 50%; background: var(--grad-btn); display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.sb-user .nm { color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .rl { font-size: 11.5px; color: #8b95a7; }
.sb-user button { margin-left: auto; background: none; border: 0; color: #8b95a7; cursor: pointer; padding: 6px; border-radius: 8px; }
.sb-user button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }
.topbar { display: none; }
.content { padding: 28px 32px 60px; max-width: 1400px; margin: 0 auto; }
.backdrop { display: none; }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .5); }
  .backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 39; }
  .main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--boreal-950); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar img { height: 28px; }
  .topbar b { letter-spacing: 2px; font-size: 12px; }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; }
  .content { padding: 18px 16px 60px; }
}

/* ------------------------------------------------ Page header */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph h1 { font-size: 26px; font-weight: 750; }
.ph .crumb { color: var(--ink-400); font-size: 13px; margin-bottom: 4px; }
.ph .crumb a { color: var(--ink-600); }
.ph .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero { background: var(--grad); color: #fff; border-radius: 18px; padding: 26px 28px; margin-bottom: 22px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -60px; width: 300px; height: 300px; background: url(assets/logo-boreal.png) center/contain no-repeat; opacity: .12; }
.hero h1 { font-size: 26px; font-weight: 750; }
.hero p { margin: 6px 0 0; opacity: .82; }

/* ------------------------------------------------ Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper-0); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; color: var(--ink-900); transition: all .15s; }
.btn:hover { border-color: var(--ink-400); }
.btn svg { width: 17px; height: 17px; }
.btn.pri { background: var(--grad-btn); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(13, 158, 111, .25); }
.btn.pri:hover { filter: brightness(1.07); }
.btn.dark { background: var(--boreal-950); color: #fff; border-color: transparent; }
.btn.danger { color: var(--red); border-color: rgba(214, 69, 69, .35); }
.btn.danger:hover { background: var(--red-50); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--paper-100); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--ink-600); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--paper-100); color: var(--ink-900); }
.icon-btn svg { width: 18px; height: 18px; }

/* ------------------------------------------------ Cards & grids */
.card { background: var(--paper-0); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-b { padding: 20px; }
.card-b.tight { padding: 8px 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 18px; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .l { color: var(--ink-600); font-size: 12.5px; font-weight: 500; }
.kpi .v { font-size: 30px; font-weight: 750; margin-top: 6px; letter-spacing: -.02em; }
.kpi .s { font-size: 12px; color: var(--ink-400); margin-top: 2px; }
.kpi .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad-btn); }
.kpi.warn .bar { background: var(--amber); }
.kpi.bad .bar { background: var(--red); }
.kpi a { color: inherit; }

/* ------------------------------------------------ Tables & lists */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-400); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--paper-50); }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fafaf7; }
.tbl .strong { font-weight: 600; }
.muted { color: var(--ink-600); }
.xs { font-size: 12px; }
.faint { color: var(--ink-400); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #fafaf7; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-box { width: 46px; flex: none; text-align: center; border-radius: 10px; background: var(--em-50); color: var(--em-600); padding: 5px 0; line-height: 1.1; }
.date-box b { display: block; font-size: 18px; }
.date-box span { font-size: 10.5px; text-transform: uppercase; font-weight: 600; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-400); }
.empty svg { width: 36px; height: 36px; opacity: .5; display: block; margin: 0 auto 8px; }

/* ------------------------------------------------ Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--paper-100); color: var(--ink-700); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-green { background: #e3f6ee; color: #0a7a55; }
.b-blue { background: #e6eefc; color: #1552b8; }
.b-violet { background: #eeecfb; color: #5a4fc4; }
.b-amber { background: #fdf3de; color: #a86a00; }
.b-red { background: var(--red-50); color: #b83232; }
.b-gray { background: var(--paper-100); color: var(--ink-600); }
.b-cyan { background: #e2f5f8; color: #067a91; }

/* ------------------------------------------------ Forms */
.fg { display: grid; gap: 14px 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.f { grid-column: span 12; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f.c2 { grid-column: span 2; } .f.c3 { grid-column: span 3; } .f.c4 { grid-column: span 4; } .f.c5 { grid-column: span 5; } .f.c6 { grid-column: span 6; } .f.c8 { grid-column: span 8; } .f.c9 { grid-column: span 9; }
@media (max-width: 720px) { .f.c2, .f.c3, .f.c4, .f.c5 { grid-column: span 6; } .f.c6, .f.c8, .f.c9 { grid-column: span 12; } }
.f > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-700); }
.f > label .req { color: var(--red); }
.f .hint { font-size: 12px; color: var(--ink-400); }
.inp, .f input:not([type=checkbox]):not([type=radio]):not([type=file]), .f select, .f textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; outline: none; transition: border .15s, box-shadow .15s; min-height: 41px; }
.f textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.inp:focus, .f input:focus, .f select:focus, .f textarea:focus { border-color: var(--em-600); box-shadow: 0 0 0 3px rgba(13, 158, 111, .14); }
.f-sec { grid-column: span 12; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--em-600); margin-top: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > .inp, .inline > input { flex: 1; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-400); }
.search input { padding-left: 38px !important; min-width: 260px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; min-height: 40px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font-weight: 500; font-size: 13px; }
.chip.on { background: var(--boreal-950); color: #fff; border-color: transparent; }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.chk input { width: 18px; height: 18px; accent-color: var(--em-600); margin: 1px 0 0; flex: none; }
.chk:has(input:checked) { border-color: rgba(13, 158, 111, .5); background: var(--em-50); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 9px 14px; cursor: pointer; font-weight: 500; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--boreal-950); color: #fff; }

/* ------------------------------------------------ Detail blocks */
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.dl.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dl > div { min-width: 0; }
.dl dt { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--ink-400); font-weight: 600; margin-bottom: 3px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.dl .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .dl, .dl.c3 { grid-template-columns: 1fr 1fr; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 11px 14px; font-weight: 600; color: var(--ink-600); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink-900); border-bottom-color: var(--em-600); }
.tabs button .n { font-size: 11px; background: var(--paper-100); padding: 1px 7px; border-radius: 99px; margin-left: 4px; }

.file-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.file-row + .file-row { margin-top: 8px; }
.file-row .ic { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--paper-100); color: var(--ink-600); flex: none; font-size: 10px; font-weight: 700; }
.file-row .ic.pdf { background: #fdecec; color: #c43b3b; }
.file-row .ic.img { background: #e6eefc; color: #1552b8; }
.file-row .grow { flex: 1; min-width: 0; }
.file-row .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: 12px; padding: 22px; text-align: center; color: var(--ink-600); cursor: pointer; background: #fcfcfa; transition: all .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--em-600); background: var(--em-50); color: var(--em-600); }
.dropzone svg { width: 28px; height: 28px; display: block; margin: 0 auto 6px; }
.lock-note { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; background: #fdf3de; color: #7a5200; font-size: 13px; }

/* ------------------------------------------------ Media */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media { position: relative; border-radius: 12px; overflow: hidden; background: #0b0f14; border: 1px solid var(--line); }
.media .thumb { aspect-ratio: 4/3; width: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.media .play { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(13, 158, 111, .9); display: grid; place-items: center; pointer-events: none; }
.media .play::after { content: ""; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.media .cap { background: #fff; padding: 6px 8px; }
.media .cap input { width: 100%; border: 0; font-size: 12.5px; outline: none; padding: 3px 2px; background: transparent; }
.media .cap .txt { font-size: 12.5px; color: var(--ink-600); min-height: 18px; }
.media .del { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, .55); color: #fff; border: 0; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; display: grid; place-items: center; }
.media .del svg { width: 15px; height: 15px; }
.progress { height: 6px; background: var(--paper-100); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad-btn); width: 0; transition: width .2s; }
.up-item { display: flex; gap: 10px; align-items: center; font-size: 12.5px; padding: 6px 0; }
.up-item .grow { flex: 1; min-width: 0; }

/* ------------------------------------------------ Map */
.map { height: 320px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.map.tall { height: 420px; }
.leaflet-container { font: inherit; }

/* ------------------------------------------------ Calendar */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-head h2 { font-size: 20px; min-width: 190px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal .dow { background: var(--paper-50); padding: 9px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-400); text-align: center; }
.cal .day { background: #fff; min-height: 116px; padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; }
.cal .day:hover { background: #fbfbf8; }
.cal .day.out { background: #fafaf8; }
.cal .day.out .n { color: var(--ink-400); }
.cal .day .n { font-size: 12.5px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .n { background: var(--em-600); color: #fff; }
.ev { font-size: 11.5px; padding: 4px 7px; border-radius: 6px; background: #e6eefc; color: #1552b8; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid #1863dc; }
.ev.instalacao { background: #e3f6ee; color: #0a6b4b; border-color: var(--em-600); }
.ev.visita_tecnica { background: #eeecfb; color: #4c42b0; border-color: var(--vi-600); }
.ev.manutencao { background: #fdf3de; color: #8a5700; border-color: var(--amber); }
.ev.concluida { opacity: .55; text-decoration: line-through; }
.ev.cancelada { opacity: .4; text-decoration: line-through; background: var(--paper-100); color: var(--ink-600); border-color: var(--ink-400); }
.ev.more { background: none; border: 0; color: var(--ink-600); padding: 0 4px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-600); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 720px) {
  .cal .day { min-height: 64px; padding: 4px; }
  .cal .ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; }
  .cal .ev.more { font-size: 10px; height: auto; }
}

/* ------------------------------------------------ Questionário */
.q-sec { counter-increment: qsec; }
.q-sec .card-h h3::before { content: counter(qsec); width: 26px; height: 26px; border-radius: 8px; background: var(--boreal-950); color: #fff; display: inline-grid; place-items: center; font-size: 12.5px; }
.q-wrap { counter-reset: qsec; }
.crono-row { display: grid; grid-template-columns: 150px 1fr 1.6fr 36px; gap: 8px; margin-bottom: 8px; }
@media (max-width: 720px) { .crono-row { grid-template-columns: 1fr 1fr; } .crono-row > :nth-child(3) { grid-column: span 2; } .crono-row > :nth-child(4) { grid-column: span 2; justify-self: end; } }
.sticky-bar { position: sticky; bottom: 0; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 16px; margin: 18px -32px -60px; display: flex; gap: 10px; justify-content: flex-end; align-items: center; z-index: 5; }
@media (max-width: 960px) { .sticky-bar { margin: 18px -16px -60px; } }
.sticky-bar .st { margin-right: auto; font-size: 12.5px; color: var(--ink-400); }
.sig { border: 1px dashed var(--line-strong); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 150px; display: block; cursor: crosshair; }
.sig-img { border: 1px solid var(--line); border-radius: 10px; background: #fff; height: 150px; width: 100%; object-fit: contain; }

/* ------------------------------------------------ Chat SAC */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; }
.msg .bubble { padding: 12px 15px; border-radius: 14px; background: var(--paper-50); border: 1px solid var(--line); white-space: pre-wrap; line-height: 1.5; overflow-wrap: anywhere; }
.msg .meta { font-size: 11.5px; color: var(--ink-400); margin: 4px 4px 0; }
.msg.mine { align-self: flex-end; }
.msg.mine .bubble { background: #e8f1fd; border-color: #cddcf7; }
.msg.sac .bubble { background: var(--em-50); border-color: #c5eadb; }
.msg.internal .bubble { background: #fdf3de; border-color: #f2dfb3; }
.msg.ev { align-self: center; max-width: 100%; }
.msg.ev .bubble { background: none; border: 0; padding: 0; font-size: 12px; color: var(--ink-400); text-align: center; }
.msg .att { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.msg .att .media { width: 120px; }
.composer { border-top: 1px solid var(--line); padding: 14px 20px; }
.composer textarea { width: 100%; min-height: 80px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; resize: vertical; outline: none; }
.composer textarea:focus { border-color: var(--em-600); }
.composer .row { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------ Modal / toast / lightbox */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 8, 11, .55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 640px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: pop .18s; }
.modal.wide { max-width: 980px; }
.modal.full { max-width: none; width: 100%; height: 90vh; display: flex; flex-direction: column; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-h h3 { font-size: 17px; }
.modal-b { padding: 22px; }
.modal.full .modal-b { flex: 1; padding: 0; display: flex; flex-direction: column; min-height: 0; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--boreal-950); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: 360px; animation: pop .2s; font-weight: 500; }
.toast.err { background: #8e2323; }
.toast.ok { background: #075e43; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .92); z-index: 300; display: grid; place-items: center; padding: 20px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 88vh; border-radius: 8px; }
.lightbox button { position: absolute; top: 14px; right: 14px; background: rgba(255, 255, 255, .15); color: #fff; border: 0; width: 42px; height: 42px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.boreal-frame { flex: 1; width: 100%; border: 0; background: #f4f2ee; }

/* ------------------------------------------------ Wizard */
.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step { flex: 1; min-width: 150px; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--ink-400); font-weight: 600; }
.step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-100); flex: none; }
.step.on { border-color: var(--em-600); color: var(--ink-900); box-shadow: 0 0 0 3px rgba(13, 158, 111, .12); }
.step.on .n { background: var(--em-600); color: #fff; }
.step.done .n { background: var(--boreal-950); color: #fff; }
.step.done { color: var(--ink-700); }

.nps-big { font-size: 48px; font-weight: 800; letter-spacing: -.03em; }
.stars-s { color: var(--amber); letter-spacing: 1px; }
.meter { height: 10px; border-radius: 99px; display: flex; overflow: hidden; background: var(--paper-100); }
.meter > span { display: block; height: 100%; }
.spin { width: 22px; height: 22px; border: 3px solid var(--paper-100); border-top-color: var(--em-600); border-radius: 50%; animation: sp .7s linear infinite; margin: 40px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
