/* ============================================================
   Loureiro Poceiro — Design System compartilhado
   Cores e identidade conforme Manual da Marca:
   grafite #363233 · verde marca #30B08E · verde claro #A8D5BA · branco
   ============================================================ */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #fafbfa;
  --ink: #363233;
  --muted: #6e6e73;
  --line: #e7e8e7;
  --line-strong: #d6d8d6;
  --green: #A8D5BA;
  --green-deep: #8cc6a3;
  --brand-green: #30B08E;
  --brand-green-d: #279b7c;
  --green-ink: #2e6b46;
  --amber: #e8a13c;
  --amber-soft: #fbeede;
  --danger: #c0392b;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(54, 50, 51, .07);
  --shadow-sm: 0 2px 10px rgba(54, 50, 51, .05);
  --shadow-lg: 0 18px 50px rgba(54, 50, 51, .12);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- transições fluidas entre páginas (View Transitions API) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .26s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .36s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* fade-in no carregamento (fallback p/ navegadores sem View Transitions) */
body { animation: page-in .42s var(--ease) both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- detalhes finos ---------- */
html { scroll-behavior: smooth; }
::selection { background: rgba(48, 176, 142, .22); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #c2c4c2; background-clip: content-box; }
:focus-visible { outline: none !important; box-shadow: 0 0 0 3px rgba(48, 176, 142, .28) !important; border-radius: 9px; }

/* micro-interações nos componentes comuns (aditivo, não quebra layout) */
.btn, .tab, .vtab, .tile, .logout, .btn-logout, button, .navlink, .kpi, .stat, .grow {
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .22s var(--ease),
              transform .14s var(--ease), border-color .18s var(--ease), filter .18s var(--ease), opacity .18s var(--ease);
}
.btn:active, button:active { transform: translateY(1px) scale(.992); }

/* ---------- barra de navegação unificada ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 11px 24px; display: flex; align-items: center; gap: 10px; }
.topbar .brand { display: inline-flex; align-items: center; gap: 10px; margin-right: 6px; text-decoration: none; flex: 0 0 auto; }
.topbar .brand img { height: 30px; width: auto; display: block; transition: transform .2s var(--ease); }
.topbar .brand:hover img { transform: scale(1.03); }
.navlinks { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.navlink {
  position: relative; border: none; background: transparent; color: var(--muted);
  font-family: var(--font); font-size: 14px; font-weight: 500; padding: 8px 13px; border-radius: 10px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.navlink .ic { font-size: 15px; line-height: 1; }
.navlink:hover { color: var(--ink); background: var(--surface-2); }
.navlink.active { color: var(--brand-green-d); background: #eef8f1; font-weight: 600; }
.navlink.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: -12px; height: 2px;
  background: var(--brand-green); border-radius: 2px; animation: nav-underline .3s var(--ease) both;
}
@keyframes nav-underline { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
.nav-spacer { margin-left: auto; }
.userchip { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); }
.userchip .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, #c5e6d3, var(--green)); color: var(--green-ink); font-weight: 700; font-size: 13px; }
.userchip .badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef8f1; color: var(--green-ink); letter-spacing: .02em; }
.userchip .badge.master { background: rgba(48, 176, 142, .14); color: var(--brand-green); }
.btn-logout { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-family: var(--font);
  font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: 10px; cursor: pointer; }
.btn-logout:hover { background: var(--surface-2); border-color: #c8cac8; }

@media (max-width: 760px) {
  .topbar-inner { padding: 10px 14px; gap: 6px; }
  .navlink span.t { display: none; }
  .navlink { padding: 8px 10px; }
  .userchip .uname { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .navlink.active::after { animation: none; }
}

/* ============================================================
   Ícones de linha (monocromáticos, herdam currentColor)
   Substituem os emojis -> tons de cinza/verde da marca.
   ============================================================ */
.i {
  display: inline-block; width: 1.05em; height: 1.05em; flex: 0 0 auto;
  background-color: currentColor; vertical-align: -.18em;
  -webkit-mask: var(--i) no-repeat center / contain; mask: var(--i) no-repeat center / contain;
}
.i-home    { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11l9-8 9 8'/><path d='M5 10v10h14V10'/></svg>"); }
.i-dashboard { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='12' width='3.4' height='8' rx='1'/><rect x='10.3' y='6' width='3.4' height='14' rx='1'/><rect x='16.6' y='9' width='3.4' height='11' rx='1'/></svg>"); }
.i-upload  { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 15V4'/><path d='M7 9l5-5 5 5'/><path d='M4 15v4a1 1 0 001 1h14a1 1 0 001-1v-4'/></svg>"); }
.i-config  { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='4' y1='8' x2='20' y2='8'/><circle cx='9' cy='8' r='2.4'/><line x1='4' y1='16' x2='20' y2='16'/><circle cx='15' cy='16' r='2.4'/></svg>"); }
.i-users   { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='8' r='3.2'/><path d='M3.5 20a5.5 5.5 0 0111 0'/><path d='M16 5.4a3.2 3.2 0 010 5.2'/><path d='M17.5 14.4a5.5 5.5 0 013.5 5.6'/></svg>"); }
.i-key     { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='8' cy='15' r='4'/><path d='M11 12l8-8'/><path d='M16 7l2 2'/></svg>"); }
.i-trash   { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 7h16'/><path d='M9 7V4h6v3'/><path d='M6.5 7l1 13h9l1-13'/></svg>"); }
.i-inbox   { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 13l3-8h12l3 8'/><path d='M3 13v6h18v-6'/><path d='M3 13h5l1.5 2h5L15 13h5'/></svg>"); }
.i-tag     { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12l9-9h8v8l-9 9-8-8z'/><circle cx='15.5' cy='8.5' r='1.3'/></svg>"); }
.i-list    { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='9' y1='7' x2='20' y2='7'/><line x1='9' y1='12' x2='20' y2='12'/><line x1='9' y1='17' x2='20' y2='17'/><circle cx='4.6' cy='7' r='1.2'/><circle cx='4.6' cy='12' r='1.2'/><circle cx='4.6' cy='17' r='1.2'/></svg>"); }
.i-doc     { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z'/><path d='M14 3v5h5'/></svg>"); }
.i-box     { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 8l-9-5-9 5 9 5 9-5z'/><path d='M3 8v8l9 5 9-5V8'/><path d='M12 13v8'/></svg>"); }
.i-bolt    { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M13 3L5 14h6l-1 7 8-11h-6l1-7z'/></svg>"); }
.i-alert   { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l9 16H3z'/><line x1='12' y1='9' x2='12' y2='14'/><line x1='12' y1='17' x2='12' y2='17'/></svg>"); }
.i-download { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 4v12'/><path d='M7 11l5 5 5-5'/><path d='M5 20h14'/></svg>"); }
.i-check   { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5 13l4 4L19 7'/></svg>"); }
.i-plus    { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='12' y1='5' x2='12' y2='19'/><line x1='5' y1='12' x2='19' y2='12'/></svg>"); }
.i-x       { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='6' y1='6' x2='18' y2='18'/><line x1='18' y1='6' x2='6' y2='18'/></svg>"); }
.i-search  { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='16.5' y1='16.5' x2='21' y2='21'/></svg>"); }
.i-export  { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 15V4'/><path d='M8 8l4-4 4 4'/><path d='M5 14v5a1 1 0 001 1h12a1 1 0 001-1v-5'/></svg>"); }
.i-restore { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 4 3 10 9 10'/><path d='M4 10a8 8 0 1 1 1.6 7.3'/></svg>"); }
.i-chevron { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); }

/* cabeçalho de tabela ordenável */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color .15s var(--ease); }
th.sortable:hover { color: var(--ink); }
th.sortable .sort-ind { width: .8em; height: .8em; margin-left: 5px; opacity: 0; transition: opacity .15s var(--ease), transform .18s var(--ease); }
th.sortable.active { color: var(--brand-green-d); }
th.sortable.active .sort-ind { opacity: 1; background-color: var(--brand-green); }
th.sortable.asc .sort-ind { transform: rotate(180deg); }
