/* CheckNum — tokens e componentes base (landing + painel) */
:root {
  --brand: #4F46E5;
  --brand-2: #7C3AED;
  --accent: #0EA47A;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --bg: #F6F7FB;
  --bg-2: #EEF0F7;
  --surface: #FFFFFF;
  --surface-2: #F9FAFC;
  --text: #0E1324;
  --text-2: #3B4256;
  --muted: #6A7287;
  --border: #E3E6EF;
  --border-2: #D3D8E4;
  --ok: #0E9F6E;
  --ok-bg: #E4F6EF;
  --no: #D63A4A;
  --no-bg: #FCE9EB;
  --warn: #B7791F;
  --warn-bg: #FDF3E1;
  --info: #2F6FDB;
  --info-bg: #E6EFFC;
  --neutral-bg: #EEF0F5;

  --brand-soft: color-mix(in oklab, var(--brand) 12%, var(--surface));
  --brand-softer: color-mix(in oklab, var(--brand) 6%, var(--surface));
  --brand-ink: color-mix(in oklab, var(--brand) 82%, #000);
  --ring: color-mix(in oklab, var(--brand) 35%, transparent);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 10px -4px rgba(16, 24, 40, .08);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A0C13;
  --bg-2: #10131D;
  --surface: #131724;
  --surface-2: #171C2B;
  --text: #E8EBF4;
  --text-2: #C3C8D6;
  --muted: #8C93A7;
  --border: #242A3B;
  --border-2: #303749;
  --ok: #3CCB94;
  --ok-bg: #11291F;
  --no: #F06A77;
  --no-bg: #2E1519;
  --warn: #E7B350;
  --warn-bg: #2C2210;
  --info: #79A6F2;
  --info-bg: #131F36;
  --neutral-bg: #1C2232;
  --brand-ink: color-mix(in oklab, var(--brand) 55%, #fff);
  --brand-soft: color-mix(in oklab, var(--brand) 22%, var(--surface));
  --brand-softer: color-mix(in oklab, var(--brand) 11%, var(--surface));
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 40px -10px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.015em; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
img { max-width: 100%; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ── Marca ── */
.cn-logo { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.cn-logo:hover { text-decoration: none; }
.cn-mark { flex: none; display: block; }
.cn-wm { font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.cn-wm em { font-style: normal; color: var(--brand); }

/* ── Botões ── */
.btn {
  --b: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px;
  font: inherit; font-weight: 600; font-size: 14px;
  color: var(--text); background: var(--b);
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { color: #fff; background: var(--brand); border-color: transparent; box-shadow: 0 1px 2px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: color-mix(in oklab, var(--brand) 88%, #000); }
.btn-grad { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 0; }
.btn-grad:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--neutral-bg); }
.btn-danger { color: var(--no); border-color: color-mix(in oklab, var(--no) 35%, var(--border)); }
.btn-danger:hover { background: var(--no-bg); }
.btn-sm { height: 31px; padding: 0 11px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15.5px; border-radius: 11px; }
.btn-icon { width: 36px; padding: 0; }

/* ── Formulários ── */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .select, textarea.input {
  width: 100%; height: 39px; padding: 0 12px;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .btn { border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-left: -1px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-2); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
input[type="color"].input { padding: 4px; width: 46px; cursor: pointer; }
input[type="range"] { accent-color: var(--brand); width: 100%; }

/* ── Cartões ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; }
.card-body { padding: 20px; }

/* ── Selos ── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px; font-size: 12px; font-weight: 600; border-radius: 99px; background: var(--neutral-bg); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-no { background: var(--no-bg); color: var(--no); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-brand { background: var(--brand-soft); color: var(--brand-ink); }
.b-pulse::before { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ── Tabelas ── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--brand-softer); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact td, .table-compact th { padding: 7px 12px; }

/* ── Progresso ── */
.progress { height: 8px; background: var(--neutral-bg); border-radius: 99px; overflow: hidden; display: flex; gap: 2px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .6s ease; }
.progress > .p-ok { background: var(--ok); }
.progress > .p-no { background: var(--no); }
.progress > .p-mut { background: var(--border-2); }
.progress-lg { height: 12px; }

/* ── Modal ── */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 10, 20, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .15s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal-lg { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16.5px; }
.modal-body { padding: 22px; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ── Toast ── */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-width: 260px; max-width: 380px; background: var(--text); color: var(--bg); border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 14px; animation: rise .2s ease-out; }
.toast svg { width: 18px; height: 18px; flex: none; color: var(--accent); }

/* ── Abas ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 10px 14px; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand-ink); border-color: var(--brand); }
.seg { display: inline-flex; padding: 3px; background: var(--neutral-bg); border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ── Utilidades ── */
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.tnum { font-variant-numeric: tabular-nums; }
.ok-t { color: var(--ok); }
.no-t { color: var(--no); }
.warn-t { color: var(--warn); }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.divider { height: 1px; background: var(--border); border: 0; margin: 4px 0; }
.alert { display: flex; gap: 12px; padding: 13px 15px; border-radius: var(--r-sm); font-size: 13.5px; border: 1px solid transparent; }
.alert svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.alert-warn { background: var(--warn-bg); color: var(--text); border-color: color-mix(in oklab, var(--warn) 30%, transparent); }
.alert-warn svg { color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--text); border-color: color-mix(in oklab, var(--info) 25%, transparent); }
.alert-info svg { color: var(--info); }
.alert-no { background: var(--no-bg); color: var(--text); border-color: color-mix(in oklab, var(--no) 30%, transparent); }
.alert-no svg { color: var(--no); }
.kbd { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); }
.codeblock { font-family: var(--mono); font-size: 12.8px; line-height: 1.65; background: #0D1120; color: #D7DCEA; padding: 16px 18px; border-radius: var(--r); overflow-x: auto; white-space: pre; }
.codeblock .c { color: #7B86A3; }
.codeblock .s { color: #8BE0B8; }
.codeblock .k { color: #B9A7FF; }
.theme-btn .i-moon { display: none; }
[data-theme="dark"] .theme-btn .i-moon { display: block; }
[data-theme="dark"] .theme-btn .i-sun { display: none; }

.grid-2 > *, .grid-3 > *, .grid-4 > *, .stack > *, .stack-sm > * { min-width: 0; }
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2 { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
}
