/* Nexus Mult Tool — portal do cliente. Identidade Nexus GSM: escuro + roxo-neon. */

:root {
  --bg: #0b0714;
  --bg-2: #110a1f;
  --panel: #160f27;
  --panel-2: #1d1433;
  --border: #2d2148;
  --text: #ece6f7;
  --muted: #a89cc4;
  --accent: #a855f7;
  --accent-2: #c084fc;
  --accent-glow: rgba(168, 85, 247, 0.45);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Consolas", "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(168, 85, 247, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-underline-offset: 3px; }
a:hover { color: #e9d5ff; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

h1, h2 { line-height: 1.25; margin: 0 0 0.75rem; }

.skip-link {
  position: absolute; left: -999px; top: 0.5rem; z-index: 50;
  background: var(--accent); color: #fff; padding: 0.5rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 0.5rem; }

.mono { font-family: var(--mono); letter-spacing: 0.02em; }
.break { word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.hint { color: var(--muted); font-size: 0.875rem; margin: 0.4rem 0 0; }
.loading, .empty { color: var(--muted); padding: 1rem 0; }
.boot { text-align: center; padding-top: 30vh; }
.noscript { text-align: center; padding: 2rem; }

/* ---------- Layout autenticado ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px; flex-shrink: 0; padding: 1.25rem 1rem;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.5rem;
  color: var(--text); text-decoration: none; font-size: 1.1rem;
}
.brand strong { color: var(--accent-2); text-shadow: 0 0 12px var(--accent-glow); }

.nav { display: flex; flex-direction: column; gap: 0.2rem; }
.nav-link {
  color: var(--muted); text-decoration: none; padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm); border: 1px solid transparent;
}
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.active {
  color: #fff; background: var(--panel-2); border-color: var(--border);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 18px -8px var(--accent-glow);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 1rem;
  padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--border);
  background: rgba(11, 7, 20, 0.7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.topbar-user { color: var(--muted); }
.menu-toggle { display: none; margin-right: auto; }

.content { padding: 1.5rem; max-width: 1200px; width: 100%; outline: none; }
.page-title { font-size: 1.6rem; margin-bottom: 1.25rem; }

/* ---------- Cartões e grades ---------- */

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.75rem; min-width: 0;
}
.card > .btn { align-self: flex-start; }
.card-title { font-size: 1.05rem; color: var(--accent-2); margin: 0; }
.error-card { border-color: var(--danger); }

.big-number {
  font-size: 2.4rem; font-weight: 700; margin: 0;
  color: #fff; text-shadow: 0 0 22px var(--accent-glow);
}
.highlight { color: var(--accent-2); font-weight: 600; }
.stat-row { display: flex; gap: 0.5rem; align-items: center; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Badges, avisos, toasts ---------- */

.badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; border: 1px solid currentColor; white-space: nowrap;
}
.badge-success { color: var(--success); background: rgba(52, 211, 153, 0.08); }
.badge-warning { color: var(--warning); background: rgba(251, 191, 36, 0.08); }
.badge-danger { color: var(--danger); background: rgba(248, 113, 113, 0.08); }
.badge-info { color: var(--info); background: rgba(96, 165, 250, 0.08); }
.badge-muted { color: var(--muted); background: rgba(168, 156, 196, 0.06); }

.notice { border-radius: var(--radius-sm); padding: 0.85rem 1rem; border: 1px solid; margin: 0 0 1rem; }
.notice-warning { border-color: var(--warning); background: rgba(251, 191, 36, 0.08); }
.notice-success { border-color: var(--success); background: rgba(52, 211, 153, 0.07); }

.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 100; max-width: min(420px, calc(100vw - 2rem)); }
.toast { padding: 0.8rem 1rem; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border); box-shadow: var(--shadow); border-left-width: 4px; }
.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-danger { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--accent); }

/* ---------- Botões ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  color: var(--text); background: var(--panel-2);
  transition: box-shadow 0.15s, background 0.15s, transform 0.05s;
}
.btn:hover { box-shadow: 0 0 0 1px var(--accent), 0 0 18px -4px var(--accent-glow); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: linear-gradient(135deg, #9333ea, #7c3aed); border-color: #a855f7; color: #fff; box-shadow: 0 0 20px -6px var(--accent-glow); }
.btn-secondary { background: transparent; border-color: var(--accent); color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-block { width: 100%; }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.875rem; }

/* ---------- Formulários ---------- */

.form { display: flex; flex-direction: column; gap: 0.9rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
input {
  font: inherit; color: var(--text); background: #0d0818;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem; width: 100%;
}
input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
input:disabled { color: var(--muted); }
.form-message:empty { display: none; }
.form-message { margin: 0; padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); }
.form-message.error { color: #fecaca; background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.5); }
.form-message.info { color: #d1fae5; background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.4); }
.form-links { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0; font-size: 0.95rem; }

/* ---------- Tabelas, listas, linha do tempo ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.positive { color: var(--success); }
.negative { color: var(--danger); }

.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.list-item p { margin: 0.1rem 0 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--border); }
.timeline-item p { margin: 0.1rem 0 0; }
.timeline-date { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

.changelog { white-space: pre-wrap; background: #0d0818; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem 1rem; }
.release-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.release-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.qr-wrap { display: flex; justify-content: center; padding: 0.5rem; }
.qr { width: 220px; height: 220px; image-rendering: pixelated; border-radius: 8px; }
.steps { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.codes { columns: 2; list-style: none; padding: 0; margin: 0.5rem 0; font-size: 1.05rem; }
.contact-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }

/* ---------- Telas públicas (login etc.) ---------- */

.auth-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth-card {
  width: 100%; max-width: 420px; padding: 2rem;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow), 0 0 60px -30px var(--accent-glow);
}
.auth-card h1 { font-size: 1.4rem; }
.auth-footer { margin-top: 1rem; font-size: 0.9rem; }

/* ---------- Responsivo ---------- */

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(280px, 85vw); z-index: 40;
    transform: translateX(-105%); transition: transform 0.2s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .content { padding: 1rem; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.1rem; }
  .codes { columns: 1; }
  .auth-card { padding: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
