/* Polimento geral (estilo 21st.dev / CodePen): tipografia Geist, texturas sutis, ícones em blocos, bordas de luz e microinterações.
   Mantém a paleta Chumbo e prata e as cores dos cartões do Dashboard. */

/* ---------- tipografia ---------- */
body { font-family: 'Geist', Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11'; letter-spacing: -.003em; }
h1, h2, h3, h4, h5 { letter-spacing: -.022em; }
.topbar h1 { font-weight: 700; letter-spacing: -.03em; }
.card h3 { font-weight: 650; letter-spacing: -.018em; }
.kpi strong, .stat strong, td.right, .money, .price-input, [class*="valor"], .counter { font-variant-numeric: tabular-nums; }
.kpi strong, .stat strong { font-family: 'Geist', Inter, sans-serif; font-weight: 700; letter-spacing: -.035em; }
.muted, small { letter-spacing: 0; }
code, kbd, .mono { font-family: 'Geist Mono', ui-monospace, monospace; }

/* ---------- textura do fundo ---------- */
body { background-color: var(--bg); }
.main { position: relative; isolation: isolate;
  background:
    radial-gradient(1100px 420px at 85% -120px, rgba(161,161,170,.16), transparent 60%),
    radial-gradient(700px 300px at 0% 0%, rgba(228,228,231,.5), transparent 70%),
    var(--bg); }
.main::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- menu lateral ---------- */
.sidebar { background:
    radial-gradient(400px 260px at 0% 0%, rgba(255,255,255,.07), transparent 60%),
    linear-gradient(180deg, #232326 0%, #1c1c1f 100%);
  border-right: 1px solid rgba(255,255,255,.06); }
.sidebar::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.side-brand { position: relative; padding-bottom: 14px; }
.side-brand::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent); }
.side-brand strong { letter-spacing: -.02em; }
#nav { gap: 2px; }
#nav a { position: relative; border-radius: 10px; gap: 12px; font-weight: 500; transition: background .18s, color .18s; }
#nav a i { width: 30px; height: 30px; flex: none; display: grid; place-items: center; font-size: 15px; border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), inset 0 1px 0 rgba(255,255,255,.06);
  transition: background .18s, color .18s, box-shadow .18s, transform .18s; }
#nav a:hover { background: rgba(255,255,255,.05); }
#nav a:hover i { color: #fff; transform: translateY(-1px); }
#nav a.active { background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.03)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); color: #fff; }
#nav a.active::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #fff, #a1a1aa); box-shadow: 0 0 12px rgba(255,255,255,.6); }
#nav a.active i { color: #18181b; background: linear-gradient(180deg, #fafafa, #d4d4d8); box-shadow: 0 4px 12px -4px rgba(0,0,0,.6), inset 0 1px 0 #fff; }
#nav a small { font-weight: 400; }
.logout { border-radius: 10px; transition: background .18s, color .18s; }
.logout:hover { background: rgba(239,68,68,.12); color: #fca5a5; }

/* ---------- barra do topo ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(250,250,250,.78); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(228,228,231,.8); }
.icon-btn { border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05), inset 0 0 0 1px var(--border); border: 0; transition: transform .15s, box-shadow .15s; }
.icon-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(0,0,0,.2), inset 0 0 0 1px #d4d4d8; }

/* ---------- cartões ---------- */
.card, .stat, .module, .model-card, .check-card, .opt-box { border: 1px solid rgba(228,228,231,.9);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 1px 2px rgba(24,24,27,.04), 0 8px 24px -12px rgba(24,24,27,.08); }
.card { background: linear-gradient(180deg, #fff, #fdfdfd); }
.stat, .module, .model-card, .check-card { transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s; }
.stat:hover, .module:hover, .model-card:hover { transform: translateY(-2px); border-color: #d4d4d8;
  box-shadow: 0 1px 0 #fff inset, 0 2px 4px rgba(24,24,27,.04), 0 18px 34px -16px rgba(24,24,27,.18); }
.kpi { position: relative; overflow: hidden; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 12px 28px -14px rgba(0,0,0,.35); transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s; }
.kpi::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(260px 120px at 100% 0%, rgba(255,255,255,.22), transparent 60%); }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 20px 36px -16px rgba(0,0,0,.4); }
.kpi i, .stat i { filter: drop-shadow(0 2px 6px rgba(0,0,0,.15)); }

/* ícones em blocos */
.module .ic, .model-card .ic { border-radius: 12px; background: linear-gradient(180deg, #fafafa, #ececee); box-shadow: inset 0 0 0 1px #e4e4e7, inset 0 1px 0 #fff, 0 4px 10px -6px rgba(0,0,0,.25); color: #3f3f46; }
.icon-plain { border-radius: 8px; transition: background .15s, color .15s; }
.icon-plain:hover { background: #f4f4f5; color: #18181b; }
.bi-trash:hover, .icon-plain:hover .bi-trash { color: #dc2626; }

/* ---------- botões ---------- */
.btn { border-radius: 10px; font-weight: 600; letter-spacing: -.005em; transition: transform .15s, box-shadow .15s, background .15s, border-color .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #52525b, #3f3f46); border: 1px solid #27272a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.2), 0 6px 14px -6px rgba(0,0,0,.4); }
.btn.primary:hover { transform: translateY(-1px); background: linear-gradient(180deg, #5c5c65, #46464e);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.18), 0 12px 22px -10px rgba(0,0,0,.45); }
.btn.outline, .btn.ghost { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.btn.outline:hover, .btn.ghost:hover { background: #fafafa; box-shadow: 0 4px 12px -6px rgba(0,0,0,.18); }
.btn.success { background: linear-gradient(180deg, #34a06b, #2f7d57); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 6px 14px -6px rgba(47,125,87,.55); }

/* ---------- campos ---------- */
input, select, textarea { border-radius: 10px; border-color: #e4e4e7; background-color: #fff; box-shadow: 0 1px 2px rgba(24,24,27,.04); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #d4d4d8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #71717a; box-shadow: 0 0 0 4px rgba(113,113,122,.14), 0 1px 2px rgba(24,24,27,.04); }
input[type=checkbox], input[type=radio], input[type=color] { box-shadow: none; }
input::placeholder, textarea::placeholder { color: #a1a1aa; }
label { letter-spacing: -.005em; }

/* ---------- abas ---------- */
.tabs, .mc-tabs { padding: 4px; gap: 2px; border-radius: 12px; background: rgba(244,244,245,.8); box-shadow: inset 0 0 0 1px #e4e4e7; }
.tabs button, .mc-tabs button { border-radius: 9px; font-weight: 500; transition: background .18s, color .18s, box-shadow .18s; }
.tabs button:hover:not(.active), .mc-tabs button:hover:not(.active) { background: rgba(255,255,255,.8); color: #18181b; }
.tabs button.active, .mc-tabs button.active { background: linear-gradient(180deg, #52525b, #3f3f46); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 10px -4px rgba(0,0,0,.45); }
.seg, .mc-seg { padding: 3px; gap: 2px; background: #f4f4f5; border-color: #e4e4e7; }
.seg button, .mc-seg button { border-radius: 7px; background: transparent; }
.seg button.on { box-shadow: 0 2px 6px -2px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.2); }

/* ---------- tabelas ---------- */
.table-wrap { border-radius: 14px; border: 1px solid #ececee; background: #fff; overflow: auto; }
table thead th { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #71717a; background: #fafafa; border-bottom: 1px solid #ececee; }
table tbody tr { transition: background .12s; }
table tbody tr:hover { background: #fafafa; }
table td { border-color: #f1f1f3; }

/* ---------- etiquetas e chips ---------- */
.badge { border-radius: 999px; font-weight: 600; letter-spacing: .01em; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.chip { border-radius: 999px; transition: background .15s, border-color .15s; }
.switch span { box-shadow: inset 0 1px 2px rgba(0,0,0,.15); }
.switch input:checked + span { box-shadow: inset 0 1px 2px rgba(0,0,0,.15), 0 0 0 3px rgba(47,166,106,.15); }
.empty { color: #a1a1aa; }

/* ---------- janelas e avisos ---------- */
.modal, .modal-box, .dialog { border-radius: 18px; box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 30px 80px -20px rgba(0,0,0,.45); }
.toast { border-radius: 12px; backdrop-filter: blur(10px); box-shadow: 0 12px 30px -10px rgba(0,0,0,.45); }

/* ---------- entrada das telas ---------- */
.content > * { animation: pl-entra .45s cubic-bezier(.2,.8,.2,1) both; }
.content > *:nth-child(2) { animation-delay: .04s; } .content > *:nth-child(3) { animation-delay: .08s; } .content > *:nth-child(4) { animation-delay: .12s; }
@keyframes pl-entra { from { opacity: 0; transform: translateY(8px); } }

/* ---------- rolagem ---------- */
* { scrollbar-width: thin; scrollbar-color: #d4d4d8 transparent; }
.sidebar * { scrollbar-color: rgba(255,255,255,.15) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #a1a1aa; }

@media (prefers-reduced-motion: reduce) { .content > *, .stat, .kpi, .module { animation: none !important; transition: none !important; } }
.tabs, .mc-tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar, .mc-tabs::-webkit-scrollbar { display: none; }

/* ===================== Polimento 2: holofote, lâmpada, ondas, busca rápida ===================== */
/* padrão de pontos que some para baixo */
.main::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 420px; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(63,63,70,.16) 1px, transparent 1.2px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%); }

/* holofote nos cartões */
.card { background: radial-gradient(520px circle at var(--hx, -999px) var(--hy, -999px), rgba(24,24,27,.035), transparent 42%), linear-gradient(180deg, #fff, #fdfdfd); }
.stat, .module, .model-card, .check-card { position: relative; background: radial-gradient(360px circle at var(--hx, -999px) var(--hy, -999px), rgba(24,24,27,.05), transparent 45%), #fff; }
.stat::after, .module::after, .model-card::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(220px circle at var(--hx, 50%) var(--hy, 50%), rgba(63,63,70,.75), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.stat:hover::after, .module:hover::after, .model-card:hover::after { opacity: 1; }
.kpi::after { background: radial-gradient(300px circle at var(--hx, 100%) var(--hy, 0%), rgba(255,255,255,.3), transparent 55%); transition: background .1s; }

/* menu: lâmpada deslizante */
#nav { position: relative; }
.pl-lamp { position: absolute; left: 0; right: 0; top: 0; border-radius: 10px; pointer-events: none; opacity: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.09), rgba(255,255,255,.025)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), height .28s, opacity .2s; }
#nav a { z-index: 1; }
#nav a:hover { background: transparent; }

/* ondas nos botões */
.pl-onda { position: absolute; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(255,255,255,.45), transparent 60%); transform: scale(0); animation: pl-onda .65s ease-out forwards; }
.btn.outline .pl-onda, .btn.ghost .pl-onda, .tabs button:not(.active) .pl-onda { background: radial-gradient(circle, rgba(63,63,70,.18), transparent 60%); }
@keyframes pl-onda { to { transform: scale(1); opacity: 0; } }

/* botão de busca no topo */
.pl-buscar { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 12px; min-width: 220px; border: 0; border-radius: 10px; cursor: pointer;
  font: inherit; font-size: 13.5px; color: #71717a; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05), inset 0 0 0 1px var(--border); transition: box-shadow .15s, color .15s; }
.pl-buscar span { flex: 1; text-align: left; }
.pl-buscar:hover { color: #18181b; box-shadow: 0 6px 14px -6px rgba(0,0,0,.18), inset 0 0 0 1px #d4d4d8; }
kbd { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px; padding: 2px 6px; border-radius: 6px; color: #52525b; background: #f4f4f5; box-shadow: inset 0 0 0 1px #e4e4e7, 0 1px 0 #d4d4d8; }
@media (max-width: 900px) { .pl-buscar { min-width: 0; width: 38px; padding: 0; justify-content: center; } .pl-buscar span, .pl-buscar kbd { display: none; } }

/* janela de busca (Ctrl+K) */
.pl-cmd { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: start center; padding: 12vh 16px 16px; }
.pl-cmd.hidden { display: none; }
.pl-cmd-fundo { position: absolute; inset: 0; background: rgba(9,9,11,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: pl-fade .18s ease-out; }
.pl-cmd-box { position: relative; width: min(600px, 100%); border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.92); backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 40px 100px -20px rgba(0,0,0,.5); animation: pl-pop .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pl-fade { from { opacity: 0; } }
@keyframes pl-pop { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
.pl-cmd-busca { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid #ececee; }
.pl-cmd-busca i { color: #a1a1aa; font-size: 17px; }
.pl-cmd-busca input { flex: 1; height: 58px; border: 0; padding: 0; font-size: 16px; background: transparent; box-shadow: none; }
.pl-cmd-busca input:focus { box-shadow: none; }
.pl-cmd-lista { max-height: 50vh; overflow-y: auto; padding: 8px; }
.pl-cmd-lista a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #3f3f46; font-weight: 500; }
.pl-cmd-lista a > i:first-child { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(180deg, #fafafa, #ececee); box-shadow: inset 0 0 0 1px #e4e4e7; color: #52525b; }
.pl-cmd-lista a span { flex: 1; }
.pl-cmd-lista a small { color: #a1a1aa; font-size: 12px; }
.pl-cmd-lista a .pl-ent { opacity: 0; color: #a1a1aa; }
.pl-cmd-lista a.on { background: #f4f4f5; color: #18181b; }
.pl-cmd-lista a.on > i:first-child { background: linear-gradient(180deg, #52525b, #3f3f46); color: #fff; box-shadow: 0 4px 10px -4px rgba(0,0,0,.4); }
.pl-cmd-lista a.on .pl-ent { opacity: 1; }
.pl-cmd-vazio { text-align: center; color: #a1a1aa; padding: 28px; margin: 0; }
.pl-cmd-pe { display: flex; gap: 16px; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid #ececee; background: #fafafa; font-size: 12px; color: #71717a; }
.pl-cmd-pe kbd { margin-right: 3px; }
