/* ===== XLoader — tema escuro ===== */
:root {
  --bg: #0b0e14;
  --bg-2: #121722;
  --panel: #161c28;
  --panel-2: #1c2433;
  --border: #26303f;
  --text: #e6ebf2;
  --muted: #8a97a8;
  --brand: #f5a623;
  --brand-2: #ffcb52;
  --accent: #3aa0ff;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1a2233 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; font-weight: 700; }
small { color: var(--muted); }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: .5px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #1a1300; font-weight: 900;
  box-shadow: 0 4px 14px rgba(245, 166, 35, .35);
}
.brand .x { color: var(--brand); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1rem; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); cursor: pointer; font-size: .92rem;
  transition: .15s; font-weight: 600;
}
.btn:hover { border-color: #38465c; background: #212b3c; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #1a1300; border: none;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-danger { color: var(--danger); border-color: #402232; }
.btn-danger:hover { background: #2a1620; }
.btn-sm { padding: .35rem .6rem; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- inputs ---- */
label.field { display: block; margin-bottom: .9rem; }
label.field > span { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .5px; }
input, select, textarea {
  width: 100%; padding: .65rem .8rem; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
  font-size: .95rem; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(245,166,35,.12); }

/* ---- cards / panels ---- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-2 { grid-template-columns: 1fr; } }

.stat { background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.stat .n { font-size: 2rem; font-weight: 800; }
.stat .l { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; }

/* ---- table ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
tbody tr:hover { background: var(--panel-2); }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .85rem; }

/* ---- badges ---- */
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge.active, .badge.published, .badge.success { background: rgba(52,211,153,.15); color: var(--ok); }
.badge.expired, .badge.paused, .badge.draft, .badge.pending { background: rgba(251,191,36,.15); color: var(--warn); }
.badge.revoked, .badge.banned, .badge.blocked, .badge.suspended, .badge.failed { background: rgba(248,113,113,.15); color: var(--danger); }

/* ---- layout admin ---- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); padding: 1.2rem 1rem; display: flex; flex-direction: column; }
.nav { display: flex; flex-direction: column; gap: .2rem; margin-top: 1.5rem; }
.nav a { color: var(--muted); padding: .6rem .8rem; border-radius: 9px; font-weight: 600; display: flex; gap: .6rem; align-items: center; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--brand); }
.main { padding: 1.5rem 2rem; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.spacer { flex: 1; }

/* ---- auth screens ---- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; box-shadow: var(--shadow); }
.auth-card h1 { text-align: center; }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 1.5rem; font-size: .9rem; }

/* ---- modal ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal h3 { margin-bottom: 1rem; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.end { justify-content: flex-end; }

/* ---- toast ---- */
#toasts { position: fixed; top: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 100; }
.toast { padding: .8rem 1rem; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-2); box-shadow: var(--shadow); font-size: .9rem; max-width: 340px; }
.toast.ok { border-color: #1e5a45; }
.toast.err { border-color: #5a2530; }

.muted { color: var(--muted); }
.hidden { display: none !important; }
.flex { display: flex; }
.gap { gap: .6rem; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.between { justify-content: space-between; }
.center-y { align-items: center; }
.code-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: .8rem; font-family: monospace; font-size: .82rem; word-break: break-all; }
