/* ============================================================================
   Apura · app.css — design aprovado no canvas (sóbrio, orgânico, colorido)
   REC-020 · Design system: tokens, shell (sidebar "névoa" recolhível), componentes, telas.
   Sem estilos inline: a CSP do servidor só aceita CSS deste arquivo.
   ============================================================================ */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/fraunces-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/fraunces-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/fraunces-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #F7F4ED; --card: #FFFFFF; --ink: #1C1B17; --ink-2: #5B584F; --ink-3: #77746A; --ink-4: #8E8A7E;
  --line: #E9E5DA; --line-2: #E0DCCF; --line-3: #F1EEE5; --soft: #FBF9F3;
  --green: #0E6F5C; --green-d: #0A594A; --green-bg: #E2F0EC; --green-ink: #0B5D4D;
  --ok: #17804A; --ok-bg: #DFF2E7; --ok-ink: #136A3F;
  --warn: #B45309; --warn-bg: #FBEEDC; --warn-ink: #8A5200; --sun: #F2C14E; --sun-bg: #FBF0D4; --sun-ink: #5A4409;
  --bad: #BE3E38; --bad-bg: #FCE9E7; --bad-ink: #9B2E29;
  --violet: #6D28D9; --violet-bg: #EFEAFB; --violet-ink: #5B21B6;
  --blue: #2563EB; --blue-bg: #E7EEFC; --blue-ink: #1D4ED8;
  --nav-bg: #1C2A24; --nav-ink: #C9D4CE; --nav-muted: #8CA096;
  --radius: 18px; --radius-s: 12px; --radius-xs: 10px;
  --shadow: 0 1px 2px rgba(28,27,23,.05); --shadow-pop: 0 18px 40px rgba(14,22,18,.32);
  --nav-w: 236px; --nav-w-c: 76px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --ease: cubic-bezier(.2,.8,.3,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
a:hover { color: var(--green-d); }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: 0; }
h1 { font-size: 29px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
p { margin: 0; }
.noscript { padding: 24px; text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }

/* ----------------------------------------------------------------- shell */
.app { min-height: 100vh; }
.shell { min-height: 100vh; display: flex; align-items: stretch; }

.nav {
  position: sticky; top: 0; z-index: 20; /* acima do conteúdo: o menu do usuário recolhido abre sobre a página */
  height: 100vh; align-self: flex-start; flex: 0 0 var(--nav-w); width: var(--nav-w); padding: 18px 14px; display: flex; flex-direction: column; gap: 3px;
  color: var(--nav-ink); background-color: var(--nav-bg);
  background-image: radial-gradient(130% 55% at 0% 0%, rgba(88,182,146,.20), transparent 70%), radial-gradient(110% 45% at 100% 100%, rgba(242,193,78,.09), transparent 70%), linear-gradient(180deg, #22332C 0%, #1B2823 55%, #15201B 100%);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
  transition: flex-basis .32s var(--ease), width .32s var(--ease), padding .32s ease;
}
.nav-collapsed .nav { flex-basis: var(--nav-w-c); width: var(--nav-w-c); padding: 18px 8px; }
.nav-brand { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 6px 10px 18px; text-align: left; color: inherit; transition: padding .3s ease, gap .3s ease; }
.nav-collapsed .nav-brand { justify-content: center; gap: 0; padding: 6px 0 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; background: var(--green); color: #fff; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand-name { font-family: var(--serif); font-size: 20px; color: #F7F4ED; flex: 1 1 auto; min-width: 0; text-overflow: ellipsis; }
.nav-fade { overflow: hidden; white-space: nowrap; max-width: 160px; opacity: 1; transition: max-width .3s ease, opacity .2s ease; }
.nav-collapsed .nav-fade { max-width: 0; opacity: 0; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--nav-ink); font-size: 13.5px; font-weight: 500; text-decoration: none; transition: padding .3s ease, background-color .2s ease; }
.nav-item:hover { background-color: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(127,211,181,.24), rgba(127,211,181,.07)); box-shadow: inset 0 0 0 1px rgba(127,211,181,.22); color: #fff; font-weight: 600; }
.nav-item svg { flex: 0 0 auto; width: 20px; height: 20px; display: block; } /* par: centralizado sem meio pixel (19px ficava em x,5 e o navegador arredondava para a direita) */
.nav-item .ico { display: inline-flex; width: 20px; height: 20px; flex: 0 0 auto; }
/* recolhida: o texto some (largura 0), então o espaçamento entre ícone e texto também tem de sumir, senão o ícone sai do centro */
.nav-collapsed .nav-item { justify-content: center; gap: 0; padding: 0; width: 44px; height: 44px; margin: 0 auto; } /* seleção vira um quadrado em volta do ícone */
.nav-spacer { flex: 1 1 auto; }

/* botão do usuário (vidro). Aberto, ele e o menu viram um único cartão: o menu é a continuação do botão para cima */
.nav-user-wrap { position: relative; margin-top: 10px; }
.nav-user {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px 9px 10px; border-radius: 16px; text-align: left; color: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,.13), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 10px 26px rgba(0,0,0,.25); backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
  transition: padding .3s ease, background .25s ease, border-radius .2s ease;
}
.nav-user:hover { background: linear-gradient(160deg, rgba(255,255,255,.17), rgba(255,255,255,.06)); }
/* aberto: sem borda de cima (uma borda transparente deixava ver o fundo escuro da barra = linha preta fininha) */
.nav-user.open { background: linear-gradient(180deg, #2B3B34 0%, #25342D 100%); border-color: rgba(255,255,255,.14); border-top-width: 0; padding-top: 10px; border-radius: 0 0 16px 16px; box-shadow: 0 16px 30px rgba(0,0,0,.3); }
.nav-user-who { flex: 1 1 auto; min-width: 0; }
.nav-user-name, .nav-user-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-name { font-size: 13px; font-weight: 600; color: #F7F4ED; }
.nav-user-sub { font-size: 11.5px; color: var(--nav-muted); }
.nav-user-chev { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px; color: var(--nav-ink); transition: transform .25s var(--ease), background .2s ease; }
.nav-user-chev svg { display: block; }
.nav-user:hover .nav-user-chev { background: rgba(255,255,255,.08); }
.nav-user.open .nav-user-chev { transform: rotate(180deg); }
.avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--sun); color: #4A3608; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(255,255,255,.16); transition: box-shadow .2s ease; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #4ADE80; border: 2px solid #2A3A33; }

.menu-pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); z-index: 30; padding: 8px 6px 7px; color: var(--nav-ink); /* 1px por cima do botão: emenda sem fresta */
  background: linear-gradient(180deg, #34463E 0%, #2B3B34 100%); border: 1px solid rgba(255,255,255,.14); border-bottom: 0; border-radius: 16px 16px 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 -14px 30px rgba(0,0,0,.24);
  animation: menuSobe .28s var(--ease) both;
}
.menu-who { padding: 6px 10px 2px; }
.menu-who b { display: block; font-size: 13px; color: #F7F4ED; }
.menu-who span { font-size: 11.5px; color: var(--nav-muted); }
.menu-cap { display: flex; align-items: center; gap: 7px; padding: 6px 10px 8px; white-space: nowrap; font-size: 11px; font-weight: 600; letter-spacing: .03em; color: var(--nav-muted); }
.menu-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 3px rgba(74,222,128,.15); flex: 0 0 auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 10px; padding: 9px 10px; font-size: 13px; font-weight: 600; color: var(--nav-ink); text-align: left; text-decoration: none; transition: background .15s ease, color .15s ease; }
.menu-item svg { flex: 0 0 auto; opacity: .9; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255,255,255,.08); color: #fff; outline: none; }
.menu-item.danger { color: #F2A097; }
.menu-item.danger:hover { background: rgba(242,160,151,.12); color: #F8C2BB; }
.menu-soon { margin-left: auto; white-space: nowrap; font-size: 10.5px; font-weight: 600; color: var(--nav-muted); padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.06); }
.menu-sep { height: 1px; background: rgba(255,255,255,.08); margin: 5px 8px; }
@keyframes menuSobe { from { opacity: 0; clip-path: inset(100% 0 0 0 round 16px 16px 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0 round 16px 16px 0 0); } }

/* recolhida: só o avatar redondo, sem o cartão de vidro; o menu abre ao lado, no mesmo vidro escuro */
.nav-collapsed .nav-user, .nav-collapsed .nav-user:hover { justify-content: center; gap: 0; padding: 6px 0; background: none; border-color: transparent; border-radius: 50%; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.nav-collapsed .nav-user:not(.open):hover .avatar { box-shadow: 0 0 0 3px rgba(127,211,181,.5); }
/* recolhida e aberto: o avatar ganha o mesmo vidro do menu e os dois se unem pela lateral, como uma aba que nasce do avatar */
.nav-collapsed .nav-user.open { justify-content: center; gap: 0; z-index: 31; padding: 5px 1px 5px 0; background: #2B3B34; border: 1px solid rgba(255,255,255,.14); border-right-width: 0; border-radius: 16px 0 0 16px; box-shadow: -8px 12px 26px rgba(0,0,0,.28); backdrop-filter: none; -webkit-backdrop-filter: none; }
.menu-pop.side { left: calc(100% - 1px); right: auto; bottom: 0; width: 232px; padding: 8px 6px 6px; border: 1px solid rgba(255,255,255,.14); border-radius: 16px 16px 16px 0; background: linear-gradient(180deg, #34463E 0%, #2B3B34 55%, #2B3B34 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 18px 40px rgba(14,22,18,.32); animation: menuLado .26s var(--ease) both; }
@keyframes popUp { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes menuLado { from { opacity: 0; clip-path: inset(0 100% 0 0 round 16px 16px 16px 0); } to { opacity: 1; clip-path: inset(0 0 0 0 round 16px 16px 16px 0); } }

.main { flex: 1 1 auto; min-width: 0; padding: clamp(20px, 3vw, 40px); display: flex; flex-direction: column; gap: 20px; overflow: hidden; overflow: clip; } /* blobs do cabeçalho não vazam sobre o menu */
.page-head { position: relative; z-index: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }
.page-head .blob { position: absolute; right: 0; top: -80px; pointer-events: none; z-index: 0; }
.page-head > * { position: relative; z-index: 1; }
.main > :not(.page-head) { position: relative; z-index: 1; } /* conteúdo sempre por cima do blob do cabeçalho */
.title-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.underline { display: block; margin-top: 3px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 700; border: 1px solid transparent; }
.chip.green { background: #E6EFE2; border-color: #CCDFC6; color: #2E5A3A; }
.chip.violet { background: var(--violet-bg); border-color: #DED3F6; color: var(--violet-ink); }
.chip.blue { background: var(--blue-bg); border-color: #CFDDF8; color: var(--blue-ink); }
.chip.amber { background: var(--warn-bg); border-color: #EFD6AE; color: var(--warn-ink); }
.chip.sun { background: var(--sun-bg); border-color: #EFDCA4; color: var(--sun-ink); }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- componentes */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 11px; padding: 11px 16px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line-2); background: #fff; color: var(--ink); min-height: 42px; transition: background .2s, transform .1s; }
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-d); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #F7F4ED; }
.btn.danger { background: #fff; color: var(--bad); border-color: #F2CBC7; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 8px 12px; min-height: 34px; font-size: 12.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.icon-btn { width: 42px; height: 42px; padding: 0; }
.pill { display: inline-block; min-width: 118px; text-align: center; white-space: nowrap; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: #fff; background: var(--ink-4); }
.pill.ok { background: var(--ok); } .pill.green { background: var(--green); } .pill.warn { background: var(--warn); } .pill.bad { background: var(--bad); } .pill.violet { background: var(--violet); } .pill.blue { background: var(--blue); }
.pill.soft { color: var(--ok-ink); background: var(--ok-bg); } .pill.soft.warn { color: var(--warn-ink); background: var(--warn-bg); } .pill.soft.bad { color: var(--bad-ink); background: var(--bad-bg); } .pill.soft.neutral { color: var(--ink-2); background: var(--line-3); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 7px; font-size: 11px; font-weight: 700; }
.tag.admin { background: var(--violet-bg); color: var(--violet-ink); } .tag.contador { background: var(--blue-bg); color: var(--blue-ink); } .tag.cliente { background: var(--ok-bg); color: var(--ok-ink); } .tag.superuser { background: var(--sun-bg); color: var(--sun-ink); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; }
.kpi { border-radius: var(--radius); padding: 16px 20px; border: 1px solid var(--line); background: #fff; }
.kpi .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.kpi .val { margin: 7px 0 7px; font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.1; }
.kpi .val small { font-size: 16px; color: var(--ink-3); }
.kpi.ok { background: var(--ok-bg); border-color: #BFE3CE; } .kpi.ok .lbl { color: var(--ok-ink); } .kpi.ok .val { color: #0E4D2E; }
.kpi.green { background: var(--green-bg); border-color: #C2DFD6; } .kpi.green .lbl { color: var(--green-ink); } .kpi.green .val { color: #0A4A3E; }
.kpi.warn { background: var(--warn-bg); border-color: #EFD6AE; } .kpi.warn .lbl { color: var(--warn-ink); } .kpi.warn .val { color: #6E4100; }
.kpi.bad { background: var(--bad-bg); border-color: #F2CBC7; } .kpi.bad .lbl { color: var(--bad-ink); } .kpi.bad .val { color: #7E2420; }
.kpi.violet { background: var(--violet-bg); border-color: #DED3F6; } .kpi.violet .lbl { color: var(--violet-ink); } .kpi.violet .val { color: #3B1A8F; }
.bar { height: 7px; border-radius: 999px; background: #fff; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--ok); border-radius: 999px; width: 0; transition: width .6s var(--ease); }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; border-radius: 16px; padding: 14px 20px; border: 1px solid; }
.notice.sun { background: var(--sun-bg); border-color: #EFDCA4; color: var(--sun-ink); }
.notice.blue { background: var(--blue-bg); border-color: #CFDDF8; color: #1E3A8A; }
.notice.green { background: var(--green-bg); border-color: #C2DFD6; color: var(--green-ink); }
.notice .ico { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.notice.sun .ico { background: var(--sun); color: #4A3608; } .notice.blue .ico { background: var(--blue); color: #fff; } .notice.green .ico { background: var(--green); color: #fff; }
.notice-body { display: flex; align-items: center; gap: 12px; min-width: 0; }
.grid-2 { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.grid-2 > .w { flex: 1.9 1 600px; min-width: 0; } .grid-2 > .n { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; min-width: 560px; }
.t th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-3); vertical-align: middle; font-size: 14px; }
.t tr:last-child td { border-bottom: 0; }
.t th:first-child, .t td:first-child { padding-left: 20px; } .t th:last-child, .t td:last-child { padding-right: 20px; }
.t .c { text-align: center; } .t .r { text-align: right; }
.t tbody tr:hover { background: #FCFBF7; }
.t .sub { display: block; font-size: 12px; font-weight: 400; color: var(--ink-4); }
.t .sub.warn { color: var(--warn-ink); } .t .sub.bad { color: var(--bad-ink); }
.t .ini { width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; margin-right: 10px; vertical-align: middle; }
.t td:first-child { white-space: nowrap; } /* nome/identificação nunca quebra: a tabela rola na horizontal */
.t b { font-weight: 600; }
.t-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--soft); font-size: 12.5px; color: var(--ink-3); }
.pager { display: flex; gap: 6px; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; font-family: var(--serif); font-size: 18px; color: var(--ink); margin-bottom: 6px; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chipbtn { border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 700; border: 1px solid var(--line-2); background: #fff; color: var(--ink); transition: background .2s, color .2s, border-color .2s; }
.chipbtn.on { background: var(--ink); border-color: var(--ink); color: #F7F4ED; }
.chipbtn.ok { background: var(--ok-bg); border-color: #BFE3CE; color: var(--ok-ink); } .chipbtn.ok.on { background: var(--ok); color: #fff; border-color: var(--ok); }
.chipbtn.warn { background: var(--warn-bg); border-color: #EFD6AE; color: var(--warn-ink); } .chipbtn.warn.on { background: var(--warn); color: #fff; border-color: var(--warn); }
.chipbtn.bad { background: var(--bad-bg); border-color: #F2CBC7; color: var(--bad-ink); } .chipbtn.bad.on { background: var(--bad); color: #fff; border-color: var(--bad); }
.rows-in { animation: rowsIn .18s ease both; } /* curta: a tabela não pode parecer "atrasada" */
@keyframes rowsIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* formulários */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .lbl-up { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.input, .select, .textarea { width: 100%; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; font-size: 14px; min-height: 42px; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(14,111,92,.14); }
.input.err { border-color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-3); margin-top: 16px; }
.help { font-size: 12.5px; color: var(--ink-3); }

/* senha: botão de mostrar/ocultar dentro do campo + medidor de força */
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: none; color: var(--ink-3); transition: background .15s, color .15s; }
.pw-eye:hover { background: var(--line-3); color: var(--ink); }
.pw-eye:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(14,111,92,.18); color: var(--green); }
.pw-eye[aria-pressed="true"] { color: var(--green); }
.pw-meter { display: flex; flex-direction: column; gap: 9px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.pw-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pw-bar i { height: 6px; border-radius: 999px; background: var(--line-2); transition: background-color .25s ease; }
.pw-bar[data-nivel="0"] i:nth-child(-n+1), .pw-bar[data-nivel="1"] i:nth-child(-n+2) { background: var(--bad); }
.pw-bar[data-nivel="2"] i:nth-child(-n+3) { background: var(--warn); }
.pw-bar[data-nivel="3"] i { background: #3BA776; }
.pw-bar[data-nivel="4"] i { background: var(--green); }
.pw-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.pw-label { font-weight: 700; color: var(--ink-3); }
.pw-label[data-nivel="0"], .pw-label[data-nivel="1"] { color: var(--bad-ink); }
.pw-label[data-nivel="2"] { color: var(--warn-ink); }
.pw-label[data-nivel="3"], .pw-label[data-nivel="4"] { color: var(--green-ink); }
.pw-len { color: var(--ink-4); font-weight: 600; }
.pw-len.ok { color: var(--green-ink); }
.pw-req { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12px; color: var(--ink-3); }
.pw-req li { display: flex; align-items: center; gap: 7px; transition: color .2s; }
.pw-req li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-2); background: #fff; flex: 0 0 auto; box-sizing: border-box; transition: background .2s, border-color .2s; }
.pw-req li.ok { color: var(--green-ink); font-weight: 600; }
.pw-req li.ok::before { content: "✓"; display: inline-flex; align-items: center; justify-content: center; border-color: var(--green); background: var(--green); color: #fff; font-size: 9px; font-weight: 700; line-height: 1; }
.pw-match { font-size: 12.5px; font-weight: 600; }
.pw-match.ok { color: var(--green-ink); } .pw-match.bad { color: var(--bad-ink); }
@media (max-width: 420px) { .pw-req { grid-template-columns: 1fr; } }
.error-box { background: var(--bad-bg); border: 1px solid #F2CBC7; color: var(--bad-ink); border-radius: 12px; padding: 11px 14px; font-size: 13.5px; font-weight: 600; }
.ok-box { background: var(--ok-bg); border: 1px solid #BFE3CE; color: var(--ok-ink); border-radius: 12px; padding: 11px 14px; font-size: 13.5px; font-weight: 600; }
.search { width: 250px; max-width: 100%; }
.otp { display: flex; gap: 9px; justify-content: space-between; }
.otp input { width: 50px; height: 58px; text-align: center; font-size: 21px; font-weight: 700; border: 1px solid var(--line-2); border-radius: 13px; background: #fff; }
.otp input:focus { outline: none; border: 2px solid var(--green); background: var(--green-bg); color: var(--green-d); }
.otp input.filled { border: 2px solid var(--green); background: var(--green-bg); color: var(--green-d); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20,26,23,.45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: fadeIn .15s ease both; }
.modal { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: #fff; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-pop); padding: 24px 26px; animation: popUp .22s var(--ease) both; }
.modal h2 { margin-bottom: 4px; }
.modal .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 18px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #1E2B26; color: #F7F4ED; border-radius: 14px; padding: 12px 16px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-pop); animation: popUp .22s var(--ease) both; max-width: 360px; display: flex; gap: 10px; align-items: center; }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); } .toast.warn { background: var(--warn); }
.toast.out { opacity: 0; transition: opacity .25s; }

/* detalhes expansíveis (auditoria) */
details.row { border-bottom: 1px solid var(--line-3); }
details.row summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 150px 150px 1fr 170px; gap: 12px; align-items: center; padding: 11px 20px; font-size: 13.5px; }
details.row summary::-webkit-details-marker { display: none; }
details.row summary:hover { background: #FCFBF7; }
details.row .body { padding: 6px 20px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
details.row pre { margin: 0; background: var(--soft); border: 1px solid var(--line-3); border-radius: 10px; padding: 10px 12px; font-size: 12px; overflow: auto; max-height: 260px; white-space: pre-wrap; word-break: break-word; }
.hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--ink-4); }

/* skeleton */
.skel { background: linear-gradient(90deg, #F1EEE5 25%, #F8F6F0 50%, #F1EEE5 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ----------------------------------------------------------------- auth (login, senha) */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }
.auth-left { flex: 1 1 440px; min-width: 0; position: relative; overflow: hidden; color: #F7F4ED; padding: clamp(36px, 5vw, 60px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  background-color: var(--nav-bg); background-image: radial-gradient(120% 45% at 0% 0%, rgba(88,182,146,.26), transparent 70%), radial-gradient(90% 40% at 100% 45%, rgba(183,155,240,.14), transparent 70%), radial-gradient(120% 45% at 20% 100%, rgba(242,193,78,.12), transparent 70%), linear-gradient(180deg, #213129 0%, #1A2621 100%); }
.auth-left .blob { position: absolute; right: -150px; bottom: -130px; pointer-events: none; }
.auth-left > * { position: relative; }
.auth-left h1 { font-size: 38px; line-height: 1.22; max-width: 460px; }
.auth-left ul { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 13px; font-size: 14.5px; color: var(--nav-ink); }
.auth-left li { display: flex; align-items: center; gap: 11px; }
.auth-left li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--d, #58B692); flex: 0 0 auto; }
.auth-left li.d2 { --d: #F2C14E; } .auth-left li.d3 { --d: #B79BF0; }
.auth-left .foot { font-size: 12px; color: var(--nav-muted); }
.auth-right { flex: 1 1 440px; min-width: 0; padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 48px); display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px 34px 30px; box-shadow: 0 2px 8px rgba(28,27,23,.06); display: flex; flex-direction: column; gap: 16px; }
.auth-card .step { display: inline-block; align-self: flex-start; padding: 5px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--violet-bg); color: var(--violet-ink); }
.auth-card h2 { font-size: 25px; }
.auth-card .lead { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.auth-links { display: flex; justify-content: space-between; font-size: 13px; gap: 10px; flex-wrap: wrap; }
.auth-note { padding-top: 16px; border-top: 1px solid var(--line-3); font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 9px; }
.auth-note .ico { width: 24px; height: 24px; border-radius: 8px; background: var(--ok-bg); color: var(--ok-ink); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }

/* ----------------------------------------------------------------- responsivo */
@media (max-width: 900px) {
  /* tela estreita: menu sempre em ícones (a preferência salva vale só para telas largas) */
  .nav { flex-basis: var(--nav-w-c); width: var(--nav-w-c); padding: 18px 8px; }
  .nav-fade { max-width: 0; opacity: 0; }
  .nav-brand, .nav-item, .nav-user { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
  .nav-item { padding: 0; width: 44px; height: 44px; margin: 0 auto; }
  .nav-user, .nav-user:hover { padding: 6px 0; background: none; border-color: transparent; border-radius: 50%; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-user:not(.open):hover .avatar { box-shadow: 0 0 0 3px rgba(127,211,181,.5); }
  .nav-user.open { z-index: 31; padding: 5px 1px 5px 0; background: #2B3B34; border: 1px solid rgba(255,255,255,.14); border-right-width: 0; border-radius: 16px 0 0 16px; box-shadow: -8px 12px 26px rgba(0,0,0,.28); backdrop-filter: none; -webkit-backdrop-filter: none; }
  details.row summary { grid-template-columns: 1fr 1fr; }
  details.row .body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .main { padding: 16px; gap: 14px; }
  h1 { font-size: 24px; }
  .page-head .blob { width: 260px; height: 134px; top: -50px; }
  .kpi .val { font-size: 30px; }
  .notice { padding: 12px 14px; }
  .auth-left { display: none; }
  .auth-card { padding: 24px 20px; }
  .otp input { width: 44px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-height: 600px) { .nav { overflow-y: auto; overflow-x: hidden; } }
