/* MTA Tools · painel admin. Cores do site/launcher (site/public/assets/css/style.css). Sem framework, sem fontes externas (CSP). */
:root {
  --back: #0F0D0C; --sidebar: #151211; --surface: #1B1716; --surface2: #231E1C;
  --border: #2F2826; --border-strong: #433936;
  --header: #F6F3F1; --label: #DCD5D2; --muted: #9A9390;
  --accent: #F56461; --accent-hover: #FC7A69; --accent-dark: #E76243; --accent-soft: #2E1A17;
  --ok: #4CC38A; --ok-soft: #14291F; --warn: #E5A84B; --warn-soft: #2C2213; --bad: #F26B6B; --bad-soft: #2E1515;
  --info: #7AA7F0; --info-soft: #172235;
  --coral: linear-gradient(135deg, #E76243 0%, #F56461 55%, #FC8469 100%);
  --radius: 12px; --radius-sm: 8px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head: "Sora", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--back); color: var(--label); font: 15px/1.5 var(--font); min-height: 100vh; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--font-head); color: var(--header); margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.1rem; } h3 { font-size: .95rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono { font-family: var(--mono); font-size: .88em; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---------- botões / campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 9px;
  font: 600 .9rem var(--font); border: 1px solid var(--border-strong); background: var(--surface2); color: var(--header); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--coral); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: #5a2b2b; }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.ok { color: var(--ok); border-color: #22503a; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: .82rem; border-radius: 7px; }
label.f { display: block; }
label.f > span { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--back);
  color: var(--header); font: 15px var(--font); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 100, 97, .18); }
input.code { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .3em; text-align: center; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.err { color: var(--bad); font-size: .9rem; min-height: 1.2em; }

/* ---------- tela de entrada ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 15% -10%, rgba(245, 100, 97, .13), transparent 60%), var(--back); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.auth-card.wide { max-width: 640px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand img { width: 36px; height: 36px; border-radius: 9px; }
.auth-brand b { font-family: var(--font-head); color: var(--header); font-size: 1.1rem; }
.auth-brand small { display: block; color: var(--muted); font-size: .8rem; }
.qr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: var(--back); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.qr img { width: 180px; height: 180px; background: #fff; border-radius: 8px; padding: 6px; image-rendering: pixelated; }
.secret { font-family: var(--mono); color: var(--header); word-break: break-all; background: var(--surface2); padding: 6px 9px; border-radius: 6px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--sidebar); border-bottom: 1px solid var(--border); padding: 10px 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; position: sticky; top: 0; z-index: 20; }
.side .brand { display: flex; align-items: center; gap: 9px; color: var(--header); font-family: var(--font-head); font-weight: 700; margin-right: auto; }
.side .brand img { width: 30px; height: 30px; border-radius: 8px; }
.side .brand small { color: var(--accent); font-weight: 600; font-family: var(--font); font-size: .75rem; margin-left: 2px; }
.menu-btn { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; background: var(--surface2); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--header); cursor: pointer; }
.side nav { display: none; flex-direction: column; gap: 2px; flex: 0 0 100%; padding: 6px 0 4px; }
.side.open nav { display: flex; }
.side nav a { display: flex; align-items: center; gap: 11px; color: var(--label); padding: 10px 12px; border-radius: 9px; font-weight: 500; font-size: .93rem; white-space: nowrap; border-left: 3px solid transparent; }
.side nav a svg { flex: none; color: var(--muted); }
.side nav a:hover { background: var(--surface2); color: var(--header); }
.side nav a:hover svg { color: var(--header); }
.side nav a.on { background: var(--accent-soft); color: var(--header); border-left-color: var(--accent); font-weight: 600; }
.side nav a.on svg { color: var(--accent); }
.side .who { display: none; }
.side.open .who { display: block; flex-basis: 100%; padding: 10px 12px 4px; border-top: 1px solid var(--border); font-size: .85rem; }
.side .who .btn { margin-top: 8px; }
@media (min-width: 900px) {
  .shell { grid-template-columns: 236px minmax(0, 1fr); }
  .side { flex-direction: column; flex-wrap: nowrap; align-items: stretch; height: 100vh; padding: 20px 12px; border-bottom: 0; border-right: 1px solid var(--border); overflow-y: auto; }
  .side .brand { padding: 0 8px 18px; margin-right: 0; }
  .menu-btn { display: none; }
  .side nav { display: flex; flex: none; padding: 0; }
  .side .who, .side.open .who { display: block; flex-basis: auto; margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); font-size: .85rem; }
}
.main { padding: 20px 16px 60px; min-width: 0; }
@media (min-width: 900px) { .main { padding: 28px 32px 60px; } }
.page-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.crumb { font-size: .85rem; margin-bottom: 6px; display: inline-block; }

/* ---------- cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card > h2 { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .cards.c2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .cards.c3 { grid-template-columns: 1fr 1fr 1fr; } .cards.c2-1 { grid-template-columns: 2fr 1fr; } }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi b { display: block; font-family: var(--font-head); font-size: 1.65rem; color: var(--header); line-height: 1.15; }
.kpi span { color: var(--muted); font-size: .82rem; }
.kpi.accent b { color: var(--accent); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; font-size: .92rem; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; color: var(--header); min-width: 0; overflow-wrap: anywhere; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 34px; gap: 10px; align-items: center; font-size: .88rem; }
.bar .t { height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.bar .t i { display: block; height: 100%; background: var(--coral); border-radius: 4px; }
.bar b { color: var(--header); text-align: right; font-weight: 600; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.empty { color: var(--muted); font-size: .9rem; padding: 10px 0; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; background: var(--sidebar); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface2); }
td .sub, .list .sub { display: block; color: var(--muted); font-size: .8rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.list li:last-child { border-bottom: 0; }

/* ---------- etiquetas ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.tag.ok { color: var(--ok); background: var(--ok-soft); border-color: #22503a; }
.tag.warn { color: var(--warn); background: var(--warn-soft); border-color: #5a4422; }
.tag.bad { color: var(--bad); background: var(--bad-soft); border-color: #5a2b2b; }
.tag.info { color: var(--info); background: var(--info-soft); border-color: #2a4166; }
.tag.beta { color: #fff; background: var(--coral); }
.tag.neutral { color: var(--label); background: var(--surface2); border-color: var(--border-strong); }

/* ---------- filtro ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input { max-width: 340px; flex: 1 1 220px; }
.filters select { width: auto; flex: 0 0 auto; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; z-index: 100; overflow-y: auto; }
.modal { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.modal h2 { margin-bottom: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.invite { background: var(--back); border: 1px dashed var(--accent); border-radius: 12px; padding: 16px; text-align: center; }
.invite .code { font-family: var(--mono); font-size: 2rem; letter-spacing: .12em; color: var(--header); font-weight: 700; }
.warnbox { background: var(--warn-soft); border: 1px solid #5a4422; color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: .88rem; }
.infobox { background: var(--info-soft); border: 1px solid #2a4166; color: #b9cff5; border-radius: 10px; padding: 10px 12px; font-size: .88rem; }

/* ---------- avisos ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; max-width: calc(100vw - 32px); }
.toast { background: var(--surface2); border: 1px solid var(--border-strong); border-left: 4px solid var(--ok); color: var(--header); padding: 10px 14px; border-radius: 10px; font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.bad { border-left-color: var(--bad); }
pre.json { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: .78rem; color: var(--muted); margin: 0; max-width: 520px; }
.chart .legend i.lg { background: var(--accent); }
.auth-card form > .btn.primary { width: 100%; min-height: 44px; }
label.check { display: flex; align-items: center; gap: 9px; font-size: .92rem; color: var(--label); cursor: pointer; }
label.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); margin: 0; }
.section-title { margin: 22px 0 10px; }
pre.mailbody { white-space: pre-wrap; word-break: break-word; font-family: var(--font); font-size: .9rem; color: var(--label); background: var(--back);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px; max-height: 320px; overflow: auto; margin: 0; }
