/* Gestor de Manutenção · Grupo Farmac — identidade: azul Farmac + verde-limão */
:root {
  --blue: #155fad; --blue-d: #0b4688; --blue-l: #2f80d1; --blue-50: #eef4fc; --blue-100: #dbe8f8;
  --lime: #c0d32c; --lime-d: #98ad12; --lime-50: #f5f9dc;
  --ink: #0f2643; --ink-2: #4b5d77; --ink-3: #8795aa; --line: #e4eaf2; --bg: #f4f7fb; --card: #fff;
  --ok: #1d9a5e; --ok-50: #e5f6ed; --warn: #c98404; --warn-50: #fff4dc; --bad: #d23f3f; --bad-50: #fdeceb;
  --r: 18px; --r-s: 12px;
  --sh-1: 0 1px 2px rgba(15, 38, 67, .05), 0 4px 16px -4px rgba(15, 38, 67, .07);
  --sh-2: 0 2px 4px rgba(15, 38, 67, .05), 0 18px 40px -12px rgba(15, 38, 67, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --head: "Montserrat", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--head); margin: 0; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); } .small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; } .stack > * + * { margin-top: 16px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- ícones ---------- */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; --ic-a: currentColor; --ic-ao: .16; }
.ic.lg { width: 26px; height: 26px; } .ic.xl { width: 40px; height: 40px; stroke-width: 1.5; } .ic.sm { width: 16px; height: 16px; }
.brand-ic .ic, .ic.brand { --ic-a: var(--lime); --ic-ao: .95; }
.chip-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--blue-50); color: var(--blue); --ic-a: var(--lime); }
.chip-ic .ic { --ic-a: var(--lime); --ic-ao: .9; }
.chip-ic.ok { background: var(--ok-50); color: var(--ok); } .chip-ic.warn { background: var(--warn-50); color: var(--warn); }
.chip-ic.bad { background: var(--bad-50); color: var(--bad); } .chip-ic.lime { background: var(--lime-50); color: var(--lime-d); }
.chip-ic.ok .ic, .chip-ic.warn .ic, .chip-ic.bad .ic { --ic-a: currentColor; --ic-ao: .2; }

/* ---------- botões ---------- */
.btn { --h: 42px; height: var(--h); padding: 0 16px; border: 0; border-radius: var(--r-s); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; white-space: nowrap; background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .15s var(--ease), box-shadow .2s, background .2s, color .2s, opacity .2s; }
.btn:hover { background: var(--bg); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.primary { background: linear-gradient(135deg, var(--blue-l), var(--blue) 60%, var(--blue-d)); color: #fff; box-shadow: 0 8px 18px -8px rgba(21, 95, 173, .75); }
.btn.primary:hover { box-shadow: 0 10px 22px -8px rgba(21, 95, 173, .9); filter: brightness(1.05); }
.btn.primary .ic { --ic-a: var(--lime); --ic-ao: .95; }
.btn.lime { background: linear-gradient(135deg, #d4e255, var(--lime)); color: var(--ink); box-shadow: 0 8px 18px -8px rgba(152, 173, 18, .8); }
.btn.soft { background: var(--blue-50); color: var(--blue); box-shadow: none; } .btn.soft:hover { background: var(--blue-100); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink-2); } .btn.ghost:hover { background: rgba(15, 38, 67, .05); color: var(--ink); }
.btn.danger { background: var(--bad-50); color: var(--bad); box-shadow: none; } .btn.danger:hover { background: #fbdcdb; }
.btn.sm { --h: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { --h: 52px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; position: relative; transition: background .2s, color .2s, transform .15s var(--ease); }
.icon-btn:hover { background: rgba(15, 38, 67, .06); color: var(--ink); } .icon-btn:active { transform: scale(.92); }
.btn.loading { color: transparent !important; position: relative; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn:not(.primary).loading::after { border-color: var(--blue-100); border-top-color: var(--blue); }

/* ---------- formulários ---------- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field > span em { color: var(--bad); font-style: normal; }
.input, .field input, .field select, .field textarea { width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-s); background: #fff; outline: none; transition: border-color .2s, box-shadow .2s; }
.field textarea { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.field select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234b5d77' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 40px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-l); box-shadow: 0 0 0 4px rgba(47, 128, 209, .14); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.field.err input, .field.err select { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(210, 63, 63, .1); }
.with-ic { position: relative; } .with-ic > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.with-ic > input { padding-left: 44px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.full { grid-column: 1 / -1; }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r-s); height: 46px; background: #fff; }
.stepper button { width: 42px; height: 100%; border: 0; background: none; color: var(--blue); display: grid; place-items: center; border-radius: 10px; }
.stepper button:hover { background: var(--blue-50); }
.stepper input { width: 52px; height: 100%; border: 0; text-align: center; font-weight: 700; font-family: var(--head); outline: none; -moz-appearance: textfield; background: none; }
.stepper input::-webkit-inner-spin-button { display: none; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button { height: 30px; padding: 0 11px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink-2); transition: all .2s; }
.presets button.on, .presets button:hover { border-color: var(--blue-l); color: var(--blue); background: var(--blue-50); }

.drop { position: relative; border: 2px dashed var(--blue-100); border-radius: var(--r); background: var(--blue-50); min-height: 150px; display: grid; place-items: center; text-align: center; color: var(--blue); cursor: pointer; overflow: hidden; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--blue-l); background: #e6effb; }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fade .3s; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .drop-x { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(255, 255, 255, .92); }
.drop .swap { position: absolute; right: 10px; bottom: 10px; pointer-events: none; }
.field.err .drop { border-color: var(--bad); background: var(--bad-50); }
.field.err .hint { color: var(--bad); font-weight: 600; }
.field.ok input { border-color: var(--ok); } .field.ok .hint { color: var(--ok); font-weight: 600; } .field.ok .with-ic > .ic { color: var(--ok); }
button.drop { width: 100%; padding: 0; font: inherit; }

.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 248px; overflow: auto; padding: 6px; border: 1.5px solid var(--line); border-radius: var(--r-s); }
.ip { position: relative; cursor: pointer; }
.ip input { position: absolute; opacity: 0; pointer-events: none; }
.ip span { display: grid; justify-items: center; align-content: start; gap: 5px; height: 100%; padding: 10px 4px 8px; border-radius: 12px; border: 1.5px solid transparent; color: var(--ink-2); text-align: center; transition: background .2s, border-color .2s, color .2s; }
.ip .ic { width: 28px; height: 28px; --ic-a: var(--lime); --ic-ao: .9; color: var(--blue); }
.ip small { font-size: 10.5px; line-height: 1.2; font-weight: 600; }
.ip:hover span { background: var(--bg); }
.ip input:checked + span { border-color: var(--blue-l); background: var(--blue-50); color: var(--blue); }
.ip input:focus-visible + span { outline: 2.5px solid var(--blue-l); outline-offset: 1px; }
.field > span small { font-weight: 500; }

/* ---------- cartões, pílulas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head h2 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.card-body { padding: 16px 20px 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--bg); color: var(--ink-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-50); color: var(--ok); } .pill.soon { background: var(--warn-50); color: var(--warn); }
.pill.late { background: var(--bad-50); color: var(--bad); } .pill.pending { background: var(--blue-50); color: var(--blue); }
.pill.late::before { animation: pulse 1.6s infinite; }
.pill.plain::before { display: none; }
.freq { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 7px; font: 700 11px/1 var(--head); background: var(--blue-50); color: var(--blue); }
.freq.T { background: var(--lime-50); color: var(--lime-d); } .freq.S { background: var(--warn-50); color: var(--warn); }
.freq.A { background: #f0ecfb; color: #6b4fc4; } .freq.Q { background: var(--ok-50); color: var(--ok); }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty .chip-ic { margin: 0 auto 12px; width: 56px; height: 56px; border-radius: 18px; }
.empty b { display: block; color: var(--ink); font-family: var(--head); margin-bottom: 4px; }

/* ---------- layout do painel ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; background: #fff; border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.side .logo { padding: 4px 10px 22px; } .side .logo img { width: 168px; }
.nav { display: grid; gap: 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px; color: var(--ink-2); font-weight: 600; transition: background .2s, color .2s; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--blue-50); color: var(--blue); }
.nav a .ic { transition: transform .3s var(--ease); }
.nav a.on .ic { --ic-a: var(--lime); --ic-ao: .95; transform: scale(1.06); }
.nav a::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--lime); transform: scaleY(0); transition: transform .3s var(--ease); }
.nav a.on::before { transform: scaleY(1); }
.nav .count { margin-left: auto; font-style: normal; line-height: 1; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--blue-l), var(--blue-d)); color: #fff; font: 700 14px var(--head); box-shadow: inset 0 -3px 0 var(--lime); }
.main { min-width: 0; padding: 26px 34px 56px; max-width: 1320px; width: 100%; }
.top { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; min-height: 48px; }
.top h1 { flex: 1; min-width: 0; }
.top .sub { display: block; font: 500 13.5px "Inter", system-ui, sans-serif; color: var(--ink-3); margin-top: 4px; letter-spacing: 0; }
.mark { display: none; width: 34px; height: 34px; background: url(logo-mark.png) center / contain no-repeat; flex: none; }
.badge { position: absolute; top: 5px; right: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); animation: pop .35s var(--ease); }

/* ---------- painel (dashboard) ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px; display: flex; gap: 14px; align-items: flex-start; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s; text-align: left; color: inherit; font: inherit; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.kpi b { display: block; font: 700 28px/1.1 var(--head); margin-bottom: 2px; }
.kpi span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.hello { position: relative; overflow: hidden; color: #fff; padding: 26px 28px; border-radius: 22px; margin-bottom: 20px; background: radial-gradient(120% 140% at 100% 0%, #2f80d1 0%, var(--blue) 45%, var(--blue-d) 100%); box-shadow: 0 18px 40px -20px rgba(11, 70, 136, .8); }
.hello h1 { font-size: 24px; } .hello p { margin: 6px 0 0; opacity: .85; max-width: min(520px, 62%); }
.hello .mark-bg { position: absolute; right: -40px; top: -60px; width: 300px; opacity: .9; pointer-events: none; }
.hello > :not(.mark-bg) { position: relative; }
.hello .btn { margin-top: 16px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.li { display: flex; align-items: center; gap: 14px; padding: 12px; margin: 0 -8px; border-radius: 14px; color: inherit; transition: background .2s; cursor: pointer; }
.li:hover { background: var(--bg); }
.li .t { font-weight: 600; } .li .s { font-size: 13px; color: var(--ink-3); }
.li > .ic:last-child { color: var(--ink-3); transition: transform .2s var(--ease); } .li:hover > .ic:last-child { transform: translateX(3px); color: var(--blue); }
.datebox { width: 50px; height: 54px; border-radius: 14px; flex: none; display: grid; place-content: center; text-align: center; background: var(--blue-50); color: var(--blue); }
.datebox b { font: 700 19px/1 var(--head); } .datebox span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.datebox.late { background: var(--bad-50); color: var(--bad); } .datebox.soon { background: var(--warn-50); color: var(--warn); } .datebox.ok { background: var(--ok-50); color: var(--ok); }

/* ---------- equipamentos ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .with-ic { flex: 1; min-width: 220px; }
.toolbar select.input { width: auto; min-width: 170px; }
.seg { display: inline-flex; padding: 4px; background: #e9eef5; border-radius: 13px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: none; font-weight: 600; font-size: 13.5px; color: var(--ink-2); transition: all .25s var(--ease); }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 2px 8px -2px rgba(15, 38, 67, .18); }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.eq { overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s; color: inherit; }
.eq:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.eq .media { position: relative; height: 128px; background: linear-gradient(135deg, var(--blue-50), #e2edf9); display: grid; place-items: center; color: var(--blue); overflow: hidden; }
.eq .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.eq:hover .media img { transform: scale(1.05); }
.eq .media .ic { width: 52px; height: 52px; stroke-width: 1.3; --ic-a: var(--lime); --ic-ao: .9; opacity: .85; }
.eq .media .pill { position: absolute; top: 12px; left: 12px; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .2); }
.eq .media .code { position: absolute; top: 12px; right: 12px; font: 700 11px var(--head); letter-spacing: .08em; background: rgba(255, 255, 255, .9); color: var(--ink-2); padding: 4px 8px; border-radius: 8px; }
.eq .body { padding: 14px 16px 6px; flex: 1; }
.eq h3 { font-size: 15px; margin-bottom: 8px; }
.meta-line { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; margin-top: 4px; min-width: 0; }
.meta-line .ic { width: 16px; height: 16px; color: var(--ink-3); }
.eq .foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; margin-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.eq .foot b { font-family: var(--head); }

/* ---------- perfil do equipamento ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; font-size: 14px; margin-bottom: 14px; transition: color .2s, gap .2s var(--ease); }
.back:hover { color: var(--blue); gap: 10px; }
.hero { display: grid; grid-template-columns: 240px 1fr; overflow: hidden; margin-bottom: 20px; }
.hero .media { min-height: 220px; background: linear-gradient(135deg, var(--blue-50), #dde9f8); display: grid; place-items: center; color: var(--blue); position: relative; }
.hero .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .media .ic { width: 72px; height: 72px; stroke-width: 1.2; --ic-a: var(--lime); --ic-ao: .9; }
.hero .info { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hero h1 { font-size: 24px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 20px; }
.fact { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.fact .ic { color: var(--blue); margin-top: 2px; --ic-a: var(--lime); --ic-ao: .9; }
.fact small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.fact div { font-weight: 600; overflow-wrap: anywhere; }
.next-card { position: relative; overflow: hidden; }
.next-date { font: 700 30px/1.1 var(--head); color: var(--blue); }
.countdown { font-weight: 600; color: var(--ink-2); }
.cl-row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.cl-row.new { animation: rise .4s var(--ease) both; background: var(--lime-50); border-radius: 10px; }
.cl-text { border: 0; background: transparent; outline: none; padding: 6px 8px; border-radius: 8px; transition: background .2s; }
.cl-text:hover { background: var(--bg); } .cl-text:focus { background: #fff; box-shadow: 0 0 0 2px var(--blue-100); }
.freq-sel { appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; text-align: center; text-align-last: center; min-width: 30px; }
.cl-row:last-child { border-bottom: 0; }
.cl-row .t { flex: 1; min-width: 0; font-size: 14px; }
.cl-row .icon-btn { width: 32px; height: 32px; opacity: .4; } .cl-row:hover .icon-btn { opacity: 1; }
.cl-add { display: flex; gap: 8px; margin-top: 12px; }
.cl-add select.input { width: 74px; padding: 0 8px; }
.cl-scroll { max-height: 460px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.tl { display: grid; gap: 4px; }
.tl .li .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.progress { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 6px; width: 120px; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lime), var(--ok)); }

/* ---------- agenda ---------- */
.month { margin-top: 22px; } .month:first-child { margin-top: 0; }
.month h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 8px 4px; }
.agenda-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s; }
.agenda-row:hover { transform: translateX(4px); box-shadow: var(--sh-2); }
.agenda-row .when { text-align: right; font-size: 13px; color: var(--ink-2); }
.agenda-row .when b { display: block; font-family: var(--head); color: var(--ink); font-size: 14px; }

/* ---------- modais (dialog nativo) ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 24px; width: min(var(--w, 580px), calc(100vw - 32px)); max-height: calc(100dvh - 40px); background: #fff; color: var(--ink); box-shadow: 0 30px 80px -20px rgba(10, 30, 60, .45); overflow: hidden; display: flex; flex-direction: column; animation: modal-in .38s var(--ease); }
dialog.modal:not([open]) { display: none; }
dialog.modal::backdrop { background: rgba(10, 30, 60, .42); backdrop-filter: blur(5px); animation: fade .3s ease; }
dialog.modal.closing { animation: modal-out .22s ease forwards; }
dialog.modal.closing::backdrop { animation: fade .22s ease reverse forwards; }
.m-head { display: flex; align-items: center; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); flex: none; }
.m-head h2 { flex: 1; font-size: 18px; }
.m-head h2 small { display: block; font: 500 13px "Inter", system-ui, sans-serif; color: var(--ink-3); margin-top: 3px; }
.m-body { padding: 20px 22px; overflow: auto; flex: 1; overscroll-behavior: contain; }
.m-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfcfe; flex: none; flex-wrap: wrap; }
.m-foot .grow { flex: 1; }

/* ---------- notificações e toasts ---------- */
.notif { position: fixed; z-index: 60; top: 74px; right: 26px; width: min(400px, calc(100vw - 24px)); max-height: min(560px, calc(100dvh - 100px)); display: flex; flex-direction: column; background: #fff; border-radius: 20px; box-shadow: var(--sh-2), 0 0 0 1px var(--line); transform-origin: top right; animation: drop-in .3s var(--ease); }
.notif .n-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.notif .n-list { overflow: auto; padding: 8px; }
.n-item { display: flex; gap: 12px; padding: 12px 10px; border-radius: 14px; cursor: pointer; transition: background .2s; position: relative; }
.n-item:hover { background: var(--bg); }
.n-item .chip-ic { width: 36px; height: 36px; border-radius: 11px; }
.n-item b { font-size: 14px; display: block; line-height: 1.35; }
.n-item p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.n-item time { font-size: 12px; color: var(--ink-3); }
.n-item.unread::after { content: ""; position: absolute; top: 18px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue-l); }
.toasts { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--ink); color: #fff; box-shadow: var(--sh-2); animation: toast-in .4s var(--ease); font-size: 14px; }
.toast .chip-ic { width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .12); color: var(--lime); }
.toast b { display: block; } .toast span { opacity: .8; font-size: 13px; }
.toast.out { animation: toast-out .3s ease forwards; }

/* ---------- login ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(130% 120% at 0% 0%, #3a8ad6 0%, var(--blue) 40%, #08386e 100%); }
.auth-art .globe { position: absolute; width: 500px; right: -130px; top: -90px; animation: float 14s ease-in-out infinite; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .25)); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(400px, 100%); animation: rise .6s var(--ease) both; }
.auth-card img { width: 220px; margin: 0 auto 30px; }
.auth-card h1 { font-size: 24px; } .auth-card > p { color: var(--ink-3); margin: 6px 0 24px; }
.form-err { color: var(--bad); font-size: 13.5px; font-weight: 600; min-height: 20px; }

/* ---------- relatório / impressão ---------- */
.report { font-size: 14px; }
.r-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 3px solid var(--blue); position: relative; }
.r-head::after { content: ""; position: absolute; left: 0; bottom: -3px; width: 90px; height: 3px; background: var(--lime); }
.r-head img { width: 170px; }
.r-head .r-title { text-align: right; }
.r-head .r-title h2 { font-size: 18px; color: var(--blue); }
.r-sec { margin-top: 20px; break-inside: avoid; }
.r-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.r-sec h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.r-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 18px; }
.r-grid small { display: block; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.r-grid div { font-weight: 600; overflow-wrap: anywhere; }
.r-table { width: 100%; border-collapse: collapse; }
.r-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.r-table td:first-child { width: 34px; } .r-table td:last-child { text-align: right; white-space: nowrap; }
.r-table tr { break-inside: avoid; }
.res { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 12.5px; }
.res.ok { color: var(--ok); } .res.nok { color: var(--bad); } .res.na { color: var(--ink-3); }
.res .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.r-photo { border-radius: 14px; max-height: 340px; width: auto; border: 1px solid var(--line); }
.r-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 46px; text-align: center; font-size: 12.5px; color: var(--ink-2); }
.r-sign div { border-top: 1.5px solid var(--ink-2); padding-top: 6px; }
.r-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sched { border-radius: 18px; padding: 18px; margin-bottom: 20px; background: linear-gradient(135deg, var(--lime-50), #fff 70%); border: 1.5px solid #e3ec9c; }
.sched.done { background: linear-gradient(135deg, var(--ok-50), #fff 70%); border-color: #bfe6d1; }
.sched h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.qr-box { display: grid; place-items: center; text-align: center; gap: 14px; }
.qr-box .qr { width: 220px; padding: 14px; border-radius: 20px; background: #fff; box-shadow: var(--sh-1), 0 0 0 1px var(--line); animation: pop .5s var(--ease); }
.qr-box .qr svg { display: block; width: 100%; height: auto; }
.short { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--bg); border: 1.5px solid var(--line); }
.short code { flex: 1; font: 600 14px ui-monospace, Consolas, monospace; color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.acode { flex: none; padding: 8px 10px; border-radius: 10px; background: var(--lime-50); color: var(--ink); font: 700 15px/1 ui-monospace, Consolas, monospace; letter-spacing: .14em; }
.label-card { width: 86mm; margin: 0 auto; padding: 6mm; border: 1.5px solid var(--line); border-radius: 5mm; text-align: center; font-size: 12px; }
.label-card img { width: 46mm; margin: 0 auto 3mm; }
.label-card .qr svg { width: 52mm; height: 52mm; display: block; margin: 0 auto; }
.label-card b { display: block; font: 700 14px var(--head); margin-top: 2mm; }
.label-card code { display: block; font: 700 12px ui-monospace, Consolas, monospace; color: var(--blue); margin-top: 2mm; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--warn-50); color: #7a5300; font-size: 13.5px; text-align: left; }
.alert.info { background: var(--blue-50); color: var(--blue-d); }
#print { display: none; }
@page { margin: 12mm; }
@media print {
  body { background: #fff; }
  body > :not(#print) { display: none !important; }
  #print { display: block; }
  .r-page { break-before: page; margin-top: 0 !important; padding-top: 0 !important; border-top: 0 !important; }
  .card { box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; animation: none !important; }
}

/* ---------- página do técnico ---------- */
.tech { max-width: 600px; margin: 0 auto; padding: 18px 16px 130px; }
.tech-top { display: flex; justify-content: center; padding: 6px 0 18px; } .tech-top img { width: 170px; }
.eq-mini { display: flex; gap: 14px; align-items: center; padding: 14px; margin-bottom: 18px; }
.eq-mini .ph { width: 68px; height: 68px; border-radius: 16px; overflow: hidden; flex: none; background: linear-gradient(135deg, var(--blue-50), #dde9f8); display: grid; place-items: center; color: var(--blue); }
.eq-mini .ph img { width: 100%; height: 100%; object-fit: cover; }
.eq-mini .ph .ic { --ic-a: var(--lime); --ic-ao: .9; width: 34px; height: 34px; }
.eq-mini h2 { font-size: 16px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.steps div { text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-3); transition: color .3s; }
.steps div::before { content: ""; display: block; height: 5px; border-radius: 99px; margin-bottom: 8px; background: linear-gradient(90deg, var(--lime), var(--blue-l)) no-repeat 0 0 / 0% 100%, var(--line); transition: background-size .5s var(--ease); }
.steps div.on, .steps div.done { color: var(--blue); }
.steps div.on::before, .steps div.done::before { background-size: 100% 100%; }
.pane { animation: slide-in .4s var(--ease) both; } .pane.back-anim { animation-name: slide-in-back; }
.pane h2 { margin-bottom: 4px; } .pane > p.muted { margin: 0 0 18px; }
.ck { padding: 14px; margin-bottom: 10px; transition: border-color .25s, background .25s; }
.ck.r-ok { border-color: #bfe6d1; } .ck.r-nok { border-color: #f3c3c2; background: #fffafa; } .ck.r-na { opacity: .75; }
.ck .q { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 14.5px; margin-bottom: 10px; }
.ck .q .n { color: var(--ink-3); font-weight: 700; min-width: 22px; }
.tri { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.tri button { height: 40px; border-radius: 11px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: all .2s var(--ease); }
.tri button .ic { width: 17px; height: 17px; stroke-width: 2.2; }
.tri button:active { transform: scale(.95); }
.tri button.on[data-r=ok] { background: var(--ok); border-color: var(--ok); color: #fff; }
.tri button.on[data-r=nok] { background: var(--bad); border-color: var(--bad); color: #fff; }
.tri button.on[data-r=na] { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.ck .obs { margin-top: 10px; animation: rise .3s var(--ease); }
.ck-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; position: sticky; top: 0; z-index: 3; padding: 10px 0; background: var(--bg); }
.tech-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tech-foot .row { max-width: 600px; margin: 0 auto; }
.cam { position: fixed; inset: 0; z-index: 300; background: #000; display: flex; flex-direction: column; animation: fade .25s; }
.cam video { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.cam-bar { display: flex; align-items: center; justify-content: space-around; padding: 22px 24px calc(22px + env(safe-area-inset-bottom)); }
.cam-btn { width: 50px; height: 50px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; }
.cam-shot { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: var(--lime); box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); transition: transform .15s var(--ease); }
.cam-shot:active { transform: scale(.9); }
.success { text-align: center; padding: 30px 10px; }
.success svg.draw { width: 120px; height: 120px; margin: 0 auto 18px; display: block; }
.success svg.draw circle { stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw .8s var(--ease) forwards; }
.success svg.draw path { stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .5s .6s var(--ease) forwards; }

/* ---------- carregamento ---------- */
.skel { border-radius: var(--r); background: linear-gradient(90deg, #eaeff6 0%, #f5f8fc 50%, #eaeff6 100%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--blue-100); border-top-color: var(--blue); animation: spin .8s linear infinite; margin: 60px auto; }

/* ---------- técnicos ---------- */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.tech-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: opacity .3s, transform .3s var(--ease), box-shadow .3s; }
.tech-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.tech-card.off { opacity: .6; }
.tech-card .grow { min-width: 0; }
.tech-code { padding: 10px 12px; border-radius: 14px; background: var(--bg); margin: 4px 0; }
.tech-code small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.tech-actions { gap: 8px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }

/* ---------- relatórios ---------- */
.filters { display: grid; gap: 16px; margin-bottom: 18px; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input, .rp-pick { width: 18px; height: 18px; flex: none; accent-color: var(--blue); cursor: pointer; }
.card-head.wrap { flex-wrap: wrap; }
.kpi.static { cursor: default; } .kpi.static:hover { transform: none; box-shadow: var(--sh-1); }
.rp-row .when { flex: none; text-align: right; font-size: 12.5px; color: var(--ink-2); }
.rp-row .when b { display: block; font-family: var(--head); font-size: 14px; color: var(--ink); }
.r-list th { text-align: left; padding: 6px 8px; border-bottom: 1.5px solid var(--line); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.r-table.r-list td:first-child { width: auto; white-space: nowrap; } .r-table.r-list td:last-child { text-align: left; }
.batch .r-page { margin-top: 36px; padding-top: 30px; border-top: 2px dashed var(--line); }
.only-mobile { display: none; }

/* ---------- animações ---------- */
.rise { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.view { animation: view-in .45s var(--ease) both; }
.view.soft .rise { animation: none; }
[role=button]:focus-visible, a:focus-visible, button:focus-visible { outline: 2.5px solid var(--blue-l); outline-offset: 2px; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px) scale(.96); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } }
@keyframes slide-in-back { from { opacity: 0; transform: translateX(-28px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes float { 50% { transform: translate(-14px, 18px) rotate(-4deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); }
  .side .logo, .side-foot { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .nav a { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 11px; border-radius: 12px; }
  .nav a::before { left: 30%; right: 30%; top: -7px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 4px 4px; transform: scaleX(0); }
  .nav a.on::before { transform: scaleX(1); }
  .nav a.on { background: transparent; }
  .nav .count { position: absolute; top: 2px; left: 55%; margin: 0; min-width: 18px; height: 18px; font-size: 10px; }
  .main { padding: 16px 16px 100px; }
  .top { margin-bottom: 16px; } .top h1 { font-size: 21px; }
  .mark { display: block; }
  .only-mobile { display: grid; } .nav a[data-nav=config] { display: none; }
  .fgrid { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; } .hero .media { min-height: 180px; }
  .notif { top: 64px; right: 12px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 240px; padding: 26px 22px; }
  .auth-art .globe { width: 380px; right: -120px; top: -90px; }
  .r-grid { grid-template-columns: 1fr 1fr; }
  .toasts { right: 16px; bottom: 90px; }
}
@media (max-width: 600px) {
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: 92dvh; animation: sheet-in .4s var(--ease); }
  dialog.modal.closing { animation: sheet-out .25s ease forwards; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .rp-row .when { display: none; }
  .kpi { padding: 14px; flex-direction: column; gap: 10px; } .kpi b { font-size: 24px; }
  .hello { padding: 22px 20px; } .hello h1 { font-size: 20px; }
  .hello .mark-bg { width: 200px; right: -70px; top: -40px; opacity: .45; }
  .agenda-row .when { display: none; }
  .agenda-row { gap: 12px; padding: 12px; }
  .m-foot .btn { flex: 1; }
  .eq-grid { grid-template-columns: 1fr; }
  .toolbar select.input { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
