/* Visual no estilo shadcn/ui: tokens zinc, bordas finas, raio 0.5rem. Tema escuro automático. */
:root {
  --bg: #ffffff; --fg: #09090b; --muted: #71717a; --muted-bg: #f4f4f5; --border: #e4e4e7;
  --card: #ffffff; --sidebar: #fafafa; --primary: #18181b; --primary-fg: #fafafa;
  --ring: #a1a1aa; --accent: #f4f4f5; --blue: #2563eb; --blue-bg: #eff6ff; --green: #16a34a;
  --danger: #dc2626; --danger-bg: #fef2f2; --radius: 0.5rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b; --fg: #fafafa; --muted: #a1a1aa; --muted-bg: #18181b; --border: #27272a;
    --card: #09090b; --sidebar: #0c0c0e; --primary: #fafafa; --primary-fg: #18181b;
    --ring: #52525b; --accent: #18181b; --blue: #60a5fa; --blue-bg: #172554; --green: #4ade80;
    --danger: #f87171; --danger-bg: #450a0a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 14px/1.5 Geist, ui-sans-serif, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mono { font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.92em; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.center { text-align: center; justify-content: center; }
.w-full { width: 100%; }

/* Layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 16px; padding: 16px 12px; background: var(--sidebar); border-right: 1px solid var(--border); }
.main { padding: 32px; min-width: 0; max-width: 1280px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; color: #3b2c08; background: linear-gradient(135deg, #f8e7a6, #d9ae3f); }
.brand-name { font-weight: 600; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 8px 8px 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; font-weight: 500; color: var(--muted); }
.nav-item:hover { background: var(--accent); color: var(--fg); }
.nav-item.active { background: var(--accent); color: var(--fg); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.avatar { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--muted-bg); font-weight: 600; text-transform: uppercase; font-size: 12px; }
.who { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { border: 0; background: transparent; color: var(--muted); padding: 6px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--accent); color: var(--fg); }

/* Tipografia e cabeçalho */
.h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.h2 { font-size: 16px; font-weight: 600; margin: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head p { margin: 4px 0 0; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.back:hover { color: var(--fg); }

/* Card, stats */
.card { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 20px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.section { padding: 20px; margin-bottom: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 16px 0 0; }
.kv dt { font-size: 12px; color: var(--muted); font-weight: 500; }
.kv dd { margin: 2px 0 0; font-weight: 500; }

/* Inputs e botões */
.input { height: 36px; width: 100%; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: transparent; color: var(--fg); font: inherit; outline: none; }
.input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.btn { height: 36px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 500; cursor: pointer; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { opacity: .9; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; }
.alert { padding: 10px 12px; border-radius: var(--radius); background: var(--danger-bg); color: var(--danger); font-size: 13px; border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--muted-bg); }
.login-card { width: 100%; max-width: 380px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-card p { margin: -6px 0 4px; }

/* Ordenação (select no estilo shadcn) */
.sort { display: flex; align-items: center; gap: 10px; }
.sort-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.select-wrap { position: relative; }
.select { appearance: none; -webkit-appearance: none; height: 36px; padding: 0 34px 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--fg); font: inherit; font-weight: 500; cursor: pointer; outline: none; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.select-wrap .chevron { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* Tabela */
.table-card { overflow: hidden; }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.search { max-width: 320px; }
.tabs { display: inline-flex; padding: 3px; border-radius: var(--radius); background: var(--muted-bg); gap: 2px; }
.tab { padding: 5px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.tab.active { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--muted-bg); }
.table tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; }
.player { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 11px; font-weight: 600; color: var(--muted); }
.badge-blue { color: var(--blue); background: var(--blue-bg); border-color: transparent; }
.progress-cell { min-width: 180px; }
.progress-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.progress-top.big { font-size: 14px; }
.progress { height: 6px; border-radius: 999px; background: var(--muted-bg); overflow: hidden; }
.progress.big { height: 10px; }
.progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #d9ae3f, #f8e7a6); }
.last-seen { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); margin: 0; }

/* Responsivo: sidebar vira barra no topo */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav { flex-direction: row; }
  .nav-label, .brand-sub, .who { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .main { padding: 20px 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Feedback */
.badge-red { color: #dc2626; background: #fef2f2; border-color: transparent; }
@media (prefers-color-scheme: dark) { .badge-red { color: #f87171; background: #450a0a; } }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--muted-bg); }
.tab { padding: 6px 12px; border-radius: calc(var(--radius) - 2px); font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
.tab.active { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.feedback-list { list-style: none; margin: 0; padding: 0; }
.feedback { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.feedback:last-child { border-bottom: 0; }
.feedback-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.feedback-head .push { margin-left: auto; }
.feedback-msg { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
