/* base.css — tokens, reset, layout de telas, cards, botões/forms/tabelas genéricos, toast
   Paleta e tipografia inspiradas na Qulture Rocks: fundo claro, roxo-vinho de marca,
   botões em pílula, cards brancos com sombra suave. Escala de espaçamento em base 8px. */

:root {
  --bg: #f5f3f6;
  --panel: #ffffff;
  --panel-alt: #f1eef3;
  --line: #e6e0e8;
  --text: #1e1e1e;
  --text-soft: #666070;
  --text-faint: #9a95a0;
  --primary: #5a0048;
  --primary-strong: #3d0030;
  --primary-soft: rgba(90, 0, 72, 0.08);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.1);
  --red: #dc2626;
  --amber: #d97706;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 100px;
  --shadow-sm: 0 2px 8px rgba(30, 0, 25, 0.06);
  --shadow: 0 8px 28px rgba(90, 0, 72, 0.10);
  --shadow-lg: 0 20px 48px rgba(90, 0, 72, 0.16);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
}

* { box-sizing: border-box; }

html { color-scheme: light; font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-soft); font-weight: 700; }
h4 { font-size: 15px; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; touch-action: manipulation; }

a { color: var(--primary); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 18px var(--space-5);
  border-bottom: 1px solid var(--line);
  background: var(--primary);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 2;
}
.topbar h2, .topbar span { margin: 0; color: #fff; }
.topbar .btn-link { color: #fff; }
.topbar .btn-link:hover { background: rgba(255, 255, 255, 0.15); }
.topbar .badge { background: rgba(255, 255, 255, 0.18); color: #fff; }

.logo-topbar { height: 28px; width: auto; display: block; }

.topbar-actions { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; position: relative; }
.topbar-actions .btn-link { min-height: 44px; padding: 8px 12px; }

.nav-hamburguer { display: none; }
.nav-menu { display: flex; align-items: center; gap: 2px; }

.icon { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; vertical-align: -3px; }

.content { padding: var(--space-5); max-width: 880px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: var(--space-5); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.card > h3 { margin-bottom: var(--space-4); }

.muted { color: var(--text-soft); font-size: 13px; }
.empty { color: var(--text-faint); font-style: italic; font-size: 14px; }

.campo {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.campo span { font-size: 13px; font-weight: 600; color: var(--text-soft); }

.campo-senha-wrap { position: relative; max-width: 320px; }
.campo-senha-wrap input { padding-right: 44px; max-width: 100%; }
.btn-olho {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  cursor: pointer;
}
.btn-olho:hover { color: var(--primary); }

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 100%;
  min-height: 44px;
  font-size: 16px;
  transition: border-color .15s;
}
/* Padrão único de largura pra campos de linha única — nunca deixar esticar pra
   preencher o container (grid/flex largo). Textarea fica de fora: precisa de espaço
   pra texto longo. */
input:not([type="checkbox"]):not([type="radio"]), select { max-width: 320px; }
textarea { min-height: 64px; resize: vertical; max-width: 100%; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input:disabled, select:disabled, textarea:disabled { background: var(--panel-alt); color: var(--text-faint); cursor: not-allowed; }

input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  padding: 11px 24px;
  font-weight: 600;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  transition: background-color .15s, transform .1s, box-shadow .15s;
}
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); box-shadow: var(--shadow); }
.btn-primary:active { transform: scale(0.98); }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: background-color .15s;
}
.btn-link:hover { background: var(--primary-soft); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-soft);
  border: none;
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.tag {
  display: inline-block;
  background: var(--panel-alt);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
}

.tabela { width: 100%; border-collapse: collapse; }
.tabela th, .tabela td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tabela th { color: var(--text-soft); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.tabela tbody tr:hover { background: var(--panel-alt); }
.tabela tbody tr:last-child td { border-bottom: none; }

.check-row { display: flex; align-items: center; gap: var(--space-3); padding: 10px 4px; font-size: 14px; border-radius: var(--radius-sm); cursor: pointer; }
.check-row:hover { background: var(--panel-alt); }
.check-list { display: flex; flex-direction: column; gap: 0; margin: var(--space-3) 0; }

.modal { display: none; position: fixed; inset: 0; background: rgba(30,0,25,.45); align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(2px); }
.modal.open { display: flex; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); width: min(480px, 92vw); box-shadow: var(--shadow-lg); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }

.toast {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
