/* =========================================================================
   Capital City · Staff Test
   Identidade: painel de operações noturno de uma cidade — fundo quase-preto
   frio, luzes de prédio em tom de latão como acento principal, tipografia
   técnica (IBM Plex) e um horizonte de skyline como elemento assinatura,
   ecoando a logo. Nada de azul genérico de SaaS.
   ========================================================================= */

:root {
  /* Superfícies — camadas frias, do fundo pro primeiro plano */
  --bg: #0a0c10;
  --surface: #12151c;
  --surface-2: #191d26;
  --surface-3: #212636;
  --line: #262b38;
  --line-soft: #1c202c;

  /* Texto */
  --ink: #edf0f5;
  --ink-dim: #8890a3;
  --ink-faint: #5b6376;

  /* Acento principal — latão/âmbar, "luzes da cidade" */
  --brass: #c99a46;
  --brass-strong: #e0b562;
  --brass-ink: #191204;

  /* Acento secundário — frio, contrasta com o latão */
  --teal: #4fb0ad;

  /* Semântico (avaliação boa/média/ruim, status) */
  --good: #4fae7d;
  --good-ink: #06210f;
  --warn: #dba53f;
  --warn-ink: #241b02;
  --bad: #cf6157;
  --bad-ink: #2b0a08;

  --radius: 8px;
  --radius-sm: 6px;
  --font-display: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Vinheta sutil, dá profundidade ao fundo sem pesar (puro CSS, sem imagem) */
body {
  background-image: radial-gradient(ellipse 900px 500px at 50% -10%, rgba(201, 154, 70, 0.06), transparent 60%);
  background-repeat: no-repeat;
}

::selection { background: rgba(201, 154, 70, 0.28); color: var(--ink); }

a { color: var(--brass-strong); }

/* Foco visível só na navegação por teclado — sem ruído visual no clique */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brass-strong);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- Elemento assinatura: horizonte de skyline ----------
   Um único SVG inline, recolorido via CSS mask (sem requisição extra),
   repetido horizontalmente. Aparece como fio condutor discreto em toda
   página logada e por trás das telas de autenticação — ecoa a silhueta
   da logo em vez de ser só decoração solta. */
:root {
  --skyline-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 40' preserveAspectRatio='none'%3E%3Crect x='0' y='24' width='16' height='16'/%3E%3Crect x='18' y='18' width='12' height='22'/%3E%3Crect x='33' y='28' width='20' height='12'/%3E%3Crect x='56' y='10' width='9' height='30'/%3E%3Crect x='68' y='22' width='17' height='18'/%3E%3Crect x='88' y='4' width='6' height='36'/%3E%3Crect x='97' y='24' width='13' height='16'/%3E%3Crect x='113' y='16' width='11' height='24'/%3E%3Crect x='127' y='30' width='23' height='10'/%3E%3Crect x='153' y='12' width='10' height='28'/%3E%3Crect x='166' y='24' width='16' height='16'/%3E%3Crect x='185' y='6' width='7' height='34'/%3E%3Crect x='195' y='26' width='14' height='14'/%3E%3Crect x='212' y='18' width='12' height='22'/%3E%3Crect x='227' y='30' width='22' height='10'/%3E%3Crect x='252' y='14' width='9' height='26'/%3E%3Crect x='264' y='24' width='17' height='16'/%3E%3Crect x='284' y='8' width='6' height='32'/%3E%3C/svg%3E");
}

.skyline-strip {
  height: 18px;
  width: 100%;
  background-color: var(--brass);
  opacity: 0.32;
  -webkit-mask-image: var(--skyline-svg);
  mask-image: var(--skyline-svg);
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: auto 100%;
  mask-size: auto 100%;
}

.skyline-watermark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background-color: var(--brass);
  opacity: 0.07;
  -webkit-mask-image: var(--skyline-svg);
  mask-image: var(--skyline-svg);
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: auto 100%;
  mask-size: auto 100%;
  pointer-events: none;
}

/* ---------- Topbar ---------- */
.topbar-wrap { position: sticky; top: 0; z-index: 10; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar .brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo { height: 26px; width: auto; display: block; }
.logo-login { height: 52px; width: auto; display: block; margin: 0 auto 14px; }

.topbar nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Container em camada — fundo recuado que "segura" os links de navegação,
   com o item ativo destacado por um degradê de latão e um brilho suave.
   Sem animação contínua nem gradiente multicolor: um único acento, discreto. */
.nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.nav-group a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-group a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.nav-group a.active {
  color: var(--brass-ink);
  background: linear-gradient(155deg, var(--brass-strong), var(--brass));
  box-shadow: 0 0 0 1px rgba(224, 181, 98, 0.35), 0 2px 10px -2px rgba(201, 154, 70, 0.55);
  font-weight: 600;
}
.nav-group a.active:hover { color: var(--brass-ink); background: linear-gradient(155deg, var(--brass-strong), var(--brass)); }

.logout-link {
  color: var(--ink-faint);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s var(--ease);
}
.logout-link:hover { color: var(--bad); }

/* ---------- Layout ---------- */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

h1 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 4px;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-dim);
  margin-bottom: 6px;
  margin-top: 14px;
}

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
input[type="text"]:hover, input[type="password"]:hover, textarea:hover, select:hover {
  border-color: #333a4a;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
  border-color: var(--brass);
  background: var(--surface-3);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.5 8L10 12.5L14.5 8' stroke='%238890a3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea { resize: vertical; min-height: 90px; font-family: inherit; }

/* Dados tabulares/identificadores em monoespaçada — reforça a leitura de
   "painel operacional" e facilita comparar números/IDs de relance. */
.mono, td.mono, .nota, .turno-contador, code {
  font-family: var(--font-mono);
}

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  transition: filter 0.15s var(--ease), background 0.15s var(--ease), transform 0.08s var(--ease);
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: default; transform: none; }

.btn-primary { background: var(--brass); color: var(--brass-ink); }
.btn-primary:hover:not(:disabled) { background: var(--brass-strong); }

.btn-secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); border-color: #333a4a; }

.btn-danger { background: var(--bad); color: white; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }

.btn-block { width: 100%; margin-top: 18px; }

.erro {
  background: rgba(207, 97, 87, 0.12);
  border: 1px solid var(--bad);
  color: #ffb3ac;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

.sucesso {
  background: rgba(79, 174, 125, 0.12);
  border: 1px solid var(--good);
  color: #a8e8c4;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

.pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pill-geral { background: rgba(79, 176, 173, 0.15); color: var(--teal); }
.pill-situacional { background: rgba(219, 165, 63, 0.15); color: var(--warn); }
.pill-diversa { background: rgba(79, 174, 125, 0.15); color: var(--good); }

.gabarito {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-left: 3px solid var(--brass);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-dim);
}

.avaliacao-btns { display: flex; gap: 8px; margin-top: 14px; }
.avaliacao-btns button {
  flex: 1;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.avaliacao-btns button:hover:not(:disabled) { border-color: #333a4a; }
.avaliacao-btns button.ativo-boa { background: var(--good); color: var(--good-ink); border-color: var(--good); }
.avaliacao-btns button.ativo-media { background: var(--warn); color: var(--warn-ink); border-color: var(--warn); }
.avaliacao-btns button.ativo-ruim { background: var(--bad); color: var(--bad-ink); border-color: var(--bad); }

.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink-dim); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr { transition: background 0.1s var(--ease); }
tbody tr:hover { background: var(--surface-2); }

.nota { font-weight: 600; }
.nota-alta { color: var(--good); }
.nota-media { color: var(--warn); }
.nota-baixa { color: var(--bad); }

.badge-bloqueado { color: var(--bad); font-size: 12px; font-weight: 500; }
.badge-admin { color: var(--brass-strong); font-size: 12px; font-weight: 500; }

.progresso { font-size: 13px; color: var(--ink-dim); margin-bottom: 10px; font-family: var(--font-mono); }

.link-voltar { color: var(--ink-dim); font-size: 13px; text-decoration: none; }
.link-voltar:hover { color: var(--ink); }

.small { font-size: 12px; color: var(--ink-dim); }

/* Agrupamento de resultados por turno */
.turno-grupo { margin-bottom: 28px; }
.turno-grupo-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.turno-grupo-titulo h2 { margin: 0; }
.turno-contador {
  background: var(--surface-2);
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11.5px;
}

/* Linha de configuração (toggle) no painel admin */
.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.config-row .status-aberto { color: var(--good); font-weight: 600; }
.config-row .status-fechado { color: var(--bad); font-weight: 600; }

/* Caixa exibindo senha nova gerada, uma única vez */
.senha-revelada {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-left: 3px solid var(--good);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.senha-revelada code {
  font-size: 14px;
  font-weight: 600;
  color: var(--good);
  user-select: all;
}

/* ---------- Telas de autenticação (login / registro) ---------- */
.auth-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

/* ---------- Responsivo ---------- */
@media (max-width: 640px) {
  .container { padding: 20px 14px 44px; }
  .card { padding: 18px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .topbar nav { gap: 10px; }
  .nav-group a { padding: 6px 10px; font-size: 12.5px; }
  .logout-link { font-size: 12px; }
  h1 { font-size: 19px; }
  table { font-size: 12px; }
  th, td { padding: 8px 6px; }
}
