/* =========================================================
   Telinha — design system
   ========================================================= */
:root {
  --bg: #07080d;
  --bg-2: #0c0e16;
  --surface: rgba(22, 25, 38, 0.72);
  --surface-solid: #141725;
  --surface-2: rgba(255, 255, 255, 0.04);
  --surface-3: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef0f7;
  --text-2: #a5abc3;
  --text-3: #6b7290;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --cyan: #22d3ee;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 55%, #f97316 100%);
  --grad-cool: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f43f5e;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
::selection { background: rgba(139, 92, 246, .45); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.16); }

/* ---------- Fundo aurora ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora::before, .aurora::after, .aurora span {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45;
  animation: drift 22s var(--ease) infinite alternate;
}
.aurora::before { width: 55vw; height: 55vw; left: -15vw; top: -20vw; background: #6d28d9; }
.aurora::after { width: 45vw; height: 45vw; right: -12vw; top: 10vh; background: #be185d; animation-delay: -8s; opacity: .3; }
.aurora span { width: 40vw; height: 40vw; left: 30vw; bottom: -25vw; background: #0891b2; animation-delay: -14s; opacity: .25; }
.aurora .grain {
  position: absolute; inset: 0; opacity: .06; filter: none; animation: none; border-radius: 0; width: auto; height: auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift { to { transform: translate(6vw, 4vh) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .aurora::before, .aurora::after, .aurora span { animation: none; } }

/* ---------- Botões ---------- */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: 12px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  font: 600 14px/1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { background: rgba(255,255,255,.12); border-color: var(--border-strong); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 8px 24px -8px rgba(236, 72, 153, .6); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 10px 30px -8px rgba(236, 72, 153, .8); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { color: #fda4af; }
.btn.danger:hover { background: rgba(244, 63, 94, .15); border-color: rgba(244, 63, 94, .35); }
.btn.solid-danger { background: var(--danger); color: #fff; border: none; }
.btn.solid-danger:hover { background: #e11d48; }
.btn.ok { color: #6ee7b7; }
.btn.ok:hover { background: rgba(52, 211, 153, .14); border-color: rgba(52, 211, 153, .35); }
.btn.sm { --h: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { --h: 50px; padding: 0 26px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer;
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Formulários ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px;
  background: rgba(0,0,0,.35); color: var(--text); border: 1px solid var(--border);
  font: inherit; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139, 92, 246, .18); background: rgba(0,0,0,.5); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a5abc3' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ---------- Cartões / superfícies ---------- */
.glass {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: var(--shadow);
}
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; background: var(--surface-3); color: var(--text-2);
}
.badge.warn { background: rgba(251, 191, 36, .14); color: var(--warn); }
.badge.ok { background: rgba(52, 211, 153, .14); color: var(--ok); }
.badge.danger { background: rgba(244, 63, 94, .14); color: #fda4af; }
.badge.mod { background: rgba(34, 211, 238, .13); color: var(--cyan); }
.badge.admin { background: rgba(139, 92, 246, .18); color: #c4b5fd; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px;
  background: rgba(244, 63, 94, .16); color: #fb7185; font-size: 11px; font-weight: 700; letter-spacing: .08em;
}
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #f43f5e; box-shadow: 0 0 0 0 rgba(244,63,94,.7); animation: ping 1.6s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgba(244,63,94,0); } 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0); } }

/* ---------- Avatares ---------- */
.avatar {
  --size: 32px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; color: #fff; font-weight: 700;
  font-size: calc(var(--size) * .4); letter-spacing: -.02em; text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { --size: 28px; margin-left: -8px; box-shadow: 0 0 0 2px var(--surface-solid); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more { background: var(--surface-3); color: var(--text-2); font-size: 11px; }

/* ---------- Barra superior ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(7, 8, 13, .6); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 6px 20px -6px rgba(236,72,153,.7);
}
.logo-mark svg { width: 18px; height: 18px; stroke: #fff; }
.nav .spacer { flex: 1; }
.nav-link { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14px; position: relative; }
.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link.active { color: var(--text); background: var(--surface-2); }
.nav-link .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-link .count[hidden] { display: none; }
.menu-wrap { position: relative; }
.me-btn { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 4px; border-radius: 99px; background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; font: inherit; font-weight: 500; }
.me-btn:hover { background: var(--surface-3); border-color: var(--border); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: .18s var(--ease); z-index: 30;
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 9px; background: none; border: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-3); }
.menu .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu .head { padding: 10px 12px 8px; font-size: 13px; }
@media (max-width: 640px) { .nav .hide-sm { display: none; } }

.page { max-width: 1120px; margin: 0 auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 40px) 80px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; max-width: min(92vw, 460px);
  background: rgba(20, 23, 37, .92); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  backdrop-filter: blur(16px); font-size: 14px; pointer-events: auto;
  animation: toastIn .35s var(--ease);
}
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); flex: none; }
.toast.error .dot { background: var(--danger); }
.toast.success .dot { background: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 4, 8, .6); backdrop-filter: blur(6px); animation: fade .2s;
}
.modal { width: 100%; max-width: 440px; padding: 28px; animation: pop .3s var(--ease); }
.modal h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; }
.modal p { margin: 0 0 20px; color: var(--text-2); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- Utilidades ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-2); }
.empty-state .icon-circle { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-3); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
kbd { font: 600 11px/1 inherit; font-family: inherit; padding: 3px 6px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); }
