/* Painel White Label — tema escuro */
:root {
  --bg: #0b0d12;
  --bg2: #10131a;
  --card: #141821;
  --card2: #1a1f2b;
  --line: rgba(255, 255, 255, .07);
  --line2: rgba(255, 255, 255, .12);
  --txt: #e8ebf2;
  --mut: #8b93a7;
  --mut2: #646c80;
  --pri: #5b8cff;
  --pri2: #7aa2ff;
  --pri-d: rgba(91, 140, 255, .14);
  --ok: #34d399;
  --ok-d: rgba(52, 211, 153, .13);
  --warn: #fbbf24;
  --warn-d: rgba(251, 191, 36, .13);
  --bad: #f87171;
  --bad-d: rgba(248, 113, 113, .13);
  --info: #60a5fa;
  --info-d: rgba(96, 165, 250, .13);
  --r: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--txt); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--pri2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mut { color: var(--mut); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.svg { display: inline-block; vertical-align: -3px; flex: none; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(900px 500px at 15% -10%, rgba(91, 140, 255, .16), transparent 60%),
  radial-gradient(700px 400px at 110% 110%, rgba(52, 211, 153, .08), transparent 60%), var(--bg); }
.login-box { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line2); border-radius: 20px; padding: 32px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.login-box h1 { font-size: 20px; margin: 18px 0 4px; letter-spacing: -.01em; }
.login-box p { margin: 0 0 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 800; letter-spacing: .04em;
  background: linear-gradient(135deg, var(--pri), #8b5cf6); color: #fff; box-shadow: 0 6px 18px rgba(91, 140, 255, .35); }
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--mut); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--mut); }
.field small { color: var(--mut2); font-size: 12px; }
.input, select.input, textarea.input { width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-d); }
textarea.input { resize: vertical; min-height: 80px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin: 4px 0 14px; font-size: 13.5px; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--pri); flex: none; }
.check small { display: block; color: var(--mut); font-size: 12px; }
.err { color: var(--bad); font-size: 13px; margin: -4px 0 12px; }

/* ---------- botoes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line2); background: var(--card2); color: var(--txt);
  border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; text-decoration: none; }
.btn:hover { background: #222838; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.pri:hover { background: #4a7bf0; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #05261a; }
.btn.ok:hover { background: #2bc48b; }
.btn.danger { background: transparent; border-color: rgba(248, 113, 113, .45); color: var(--bad); }
.btn.danger:hover { background: var(--bad-d); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; padding: 11px 14px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-btn { background: none; border: 0; color: var(--mut); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--txt); background: rgba(255, 255, 255, .06); }

/* ---------- estrutura ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 4px 6px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--mut); font-weight: 600; font-size: 13.5px; }
.nav a:hover { background: rgba(255, 255, 255, .04); color: var(--txt); text-decoration: none; }
.nav a.on { background: var(--pri-d); color: var(--txt); }
.nav a.on .svg { color: var(--pri2); }
.nav .pill { margin-left: auto; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.side-foot .who { flex: 1; min-width: 0; font-size: 13px; }
.side-foot .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar { display: none; }
.main { min-width: 0; padding: 26px 30px 60px; max-width: 1280px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; line-height: 1.2; }
.head p { margin: 4px 0 0; }
.crumb { font-size: 12.5px; color: var(--mut); margin-bottom: 6px; display: block; }
.scrim { display: none; }

/* ---------- cartoes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 18px; }
.card h2 { font-size: 15px; margin: 0 0 14px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card h2 .mut { font-weight: 500; font-size: 13px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat > span { font-size: 12.5px; color: var(--mut); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat b { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.25; overflow-wrap: anywhere; }
.stat small { color: var(--mut2); font-size: 12px; }
.stat.ok b { color: var(--ok); } .stat.warn b { color: var(--warn); } .stat.bad b { color: var(--bad); }
a.stat:hover { border-color: var(--line2); text-decoration: none; }
a.stat { color: inherit; }

/* ---------- selos ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: rgba(255, 255, 255, .06); color: var(--mut); }
.pill.ok { background: var(--ok-d); color: var(--ok); }
.pill.warn { background: var(--warn-d); color: var(--warn); }
.pill.bad { background: var(--bad-d); color: var(--bad); }
.pill.info { background: var(--info-d); color: var(--info); }
.pill.pri { background: var(--pri); color: #fff; min-width: 20px; justify-content: center; padding: 1px 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mut2); display: inline-block; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-d); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- tabelas ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mut2); padding: 0 12px 10px; white-space: nowrap; }
td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(255, 255, 255, .02); }
td .sub { display: block; color: var(--mut); font-size: 12px; }
td.r, th.r { text-align: right; }
.empty { padding: 30px 10px; text-align: center; color: var(--mut); }
.empty b { display: block; color: var(--txt); font-size: 15px; margin-bottom: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; font-size: 13px; }

/* ---------- filtros ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters .input { width: auto; min-width: 150px; padding: 8px 11px; }
.filters .grow { flex: 1; min-width: 200px; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; padding: 6px 11px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--mut); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--card2); color: var(--txt); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset; }

/* ---------- abas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 22px 0 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 12px; color: var(--mut); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--txt); border-bottom-color: var(--pri); }

/* ---------- licenca (detalhe do projeto) ---------- */
.lic { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.lic-main { display: flex; flex-direction: column; gap: 14px; }
.lic-big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.lic-big.ok { color: var(--ok); } .lic-big.warn { color: var(--warn); } .lic-big.bad { color: var(--bad); } .lic-big.info { color: var(--info); }
.toggles { display: flex; flex-direction: column; gap: 4px; }
.sw { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; border-top: 1px solid var(--line); }
.sw:first-child { border-top: 0; padding-top: 0; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw .tg { flex: none; width: 38px; height: 22px; border-radius: 12px; background: rgba(255, 255, 255, .14); position: relative; transition: background .15s; margin-top: 1px; }
.sw .tg::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw input:checked + .tg { background: var(--pri); }
.sw input.danger:checked + .tg { background: var(--bad); }
.sw input:checked + .tg::after { transform: translateX(16px); }
.sw input:focus-visible + .tg { box-shadow: 0 0 0 3px var(--pri-d); }
.sw b { display: block; font-size: 13.5px; }
.sw small { color: var(--mut); font-size: 12px; line-height: 1.4; display: block; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.alert { border: 1px solid rgba(251, 191, 36, .35); background: var(--warn-d); border-radius: 12px; padding: 11px 14px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert.bad { border-color: rgba(248, 113, 113, .35); background: var(--bad-d); }
.alert.info { border-color: rgba(96, 165, 250, .35); background: var(--info-d); }
.alert .svg { margin-top: 2px; }
.alert + .alert, .alert + .card, .card + .alert { margin-top: 12px; }

/* ---------- token ---------- */
.token { display: flex; gap: 8px; align-items: center; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; word-break: break-all; }
.token code { flex: 1; min-width: 0; }
pre.code { background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; margin: 0 0 12px; }
ol.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
ol.steps li::marker { color: var(--pri2); font-weight: 700; }

/* ---------- chips de dias ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chips button { background: var(--bg2); border: 1px solid var(--line2); color: var(--mut); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chips button.on, .chips button:hover { border-color: var(--pri); color: var(--txt); }
.preview { background: var(--bg2); border: 1px dashed var(--line2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
.preview b { color: var(--ok); }

/* ---------- linha do tempo ---------- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.tl li:first-child { border-top: 0; padding-top: 0; }
.tl .ic { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); color: var(--mut); }
.tl .ic.ok { background: var(--ok-d); color: var(--ok); } .tl .ic.bad { background: var(--bad-d); color: var(--bad); } .tl .ic.info { background: var(--info-d); color: var(--info); }
.tl .tx { flex: 1; min-width: 0; font-size: 13.5px; }
.tl .tx small { display: block; color: var(--mut); font-size: 12px; }
.tl .amt { font-weight: 700; color: var(--ok); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- listas curtas ---------- */
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.mini li:first-child { border-top: 0; padding-top: 0; }
.mini .l { min-width: 0; }
.mini .l b, .mini .l small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .l small { color: var(--mut); font-size: 12px; }
.mini .r { text-align: right; flex: none; font-size: 12.5px; color: var(--mut); }
.mini .r b { display: block; color: var(--txt); font-size: 13.5px; }

/* ---------- modal e aviso ---------- */
.modal { position: fixed; inset: 0; background: rgba(4, 6, 10, .72); display: grid; place-items: center; padding: 16px; z-index: 50; backdrop-filter: blur(3px); }
.modal-box { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line2); border-radius: 18px; box-shadow: 0 30px 90px rgba(0, 0, 0, .55); }
.modal-box.wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1f2533; border: 1px solid var(--line2); color: var(--txt); padding: 11px 16px; border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5); z-index: 60; font-weight: 600; font-size: 13.5px; max-width: calc(100vw - 32px); }
.toast.bad { border-color: rgba(248, 113, 113, .5); color: #fecaca; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.loading { padding: 50px 0; display: grid; place-items: center; color: var(--mut); }

/* ---------- celular ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; height: auto; }
  body.menu .side { transform: none; }
  body.menu .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 35; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); position: sticky; top: 0; z-index: 30; }
  .main { padding: 20px 16px 50px; }
  .head h1 { font-size: 21px; }
  .lic { grid-template-columns: 1fr; }
  .lic-big { font-size: 25px; }
  .card { padding: 16px; }
  .tbl-wrap { margin: 0 -16px; padding: 0 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.two { grid-template-columns: 1fr; }
  .stat { padding: 13px 14px; }
  .stat b { font-size: 19px; }
  .filters .input, .filters .grow { min-width: 0; flex: 1 1 140px; }
}

/* utilitarios (a CSP nao deixa style="" no HTML) */
.col { min-width: 0; }
.sp34 { width: 34px; }
.of { font-size: 15px; font-weight: 600; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.mt12 { margin-top: 12px; }
.mt18 { margin-top: 18px; }
.pills.inl { display: inline-flex; vertical-align: middle; }
.sum { margin: 0 0 10px; }
.flex1 { flex: 1; }
.btns.end { justify-content: flex-end; }
.kv.mkv { margin: 6px 0 16px; }
.danger-t { color: var(--bad); }
.m0t { margin-top: 0; }

.grid > .card { margin-top: 0; }
.token .btn { font-family: var(--font); }
.tbl-wrap > table { min-width: 720px; }
