/* Codexia -- tokens e componentes (mesma familia visual do CodexiaVision) */
:root {
  --bg-base: #0a0c10; --bg-surface: #11141b; --bg-card: #151922; --bg-card-hover: #1b212d; --bg-input: #0c0f15;
  --border-subtle: rgba(255, 255, 255, .06); --border-medium: rgba(255, 255, 255, .12); --border-focus: rgba(150, 213, 7, .45);
  --text-main: #f8fafc; --text-muted: #94a3b8; --text-dim: #64748b;
  --green: #96d507; --green-hover: #a6ea15; --green-glow: rgba(150, 213, 7, .20); --green-subtle: rgba(150, 213, 7, .08);
  --amber: #f59e0b; --red: #ef4444; --purple: #a855f7; --cyan: #06b6d4;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 14px; --t: all .18s cubic-bezier(.4, 0, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { background: var(--bg-base); color: var(--text-main); font: 14px/1.5 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 4px; }

/* botoes e campos */
.btn { height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; cursor: pointer;
  border-radius: var(--radius-md); border: 1px solid var(--border-medium); background: var(--bg-card); color: var(--text-main);
  font-weight: 600; font-size: 13px; text-decoration: none; transition: var(--t); white-space: nowrap; }
.btn:hover { background: var(--bg-card-hover); }
.btn svg { width: 16px; height: 16px; }
.btn.primario { background: var(--green); border-color: var(--green); color: #0a0c10; }
.btn.primario:hover { background: var(--green-hover); }
.btn.grande { height: 44px; padding: 0 20px; font-size: 14px; }
.btn:disabled { opacity: .6; cursor: default; }
.input, .select { background: var(--bg-input); border: 1px solid var(--border-medium); color: var(--text-main); border-radius: var(--radius-md);
  height: 36px; padding: 0 11px; outline: none; transition: var(--t); font-size: 13px; }
.input:focus, .select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--green-subtle); }

/* cartoes, kpis, tabela, status */
.card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.card-head h2 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.card-head h2 svg { width: 15px; height: 15px; color: var(--text-muted); }
.card-head .acao { margin-left: auto; font-size: 12px; color: var(--green); text-decoration: none; font-weight: 600; cursor: pointer; background: none; border: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px 16px; }
.kpi-lbl { display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kpi-lbl svg { width: 14px; height: 14px; }
.kpi-val { font-size: 26px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.kpi-sub b { font-weight: 700; }
.t-green { color: var(--green); } .t-red { color: var(--red); } .t-amber { color: var(--amber); } .t-dim { color: var(--text-dim); }
.bar { height: 6px; background: var(--bg-input); border-radius: 99px; overflow: hidden; margin-top: 9px; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .4s; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; padding: 9px 12px;
  background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prod b { font-weight: 600; display: block; max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: var(--text-dim); }
.det { font-size: 11px; color: var(--text-dim); }
.gaiola { display: inline-block; font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-input); border: 1px solid var(--border-subtle);
  border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.dif { font-weight: 800; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-ok, .p-online { color: var(--green); background: var(--green-subtle); }
.p-falta, .p-offline { color: var(--red); background: rgba(239, 68, 68, .10); }
.p-sobra { color: var(--amber); background: rgba(245, 158, 11, .10); }
.p-pendente { color: var(--text-muted); background: rgba(148, 163, 184, .08); }
.p-fora_cadastro { color: var(--purple); background: rgba(168, 85, 247, .10); }
.vazio { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.vazio svg { width: 30px; height: 30px; color: var(--text-dim); margin-bottom: 10px; }
.vazio b { display: block; color: var(--text-main); font-size: 14px; margin-bottom: 4px; }
.erro { padding: 11px 14px; border-radius: var(--radius-md); border: 1px solid rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .08);
  color: #fca5a5; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.erro svg { width: 16px; height: 16px; flex-shrink: 0; }

/* login (modal) */
.login-bd { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .65); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--bg-surface); border: 1px solid var(--border-medium); border-radius: var(--radius-lg); padding: 26px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .6); position: relative; }
.login-card img { height: 26px; display: block; }
.login-card p { color: var(--text-muted); margin: 10px 0 20px; font-size: 13px; }
.login-card .x { position: absolute; top: 12px; right: 12px; background: none; border: 0; color: var(--text-dim); cursor: pointer; }
.login-card .x:hover { color: var(--text-main); }
.campo { display: block; margin-bottom: 14px; }
.campo span { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.campo .input { width: 100%; height: 40px; }
.login-erro { color: #fca5a5; font-size: 12px; margin: -4px 0 12px; }
.login-card .btn { width: 100%; height: 42px; }
