/* ReSOLVE Fleet Management — o desenho da ReSOLVE Facilities (v19), medido na própria aplicação:
   Manrope + Material Symbols, ardósia #334155, fundo #f6f7f8, cartões de canto 24 com «relevo»
   (luz em cima, espessura em baixo, sombra larga), teclas com relevo, cabeçalho em ilha de vidro,
   barra lateral branca no computador e cápsula flutuante com o «+» no telemóvel. */

@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* `block` e não `swap`: o recurso de um ícone é o nome dele escrito por extenso */
@font-face {
  font-family: 'Material Symbols Outlined'; font-style: normal; font-weight: 100 700; font-display: block;
  src: url('/fonts/material-symbols-outlined.woff2') format('woff2');
}

:root {
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --primary: #334155;            /* slate-700 — a cor da ReSOLVE */
  --primary-dark: #1e293b;
  --primary-rgb: 51 65 85;
  --on-primary: #ffffff;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --text: #121617;
  --ink: #0f172a;                /* slate-900 */
  --muted: #606f85;              /* o «slate-500» da ReSOLVE (≥4,5:1) */
  --faint: #94a3b8;
  --s50: #f8fafc; --s100: #f1f5f9; --s200: #e2e8f0; --s300: #cbd5e1; --s600: #475569; --s700: #334155;
  --border-light: #e0e3e8;
  --red: #dc2626; --amber: #d97706; --green: #059669; --blue: #0284c7;
  --c0: #334155; --c1: #0ea5e9; --c2: #10b981; --c3: #8b5cf6;
  /* o relevo (index.css da ReSOLVE Facilities, «rf-relevo», «rf-relevo-botao», «rf-relevo-primario») */
  --relevo-img: linear-gradient(to bottom, rgb(255 255 255 / .7), rgb(255 255 255 / 0) 30%, rgb(15 23 42 / 0) 50%, rgb(15 23 42 / .035));
  --relevo: inset 0 1px 0 #fff, inset 0 -2px 0 rgb(15 23 42 / .045), 0 1px 2px rgb(15 23 42 / .08), 0 4px 10px -3px rgb(15 23 42 / .10), 0 20px 32px -16px rgb(15 23 42 / .28);
  --relevo-sobe: inset 0 1px 0 #fff, inset 0 -2px 0 rgb(15 23 42 / .045), 0 2px 4px rgb(15 23 42 / .09), 0 8px 16px -5px rgb(15 23 42 / .13), 0 26px 40px -18px rgb(15 23 42 / .34);
  --tecla-img: linear-gradient(to bottom, rgb(255 255 255 / .75), rgb(255 255 255 / 0) 55%, rgb(15 23 42 / 0) 60%, rgb(15 23 42 / .04));
  --tecla: inset 0 1px 0 rgb(255 255 255 / .9), inset 0 -1px 0 rgb(15 23 42 / .06), 0 1px 2px rgb(15 23 42 / .10), 0 3px 6px -3px rgb(15 23 42 / .12);
  --prim-img: linear-gradient(to bottom, rgb(255 255 255 / .26), rgb(255 255 255 / 0) 50%, rgb(0 0 0 / 0) 55%, rgb(0 0 0 / .14));
  --prim: inset 0 1px 0 rgb(255 255 255 / .32), inset 0 -1px 0 rgb(0 0 0 / .18), 0 2px 4px rgb(51 65 85 / .22), 0 8px 16px -6px rgb(51 65 85 / .42);
  --icone-img: radial-gradient(circle at 32% 24%, rgb(255 255 255 / .9), rgb(255 255 255 / 0) 60%);
  --icone: inset 0 -1.5px 2px rgb(15 23 42 / .10), 0 1px 2px rgb(15 23 42 / .12);
  --premido: inset 0 1px 3px rgb(15 23 42 / .18);
  --poco: inset 0 1px 2px rgb(15 23 42 / .06);
  --cavado: inset 0 1px 3px rgb(15 23 42 / .07), inset 0 -1px 0 rgb(255 255 255 / .7);
  --ring: 0 0 0 4px rgb(51 65 85 / .10);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 400 16px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; text-wrap: pretty; }
h1, h2, h3, h4, label, th { text-wrap: balance; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
::selection { background: rgb(51 65 85 / .12); }
.ms {
  font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr;
  -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; flex: none;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.rf-label, h2 { font-size: 10px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; line-height: 1.5; }
.muted { color: var(--muted); }
.text-red { color: var(--red); font-weight: 700; }
.text-amber { color: var(--amber); font-weight: 700; }
.text-green { color: var(--green); font-weight: 700; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted); font-weight: 600; font-size: 14px; }

/* ================================================================ estrutura */
.layout { min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: 256px; display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid var(--s200);
  background-image: linear-gradient(to right, rgb(255 255 255 / 0) 85%, rgb(15 23 42 / .025));
  box-shadow: inset -1px 0 0 rgb(255 255 255 / .8), 6px 0 18px -10px rgb(15 23 42 / .22);
}
.side-head { flex: none; display: flex; flex-direction: column; gap: 12px; padding: 24px 24px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--s100); }
.side-logo { display: block; align-self: flex-start; }
.side-logo img { display: block; width: 180px; height: 44px; object-fit: contain; object-position: left center; }
.tenant-pill {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; max-width: 100%;
  background: rgb(51 65 85 / .05); border: 1px solid rgb(51 65 85 / .10); color: var(--primary); cursor: default;
}
label.tenant-pill { cursor: pointer; }
label.tenant-pill:hover { background: rgb(51 65 85 / .08); }
.tenant-pill > .ms { font-size: 16px; }
.tenant-pill > .chev { font-size: 16px; margin-left: auto; opacity: .7; }
.tenant-pill span:not(.ms), .tenant-pill select { min-width: 0; flex: 1; font: 900 11px/1.4 var(--font); color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-pill select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; padding: 0; margin: 0; cursor: pointer; outline: none; height: auto; min-height: 0; box-shadow: none; }
.tenant-pill select:focus-visible { text-decoration: underline; }
.tenant-pill.loc { background: transparent; border-color: var(--s200); }
.procurar {
  display: flex; align-items: center; gap: 8px; height: 40px; width: 100%; padding: 0 12px; border-radius: 16px;
  border: 1px solid rgb(226 232 240 / .8); background: var(--s50); color: var(--muted); cursor: pointer; transition: background-color .15s;
}
.procurar:hover { background: var(--s100); }
.procurar .ms { font-size: 18px; }
.procurar span:not(.ms) { flex: 1; min-width: 0; text-align: left; font: 700 12px var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tecla { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--s200); background: #fff; font: 700 10px var(--font); color: var(--muted); box-shadow: 0 1px 0 var(--s200); }
.side-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 4px; padding-bottom: 16px; }
.side-nav a, .side-nav .nav-btn {
  display: flex; align-items: center; gap: 16px; padding: 14px 24px; color: var(--muted); font: 700 14px/1.3 var(--font); letter-spacing: .025em;
  border: 0; border-right: 4px solid transparent; background: transparent; text-align: left; cursor: pointer; transition: color .2s, background-color .2s;
}
.side-nav a .ms, .side-nav .nav-btn .ms { font-size: 22px; }
.side-nav a:hover, .side-nav .nav-btn:hover { color: var(--s600); background: var(--s50); }
.side-nav a.active { color: var(--primary); background: rgb(51 65 85 / .05); border-right-color: var(--primary); }
.side-nav a.active .ms { font-variation-settings: 'FILL' 1; }
.nav-section { padding: 16px 24px 4px; font-size: 10px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.nav-new { padding: 8px 16px; }
.new-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-radius: 16px; cursor: pointer;
  background-color: var(--primary); background-image: var(--prim-img); box-shadow: var(--prim); color: #fff; font: 700 14px var(--font); transition: transform .15s;
}
.new-btn .ms { font-size: 20px; }
.new-btn:hover { transform: scale(1.02); }
.new-btn:active { background-image: none; box-shadow: var(--premido); }
.only-narrow { display: none !important; }
.side-foot { flex: none; border-top: 1px solid var(--s100); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.side-user strong { display: block; font-size: 13px; font-weight: 800; color: var(--ink); line-height: 1.3; }
.side-user small { display: block; font-size: 10px; font-weight: 700; color: #6d28d9; text-transform: uppercase; letter-spacing: 1px; }
.side-ver { padding: 12px; border-top: 1px solid var(--s100); font-size: 10px; font-weight: 500; color: var(--muted); text-align: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--s100); color: var(--s700); font: 800 12px var(--font); background-image: var(--icone-img); box-shadow: var(--icone); }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; background-color: #fff; border: 1px solid var(--s200); }

.main { margin-left: 256px; min-width: 0; }
.page { max-width: 1280px; margin: 0 auto; padding: 0 32px 40px; }
.page > * + * { margin-top: 20px; }
.page > .page-head + * { margin-top: 0; }
.scrim { display: none; }
.dock { display: none; }

/* ---------------------------------------------------------------- cabeçalho: a ilha de vidro */
.page-head {
  position: sticky; top: 8px; z-index: 40; margin: 8px -24px 24px; padding: 8px 24px; border-radius: 28px;
  background-color: rgb(255 255 255 / .75); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  background-image: linear-gradient(to bottom, rgb(255 255 255 / .6), rgb(255 255 255 / 0) 40%, rgb(15 23 42 / 0) 60%, rgb(15 23 42 / .035)), linear-gradient(rgb(255 255 255 / .2), rgb(255 255 255 / .2));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .8), inset 0 1px 0 rgb(255 255 255 / .95), inset 0 -2px 0 rgb(15 23 42 / .05), 0 2px 6px rgb(15 23 42 / .08), 0 16px 32px -14px rgb(15 23 42 / .32);
}
@media (prefers-reduced-transparency: reduce) { .page-head { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: #fff; } }
.ph-row { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.ph-t { flex: 1; min-width: 0; }
.ph-t h1 { font-size: 18px; font-weight: 700; line-height: 1.25; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-t .rf-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-logo { display: none; }
.page-head .actions { display: flex; align-items: center; gap: 8px; flex: none; }
.hbtn {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted);
  background-color: #fff; border: 1px solid rgb(226 232 240 / .7); background-image: var(--tecla-img); box-shadow: var(--tecla); transition: color .15s, background-color .15s;
}
.hbtn .ms { font-size: 20px; }
.hbtn:hover { color: var(--s700); background-color: var(--s50); }
.hbtn:active { background-image: none; box-shadow: var(--premido); }
a.hbtn { color: var(--text); }
a.hbtn .ms { font-size: 22px; }
.user-menu { position: relative; }
.dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 10px); width: 280px; z-index: 60; padding: 8px;
  background: #fff; border: 1px solid var(--s100); border-radius: 24px; box-shadow: 0 25px 50px -12px rgb(15 23 42 / .25), 0 2px 6px rgb(15 23 42 / .06);
}
.user-menu.open .dropdown { display: block; }
.dropdown .who { display: flex; gap: 12px; align-items: flex-start; padding: 12px 12px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--s100); }
.dropdown .who strong { display: block; font-size: 14px; font-weight: 800; color: var(--ink); }
.dropdown .who small { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 12px; color: var(--s700); font: 600 14px var(--font); cursor: pointer; text-align: left; }
.dropdown a .ms, .dropdown button .ms { font-size: 20px; color: var(--muted); }
.dropdown a:hover, .dropdown button:hover { background: var(--s50); }
.role-pill { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; background: var(--s100); color: var(--s600); font: 800 10px/1.6 var(--font); text-transform: uppercase; letter-spacing: .05em; }

/* pesquisa, «Filtros» e pastilhas dentro da ilha */
.ph-tools { display: flex; gap: 8px; margin-top: 8px; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field > .ms { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--muted); pointer-events: none; }
.search-field input {
  display: block; width: 100%; height: 44px; padding: 0 16px 0 44px; border-radius: 999px; border: 1px solid var(--s200); background: #fff;
  font: 600 14px var(--font); color: var(--ink); box-shadow: var(--poco); outline: none; -webkit-appearance: none; appearance: none;
}
.search-field input::placeholder { color: var(--muted); font-weight: 500; }
.search-field input:focus { border-color: rgb(51 65 85 / .4); box-shadow: var(--ring); }
.search-field.big input { height: 48px; border-radius: 16px; background: var(--s100); border-color: transparent; }
.search-field.big input:focus { background: #fff; }
.ph-filters { margin-top: 8px; padding: 16px; background: #fff; border: 1px solid var(--s100); border-radius: 24px; background-image: var(--relevo-img); box-shadow: var(--relevo); }
.filters-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--s200); background-color: #fff; color: var(--muted); font: 600 14px var(--font);
  background-image: var(--tecla-img); box-shadow: var(--tecla); transition: color .15s, background-color .15s;
}
.chip:hover { color: var(--s700); }
.chip .ms { font-size: 18px; }
.chip.on { background-color: var(--primary); border-color: var(--primary); color: #fff; background-image: var(--prim-img); box-shadow: var(--prim); }
.chip:active { background-image: none; box-shadow: var(--premido); }

/* ================================================================ botões (a família «rf-btn») */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 16px; cursor: pointer;
  font: 600 14px/1.25 var(--font); text-align: center; white-space: nowrap; text-decoration: none;
  background-color: #fff; border: 1px solid var(--s200); color: var(--s700); background-image: var(--tecla-img); box-shadow: var(--tecla);
  transition: background-color .15s, color .15s, transform .1s;
}
.btn .ms { font-size: 20px; }
.btn:hover { background-color: var(--s50); text-decoration: none; }
.btn:active:not(:disabled) { background-image: none; box-shadow: var(--premido); transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; background-image: none; box-shadow: none; }
.btn.primary { background-color: var(--primary); border-color: var(--primary); color: #fff; background-image: var(--prim-img); box-shadow: var(--prim); }
.btn.primary:hover { background-color: var(--primary-dark); }
.btn.primary:disabled { opacity: .4; box-shadow: none; }
.btn.danger { background-color: #dc2626; border-color: #dc2626; color: #fff; background-image: linear-gradient(to bottom, rgb(255 255 255 / .22), rgb(255 255 255 / 0) 50%, rgb(0 0 0 / 0) 55%, rgb(0 0 0 / .14)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .28), inset 0 -1px 0 rgb(0 0 0 / .18), 0 2px 4px rgb(220 38 38 / .2), 0 8px 16px -6px rgb(220 38 38 / .35); }
.btn.danger:hover { background-color: #b91c1c; }
.btn.small { height: 36px; padding: 0 14px; gap: 6px; font-size: 13px; }
.btn.small .ms { font-size: 18px; }
.btn.pill { height: 40px; padding: 0 16px; border-radius: 999px; }
#fBtn { height: 44px; flex: none; }
.btn.on { background-color: var(--s100); }
.btn .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font: 800 11px var(--font); }
.btn.block { width: 100%; }
.btn-add {
  width: 100%; min-height: 48px; padding: 10px 20px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border-radius: 16px; border: 2px dashed rgb(51 65 85 / .25); background: transparent; color: var(--primary); font: 600 14px var(--font); transition: background-color .15s;
}
.btn-add .ms { font-size: 20px; }
.btn-add:hover { background: rgb(51 65 85 / .05); }
.link-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; background: none; border: 0; padding: 0; color: var(--primary); font: 600 13px var(--font); cursor: pointer; }
.link-btn .ms { font-size: 18px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
.link { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--primary); }
.link .ms { font-size: 18px; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.count-pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--s100); color: var(--s600); font: 800 10px var(--font); letter-spacing: 0; vertical-align: 1px; }

/* ================================================================ cartões */
.card { background-color: #fff; border: 1px solid var(--s100); border-radius: 24px; background-image: var(--relevo-img); box-shadow: var(--relevo); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 4px; }
.sobe { transition: box-shadow .15s ease-out, transform .15s; }
@media (hover: hover) { .sobe:hover { box-shadow: var(--relevo-sobe); } }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.empty .ms { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 16px; background: var(--s100); color: var(--muted); }
.empty.ok .ms { background: #ecfdf5; color: var(--green); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 24px; text-align: center; }
.empty-state > .ms { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--s100); color: var(--muted); }
.empty-state strong { font-size: 14px; color: var(--s700); }
.empty-state p { font-size: 13px; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.kpis > .kpi:first-child { grid-column: span 2; }
.grid.kpis-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.kpis-6 > .kpi:first-child { grid-column: auto; }

/* indicador: rótulo, número grande na cor da marca e o ícone redondo à direita */
.kpi { position: relative; display: flex; flex-direction: column; padding: 16px; color: var(--text); text-decoration: none; min-height: 119px; }
a.kpi:hover { text-decoration: none; }
.kpi .rf-label { padding-right: 52px; line-height: 1.25; }
.kpi .value { margin-top: 4px; font-size: 38px; font-weight: 800; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: -.01em; padding-right: 52px; overflow-wrap: anywhere; }
.kpi .value .unit { font-size: 15px; font-weight: 800; margin-left: 4px; letter-spacing: 0; }
.kpi .sub { margin-top: auto; padding-top: 8px; font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.4; }
.kpi-ic { position: absolute; top: 32px; right: 16px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background-color: rgb(51 65 85 / .10); color: var(--primary); background-image: var(--icone-img); box-shadow: var(--icone); }
.kpi-ic .ms { font-size: 26px; }
.kpi.tone-red .value { color: var(--red); }
.kpi.tone-red .kpi-ic { background-color: rgb(239 68 68 / .10); color: var(--red); }
.kpi.tone-amber .value { color: var(--amber); }
.kpi.tone-amber .kpi-ic { background-color: rgb(245 158 11 / .12); color: var(--amber); }
.greet { margin-bottom: 20px; }
.greet .rf-label { margin-bottom: 4px; }
.greet h2 { font-size: 30px; font-weight: 800; line-height: 1.2; color: var(--text); text-transform: none; letter-spacing: -.01em; }
.greet h2 span { color: var(--primary); }

/* ================================================================ tabelas (a «mesa» da ReSOLVE) */
.table-wrap { overflow-x: auto; }
.card.table-wrap { overflow: hidden; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; padding: 16px 16px 12px; font-size: 10px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--s100); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--s100); vertical-align: middle; color: var(--ink); }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; }
th.right, td.right { text-align: right; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--s700); }
tr.clickable { cursor: pointer; transition: background-color .15s; }
tr.clickable:hover td { background: rgb(51 65 85 / .04); }
tr.clickable:active td { box-shadow: inset 0 1px 3px rgb(15 23 42 / .08); }
.table-foot { padding: 12px 20px; border-top: 1px solid var(--s100); font-size: 12px; font-weight: 600; color: var(--muted); }
.list-plain { list-style: none; margin: 0; padding: 4px 8px 8px; }
.list-plain li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 16px; }
.list-plain li:hover { background: var(--s50); }
.list-plain li a { color: var(--ink); font-weight: 500; font-size: 13.5px; min-width: 0; }
.list-plain li a strong { font-weight: 700; }
.list-plain .muted { font-size: 12.5px; }

/* pastilhas de estado: pontinho, texto a negrito e um aro interior */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  font: 700 11px/1 var(--font); background: var(--s50); color: var(--s600); box-shadow: inset 0 0 0 1px var(--s200);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.green { background: #ecfdf5; color: #047857; box-shadow: inset 0 0 0 1px #a7f3d0; }
.badge.amber { background: #fffbeb; color: #b45309; box-shadow: inset 0 0 0 1px #fde68a; }
.badge.red { background: #fef2f2; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.badge.blue { background: #f0f9ff; color: #0369a1; box-shadow: inset 0 0 0 1px #bae6fd; }
.badge.gray { background: var(--s50); color: var(--s600); box-shadow: inset 0 0 0 1px var(--s200); }

/* matrícula desenhada como a chapa real */
.plate { display: inline-flex; align-items: stretch; border: 2px solid #111827; border-radius: 6px; background: #fff; overflow: hidden; font: 800 15px/1 var(--font); letter-spacing: 1px; color: #111827; white-space: nowrap; vertical-align: middle; }
.plate .p-txt { padding: 6px 10px 5px; }
.plate .p-eu { background: #1d3f9a; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: end center; padding: 3px 4px; min-width: 18px; letter-spacing: 0; }
.plate.plate-sm { font-size: 12px; border-width: 1.5px; border-radius: 4px; }
.plate.plate-sm .p-txt { padding: 3px 6px 2px; }
.plate.plate-sm .p-eu { font-size: 7px; min-width: 11px; padding: 1px 2px; }
.file-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.file-link .ms { font-size: 18px; }

/* alertas */
.alert-list { list-style: none; margin: 0; padding: 4px 8px 8px; max-height: 470px; overflow-y: auto; }
.alert-list li a { display: flex; gap: 12px; padding: 12px; border-radius: 16px; color: inherit; align-items: flex-start; }
.alert-list li a:hover { background: var(--s50); }
.alert-list .dot { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.dot.danger { background: #ef4444; } .dot.warning { background: #f59e0b; } .dot.info { background: #0ea5e9; }
.alert-list .t { font-weight: 700; font-size: 14px; color: var(--ink); }
.alert-list .d { color: var(--muted); font-size: 12.5px; }
.alert-list .when { margin-left: auto; white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.alert-list .cat { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

/* gráficos: barras em «tubo» */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 700 10.5px var(--font); }
.chart .grid-line { stroke: var(--s100); stroke-width: 1; }
.chart .s0 { fill: var(--c0); } .chart .s1 { fill: var(--c1); } .chart .s2 { fill: var(--c2); } .chart .s3 { fill: var(--c3); }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background-image: radial-gradient(circle at 35% 30%, rgb(255 255 255 / .6), rgb(255 255 255 / 0) 62%); box-shadow: inset 0 -1px 1px rgb(0 0 0 / .22); }
.sw0 { background-color: var(--c0); } .sw1 { background-color: var(--c1); } .sw2 { background-color: var(--c2); } .sw3 { background-color: var(--c3); }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "bar bar"; gap: 6px 12px; align-items: center; margin: 14px 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.hbar > span:first-child { grid-area: label; }
.hbar .track { grid-area: bar; height: 10px; background: var(--s100); border-radius: 999px; overflow: hidden; box-shadow: var(--cavado); }
.hbar .fill { height: 100%; background-color: var(--c0); border-radius: 999px; background-image: linear-gradient(to bottom, rgb(255 255 255 / .32), rgb(255 255 255 / 0) 45%, rgb(0 0 0 / 0) 55%, rgb(0 0 0 / .18)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .35); }
.hbar .fill.green { background-color: #10b981; } .hbar .fill.amber { background-color: #f59e0b; } .hbar .fill.red { background-color: #ef4444; } .hbar .fill.gray { background-color: var(--faint); } .hbar .fill.blue { background-color: #0ea5e9; }
.hbar .v { grid-area: value; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ficha (viatura e motorista) */
.detail-head { padding: 20px; }
.detail-head .title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head .title h1 { font-size: 20px; font-weight: 800; color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px 24px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--s100); }
.facts small { display: block; font-size: 10px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; }
.facts span { font-size: 14px; font-weight: 600; color: var(--ink); }
.facts > div { min-width: 0; overflow-wrap: anywhere; }

/* separadores: pastilhas (fichas) e segmentado (definições) */
.tabs { display: flex; gap: 8px; padding: 16px 16px 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--s200); background-color: #fff; color: var(--muted); font: 600 14px var(--font); background-image: var(--tecla-img); box-shadow: var(--tecla);
}
.tabs button.active { background-color: var(--primary); border-color: var(--primary); color: #fff; background-image: var(--prim-img); box-shadow: var(--prim); }
.tabs .n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--s100); color: var(--s600); font: 800 11px var(--font); }
.tabs button.active .n { background: rgb(255 255 255 / .2); color: #fff; }
.tabs.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: var(--s200); box-shadow: var(--cavado); }
.tabs.seg button { height: 40px; border: 0; background: transparent; box-shadow: none; background-image: none; color: var(--s600); justify-content: center; padding: 0 12px; }
.tabs.seg button:hover { color: var(--ink); }
.tabs.seg button.active { background-color: #fff; color: var(--ink); background-image: var(--tecla-img); box-shadow: 0 0 0 1px rgb(15 23 42 / .06), inset 0 1px 0 rgb(255 255 255 / .9), 0 1px 2px rgb(15 23 42 / .12), 0 3px 6px -3px rgb(15 23 42 / .14); }
.settings-tabs > .tab-body { margin-top: 20px; }
.tab-actions { padding: 8px 16px 16px; }
.tab-body > .table-wrap { border-top: 1px solid var(--s100); }

/* ================================================================ formulários (o «rf-campo») */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid > *, .field > * { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field.wide, .field.auto-wide { grid-column: 1 / -1; }
.field > label, .flabel { font-size: 10px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; line-height: 1.4; }
.req { color: var(--red); }
.help { font-size: 12px; font-weight: 500; color: var(--muted); }
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  display: block; width: 100%; max-width: 100%; height: 48px; padding: 0 16px; border-radius: 16px; border: 1px solid transparent;
  background-color: var(--s100); color: var(--ink); font: 600 14px var(--font); outline: none; box-shadow: var(--poco);
  -webkit-appearance: none; appearance: none; transition: background-color .15s, border-color .15s, box-shadow .15s;
}
:where(input, textarea)::placeholder { color: var(--muted); font-weight: 500; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea):focus { background-color: #fff; border-color: rgb(51 65 85 / .4); box-shadow: var(--ring); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
textarea { height: auto; min-height: 96px; padding: 12px 16px; line-height: 1.625; resize: vertical; }
select {
  padding-right: 40px; cursor: pointer; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center; background-repeat: no-repeat; background-size: 20px 20px;
}
input[type=date], input[type=time] { line-height: 48px; text-align: left; min-width: 0; }
input::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type=date]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input[type=number] { -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=search]::-webkit-search-decoration, input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
input.invalid, select.invalid, textarea.invalid { border-color: #ef4444 !important; background-color: #fef2f2 !important; }
.combo-free { margin-top: 8px; }
.form-error, .form-ok { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.form-error { background: #fef2f2; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.form-ok { background: #ecfdf5; color: #047857; box-shadow: inset 0 0 0 1px #a7f3d0; }
.confirm-text { font-size: 14px; color: var(--s600); line-height: 1.6; }

/* sim/não: o interruptor da ReSOLVE, numa linha preenchida como os campos */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 12px 0 16px; border-radius: 16px; background: var(--s100); cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink); text-transform: none; letter-spacing: 0; }
input.switch { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 48px; height: 28px; margin: 0; border-radius: 999px; background: var(--s200); box-shadow: var(--cavado); cursor: pointer; transition: background-color .2s; }
input.switch::before { content: ''; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background-color: #fff; background-image: var(--icone-img); box-shadow: var(--icone); transition: transform .2s; }
input.switch:checked { background: var(--primary); }
input.switch:checked::before { transform: translateX(20px); }
input.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--s700); cursor: pointer; text-transform: none; letter-spacing: 0; }
.check input, .km-table input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); flex: none; }

/* escolha múltipla e intervalo: a «escolha» da ReSOLVE (pastilha preenchida, a escolhida na cor da marca) */
.chips, .escolhas { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { all: unset; position: relative; display: inline-flex; cursor: pointer; }
.chips .chip input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chips .chip span, .escolha {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent;
  background: var(--s100); color: var(--s700); font: 600 13px var(--font); cursor: pointer; transition: background-color .15s; min-width: 48px; white-space: nowrap;
}
.chips .chip:hover span, .escolha:hover { background: var(--s200); }
.chips .chip input:checked + span, .escolha[aria-pressed="true"] { background-color: var(--primary); border-color: var(--primary); color: #fff; background-image: var(--prim-img); box-shadow: var(--prim); }
.chips .chip input:focus-visible + span { box-shadow: var(--ring); }
.chips .chip input:disabled + span { opacity: .6; cursor: default; }
.period .escolhas { margin-top: 12px; }
.period-dates { margin-top: 16px; }

.file-box { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 2px dashed rgb(51 65 85 / .2); }
.file-box input[type=file] { max-width: 100%; font: 500 13px var(--font); color: var(--muted); }
.file-box input[type=file]::file-selector-button { margin-right: 12px; height: 36px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--s200); background: #fff; color: var(--s700); font: 600 13px var(--font); cursor: pointer; box-shadow: var(--tecla); }

/* registo periódico de quilómetros */
.km-table td { padding: 10px 12px; }
.km-table input[type=number] { height: 44px; max-width: 170px; }
.km-last { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.km-table td:first-child .muted { margin-left: 8px; font-weight: 500; }
.row-msg { font-size: 12px; margin-top: 4px; font-weight: 600; }

/* ================================================================ diálogos */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgb(0 0 0 / .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: rf-fade .2s ease-out;
}
.modal-backdrop.top { align-items: flex-start; padding-top: 12vh; }
.modal {
  position: relative; width: 100%; max-width: 32rem; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 40px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25); animation: rf-zoom .28s cubic-bezier(.2, .8, .2, 1);
}
.modal.wide { max-width: 42rem; }
.sheet-handle { display: none; }
.modal-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 24px 24px 16px; }
.modal-head h2 { flex: 1; min-width: 0; font-size: 20px; font-weight: 800; line-height: 1.25; color: var(--text); text-transform: none; letter-spacing: -.01em; }
.close-btn { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background-color: var(--s100); color: var(--muted); background-image: var(--tecla-img); box-shadow: var(--tecla); }
.close-btn .ms { font-size: 20px; }
.close-btn:hover { background-color: var(--s200); }
.tile { flex: none; width: 40px; height: 40px; border-radius: 16px; display: grid; place-items: center; background-color: rgb(51 65 85 / .10); color: var(--primary); background-image: var(--icone-img); box-shadow: var(--icone); }
.tile .ms { font-size: 22px; }
.tile.tone-red { background-color: rgb(239 68 68 / .10); color: var(--red); }
.tile.sm { width: 36px; height: 36px; border-radius: 12px; }
.tile.sm .ms { font-size: 20px; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 24px 8px; }
.modal-foot { flex: none; display: flex; flex-wrap: wrap-reverse; gap: 12px; padding: 16px 24px 24px; }
.modal-foot > * { flex: 1 1 0; min-width: fit-content; }
.modal-foot .left { flex-basis: 100%; background-color: #fff; color: #dc2626; border-color: #fecaca; background-image: var(--tecla-img); box-shadow: var(--tecla); }
.modal-foot .left:hover { background-color: #fef2f2; }
@keyframes rf-fade { from { opacity: 0; } }
@keyframes rf-zoom { from { opacity: 0; transform: scale(.95); } }
@keyframes rf-sobe { from { transform: translateY(100%); } }
body.modal-open { overflow: hidden; }

/* «Novo registo» e «Procurar» */
.choice-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.choice {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 16px; text-align: left; cursor: pointer;
  background-color: #fff; border: 1px solid var(--s100); border-radius: 24px; background-image: var(--relevo-img); box-shadow: var(--relevo); transition: box-shadow .15s;
}
.choice:hover { box-shadow: var(--relevo-sobe); }
.choice:active { background-image: none; box-shadow: var(--premido); }
.choice .tile { width: 48px; height: 48px; background-color: var(--s100); color: var(--ink); }
.choice .tile .ms { font-size: 24px; }
.ct { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ct strong { font-size: 14px; font-weight: 700; color: var(--ink); }
.ct small { font-size: 12px; font-weight: 500; color: var(--muted); }
.chev { color: var(--faint); font-size: 22px; }
.search-res { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; padding-bottom: 12px; }
.sr { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; color: inherit; }
.sr:hover, .sr.on { background: var(--s100); text-decoration: none; }

/* ================================================================ avisos */
#toasts { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 420px; padding: 12px 16px 12px 12px; border-radius: 16px;
  background: #fff; border: 1px solid #a7f3d0; box-shadow: 0 25px 50px -12px rgb(15 23 42 / .3); font-size: 13px; font-weight: 700; color: var(--ink); animation: rf-zoom .3s ease-out;
}
.toast .t-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #ecfdf5; color: var(--green); }
.toast .t-ic .ms { font-size: 20px; }
.toast.error { border-color: #fecaca; }
.toast.error .t-ic { background: #fef2f2; color: var(--red); }

/* ================================================================ empresas e perfil */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.company-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.company-card.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--relevo); }
.cc-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.cc-head > div { min-width: 0; }
.company-card h2 { font-size: 16px; font-weight: 800; text-transform: none; letter-spacing: -.01em; color: var(--ink); }
.company-card small { font-size: 12px; }
.company-card .stats { display: flex; gap: 22px; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; flex-wrap: wrap; }
.company-card .stats b { color: var(--primary); font-size: 24px; font-weight: 800; display: block; letter-spacing: 0; }
.company-card .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.profile-card { display: flex; align-items: center; gap: 16px; }
.profile-card strong { display: block; font-size: 18px; font-weight: 800; color: var(--ink); }
.profile-card small { display: block; font-size: 13px; color: var(--muted); }
form.card-pad h2 { margin-bottom: 14px; }
form.card-pad .field + .field { margin-top: 12px; }
form.card-pad > div:last-child .btn { margin-top: 4px; }

/* ================================================================ entrada (como o ecrã de entrada da ReSOLVE Facilities) */
.login { position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.login-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(64px); }
.blob.a { left: -96px; top: -96px; width: 416px; height: 416px; background: rgb(3 73 113 / .32); animation: rf-drift-a 21s ease-in-out infinite; }
.blob.b { right: -112px; top: 96px; width: 320px; height: 320px; background: rgb(116 185 132 / .40); animation: rf-drift-b 26s ease-in-out infinite; }
.blob.c { left: 25%; bottom: -112px; width: 448px; height: 448px; background: rgb(14 132 199 / .26); animation: rf-drift-c 17s ease-in-out infinite; }
@keyframes rf-drift-a { 50% { transform: translate3d(2.5rem, -1.5rem, 0) scale(1.12); } }
@keyframes rf-drift-b { 50% { transform: translate3d(-2rem, 1.75rem, 0) scale(1.08); } }
@keyframes rf-drift-c { 0%, 100% { transform: scale(1.05); } 50% { transform: translate3d(1.25rem, 1.25rem, 0) scale(.95); } }
.planta { position: absolute; inset: 0; background-image: radial-gradient(rgb(15 23 42 / .14) 1px, transparent 1.3px); background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(70% 55% at 50% 30%, #000, transparent 75%); mask-image: radial-gradient(70% 55% at 50% 30%, #000, transparent 75%); }
.planta.clara { background-image: radial-gradient(rgb(255 255 255 / .09) 1px, transparent 1.3px); background-size: 20px 20px; -webkit-mask-image: none; mask-image: none; }
.login-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 48px 24px 24px; }
.login-col { width: 100%; max-width: 448px; margin: 0 auto; }
.login-logo { position: relative; display: flex; justify-content: center; margin-bottom: 8px; }
.login-logo .halo { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); height: 96px; background: rgb(255 255 255 / .6); filter: blur(40px); border-radius: 50%; z-index: -1; }
.login-logo img { height: 96px; width: auto; max-width: 80vw; object-fit: contain; filter: drop-shadow(0 1px 2px rgb(15 23 42 / .08)); }
.login-sub { text-align: center; font-size: 14px; font-weight: 500; color: var(--muted); margin: 6px 0 32px; }
.glass {
  display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 24px;
  background-color: rgb(255 255 255 / .6); border: 1px solid rgb(255 255 255 / .85); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgb(15 23 42 / .06), 0 24px 44px -20px rgb(15 23 42 / .35); animation: rf-up .7s cubic-bezier(.2, .8, .2, 1) both .25s;
}
@keyframes rf-up { from { opacity: 0; transform: translateY(12px); } }
.glass-head h1 { font-size: 20px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.glass-head p, .glass-txt { font-size: 13px; color: var(--muted); line-height: 1.55; }
.glass-head strong { color: var(--ink); }
.in-ic { position: relative; }
.in-ic > .ms { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--muted); pointer-events: none; transition: color .15s; }
.in-ic:focus-within > .ms { color: var(--primary); }
.in-ic input { padding-left: 48px; }
.glass .form-error, .glass .form-ok { margin: 0; }
.demo-hint { margin-top: 20px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }
.demo-hint code { font: 700 12px var(--font); color: var(--primary); }
.login-brand { display: none; }

/* ================================================================ computador (com rato) vs. telemóvel e tablet — como na ReSOLVE */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .login-brand {
    display: flex; position: absolute; inset: 0 auto 0 0; width: 50%; z-index: 10; flex-direction: column; justify-content: center; gap: 28px; padding: 0 7%;
    overflow: hidden; color: #fff; background: linear-gradient(160deg, #02253b 0%, #034971 55%, #06324f 100%);
  }
  .login-brand .aura { position: absolute; inset: 0; filter: blur(10px); background: radial-gradient(45% 40% at 85% 15%, rgb(116 185 132 / .45), transparent 70%), radial-gradient(55% 45% at 10% 95%, rgb(14 165 233 / .35), transparent 70%); }
  .login-brand img { position: relative; width: 256px; height: auto; filter: drop-shadow(0 25px 25px rgb(0 0 0 / .15)); }
  .lb-head { position: relative; font-size: 2.6rem; line-height: 1.12; font-weight: 800; letter-spacing: -.025em; max-width: 14em; }
  .login-brand ul { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 15px; color: #e2e8f0; }
  .login-brand li { display: flex; align-items: center; gap: 12px; }
  .login-brand li .ms { width: 36px; height: 36px; border-radius: 16px; display: grid; place-items: center; background: rgb(255 255 255 / .1); font-size: 20px; }
  .login-main { margin-left: 50%; }
}

@media (max-width: 1279px) and (min-width: 1024px) {
  .grid.kpis-7 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.kpis-7 > .kpi:first-child { grid-column: span 2; }
  .grid.kpis-7 > .kpi:last-child { grid-column: span 2; }
}

/* telemóvel e tablet: sem barra lateral; cápsula flutuante em baixo com o «+», cabeçalho em ilha */
@media (max-width: 1023px), (hover: none), (pointer: coarse) {
  .main { margin-left: 0; }
  .page { padding: 0 16px calc(128px + env(safe-area-inset-bottom)); }
  .page > * + * { margin-top: 16px; }
  .page-head { margin: 8px -8px 16px; padding: 8px; top: max(8px, env(safe-area-inset-top)); }
  .ph-row { gap: 8px; }
  .ph-t h1 { font-size: 18px; }
  .page-head.home .ph-t { display: none; }
  .page-head.home .ph-logo { display: block; flex: 1; min-width: 0; padding-left: 4px; }
  .page-head.home .ph-logo img { display: block; height: 40px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
  .hide-narrow { display: none; }
  .btn.pill:has(> .hide-narrow) { width: 40px; padding: 0; gap: 0; }
  .ph-tools { margin-top: 8px; }
  .chips-wrap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 8px -8px 0; padding: 0 8px 4px; scroll-padding-inline: 8px; }
  .chips-wrap::-webkit-scrollbar { display: none; }
  .chips-row { flex-wrap: nowrap; }
  .filters-grid { grid-template-columns: minmax(0, 1fr); }
  .dropdown { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 64px); right: 8px; width: min(300px, calc(100vw - 16px)); }

  /* a barra lateral passa a gaveta (abre no «Menu») */
  .sidebar {
    width: 300px; max-width: 86vw; border-radius: 0 40px 40px 0; border-right: 0; z-index: 90;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
    transform: translateX(-105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 25px 50px -12px rgb(0 0 0 / .35);
  }
  .sidebar.open { transform: none; }
  .only-narrow { display: flex !important; }
  .nav-section.only-narrow { display: block !important; }
  .side-nav .nav-new { display: none; }
  .procurar .tecla { display: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 85; background: rgb(0 0 0 / .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.show { opacity: 1; pointer-events: auto; }

  .dock {
    display: flex; position: fixed; z-index: 50; left: 12px; right: 12px; margin: 0 auto; max-width: 336px; height: 48px;
    bottom: calc(1.5rem + env(safe-area-inset-bottom)); border-radius: 999px; align-items: center; justify-content: space-around;
    background-color: rgb(255 255 255 / .75); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    background-image: linear-gradient(to bottom, rgb(255 255 255 / .55), rgb(255 255 255 / 0) 45%, rgb(15 23 42 / 0) 55%, rgb(15 23 42 / .05));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .9), inset 0 -2px 0 rgb(15 23 42 / .06), 0 2px 6px rgb(15 23 42 / .10), 0 14px 28px -10px rgb(15 23 42 / .30);
  }
  .dock-item { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
  .dock-ic { display: inline-flex; align-items: center; justify-content: center; padding: 1px 14px; border-radius: 999px; transition: background-color .2s; }
  .dock-ic .ms { font-size: 22px; }
  .dock-l { font: 500 10px/1.2 var(--font); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dock-item.active { color: var(--primary); }
  .dock-item.active .dock-ic { background-color: rgb(51 65 85 / .10); background-image: linear-gradient(to bottom, rgb(255 255 255 / .6), rgb(255 255 255 / 0) 55%); box-shadow: inset 0 1px 0 rgb(255 255 255 / .8), inset 0 -1px 0 rgb(15 23 42 / .05), 0 1px 2px rgb(15 23 42 / .10), 0 2px 5px -2px rgb(15 23 42 / .12); }
  .dock-item.active .ms { font-variation-settings: 'FILL' 1; }
  .dock-new { flex: 1; display: flex; justify-content: center; }
  .dock-plus { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #fff; background-color: var(--primary); background-image: var(--prim-img); box-shadow: var(--prim); transition: transform .15s; }
  .dock-plus .ms { font-size: 26px; }
  .dock-plus:active { transform: scale(.95); background-image: none; box-shadow: var(--premido); }

  .grid.two, .grid.halves { grid-template-columns: minmax(0, 1fr); }
  .grid.kpis, .grid.kpis-7, .grid.kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid.kpis-6 > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { min-height: 107px; }
  /* o número nunca parte («17 153 €», «24/09/2026»): encolhe com a largura; o ícone vai para o canto */
  .kpi .value { font-size: clamp(18px, 6.6vw, 26px); padding-right: 0; white-space: nowrap; overflow-wrap: normal; }
  .kpi > .kpi:first-child .value, .grid.kpis > .kpi:first-child .value, .grid.kpis-7 > .kpi:first-child .value { font-size: 26px; }
  .kpi .rf-label { padding-right: 40px; min-height: 26px; }
  .kpi .value .unit { font-size: 12px; margin-left: 3px; }
  .kpi-ic { width: 32px; height: 32px; top: 12px; right: 12px; }
  form.card-pad .btn.primary { width: 100%; }
  .kpi-ic .ms { font-size: 19px; }
  .greet h2 { font-size: 20px; }
  .greet { margin-bottom: 16px; }
  .card-pad, .detail-head { padding: 16px; }
  .card-head { padding: 16px 16px 4px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .detail-head .title h1 { width: 100%; order: 3; font-size: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .company-grid { grid-template-columns: minmax(0, 1fr); }
  #toasts { left: 12px; right: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }

  /* os campos a 16 px: com menos, o iPhone aproxima a página ao tocar num campo */
  :where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea), .search-field input { font-size: 16px; }
  .tenant-pill span:not(.ms), .tenant-pill select { font-size: 13px; }

  /* diálogos: folha que sobe de baixo, com a pega */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-backdrop.top { align-items: flex-end; padding-top: 0; }
  .modal, .modal.wide { max-width: none; max-height: 92vh; max-height: 92dvh; border-radius: 40px 40px 0 0; animation: rf-sobe .28s cubic-bezier(.2, .8, .2, 1); }
  .sheet-handle { display: block; flex: none; width: 40px; height: 6px; border-radius: 999px; background: var(--s300); margin: 12px auto 0; }
  .modal-head { padding: 12px 20px 12px; }
  .modal-body { padding: 4px 20px 8px; }
  .modal-foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--s100); }
  body.modal-open { position: fixed; left: 0; right: 0; width: 100%; }

  /* fichas: as pastilhas e as listas soltas, sem cartão à volta */
  .card:has(> .tabs:not(.seg)) { background: none; border: 0; box-shadow: none; background-image: none; }
  .card:has(> .tabs:not(.seg)) > .tabs { padding: 0 0 12px; margin: 0 -16px; padding-inline: 16px; }
  .card:has(> .tabs:not(.seg)) .tab-actions { padding: 0 0 12px; }
  .card:has(> .tabs:not(.seg)) .tab-body > .table-wrap { border-top: 0; }
}

/* tabelas → cartões no telemóvel (cada registo é um cartão com relevo, como os pedidos da ReSOLVE) */
@media (max-width: 760px) {
  .card.table-wrap.list-card, .tab-body > .table-wrap { background: none; border: 0; box-shadow: none; background-image: none; overflow: visible; }
  table.rtable, table.rtable tbody, table.rtable tr, table.rtable td { display: block; width: 100%; }
  table.rtable thead { display: none; }
  table.rtable tr { position: relative; padding: 14px 16px; margin-bottom: 12px; background-color: #fff; border: 1px solid var(--s100); border-radius: 24px; background-image: var(--relevo-img); box-shadow: var(--relevo); }
  .card:not(.list-card) table.rtable tr { box-shadow: none; background-image: none; border-radius: 0; margin: 0; border: 0; border-bottom: 1px solid var(--s100); }
  .card:not(.list-card) table.rtable tbody tr:last-child { border-bottom: 0; }
  .card:has(> .tabs:not(.seg)) table.rtable tr { background-color: #fff; border: 1px solid var(--s100); border-radius: 24px; background-image: var(--relevo-img); box-shadow: var(--relevo); margin-bottom: 12px; }
  table.rtable tr.clickable:hover td { background: transparent; }
  table.rtable tr.clickable:active { box-shadow: var(--premido); }
  table.rtable td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; text-align: right !important; font-size: 14px; min-height: 30px; }
  table.rtable td::before { content: attr(data-label); flex: none; max-width: 48%; text-align: left; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
  table.rtable td:first-child { justify-content: flex-start; text-align: left !important; font-size: 15px; font-weight: 700; padding: 0 0 8px; }
  table.rtable td:first-child::before { display: none; }
  table.rtable td.is-empty { display: none; }
  table.rtable td > * { min-width: 0; }
  table.rtable td input { max-width: 60%; }
  table.rtable.km-table td:last-child { flex-wrap: wrap; }
  table.rtable.km-table td:last-child input { flex: 1; max-width: none; min-width: 0; }
  table.rtable.km-table td:last-child .row-msg { flex-basis: 100%; text-align: left; }
  .modal table.rtable tr { box-shadow: none; background-image: none; border-color: var(--s200); }
  .table-foot { padding: 4px 8px 0; border: 0; text-align: center; }
}

html, body { touch-action: pan-x pan-y; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
