/* ==========================================================================
   AssetOS — folha de estilos
   Base: "Systematic Asset Intelligence" (maquetes) + login estilo LVENGINE
   ========================================================================== */

:root {
  --navy-950: #0b1220;
  --navy-900: #131b2e;
  --navy-800: #1e293b;
  --navy-700: #334155;
  --blue-700: #0047a0;
  --blue-600: #0058be;
  --blue-500: #2170e4;
  --blue-400: #4d8ef0;
  --blue-100: #dce9ff;
  --blue-50:  #eff4ff;
  --sky-300:  #7dd3fc;
  --brand-gradient: linear-gradient(135deg, var(--blue-500), var(--sky-300)); /* logótipo e botão primário */

  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #eff4ff;
  --surface-3: #e5eeff;
  --text: #0b1c30;
  --text-2: #45464d;
  --text-3: #76777d;
  --border: #dde3ee;
  --border-2: #c6c6cd;

  --green: #059669;   --green-bg: #d1fae5;
  --amber: #b45309;   --amber-bg: #fef3c7;
  --red: #ba1a1a;     --red-bg: #ffdad6;
  --slate: #475569;   --slate-bg: #e2e8f0;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, .16);
  --header-h: 0px;     /* barra superior: só existe em ecrãs pequenos (.mobilebar) */
  --sb-w: 264px;        /* largura da sidebar */
  --sb-w-min: 76px;     /* sidebar recolhida */
  --sb-gap: 0px;        /* sidebar encostada à margem */
  --top-h: 86px;        /* faixa de cima: logótipo da sidebar = 1.ª linha do cabeçalho */
  --font-title: "Google Sans Flex", "Inter", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
img { max-width: 100%; display: block; }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ms {
  font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal;
  font-size: 20px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; direction: ltr; vertical-align: middle;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-smoothing: antialiased; user-select: none;
}
.ms.sm { font-size: 18px; } .ms.xs { font-size: 16px; } .ms.lg { font-size: 24px; }
.ms.fill { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

/* ---------- Barra de progresso (navegação AJAX) ---------- */
#nav-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999;
  background: linear-gradient(90deg, var(--blue-500), var(--sky-300));
  box-shadow: 0 0 10px rgba(33, 112, 228, .6); opacity: 0;
  transition: width .25s ease, opacity .3s ease;
}
#nav-progress.on { opacity: 1; }
body.nav-loading main { opacity: .6; transition: opacity .15s; pointer-events: none; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  background: var(--brand-gradient); color: #fff;
}
.brand-mark .ms { font-size: 19px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; z-index: 60;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 8px;
}
.dropdown h6 { margin: 6px 8px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.dropdown button, .dropdown a {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none;
  font: inherit; color: var(--text); text-align: left; border-radius: var(--radius); cursor: pointer;
}
.dropdown button:hover, .dropdown a:hover { background: var(--surface-2); text-decoration: none; }
.dropdown .on { background: var(--blue-50); color: var(--blue-600); font-weight: 600; }
.dropdown .sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown form { margin: 0; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #3b82f6, #1e40af); color: #fff; font-weight: 600; font-size: 13px;
  border: 2px solid rgba(255,255,255,.2);
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; border: 0; }
.avatar.lt { background: var(--blue-100); color: var(--blue-700); border: 0; }
.avatar { overflow: hidden; position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 88px; height: 88px; font-size: 28px; border: 0; cursor: pointer; }
.avatar-edit { display: flex; align-items: center; gap: 20px; }
.avatar-cam { position: absolute; inset: auto 0 0 0; height: 28px; display: grid; place-items: center; background: rgba(15,23,42,.55); color: #fff; opacity: 0; transition: opacity .15s; }
.avatar.xl:hover .avatar-cam, .avatar.xl:focus-within .avatar-cam { opacity: 1; }

/* ==========================================================================
   Sidebar vertical (flutuante, recolhível)
   ========================================================================== */
.sidebar {
  position: fixed; z-index: 60; top: var(--sb-gap); bottom: var(--sb-gap); left: var(--sb-gap);
  width: var(--sb-w); display: flex; flex-direction: column; padding: 16px 14px 0;
  background: var(--surface);
  transition: width .2s ease, transform .25s ease;
}
body.has-sidebar { padding-left: calc(var(--sb-w) + var(--sb-gap)); transition: padding-left .2s ease; }

/* Topo: logótipo + site ativo (um só botão que abre a troca de site) */
.sb-top { display: flex; align-items: center; gap: 10px; min-height: 38px; margin-bottom: 14px; }
.sb-top .brand-mark { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.sb-top .brand-mark .ms { font-size: 21px; }
.sb-top .brand-mark:hover, .sb-co:hover .brand-mark { text-decoration: none; filter: brightness(1.05); }
.sb-ctx { position: relative; flex: 1; min-width: 0; }
/* O botão ocupa toda a faixa de cima da sidebar (anula o padding da sidebar e repõe-no por dentro) */
.sb-co {
  list-style: none; display: flex; align-items: center; gap: 12px; margin: -16px -14px 0; padding: 14px 18px 14px 14px;
  min-height: var(--top-h); color: var(--text); cursor: pointer; transition: background .15s;
}
.sb-co::-webkit-details-marker { display: none; }
.sb-co:hover, .sb-ctx[open] > .sb-co { background: #f3f5f9; }
.sb-co-lbl { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.sb-co-lbl b { display: block; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-co > .ms { color: var(--text-3); flex: none; }
.sb-ctx .sb-pop { top: calc(100% + 4px); left: -6px; width: calc(100% + 12px); min-width: 240px; }
.sb-ctx[open] > .sb-co .sb-chev { transform: none; }

/* Recolher / expandir (no fundo da barra, acima das Configurações) */
.sb-toggle { width: 100%; border: 0; background: none; font: inherit; text-align: left; flex: none; }

/* Espaçador: empurra recolher, configurações e utilizador para o fundo */
.sb-fill { flex: 1 1 auto; min-height: 12px; }

/* Ligações */
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-link {
  position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px;
  border-radius: 10px; color: #5b6070; font-size: 13.5px; font-weight: 500; cursor: pointer; list-style: none;
  white-space: nowrap;
}
.sb-link::-webkit-details-marker { display: none; }
.sb-link > .ms:first-child { font-size: 21px; color: #7c818d; flex: none; }
.sb-link:hover { background: #f4f5f8; color: var(--text); text-decoration: none; }
.sb-link:hover > .ms:first-child { color: var(--text-2); }
.sb-link.active { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.sb-link.active > .ms:first-child { color: var(--blue-600); font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.sb-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-chev { color: var(--text-3); transition: transform .15s; flex: none; }
details[open] > summary .sb-chev { transform: rotate(180deg); }
.sb-count {
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 9px; padding: 1px 7px; line-height: 1.5;
}

/* Submenu (Definições) */
.sb-group > summary { list-style: none; }
.sb-group > summary.active { background: none; color: var(--text); }
.sb-sub { position: relative; display: flex; flex-direction: column; gap: 2px; margin: 4px 0 6px 20px; padding-left: 14px; }
.sb-sub::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: #e3e6ec; }
.sb-sub a { height: 34px; display: flex; align-items: center; padding: 0 10px; border-radius: 8px; font-size: 13px; color: #6b7080; }
.sb-sub a:hover { background: #f4f5f8; color: var(--text); text-decoration: none; }
.sb-sub a.active { background: #f1f3f7; color: var(--text); font-weight: 600; }

/* Utilizador */
.sb-user { position: relative; margin: 8px -14px 0; border-top: 1px solid #eceef3; background: #fafbfc; }
.sb-user > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 14px; }
.sb-user > summary::-webkit-details-marker { display: none; }
.sb-user > summary:hover { background: #f3f5f8; }
.sb-user .avatar { border: 0; width: 36px; height: 36px; }
.sb-user-lbl { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sb-user-lbl b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-lbl small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Menus suspensos dentro da sidebar */
.sb-pop { left: 0; right: auto; width: 100%; min-width: 220px; max-height: min(60vh, 420px); overflow: auto; }
.sb-pop-up { top: auto; bottom: calc(100% + 6px); left: 8px; width: calc(100% - 16px); }

/* ---------- Sidebar recolhida (só ícones + tooltips) ---------- */
@media (min-width: 961px) {
  .sb-collapsed .sidebar { width: var(--sb-w-min); padding-left: 10px; padding-right: 10px; }
  .sb-collapsed body.has-sidebar { padding-left: calc(var(--sb-w-min) + var(--sb-gap)); }
  .sb-collapsed .sb-top { flex-direction: column; gap: 10px; }
  .sb-collapsed .sb-co-lbl,
  .sb-collapsed .sb-txt, .sb-collapsed .sb-chev, .sb-collapsed .sb-count,
  .sb-collapsed .sb-user-lbl, .sb-collapsed .sb-sub { display: none; }
  .sb-collapsed .sb-toggle .ms { transform: scaleX(-1); }
  .sb-collapsed .sb-ctx { flex: none; }
  .sb-collapsed .sb-co { margin: -16px -10px 0; padding: 14px 10px; justify-content: center; }
  .sb-collapsed .sb-link { justify-content: center; padding: 0; }
  .sb-collapsed .sb-user { margin-left: -10px; margin-right: -10px; }
  .sb-collapsed .sb-user > summary { justify-content: center; padding: 14px 0; }
  .sb-collapsed .sb-pop { left: calc(100% + 12px); top: 0; width: 240px; }
  .sb-collapsed .sb-pop-up { top: auto; bottom: 8px; left: calc(100% + 12px); }
  /* Contador passa a ponto vermelho */
  .sb-collapsed .sb-link:has(.sb-count)::after {
    content: ""; position: absolute; top: 8px; right: 14px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--red); border: 2px solid var(--surface);
  }
  /* Tooltips */
  .sb-collapsed [data-tip]:hover::before {
    content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%);
    background: var(--navy-900); color: #fff; font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 6px;
    white-space: nowrap; pointer-events: none; z-index: 70; box-shadow: var(--shadow);
  }
  .sb-collapsed details[open] > [data-tip]:hover::before { display: none; }
}

/* Barra superior móvel + gaveta */
.mobilebar, .sb-scrim { display: none; }
.sb-icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--text); }
.sb-icon-btn:hover { background: #f1f3f7; }

/* ---------- Escolher empresa ---------- */
.co-search { position: relative; margin-bottom: 26px; max-width: 640px; }
.co-search input {
  width: 100%; height: 52px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  padding: 0 16px 0 48px; font: inherit; font-size: 15px; box-shadow: var(--shadow-sm);
}
.co-search input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(33,112,228,.15); }
.co-search .ms { position: absolute; left: 16px; top: 15px; color: var(--text-3); font-size: 22px; }
.co-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 0 0 10px; }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.co-recent { margin-bottom: 28px; }
.co-card {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; font: inherit; color: var(--text);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.co-card:hover { border-color: var(--blue-400); box-shadow: 0 4px 14px rgba(33,112,228,.10); }
.co-card:active { transform: scale(.99); }
.co-card:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.co-card.is-current { border-color: var(--blue-100); background: var(--blue-50); }
.co-av {
  width: 42px; height: 42px; border-radius: 10px; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: hsl(var(--h) 55% 32%); background: hsl(var(--h) 70% 92%);
}
.co-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.co-main b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-main small { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-go { color: var(--text-3); opacity: 0; transition: opacity .12s, transform .12s; }
.co-card:hover .co-go { opacity: 1; transform: translateX(2px); color: var(--blue-600); }
.co-tag { flex: none; }
.pager.co-pager { border-top: 0; padding: 18px 0 0; }

/* ---------- Janelas modais (<dialog>) ---------- */
dialog.modal {
  width: min(680px, calc(100vw - 32px)); max-height: min(86vh, 760px); padding: 0; border: 0;
  border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.modal[open] { display: flex; animation: modal-in .16s ease-out; }
dialog.modal::backdrop { background: rgba(15,23,42,.45); backdrop-filter: blur(2px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-box { display: flex; flex-direction: column; width: 100%; min-height: 0; margin: 0; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.modal-head h3 .ms { color: var(--blue-600); }
.modal-body { padding: 18px 24px; overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }
.icon-x { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 4px; border-radius: 6px; }
.icon-x:hover { background: var(--surface-2); color: var(--text); }
/* Confirmação */
dialog.modal.confirm-modal { width: min(460px, calc(100vw - 32px)); }
.confirm-main { display: flex; gap: 16px; padding: 24px 24px 20px; }
.confirm-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #e8f0fe; color: var(--blue-600); }
.confirm-modal.is-danger .confirm-ico { background: #fdecea; color: var(--red); }
.confirm-text { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.confirm-text h3 { font-size: 16.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.confirm-text p { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.confirm-check { align-items: flex-start; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; }
.confirm-check input { margin-top: 1px; flex: none; }
.confirm-modal.is-danger .confirm-check input { accent-color: var(--red); }
.btn-danger-solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger-solid:hover { filter: brightness(.92); }

.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--blue-600); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Exemplos (preenchimento rápido) */
.ex-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ex-group-head h4 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 0; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); font-size: 13px; user-select: none;
  transition: background .1s, border-color .1s, color .1s;
}
.ex-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ex-chip:hover { border-color: var(--blue-400); }
.ex-chip:has(input:focus-visible) { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.ex-chip.on { background: var(--blue-50); border-color: var(--blue-500); color: var(--blue-700); font-weight: 600; }
.ex-chip.on::before { content: "check"; font-family: "Material Symbols Outlined"; font-size: 16px; font-weight: normal; margin-left: -2px; }
.ex-chip.is-existing { cursor: default; opacity: .55; background: var(--surface-2); border-style: dashed; }
.ex-chip.is-existing span:last-child { text-decoration: line-through; }
.ex-chip.is-existing:hover { border-color: var(--border); }
.card-head .btn { margin-left: auto; }

/* ---------- Campos de escolha (dropdown com pesquisa) ---------- */
.combo { position: relative; }
.combo-native { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; }
.combo-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--text); background: var(--surface);
}
.combo-btn.is-placeholder .combo-lbl { color: var(--text-3); }
.combo-btn:disabled { cursor: not-allowed; opacity: .6; }
.combo-lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-chev { color: var(--text-3); flex: none; transition: transform .15s; pointer-events: none; }
.combo.open .combo-chev { transform: rotate(180deg); }
.combo.open .combo-btn, .combo.open > .input { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(33,112,228,.12); }
.combo-text > .input { padding-right: 34px; }
.combo-text > .combo-chev { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.combo-text.open > .combo-chev { transform: translateY(-50%) rotate(180deg); }
.combo-ic { flex: none; }
.combo-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.combo-code {
  flex: none; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text-3);
  background: var(--surface-2); border-radius: 4px; padding: 1px 5px;
}
.combo-pop {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; animation: combo-in .12s ease-out;
}
.combo.up .combo-pop { top: auto; bottom: calc(100% + 6px); }
@keyframes combo-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.combo-search {
  margin: 8px 8px 4px; height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px;
  font: inherit; font-size: 13.5px; background: var(--surface-2);
}
.combo-search:focus { outline: none; border-color: var(--blue-500); background: #fff; }
.combo-list { max-height: 260px; overflow: auto; padding: 4px; }
.combo-opt {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px;
}
.combo-opt.act { background: var(--surface-2); }
.combo-opt.sel { font-weight: 600; color: var(--blue-700); }
.combo-opt.sel::after { content: "check"; font-family: "Material Symbols Outlined"; font-size: 18px; margin-left: auto; color: var(--blue-600); font-weight: normal; }
.combo-opt.is-none .combo-lbl { color: var(--text-3); font-style: italic; }
.combo-empty { padding: 12px 10px; color: var(--text-3); font-size: 13px; }
.combo-create {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; border: 0; border-top: 1px solid var(--border);
  background: var(--surface-2); color: var(--blue-600); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.combo-create:hover { background: var(--blue-50); }
.combo-create span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Painel lateral (desliza da direita) ---------- */
dialog.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(480px, 100vw); max-width: 100vw;
  padding: 0; border: 0; border-radius: 16px 0 0 16px; background: var(--surface); color: var(--text);
  box-shadow: -18px 0 48px rgba(15,23,42,.18); overflow: hidden;
}
dialog.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .22s cubic-bezier(.2,.8,.2,1); }
dialog.drawer::backdrop { background: rgba(15,23,42,.35); backdrop-filter: blur(1px); }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
.drawer-form { display: flex; flex-direction: column; height: 100%; min-height: 0; margin: 0; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 16px; border-bottom: 1px solid var(--border); }
.drawer-head .eyebrow { display: block; margin-bottom: 4px; }
.drawer-head h3 { font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.drawer-head h3 .ms { color: var(--blue-600); }
.drawer-body { flex: 1; overflow: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.drawer-body .form-grid { margin: 0; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }
.drawer-sep { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.drawer-sep::before, .drawer-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.drawer-loading { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-3); padding: 40px; }
.drawer-loading .ms { font-size: 30px; }
.drawer-loading .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog.drawer.drawer-wide { width: min(580px, 100vw); }
.drawer-body details.fold { margin: 0 -24px; }
.drawer-body details.fold:last-child { border-bottom: 1px solid var(--border); }
.drawer-foot .mr-auto { margin-right: auto; }

/* ---------- Últimas compras: um cartão por compra ---------- */
.orders { display: flex; flex-direction: column; gap: 14px; }
.orders + .pager { border-top: 0; padding: 18px 0 0; }
.order { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.order-head {
  display: grid; grid-template-columns: auto auto minmax(0, 1.4fr) auto minmax(0, 1.6fr); gap: 8px 32px; align-items: start;
  padding: 14px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13px;
}
.oh-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.oh-cell span, .oh-ref span { color: var(--text-3); font-size: 12px; }
.oh-cell b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oh-ref { text-align: right; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.oh-ref b { font-weight: 600; }
.oh-links { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px 16px; }
.oh-links a { display: inline-flex; align-items: center; gap: 3px; }
.order-body { padding: 16px 20px 6px; }
.order-state { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: #047857; }
.order-state.wait { color: #7c3aed; }
.order-state .faint { font-size: 13px; font-weight: 400; }
.order-line { display: grid; grid-template-columns: 76px minmax(0, 1fr) 240px; gap: 18px; align-items: start; padding: 12px 0 14px; }
.order-line + .order-line { border-top: 1px solid var(--border); }
.ol-thumb { position: relative; display: block; width: 76px; height: 76px; }
.ol-thumb .thumb.lg { width: 76px; height: 76px; border-radius: 10px; object-fit: contain; background: #fff; }
.ol-thumb .thumb.lg.ph .ms { font-size: 34px; }
.ol-qty {
  position: absolute; right: -6px; bottom: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--blue-700); background: #fff; border: 1px solid var(--border-2);
}
.ol-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ol-name { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.ol-meta { font-size: 12.5px; color: var(--text-3); }
.ol-meta .tag-sm { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--blue-600); }
.ol-price b { font-weight: 700; font-size: 14px; }
.ol-price .faint { font-size: 12.5px; }
.ol-status { display: flex; flex-wrap: wrap; gap: 6px; }
.ol-actions { display: flex; flex-direction: column; gap: 8px; }
.ol-actions form { margin: 0; }
.ol-actions .btn { justify-content: center; }
@media (max-width: 900px) {
  .order-head { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .oh-ref { grid-column: 1 / -1; text-align: left; flex-direction: row; justify-content: space-between; flex-wrap: wrap; }
  .order-line { grid-template-columns: 64px minmax(0, 1fr); }
  .ol-thumb, .ol-thumb .thumb.lg { width: 64px; height: 64px; }
  .ol-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .ol-actions > * { flex: 1 1 180px; }
}

/* ---------- Editar rápido: topo com a imagem do equipamento ---------- */
.qe-hero {
  position: relative; flex: none; padding: 20px 24px 22px; color: #fff; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 100%, #38bdf8 0%, transparent 45%), linear-gradient(135deg, #2170e4 0%, #3b82f6 55%, #3730a3 100%);
}
.qe-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.qe-hero .eyebrow { display: block; margin-bottom: 4px; color: rgba(255,255,255,.75); }
.qe-hero h3 { font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: #fff; }
.qe-x {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff;
}
.qe-x:hover { background: rgba(255,255,255,.22); }
.qe-img { display: flex; align-items: center; gap: 18px; }
.qe-frame {
  width: 104px; height: 104px; flex: none; border-radius: 16px; background: #fff; display: grid; place-items: center;
  overflow: hidden; cursor: pointer; box-shadow: 0 10px 24px rgba(15,23,42,.22); outline: 2px dashed transparent; outline-offset: 3px;
  transition: outline-color .15s, transform .15s;
}
.qe-frame img { width: 100%; height: 100%; object-fit: contain; }
.qe-frame .ms { font-size: 48px; color: var(--c, var(--blue-500)); }
.qe-frame:hover, .qe-frame.over { outline-color: rgba(255,255,255,.85); }
.qe-frame.over { transform: scale(1.03); }
.qe-frame { position: relative; }
.qe-frame.saving::before { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.7); }
.qe-frame.saving::after {
  content: "progress_activity"; font-family: "Material Symbols Outlined"; font-size: 28px; line-height: 1; color: var(--blue-600);
  position: absolute; left: calc(50% - 14px); top: calc(50% - 14px); animation: spin 1s linear infinite;
}
.qe-img-side { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.qe-img-side b { font-size: 15px; font-weight: 600; }
.qe-img-side > span { font-size: 13px; color: rgba(255,255,255,.85); }
.qe-img-side small { font-size: 11.5px; color: rgba(255,255,255,.7); }
.qe-img-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.qe-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 9px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: #fff; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12);
}
.qe-btn:hover { background: rgba(255,255,255,.22); }
.qe-btn.solid { background: #fff; color: var(--blue-700); border-color: #fff; }
.qe-btn.solid:hover { background: var(--blue-50); }
.qe-btn.icon { width: 34px; padding: 0; justify-content: center; }
.qe-btn[hidden] { display: none; }
@media (max-width: 480px) { .qe-img { align-items: flex-start; } .qe-frame { width: 84px; height: 84px; } }
/* Seleção múltipla na lista de equipamentos */
.tbl .col-check { width: 44px; padding-right: 0; cursor: pointer; }
.tbl .col-check input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--blue-600); vertical-align: middle; }
.tbl tr.is-selected > td { background: var(--blue-50); }
.bulk-bar {
  position: sticky; top: calc(var(--header-h, 0px) + 8px); z-index: 20; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 8px 10px 8px 14px; border: 1px solid #cfe0fb; border-radius: var(--radius);
  background: var(--surface); box-shadow: 0 6px 18px rgba(15,23,42,.08); animation: pop .2s ease;
}
.bulk-bar[hidden] { display: none; }
.bulk-count { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--blue-700); font-size: 14px; }
.bulk-count .ms { color: var(--blue-600); }
/* Lista de equipamentos: seletor de vista e grelha de miniaturas */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.list-toolbar .seg .ms { font-size: 17px; }
.asset-grid-wrap { padding: 16px; }
.asset-grid-all { margin-bottom: 12px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.asset-card {
  display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); overflow: hidden; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s;
}
.asset-card:hover { border-color: #d6e2f5; box-shadow: 0 10px 26px rgba(15,23,42,.08); transform: translateY(-1px); }
.asset-card.is-selected { border-color: var(--blue-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-600) 18%, transparent); }
/* Imagem: caixa 4:3 fixa; a fotografia ajusta-se sem cortes e nunca muda o tamanho do cartão */
.asset-card-img {
  position: relative; flex: none; aspect-ratio: 4 / 3; min-height: 0; overflow: hidden; display: grid; place-items: center;
  background: #f4f6f9;
}
.asset-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 34px 18px 14px; mix-blend-mode: multiply; }
.asset-card-img > .ms { font-size: 60px; color: var(--c); opacity: .7; }
/* Estado: canto superior esquerdo, pequeno e sem contorno */
.asset-card-status {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px; max-width: calc(100% - 96px);
  height: 22px; padding: 0 9px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, white);
}
.asset-card-status::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
/* Ações: canto superior direito, botões redondos brancos */
.asset-card-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.asset-card-check, .asset-card-edit {
  display: grid; place-items: center; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 9px;
  background: #fff; color: var(--text-2); box-shadow: 0 1px 4px rgba(15,23,42,.14); cursor: pointer;
}
.asset-card-edit:hover { color: var(--blue-600); }
.asset-card-check input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--blue-600); }
.asset-card-edit { opacity: 0; transition: opacity .15s; }
.asset-card-check { opacity: 0; transition: opacity .15s; }
.asset-card:hover .asset-card-check, .asset-card:hover .asset-card-edit, .asset-card.is-selected .asset-card-check,
.asset-card-check:focus-within, .asset-card-edit:focus-visible { opacity: 1; }
@media (hover: none) { .asset-card-check, .asset-card-edit { opacity: 1; } }
/* Parte inferior com altura fixa: nome (2 linhas reservadas) + 2 linhas de informação com ícone */
.asset-card-body { display: grid; grid-template-rows: calc(2 * 1.3em) auto; row-gap: 12px; flex: none; padding: 14px 14px 16px; min-width: 0; }
.asset-card-name {
  font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--text); overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.asset-card-meta { display: grid; grid-template-columns: fit-content(62%) minmax(0, 1fr); grid-auto-rows: 20px; gap: 6px 10px; margin: 0; padding: 0; list-style: none; }
.asset-card-meta li { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--text-2); }
.asset-card-meta li .ms { flex: none; font-size: 16px; color: var(--text-3); }
.asset-card-meta li > span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-card-meta li .code { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.asset-card-meta li .faint { color: var(--text-3); }
@media (max-width: 640px) { .asset-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } .asset-grid-wrap { padding: 10px; } }
/* Botão "Editar rápido" nas linhas da lista */
.row-edit { opacity: 0; transition: opacity .15s; }
tr:hover .row-edit, .row-edit:focus-visible { opacity: 1; }
@media (hover: none) { .row-edit { opacity: 1; } }
@media (max-width: 640px) {
  dialog.drawer { border-radius: 0; width: 100vw; }
}

/* ---------- Layout ---------- */
/* Sem padding em cima: a 1.ª linha do cabeçalho tem a altura da faixa do logótipo (--top-h) e fica alinhada com ele */
.page { max-width: 1440px; margin: 0 auto; padding: 0 24px 64px; }
/* Cabeçalho da página: título e ações numa linha, a linha divisória e os breadcrumbs por baixo */
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: var(--top-h); column-gap: 16px; align-items: center; margin-bottom: 22px; }
.page-head > div:first-child { display: contents; }
.page-head h1 { grid-row: 1; grid-column: 1; font-family: var(--font-title); font-size: 32px; font-weight: 400; letter-spacing: -.01em; }
.page-head .actions { grid-row: 1; grid-column: 2; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-head::after {
  content: ""; grid-row: 2; grid-column: 1 / -1; height: 2px;
  /* a linha estende-se da sidebar até à margem direita (border-image-outset: só pinta, não cria scroll) */
  border-image: linear-gradient(#d3d6e6 0 1px, #fff 1px 2px) fill 0 / 0 / 0 100vw;
}
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; flex-wrap: wrap; }
/* No cabeçalho: por baixo do título, antes da linha */
.page-head .crumbs { grid-row: 3; grid-column: 1 / -1; margin: 16px 0 0; }
.crumbs a { color: var(--text-2); }
.crumbs .ms { font-size: 16px; color: var(--text-3); }

.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
.g-side { grid-template-columns: 300px minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.upper { text-transform: uppercase; }
.right { text-align: right; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }

/* ---------- Cartões ---------- */
.card {
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-lg);
}
.card-pad { padding: 24px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-head h2 .ms, .card-head h3 .ms { color: var(--blue-600); }
.card-body { padding: 20px 24px; }
.card-foot { padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card.tint { background: var(--blue-50); border-color: var(--blue-100); }
.card-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--text-2); }

/* KPIs */
.kpi { padding: 22px 24px; }
.kpi .val { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 14px; }
.kpi .val b { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.kpi .val small { font-size: 12px; font-weight: 600; }
.bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue-600); border-radius: 3px; }
.t-green { color: var(--green); } .t-red { color: var(--red); } .t-amber { color: var(--amber); } .t-blue { color: var(--blue-600); }
.bg-green { background: var(--green) !important; } .bg-red { background: var(--red) !important; } .bg-amber { background: #d97706 !important; }

/* Gráfico de barras */
.bars { display: flex; align-items: flex-end; gap: 18px; height: 230px; padding: 10px 0 0; border-bottom: 1px solid var(--border); }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; min-width: 0; }
.bars .col { width: 100%; max-width: 160px; border-radius: 4px 4px 0 0; min-height: 4px; position: relative; transition: height .5s ease; }
.bars .col span { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-weight: 600; font-size: 12.5px; color: var(--text); }
.bars-labels { display: flex; gap: 18px; padding-top: 10px; }
.bars-labels div { flex: 1; text-align: center; font-size: 12.5px; color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Alertas laterais */
.alert-item {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius); border-left: 4px solid;
  margin-bottom: 10px; color: inherit;
}
.alert-item:hover { text-decoration: none; filter: brightness(.98); }
.alert-item .eyebrow { font-size: 11px; }
.alert-item.red { background: #fdecea; border-color: var(--red); } .alert-item.red .ms, .alert-item.red .eyebrow { color: var(--red); }
.alert-item.blue { background: var(--blue-50); border-color: var(--blue-600); } .alert-item.blue .ms, .alert-item.blue .eyebrow { color: var(--blue-600); }
.alert-item.amber { background: #fff7e6; border-color: #d97706; } .alert-item.amber .ms, .alert-item.amber .eyebrow { color: var(--amber); }
.alert-item.gray { background: var(--surface-2); border-color: var(--navy-700); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn .ms { font-size: 19px; }
/* Primário: o mesmo degradé do logótipo (a sombra no texto mantém-no legível na ponta clara) */
.btn-primary {
  background: var(--blue-500) var(--brand-gradient); color: #fff; border-color: transparent;
  text-shadow: 0 1px 2px rgba(0, 40, 110, .35);
}
.btn-primary:hover { filter: brightness(.94) saturate(1.1); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--red); border-color: #f1b8b2; }
.btn-danger:hover { background: #fdecea; }
.btn-dark { background: var(--navy-900); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; gap: 4px; }
.btn-xs .ms { font-size: 16px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-square { width: 40px; }
.actions-sep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--border-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius);
  color: #aab4c8; position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; border: 2px solid var(--navy-900); }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text); letter-spacing: .01em; }
.field .hint { font-size: 12px; color: var(--text-3); }
.req::after { content: " *"; color: var(--red); }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: 14px var(--font);
  transition: border-color .15s, box-shadow .15s, background .3s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%2345464d' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; }
.input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(33,112,228,.15); }
.input[readonly] { background: var(--surface-2); }
.input.autofilled { background: #f0f7ff; border-color: #9cc2f7; }
.input-ic { position: relative; }
.input-ic > .ms { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-ic > .input { padding-left: 42px; }
.input-ic > .suffix { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.input-lg { height: 50px; font-size: 15px; }
input[type="color"].input { padding: 4px; width: 64px; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--blue-600); margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-section { padding: 22px 24px; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: 0; }

details.fold { border-top: 1px solid var(--border); }
details.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 24px;
  font-weight: 600; font-size: 15px; user-select: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .ms:first-child { color: var(--blue-600); }
details.fold > summary .chev { margin-left: auto; transition: transform .2s; color: var(--text-3); }
details.fold[open] > summary .chev { transform: rotate(180deg); }
details.fold > summary small { font-weight: 400; color: var(--text-3); font-size: 12.5px; }
details.fold > .fold-body { padding: 4px 24px 22px; }
details.fold > summary:hover { background: var(--surface-2); }

.autofill-note {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 0 24px 0;
  background: linear-gradient(90deg, #eef5ff, #f5f0ff); border: 1px solid #cfe0fb; border-radius: var(--radius);
  font-size: 13px; color: var(--blue-700);
  animation: pop .25s ease;
}
@keyframes pop { from { transform: translateY(-4px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Badges / chips ---------- */
.badge {
  --c: #64748b;
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 4px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, white);
  border: 1px solid color-mix(in srgb, var(--c) 22%, white);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.badge.plain::before { display: none; }
.badge.lg { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 4px;
  background: var(--surface-3); color: var(--blue-700); font-size: 12px; font-weight: 500;
}
/* Contador redondo (n.º de ativos de uma importação) */
.count-pill {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
  background: #eceef3; color: var(--text-2); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.dot-c { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.cat-ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none;
  color: var(--c, var(--blue-600)); background: color-mix(in srgb, var(--c, #2170e4) 12%, white); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-2); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl th a { color: inherit; display: inline-flex; align-items: center; gap: 2px; }
.tbl th a:hover { color: var(--blue-600); text-decoration: none; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: #fafcff; }
.tbl tr[data-href], .tbl tr[data-quick-edit] { cursor: pointer; }
.tbl tbody tr.row-pending { background: #f4f5f7; }
.tbl tbody tr.row-pending:hover { background: #eceef2; }
.tbl .tag { font-family: var(--mono); font-weight: 600; color: var(--blue-600); white-space: nowrap; }
.tbl .sub { display: block; font-size: 12px; color: var(--text-3); }
.tbl .sub .tag-sm { font-size: 11px; font-weight: 500; letter-spacing: .01em; }
.th-alt { font-weight: 500; opacity: .75; }
.tbl .thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.tbl .thumb.ph { display: grid; place-items: center; }
/* Miniatura do equipamento fora das tabelas e em tamanhos menores */
.thumb { width: 44px; height: 44px; max-width: none; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); flex: none; } /* tamanho fixo: sem max-width, senão encolhe em células com width:1% */
.thumb.ph { display: grid; place-items: center; }
.thumb.sm, .tbl .thumb.sm { width: 36px; height: 36px; }
.thumb.sm .ms { font-size: 19px; }
.thumb.xs, .tbl .thumb.xs { width: 22px; height: 22px; border-radius: 5px; }
.thumb.xs .ms { font-size: 14px; }
/* Linhas que desdobram */
.tbl tr.expandable { cursor: pointer; }
.row-toggle .ms { transition: transform .15s; }
.tbl tr.expandable.open .row-toggle .ms { transform: rotate(90deg); }
.tbl tr.expandable.open > td { background: var(--surface-2); border-bottom-color: transparent; }
.tbl tr.sub-row > td { background: var(--surface-2); padding: 0 12px 12px 48px; }
.tbl-inner { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tbl-inner td { padding-top: 8px; padding-bottom: 8px; }
.sub-row-foot { padding: 8px 4px 0; }
.asset-ref { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.alert-item > .thumb { margin-top: 2px; }
.tbl .chk { width: 40px; }
.empty { padding: 48px 24px; text-align: center; color: var(--text-2); }
.empty .ms { font-size: 44px; color: var(--border-2); display: block; margin: 0 auto 10px; }

.filters {
  display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(140px, 1fr)) auto; gap: 14px; align-items: end;
  padding: 18px 20px; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius-lg); margin-bottom: 20px;
}
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager nav { display: flex; gap: 6px; }
.pager a, .pager span.cur {
  min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius);
  border: 1px solid var(--border); color: var(--text); font-weight: 500; padding: 0 8px;
}
.pager a:hover { background: var(--surface-2); text-decoration: none; }
.pager span.cur { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-2); margin-bottom: 24px; overflow-x: auto; overflow-y: hidden; }
.tabs a {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--text-2); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--blue-600); border-bottom-color: var(--blue-600); font-weight: 600; }
.tabs .ms { font-size: 19px; }

/* ---------- Flash ---------- */
.flashes { position: fixed; top: calc(var(--header-h) + 18px); right: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 36px)); }
.flash {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: var(--radius-lg);
  background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px;
  animation: slidein .25s ease;
}
.flash .ms { flex: none; }
.flash.success .ms { color: #34d399; } .flash.error .ms { color: #f87171; }
.flash.warning .ms { color: #fbbf24; } .flash.info .ms { color: var(--sky-300); }
.flash button { margin-left: auto; background: none; border: 0; color: #8fa0bd; cursor: pointer; padding: 0; }
.flash.out { opacity: 0; transform: translateX(12px); transition: all .3s; }
@keyframes slidein { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.inline-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; }
.inline-alert.error { background: #fdecea; color: var(--red); border: 1px solid #f5c2bc; }
.inline-alert.info { background: #f0f7ff; color: var(--blue-700); border: 1px solid #cfe0fb; }
.inline-alert.success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* ---------- Detalhe de ativo ---------- */
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.specs .full { grid-column: 1 / -1; }
.specs dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.specs dd { margin: 0; font-size: 15px; word-break: break-word; }
.specs .asset-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.specs .asset-id .mono { font-size: 17px; font-weight: 700; letter-spacing: .02em; color: var(--text); }
.asset-hero { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
.asset-img {
  aspect-ratio: 1; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden;
}
.asset-img img { width: 100%; height: 100%; object-fit: cover; }
.asset-img .ms { font-size: 72px; color: var(--c, var(--blue-500)); opacity: .8; }
/* Controlo segmentado (rádios com aspeto de botões) */
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.seg label { margin: 0; cursor: pointer; }
.seg > a { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.seg > a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15,23,42,.08); }

/* ---------- Galeria de imagens ---------- */
.drop.drop-sm { min-height: 120px; padding: 18px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; padding: 4px 20px 20px; }
.gal-item { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.gal-img { display: block; aspect-ratio: 4/3; background: #f4f5f7; }
.gal-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gal-item figcaption { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 8px 8px 8px 10px; border-top: 1px solid var(--border); }
.gal-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gal-use { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Seletor da galeria (slider) */
dialog.modal.gal-picker { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.gp-stage { position: relative; display: grid; place-items: center; height: min(52vh, 480px); background: #f4f5f7; border-radius: 12px; overflow: hidden; }
.gp-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gp-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: var(--text); box-shadow: var(--shadow); cursor: pointer; }
.gp-nav:hover { background: #fff; color: var(--blue-600); }
.gp-nav:disabled { opacity: .35; cursor: default; }
.gp-prev { left: 12px; } .gp-next { right: 12px; }
.gp-cap { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); }
.gp-cap b { color: var(--text); font-weight: 600; }
.gp-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.gp-thumb { flex: none; width: 84px; height: 64px; border-radius: 8px; border: 2px solid transparent; padding: 0; background: #f4f5f7; cursor: pointer; overflow: hidden; scroll-snap-align: center; }
.gp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gp-thumb.on { border-color: var(--blue-600); box-shadow: 0 0 0 2px rgba(0,88,190,.2); }
.gp-empty { padding: 40px 20px; text-align: center; color: var(--text-3); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label > span { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--text-2, #6b7080); white-space: nowrap; }
.seg input:checked + span { background: var(--surface, #fff); color: var(--text); box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--blue-600); outline-offset: 1px; }
.custodian { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius); background: var(--blue-50); border: 1px solid var(--blue-100); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text-2); }
.kv span:last-child { text-align: right; font-weight: 500; }
/* "Sair" de um site partilhado (perfil): discreto, só ganha cor ao passar o rato */
.leave-site { display: inline; margin: 0 0 0 10px; }
.leave-site button { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 400; color: var(--text-3); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.leave-site button:hover { color: #ba1a1a; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 0 0 18px; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 2px; background: var(--border); }
.timeline .ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--blue-600); }
.timeline .ic .ms { font-size: 17px; }
.timeline .t-maintenance .ic { background: #fff3dc; color: var(--amber); }
.timeline .t-issue .ic { background: #fdecea; color: var(--red); }
.timeline .t-audit .ic { background: #dff7ec; color: var(--green); }
.timeline b { font-weight: 600; display: block; }
.timeline small { color: var(--text-3); font-size: 12px; }
.timeline p { margin-top: 4px; color: var(--text-2); font-size: 13px; white-space: pre-line; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-panel { padding: 16px; border: 1px dashed var(--border-2); border-radius: var(--radius); margin-top: 12px; background: #fcfdff; }

/* ---------- Etiqueta (pré-visualização e impressão) ---------- */
.label-card { background: var(--blue-50); border: 1px solid var(--blue-100); }
.label-preview-wrap { display: grid; place-items: center; padding: 18px; background: #fff; border: 2px dashed var(--border-2); border-radius: var(--radius); }
.lbl {
  --w: 101.6mm; --h: 50.8mm;
  width: var(--w); height: var(--h); background: #fff; color: #000; overflow: hidden;
  display: grid; grid-template-columns: 1fr auto; gap: 2.5mm; padding: 3mm 3.5mm; font-family: var(--font);
  box-sizing: border-box; position: relative; page-break-inside: avoid; break-inside: avoid;
}
.lbl .l-txt { display: flex; flex-direction: column; min-width: 0; }
.lbl .l-co { font-size: 2.5mm; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl .l-name { font-size: 4.1mm; font-weight: 800; line-height: 1.1; margin-top: 1.4mm; text-transform: uppercase; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lbl .l-meta { margin-top: auto; font-size: 2.3mm; line-height: 1.35; }
.lbl .l-meta span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl .l-id-k { font-size: 2.1mm; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-top: 1mm; }
.lbl .l-id { font-family: var(--mono); font-size: 4mm; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.lbl .l-qr { height: calc(var(--h) - 6mm); aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; }
.lbl .l-qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.lbl.sz-sm { padding: 1.8mm 2.2mm; gap: 1.8mm; }
.lbl.sz-sm .l-co { font-size: 1.8mm; } .lbl.sz-sm .l-name { font-size: 2.8mm; margin-top: .6mm; -webkit-line-clamp: 1; }
.lbl.sz-sm .l-id { font-size: 3mm; } .lbl.sz-sm .l-id-k { display: none; } .lbl.sz-sm .l-meta { font-size: 1.8mm; }
.lbl.sz-sm .l-qr { height: calc(var(--h) - 3.6mm); }
.lbl.sz-md { padding: 2.5mm 3mm; }
.lbl.sz-md .l-co { font-size: 2.1mm; } .lbl.sz-md .l-name { font-size: 3.2mm; } .lbl.sz-md .l-id { font-size: 3.3mm; }
.lbl.sz-md .l-meta { font-size: 2mm; } .lbl.sz-md .l-qr { height: calc(var(--h) - 5mm); }
.lbl.sz-xs { padding: 1.4mm 1.6mm; gap: 1.2mm; }
.lbl.sz-xs .l-co, .lbl.sz-xs .l-id-k, .lbl.sz-xs .l-meta { display: none; }
.lbl.sz-xs .l-name { font-size: 2.1mm; -webkit-line-clamp: 2; margin-top: 0; }
.lbl.sz-xs .l-id { font-size: 2.4mm; margin-top: auto; }
.lbl.sz-xs .l-qr { height: calc(var(--h) - 2.8mm); }
.preview-scale { transform-origin: center; }

/* ---------- Seleção de etiquetas ---------- */
.sel-bar {
  position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; margin-top: 16px; border-radius: var(--radius-lg);
  background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg);
}

/* ---------- Navegação móvel ---------- */
.bottomnav { display: none; }

/* ==========================================================================
   Autenticação (cartão dividido, painel em gradiente)
   ========================================================================== */
.auth-body { background: #1f1f22; min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.auth-shell {
  width: 100%; max-width: 1080px; min-height: 640px; display: grid; grid-template-columns: 1fr 1fr;
  background: #fff; border-radius: 28px; padding: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.auth-hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 22px; padding: 44px 44px 40px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(60% 45% at 35% 22%, rgba(186, 222, 255, .55), transparent 70%),
    radial-gradient(55% 50% at 85% 55%, rgba(80, 210, 255, .85), transparent 70%),
    radial-gradient(70% 55% at 15% 95%, rgba(110, 200, 255, .7), transparent 70%),
    radial-gradient(45% 40% at 95% 100%, rgba(40, 30, 160, .9), transparent 70%),
    linear-gradient(160deg, #2a46c9 0%, #3b82f6 45%, #38bdf8 75%, #2a3bb8 100%);
}
.auth-hero .brand { color: #fff; font-size: 19px; align-self: flex-start; }
.auth-hero .brand-mark { background: rgba(255,255,255,.2); }
.auth-hero-body { margin-top: auto; padding-top: 48px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; color: #fff; background: rgba(255,255,255,.2);
  backdrop-filter: blur(6px);
}
.auth-hero h1 { font-size: 44px; font-weight: 600; letter-spacing: -.03em; line-height: 1.08; margin: 18px 0 14px; }
.auth-hero-body > p { color: rgba(255,255,255,.88); font-size: 15.5px; line-height: 1.6; }
.auth-steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.auth-steps li {
  min-height: 132px; padding: 14px 14px 16px; border-radius: 16px; display: flex; flex-direction: column; justify-content: space-between;
  background: rgba(255,255,255,.16); color: rgba(255,255,255,.85); backdrop-filter: blur(6px);
}
.auth-steps li b { font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.auth-steps .n {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.55);
}
.auth-steps .n .ms { font-size: 17px; }
.auth-steps li.on { background: #fff; color: var(--navy-900); }
.auth-steps li.on .n { background: #1d3fd6; border-color: #1d3fd6; color: #fff; }

.auth-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 56px 40px 40px; }
.auth-panel-top { position: absolute; top: 22px; right: 26px; }
.auth-panel-top a.back { color: var(--text-3); font-size: 13.5px; display: flex; align-items: center; gap: 4px; }
.auth-form { width: 100%; max-width: 360px; }
.auth-form h2 { font-size: 32px; font-weight: 500; letter-spacing: -.02em; text-align: center; margin-bottom: 30px; }
.auth-form .lead { margin: -20px 0 28px; color: var(--text-2); font-size: 14px; text-align: center; }
.auth-form .lead a { font-weight: 600; }
.auth-form .field { margin-bottom: 22px; }
.auth-form label:not(.check) { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 9px; }
.auth-form .input {
  height: 46px; border: 1px solid transparent; background: #f5f5f6; border-radius: 12px; font-size: 14px; padding: 0 16px;
}
.auth-form textarea.input { height: auto; padding: 12px 16px; }
.auth-form .input::placeholder { color: #a3a6ad; }
.auth-form .input:focus { background: #fff; border-color: var(--blue-500); }
.auth-form .input-ic > .ms { left: 15px; }
.auth-form .input-ic > .ms ~ .input { padding-left: 44px; }
.auth-form .input-ic > .input { padding-right: 44px; }
.auth-form .btn-lg { height: 48px; border-radius: 12px; font-size: 15.5px; font-weight: 600; }
.auth-form .btn-primary { background: #1d3fd6; }
.auth-form .btn-primary:hover { background: #1733b3; }
.auth-form .auth-alt { background: #fff; border: 1px solid #e3e5ea; color: var(--text); gap: 10px; }
.auth-form .auth-alt:hover { background: #f8f9fb; text-decoration: none; }
.auth-form .auth-alt .ms { color: #1d3fd6; }
.auth-opts { margin-top: 10px; font-size: 12.5px; gap: 12px; white-space: nowrap; }
.auth-opts .check { font-size: 12.5px; gap: 7px; }
.auth-opts .check input { width: 15px; height: 15px; }
.auth-opts a { font-weight: 500; }
.auth-or { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--text-2); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #e3e5ea, transparent); }
.auth-legal { margin-top: 26px; text-align: center; font-size: 12px; line-height: 1.6; color: var(--text-2); }
.auth-legal a { font-weight: 500; }
.eye { background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 8px; border-radius: 6px; }
.eye:hover { color: var(--text); }
.pw-meter { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 2px; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* ==========================================================================
   Ficha pública (mobile-first)
   ========================================================================== */
.pub-body { background: var(--bg); }
.pub { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: 32px; }
.pub-top { background: var(--navy-900); color: #fff; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pub-top .brand { font-size: 18px; }
.pub-hero {
  position: relative; height: 220px; background: linear-gradient(160deg, #1e3a8a, #0f172a); color: #fff;
  display: flex; align-items: flex-end; overflow: hidden;
}
.pub-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pub-hero .ph-ic { position: absolute; right: -10px; top: 10px; font-size: 180px; opacity: .12; }
.pub-hero .ov { position: relative; width: 100%; padding: 18px; background: linear-gradient(transparent, rgba(2,6,23,.85)); }
.pub-hero h1 { font-size: 26px; font-weight: 700; }
.pub-hero small { color: #cbd5e1; font-weight: 500; letter-spacing: .04em; }
.pub-body .card { margin: 14px 16px 0; }
.pub .btn-lg { margin: 0; }
.copy-btn { background: none; border: 0; color: var(--blue-600); cursor: pointer; padding: 4px; }

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1180px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .f-q { grid-column: 1 / -1; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  :root { --header-h: 56px; }
  .page { padding-top: 18px; }
  .page-head { grid-template-rows: auto; }
  .mobilebar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 50; height: var(--header-h);
    padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .mobilebar .brand-mark { width: 32px; height: 32px; border-radius: 9px; flex: none; }
  .mobilebar .brand-mark:hover { text-decoration: none; }
  .mobilebar-co {
    display: flex; align-items: center; gap: 2px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text);
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  }
  .mobilebar-co:hover { text-decoration: none; }
  button.mobilebar-co { border: 0; background: none; font-family: inherit; cursor: pointer; padding: 0; }
  body.has-sidebar { padding-left: 0; }
  .sidebar { transform: translateX(-105%); width: min(300px, 86vw); }
  .sb-toggle { display: none; }
  .sb-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .sb-open .sb-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15,23,42,.35); }
  .sb-open body { overflow: hidden; }
  .g-main, .g-side, .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .auth-body { padding: 0; place-items: stretch; }
  .auth-shell { grid-template-columns: 1fr; border-radius: 0; min-height: 100vh; box-shadow: none; padding: 0; }
  .auth-hero { display: none; }
  .auth-panel { padding: 64px 20px 32px; }
  .asset-hero { grid-template-columns: 1fr; }
  .asset-img { max-width: 220px; }
}
@media (max-width: 640px) {
  .page { padding: 18px 14px 96px; }
  .page-head h1 { font-size: 26px; }
  .page-head { grid-template-columns: minmax(0, 1fr); }
  .page-head .actions { grid-row: 5; grid-column: 1; justify-content: flex-start; margin-top: 12px; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 16px; } .kpi .val b { font-size: 26px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 14px; }
  .form-grid, .form-grid.g3, .specs { grid-template-columns: 1fr; }
  .card-pad, .card-body, .form-section { padding: 16px; }
  .card-head { padding: 14px 16px; }
  details.fold > summary { padding: 14px 16px; } details.fold > .fold-body { padding: 4px 16px 18px; }
  .autofill-note { margin: 0 16px; }
  .hide-sm { display: none !important; }
  .tbl td, .tbl th { padding: 10px 12px; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: 64px;
    background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(15,23,42,.06);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--text-2); font-weight: 500; }
  .bottomnav a.active { color: var(--blue-600); font-weight: 600; }
  .bottomnav a:hover { text-decoration: none; }
  .bottomnav a.fab { flex: none; width: 58px; height: 58px; margin-top: -18px; border-radius: 16px; background: var(--blue-600); color: #fff; box-shadow: 0 6px 16px rgba(0,88,190,.4); }
  .flashes { top: auto; bottom: 78px; }
  .bars { gap: 8px; } .bars-labels { gap: 8px; }
}

/* ==========================================================================
   Impressão
   ========================================================================== */
@media print {
  .sidebar, .mobilebar, .sb-scrim, .bottomnav, .flashes, .no-print, #nav-progress { display: none !important; }
  body { background: #fff; }
}

/* ---------- Importação de faturas ---------- */
.filter-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px;
  background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius); color: var(--blue-700); font-size: 13.5px; }
.filter-banner > .ms { color: var(--blue-600); }
.filter-banner > span:nth-child(2) { flex: 1; min-width: 200px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 220px; padding: 28px 20px; border: 2px dashed var(--border-2); border-radius: var(--radius-lg); background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--blue-500); background: var(--blue-50); }
.drop.has-file { border-style: solid; border-color: var(--blue-600); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-ic { font-size: 42px; color: var(--blue-600); }
.drop-title { font-weight: 600; font-size: 15px; word-break: break-word; }
.drop-hint { font-size: 12.5px; color: var(--text-3); }
.drop-busy { display: flex; align-items: center; gap: 14px; min-height: 120px; padding: 20px; margin-bottom: 12px; }
.drop-busy[hidden] { display: none; }
.drop-busy .ms { font-size: 34px; color: var(--blue-600); animation: spin 1s linear infinite; }
.input-sm { height: 32px; font-size: 12.5px; padding-top: 0; padding-bottom: 0; }
.inv-head { grid-template-columns: 1.6fr 1.4fr 1.2fr 1fr 1fr 1fr; }
.inv-bar { flex-wrap: wrap; gap: 10px; }
.inv-tools { margin-left: auto; }
.inv-tools .input { width: 300px; max-width: 100%; }
.inv-tbl td { padding: 8px 6px; vertical-align: top; }
.inv-tbl td:first-child, .inv-tbl th:first-child { padding-left: 16px; }
.inv-tbl td:last-child, .inv-tbl th:last-child { padding-right: 16px; }
.inv-tbl .input { height: 36px; min-width: 120px; }
.inv-tbl .inv-name { min-width: 260px; }
.inv-tbl .inv-val { min-width: 100px; width: 110px; }
.inv-tbl td:first-child { padding-top: 16px; }
.inv-check { width: 17px; height: 17px; accent-color: var(--blue-600); margin: 0; cursor: pointer; }
.inv-src { margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--text-3); white-space: normal; overflow-wrap: anywhere; max-width: 420px; }
.inv-tbl .input.inv-obs { height: 30px; margin-top: 6px; font-size: 12.5px; }
.inv-src .mono { font-weight: 600; color: var(--text-2); margin-right: 4px; }
.inv-src .badge { height: 20px; font-size: 10.5px; margin-left: 4px; vertical-align: middle; }
.inv-taken { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 12px; color: var(--red); font-weight: 600; }
.inv-tbl tr.off td:not(:first-child) { opacity: .45; }
.inv-tbl tr.off:hover td:not(:first-child) { opacity: .75; }
@media (max-width: 900px) { .inv-head { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Gráficos simples (analíticas / stock) ---------- */
.hb { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 12px; padding: 7px 6px; margin: 0 -6px; border-radius: 6px; color: inherit; position: relative; }
a.hb:hover, .hb:hover, .hb:focus-visible { background: var(--surface-2); text-decoration: none; outline: none; }
.hb.on { background: var(--blue-50); }
.hb-l { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.hb-l .dot-c { width: 9px; height: 9px; }
.hb-t { height: 10px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hb-t i { display: block; height: 100%; min-width: 2px; background: var(--blue-500); border-radius: 0 4px 4px 0; }
.hb-v { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }

.vchart { display: flex; align-items: stretch; gap: 2px; height: 220px; padding-top: 24px; }
.vc { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; outline: none; border-radius: 6px; }
.vc-bar { flex: 1; display: flex; align-items: flex-end; justify-content: center; position: relative; border-bottom: 1px solid var(--border-2); padding: 0 18%; }
.vc-bar i { display: block; width: 100%; background: var(--blue-500); border-radius: 4px 4px 0 0; min-height: 0; }
.vc:hover .vc-bar i, .vc:focus-visible .vc-bar i { background: var(--blue-600); }
.vc:hover, .vc:focus-visible { background: var(--surface-2); }
.vc-lbl { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.vc-x { text-align: center; font-size: 11.5px; color: var(--text-3); padding-top: 6px; line-height: 1.2; }
.vc-x small { display: block; font-size: 10px; }

[data-hint]:hover::after, [data-hint]:focus-visible::after {
  content: attr(data-hint); position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  background: var(--navy-900); color: #fff; font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 6px;
  white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.vc[data-hint]:hover::after, .vc[data-hint]:focus-visible::after { bottom: auto; top: -8px; transform: translate(-50%, -100%); }
@media (max-width: 720px) { .vc-x { font-size: 10px; } .vc-lbl { display: none; } }
.filter-banner.warn { background: var(--amber-bg); border-color: #f5c56b; color: #7c3a06; }
.filter-banner.warn > .ms { color: var(--amber); }
.drop-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.drop-files li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 10px; border-radius: 6px; background: var(--surface-2); }
.drop-files li.dup { background: var(--amber-bg); color: #7c3a06; }
.drop-files li.dup .ms { color: var(--amber); }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.assign-fields { margin-top: 10px; }
/* Painéis de criação rápida empilhados (ex.: departamento criado a partir de uma pessoa nova) */
dialog.drawer.drawer-nested { box-shadow: -18px 0 40px rgba(15, 23, 42, .22); }

/* ==========================================================================
   Área de Definições: menu lateral próprio, hub e cabeçalho das secções
   ========================================================================== */
kbd {
  font: 600 11px/1 var(--font); color: var(--text-2); background: var(--surface); white-space: nowrap;
  border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px;
}

/* Menu lateral */
.sb-back { border: 1px solid var(--border); margin-bottom: 6px; flex: none; }
.sb-set-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 14px 4px 8px; }
.sb-set-head b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.sb-set-head a { font-size: 13px; }
.sb-set-head a.on { font-weight: 600; }
.sb-search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 10px; flex: none;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-3);
}
.sb-search:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-50); }
.sb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text); }
.sb-set { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin: 6px -14px 0; padding: 0 14px 8px; }
.sb-label { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.sb-set .sb-label:first-child { margin-top: 6px; }
.sb-empty { padding: 8px 10px; }
@media (min-width: 961px) {
  .sb-collapsed .sb-set-head, .sb-collapsed .sb-search, .sb-collapsed .sb-empty { display: none; }
  .sb-collapsed .sb-label { height: 1px; margin: 8px 6px; overflow: hidden; color: transparent; background: var(--border); }
  .sb-collapsed .sb-set { margin: 0 -10px; padding: 0 10px; overflow: visible; }
}

/* Cabeçalho (hub e secções) */
.set-head { padding: 30px 0 0; margin-bottom: 18px; }
.set-head h1 { font-family: var(--font-title); font-size: 32px; font-weight: 400; letter-spacing: -.01em; }
.set-head p { margin-top: 6px; }
.set-head .crumbs { margin-bottom: 8px; gap: 8px; }
.set-head .crumbs a { color: var(--blue-600); }
.set-head-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

/* Hub */
.set-search {
  display: flex; align-items: center; gap: 12px; max-width: 660px; height: 52px; padding: 0 12px 0 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text-3);
}
.set-search:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-50); }
.set-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 15px; color: var(--text); }

.setup-card { margin-top: 28px; padding: 22px 24px; border-color: var(--border); }
.setup-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.setup-top h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.setup-top form { margin: 0; }
.setup-bar { height: 6px; margin: 16px 0 14px; border-radius: 99px; background: #e6e8ee; overflow: hidden; }
.setup-bar span { display: block; height: 100%; border-radius: inherit; background: var(--blue-500); transition: width .3s; }
.setup-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.setup-step {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px;
  background: #eef0f4; color: var(--text-2); font-size: 13px; font-weight: 500;
}
.setup-step:hover { text-decoration: none; background: #e4e7ed; color: var(--text); }
.setup-step.done { background: var(--green-bg); color: var(--green); }
.setup-step.done:hover { background: color-mix(in srgb, var(--green-bg) 80%, var(--green)); }

.set-group { margin-top: 32px; }
.set-group h2 { font-size: 19px; font-weight: 600; }
.set-group > p { margin-top: 4px; }
.set-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(220px, calc((100% - 48px) / 4)), 1fr)); gap: 16px; margin-top: 14px; }
.set-card {
  display: flex; flex-direction: column; padding: 20px 22px 22px; min-height: 150px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.set-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--blue-500) 45%, var(--border)); box-shadow: var(--shadow); transform: translateY(-1px); }
.set-card:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.set-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.set-ic { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); }
.set-tag {
  min-width: 26px; height: 22px; padding: 0 8px; border-radius: 99px; display: inline-grid; place-items: center;
  background: #eef0f4; color: var(--text-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.set-card b { font-size: 16px; font-weight: 600; }
.set-card .set-desc { margin-top: 4px; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.set-hub > .empty { margin-top: 32px; }

@media (max-width: 960px) {
  .set-head { padding-top: 18px; }
  .set-head h1 { font-size: 26px; }
  .set-search kbd, .sb-search kbd { display: none; }
}

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 30px 0 0; margin-bottom: 22px; }
.dash-head h1 { font-family: var(--font-title); font-size: 32px; font-weight: 400; letter-spacing: -.01em; }
.dash-head p { margin-top: 6px; }
.dash-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-actions form { margin: 0; }
.dash-actions select.input { height: 40px; min-width: 170px; }

.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.dash-kpis .card, .dash-row > .card { border-color: var(--border); border-radius: 12px; }
.dk { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; color: inherit; }
a.dk:hover { text-decoration: none; box-shadow: var(--shadow); }
.dk-val { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dk-val b { font-family: var(--font-title); font-size: 38px; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dk-val small { font-size: 13px; font-weight: 500; line-height: 1.3; max-width: 170px; }
.dk-stack { display: flex; gap: 3px; height: 7px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.dk-stack i { display: block; min-width: 4px; }
.dk-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.dk-legend span { display: flex; align-items: center; gap: 6px; }
.dk-legend i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.dk-legend b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.dk-bar { height: 7px; margin-top: 4px; }
.dk-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.dk-row > span:first-child { color: var(--text-2); }
.dk-kv { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); }
.dk-kv b { color: var(--text); font-variant-numeric: tabular-nums; }

.dash-row { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(300px, 1fr); gap: 20px; margin-bottom: 20px; }
.dash-h { font-size: 17px; font-weight: 600; }
.dash-row .card-pad > p { margin-top: 4px; }
.dash-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--red-bg); color: var(--red); font-size: 12px; font-weight: 700; }
.dash-link { display: inline-block; margin-top: 18px; font-weight: 600; font-size: 13.5px; }
.dash-split { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-big { font-family: var(--font-title); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-legend { display: flex; gap: 18px; margin: 16px 0 6px; font-size: 13px; color: var(--text-2); }
.dash-legend span { display: flex; align-items: center; gap: 6px; }
.dash-legend i { width: 10px; height: 10px; border-radius: 2px; }

/* Precisa de atenção */
.att { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.att:last-child { border-bottom: 0; }
.att p { margin-top: 2px; }
.att .btn { flex: none; }
.att-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.att-ic .ms { font-size: 20px; }
.att-ic.red { background: #fdecea; color: var(--red); }
.att-ic.amber { background: #fff4e0; color: var(--amber); }
.att-ic.blue { background: var(--blue-50); color: var(--blue-600); }
.att-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.att-title b { font-weight: 600; }
.att-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.att-tag.red { background: #fdecea; color: var(--red); }
.att-tag.amber { background: #fff4e0; color: var(--amber); }
.att-tag.blue { background: var(--blue-50); color: var(--blue-600); }

/* Qualidade das fichas */
.dq-top { display: flex; align-items: center; gap: 22px; margin: 20px 0 18px; }
.dq-top p { margin-top: 2px; }
.donut { width: 100px; height: 100px; flex: none; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 11; }
.donut-bg { stroke: var(--surface-3); }
.donut-fg { stroke: var(--blue-500); stroke-linecap: round; }
.donut text { transform: rotate(90deg); transform-origin: 50px 50px; text-anchor: middle; dominant-baseline: central; font: 700 20px var(--font); fill: var(--text); }
.dq-field { margin-top: 12px; }
.dq-field .bar { margin-top: 5px; height: 5px; }

/* Renovações */
.rchart { display: flex; align-items: stretch; gap: 10px; height: 230px; padding-top: 26px; }
.rc-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.rc-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--border); }
.rc-bar { position: relative; width: 100%; max-width: 46px; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.rc-bar i { display: block; min-height: 3px; border-radius: 3px 3px 0 0; }
.rc-n { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 600; }
.rc-lbl { font-size: 12px; color: var(--text-2); }

/* Idade */
.dash-ages { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.bar.lg { height: 10px; border-radius: 5px; margin-top: 6px; }
.bar.lg > i { border-radius: 5px; background: var(--blue-500); }
.dash-note { display: block; margin-top: 20px; padding: 12px 14px; border-radius: 8px; background: #fff7e6; border: 1px solid #fde3b0; color: #8a4b08; font-size: 13.5px; }
.dash-note:hover { text-decoration: none; filter: brightness(.98); }

/* Categorias por localização */
.dash-matrix th.center, .dash-matrix td.center { text-align: center; }
.dash-matrix td { padding-top: 9px; padding-bottom: 9px; }
.dash-matrix b { font-weight: 600; }
.heat { display: inline-grid; place-items: center; min-width: 46px; height: 30px; padding: 0 8px; border-radius: 6px; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--blue-500) var(--h), white); }
.dash-matrix tfoot td { padding: 14px 16px; font-weight: 700; border-top: 2px solid var(--border); background: var(--surface-2); }

/* Atividade */
.dash-feed { padding: 4px 24px 8px; }
.feed-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); color: var(--text); font-size: 13.5px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { text-decoration: none; }
.feed-item:hover .mono { text-decoration: underline; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }

@media (max-width: 1280px) { .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .dash-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .dash-kpis { grid-template-columns: minmax(0, 1fr); }
  .dash-head h1 { font-size: 26px; }
  .att { flex-wrap: wrap; padding: 14px 16px; }
  .att .btn { margin-left: 50px; }
  .rchart { gap: 4px; }
}
