/* Painel da revenda e do admin — tokens de replica/design/tokens.json (escuro, destaque verde). */
:root {
  --bg: #0a1322; --surface: #12213a; --surface-2: #1a2d4d; --border: #263c5f; --border-input: #6f86a8;
  --text: #fff; --muted: #a9b8cf; --accent: #00c853; --accent-soft: #a5d6a7; --on-accent: #04210f;
  --danger: #ff6b6b; --warning: #ffb547; --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
  --shadow: 0 16px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, "Segoe UI", system-ui, -apple-system, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-soft); }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Barra superior */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(10, 19, 34, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.top .menu-btn { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); cursor: pointer; display: grid; place-items: center; }
.top .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.top .brand img { width: 36px; height: 36px; }
.top .brand b { display: block; font-size: 16px; line-height: 1.1; }
.top .brand small { color: var(--muted); font-size: 12px; }
.top .spacer { flex: 1; }
.credit-pill { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; white-space: nowrap; cursor: pointer; }
.credit-pill b { color: var(--accent); font-size: 17px; }

/* Gaveta */
.drawer { position: fixed; inset: 0; z-index: 30; display: none; }
.drawer.open { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.drawer nav { position: absolute; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; overflow-y: auto; }
.drawer nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); color: var(--text); text-decoration: none; font-weight: 500; }
.drawer nav a:hover, .drawer nav a:focus-visible { background: var(--surface-2); outline: none; }
.drawer nav a.active { background: var(--accent); color: var(--on-accent); }
.drawer nav .sep { height: 1px; background: var(--border); margin: 10px 6px; }
.drawer nav .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; padding: 8px 14px 4px; }

/* Página */
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 80px; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 17px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; }
.kpi .v { font-size: 28px; font-weight: 700; }
.kpi .l { color: var(--muted); font-size: 13px; }
.shortcut { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); cursor: pointer; text-align: left; }
.shortcut:hover, .shortcut:focus-visible { border-color: var(--accent); outline: none; }
.shortcut .ic { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--surface-2); display: grid; place-items: center; color: var(--accent); }
.shortcut b { font-size: 16px; }
.shortcut span { color: var(--muted); font-size: 13px; }

/* Formulários */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea { width: 100%; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border-input); border-radius: var(--r-md); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 200, 83, .25); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 180px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: var(--r-md); border: 1px solid transparent; background: var(--accent); color: var(--on-accent); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.tabs { display: flex; gap: 6px; background: var(--bg); border: 1px solid var(--border); padding: 4px; border-radius: var(--r-md); width: fit-content; }
.tabs button { background: none; border: 0; padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }

/* Listas */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--border); }
.item .main { min-width: 0; flex: 1; }
.item .t { font-weight: 600; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: rgba(0, 200, 83, .15); color: var(--accent); }
.pill.warn { background: rgba(255, 181, 71, .15); color: var(--warning); }
.pill.bad { background: rgba(255, 107, 107, .15); color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.table-wrap { overflow-x: auto; }

/* Pacotes */
.pack { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.pack .cr { font-size: 30px; font-weight: 800; }
.pack .cr small { font-size: 15px; color: var(--muted); font-weight: 600; }
.pack .price { font-size: 20px; font-weight: 700; color: var(--accent); }
.pack .unit { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.pack .tag { position: absolute; top: 14px; right: 14px; }
.pack.best { border-color: var(--accent); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.modal .box { position: relative; width: min(520px, 100%); max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.modal .box h3 { margin: 0 0 6px; font-size: 19px; }
.modal .close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }
.qr { display: grid; place-items: center; background: #fff; border-radius: var(--r-md); padding: 12px; width: 260px; height: 260px; margin: 14px auto; }
.qr svg, .qr img { width: 236px; height: 236px; image-rendering: pixelated; }
.copybox { display: flex; gap: 8px; }
.copybox input { font-size: 12px; }
.wait { display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--muted); margin-top: 10px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.msg { margin-top: 12px; padding: 10px 14px; border-radius: var(--r-md); font-size: 14px; }
.msg.ok { background: rgba(0, 200, 83, .12); color: var(--accent-soft); }
.msg.err { background: rgba(255, 107, 107, .12); color: var(--danger); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--accent); color: var(--on-accent); font-weight: 700; padding: 12px 18px; border-radius: var(--r-md); box-shadow: var(--shadow); }
.timeline { border-left: 2px solid var(--border); margin: 6px 0 0 6px; padding-left: 14px; }
.timeline div { position: relative; padding: 6px 0; font-size: 14px; }
.timeline div::before { content: ""; position: absolute; left: -21px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.login { max-width: 420px; margin: 8vh auto; }
.login .logo { display: block; width: 260px; margin: 0 auto 20px; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.codes span { background: var(--bg); border: 1px dashed var(--accent); border-radius: var(--r-sm); padding: 8px; text-align: center; font-weight: 700; }
@media (max-width: 560px) { .top .brand small { display: none; } .page-head h1 { font-size: 20px; } }
