/* =============================================================================
   LDB Research Intelligence — app.css
   Tema: dark premium (paleta do preview(4).html)
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg:       #08111f;
  --panel:    #0f1b2d;
  --card:     #132238;
  --card2:    #172942;
  --border:   #243752;
  --text:     #eef4ff;
  --muted:    #92a4bd;
  --accent:   #2f7df6;
  --accent2:  #65a4ff;
  --success:  #28c08a;
  --warning:  #f0a84b;
  --danger:   #ef6b73;
  --shadow:   0 18px 50px rgba(0,0,0,.28);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #07101c 0%, #0a1423 100%);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* ---------- APP SHELL: sidebar + main ---------- */
.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(8,17,31,.96);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.brand-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
  overflow: hidden;
  padding: 4px;
}
.brand:hover .brand-logo-wrap {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(240, 168, 75, 0.4);
  box-shadow: 0 0 16px rgba(240, 168, 75, 0.2);
  transform: scale(1.04);
}
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #174da8);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.brand-info h2 {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}
.brand-info span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

/* ---------- NAV ---------- */
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.nav button:hover,
.nav button.active {
  background: var(--card);
  color: var(--text);
}
.nav button.active {
  color: var(--accent2);
}

/* Sync badge (dentro da sidebar, no rodapé) */
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  width: 100%;
  justify-content: center;
}
.sync-badge.ok      { border-color: rgba(40,192,138,.4); color: #85e5bd; background: rgba(40,192,138,.07); }
.sync-badge.offline { border-color: rgba(239,107,115,.4); color: #f9a8ac; background: rgba(239,107,115,.07); }
.sync-badge.loading { border-color: rgba(240,168,75,.4);  color: #fcd59c; background: rgba(240,168,75,.07); }

/* ---------- MAIN CONTENT ---------- */
.main {
  padding: 28px;
  min-width: 0;
}

/* Topbar interna (título da seção) */
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.topbar h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0;
}
.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- GRIDS ---------- */
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }

/* ---------- CARD / PANEL / METRIC ---------- */
.card, .panel, .metric {
  background: linear-gradient(180deg, var(--card) 0%, #102037 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel { margin-top: 16px; }
.panel h3 { font-size: 15px; font-weight: 700; margin: 0 0 14px; }

.metric .k, .metric .label { color: var(--muted); font-size: 12px; }
.metric .v, .metric .value { font-size: 28px; font-weight: 800; margin-top: 6px; }
.metric .sub { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---------- SECTION TITLE ---------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}
.section-title h2 { font-size: 20px; font-weight: 700; margin: 0; }

/* ---------- TYPOGRAPHY ---------- */
.muted  { color: var(--muted); }
.small  { font-size: 12px; }

/* ---------- INSIGHT BLOCK ---------- */
.insight {
  background: rgba(47,125,246,.09);
  border: 1px solid rgba(47,125,246,.24);
  border-radius: 12px;
  padding: 15px;
  color: #dce9ff;
  line-height: 1.6;
  font-size: 14px;
}

/* ---------- BARS (dashboard) ---------- */
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; gap: 7px; }
.bar-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.bar { height: 8px; background: #0b1627; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; }
.bar-row:nth-child(1) .bar span { background: #45b95f; }
.bar-row:nth-child(2) .bar span { background: #f47b3a; }
.bar-row:nth-child(3) .bar span { background: #f2bd35; }
.bar-row:nth-child(4) .bar span { background: var(--accent); }
.bar-row:nth-child(5) .bar span { background: var(--danger); }

/* ---------- FORM ---------- */
.form-card {
  max-width: 980px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.form-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.form-head strong { font-size: 15px; }
.form-body { padding: 22px; }
.form-grid, .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field, label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.field label { color: var(--muted); }

input, select, textarea {
  width: 100%;
  background: #0c1728;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 13px;
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47,125,246,.12);
}
textarea { min-height: 90px; resize: vertical; }

select option { background: var(--card); }

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ---------- BUTTONS ---------- */
.btn {
  border: 1px solid var(--border);
  background: #0d1a2c;
  color: var(--text);
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  transition: opacity .15s, filter .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.ghost   { background: transparent; }
.btn.success { background: var(--success); border-color: var(--success); }
.btn.warn    { background: var(--warning); border-color: var(--warning); color: #07101c; }
.btn.small   { padding: 7px 11px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* ---------- INTERVIEW / PERGUNTAS ---------- */
.question-wrap {
  max-width: 780px;
  margin: 0 auto;
}
.progress {
  height: 8px;
  background: #0b1627;
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 22px;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .3s ease;
}
.question {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 18px;
  max-width: 720px;
}
.answers, .choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.answer, .choice {
  border: 1px solid var(--border);
  background: #0d1a2c;
  color: var(--text);
  padding: 14px 16px;
  border-radius: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
.answer:hover, .choice:hover {
  border-color: var(--accent);
  background: rgba(47,125,246,.08);
}
.answer.selected, .choice.selected {
  border-color: var(--accent);
  background: rgba(47,125,246,.18);
  color: #ffffff;
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(47,125,246,.25);
}
.choice-indicator {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent2);
  min-width: 16px;
  text-align: right;
}

.note-box { margin-top: 16px; }

/* ---------- TAGS ---------- */
.tag {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  color: #cfe0f8;
  margin: 3px 4px 3px 0;
}
.tag.high { border-color: rgba(40,192,138,.4); color: #85e5bd; background: rgba(40,192,138,.07); }

/* ---------- KPI LINE ---------- */
.kpi-line { height: 6px; border-radius: 99px; background: #0b1627; overflow: hidden; margin-top: 8px; }
.kpi-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }

/* ---------- SCORE RING ---------- */
.score-panel { display: grid; place-items: center; min-height: 220px; }
.score-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) var(--pct, 82%), #0b1627 0);
  position: relative;
  box-shadow: 0 0 32px rgba(47,125,246,.2);
}
.score-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--card);
}
.score-ring-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}
.score-ring-inner strong { font-size: 36px; font-weight: 900; }
.score-ring-inner span  { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- DIAGNOSIS ---------- */
.diagnosis-grid  { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; }
.diag-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.diag-item {
  background: #0c1728;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.diag-item .k { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.diag-item .v { margin-top: 6px; font-size: 14px; line-height: 1.4; }

.bullet {
  padding: 12px 14px;
  border-radius: 10px;
  background: #0c1728;
  border: 1px solid var(--border);
  margin: 8px 0;
  font-size: 14px;
}
.bullet strong { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; margin-bottom: 5px; }

/* ---------- KANBAN ---------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr)) minmax(230px, 260px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.column, .kanban-col {
  background: linear-gradient(180deg, var(--card) 0%, #102037 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px;
  min-height: 300px;
}
.kanban-title, .column h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.count {
  background: #0b1627;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

/* Lead cards */
.lead-card, .store-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  margin-bottom: 10px;
}
.lead-card .name, .store-card h4 { font-size: 14px; font-weight: 700; margin: 0 0 6px; }
.lead-card .meta, .store-card p  { font-size: 12px; color: var(--muted); margin: 3px 0; }
.lead-card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* ---------- PILLS ---------- */
.pill { padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.pill.high { background: rgba(40,192,138,.12); color: #85e5bd; border: 1px solid rgba(40,192,138,.3); }
.pill.mid  { background: rgba(240,168,75,.12);  color: #fcd59c; border: 1px solid rgba(240,168,75,.3); }
.pill.low  { background: rgba(239,107,115,.12); color: #f9a8ac; border: 1px solid rgba(239,107,115,.3); }

/* ---------- LIST ---------- */
.list { display: grid; gap: 0; }
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: 0; }
.empty { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #0f1b2d;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 100;
  font-size: 14px;
  animation: slideUp .2s ease;
}
.toast.toast-error { background: rgba(239,107,115,.15); border-color: var(--danger); color: var(--danger); }
@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ---------- HERO ---------- */
.hero { padding: 4px 0 20px; }
.hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.hero p   { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- DRAG AND DROP ---------- */

/* Card arrastável: cursor de grab + transição suave */
.store-card.draggable {
  cursor: grab;
  transition: opacity .18s, transform .18s, box-shadow .18s;
  user-select: none;
}
.store-card.draggable:active {
  cursor: grabbing;
}

/* Card sendo arrastado: fica semitransparente e levemente menor */
.store-card.dragging {
  opacity: .38;
  transform: scale(.97);
  box-shadow: none;
}

/* Coluna que está recebendo o arraste: borda + brilho azul */
.kanban-col.drag-over {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(47,125,246,.14) 0%, rgba(47,125,246,.06) 100%);
  box-shadow: 0 0 0 2px rgba(47,125,246,.25), var(--shadow);
}
.kanban-col.drag-over .kanban-title strong {
  color: var(--accent2);
}

/* Área interna dos cards (onde o drop acontece) */
.kanban-cards {
  min-height: 60px;
}

/* Placeholder "Solte aqui" quando a coluna está vazia */
.drop-hint {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  transition: border-color .15s, color .15s;
}
.kanban-col.drag-over .drop-hint {
  border-color: var(--accent);
  color: var(--accent2);
}

/* ---------- MACRO BADGES DE GESTÃO ---------- */
.macro-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  user-select: none;
}
/* Em andamento -> Amarelo */
.macro-badge.status-andamento {
  background: rgba(242, 189, 53, 0.15);
  color: #ffd166;
  border: 1px solid rgba(242, 189, 53, 0.38);
}
/* Concluída (Cadastro LDB) -> Verde */
.macro-badge.status-concluido-pos {
  background: rgba(40, 192, 138, 0.15);
  color: #85e5bd;
  border: 1px solid rgba(40, 192, 138, 0.38);
}
/* Concluída (Sem fit) -> Vermelho */
.macro-badge.status-concluido-neg {
  background: rgba(239, 107, 115, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 107, 115, 0.38);
}

/* ---------- TABS DE FILTRO DE GESTÃO ---------- */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-tab {
  border: 1px solid var(--border);
  background: #0c1728;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
}
.filter-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}
.filter-tab.active {
  background: rgba(47, 125, 246, 0.2);
  border-color: var(--accent);
  color: #ffffff;
}
.filter-tab.active.tab-andamento {
  background: rgba(242, 189, 53, 0.2);
  border-color: #ffd166;
  color: #ffd166;
}
.filter-tab.active.tab-concluido {
  background: rgba(40, 192, 138, 0.2);
  border-color: #85e5bd;
  color: #85e5bd;
}

/* ---------- ZONAS DE DESFECHO (KANBAN) ---------- */
.kanban-drop-zone {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-style: dashed !important;
  border-width: 2px !important;
  text-align: center;
  transition: all .2s ease;
  cursor: pointer;
}
.kanban-drop-zone.drop-success {
  border-color: rgba(40, 192, 138, 0.35);
  background: rgba(40, 192, 138, 0.05);
  color: #85e5bd;
}
.kanban-drop-zone.drop-success.drag-over {
  border-color: #28c08a !important;
  background: rgba(40, 192, 138, 0.18) !important;
  box-shadow: 0 0 0 2px rgba(40, 192, 138, 0.4), 0 0 20px rgba(40, 192, 138, 0.2);
}
.kanban-drop-zone.drop-danger {
  border-color: rgba(239, 107, 115, 0.35);
  background: rgba(239, 107, 115, 0.05);
  color: #fca5a5;
}
.kanban-drop-zone.drop-danger.drag-over {
  border-color: #ef6b73 !important;
  background: rgba(239, 107, 115, 0.18) !important;
  box-shadow: 0 0 0 2px rgba(239, 107, 115, 0.4), 0 0 20px rgba(239, 107, 115, 0.2);
}

/* ---------- DASHBOARD & TOPBAR HEADER ENHANCEMENTS ---------- */
.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.dash-title-group {
  flex: 1;
  min-width: 0;
}

.dash-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-title-row h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: #fff;
}

.dash-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.dash-btn-new {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 10px 18px;
  font-weight: 700;
  border-radius: 10px;
}

/* ---------- MOBILE HEADER & DRAWER ---------- */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(8, 17, 31, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.mobile-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.mobile-header-brand .brand-logo-wrap {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: transform 0.2s ease;
}

.mobile-header-brand:active .brand-logo-wrap {
  transform: scale(0.95);
}

.mobile-header-title {
  display: flex;
  flex-direction: column;
}

.mobile-header-title strong {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.mobile-header-title span {
  font-size: 10px;
  color: var(--accent2);
  font-weight: 600;
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-header-btn-action {
  background: linear-gradient(135deg, #2f7df6, #1b5edb);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(47, 125, 246, 0.3);
  transition: all 0.15s ease;
}

.mobile-header-btn-action:active {
  transform: scale(0.96);
}

.mobile-hamburger-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.mobile-hamburger-btn:active {
  background: rgba(255, 255, 255, 0.12);
}

.mobile-hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-hamburger-btn.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-hamburger-btn.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-hamburger-btn.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Drawer Backdrop */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9998;
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 295px;
  max-width: 86vw;
  height: 100vh;
  background: #091322;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.65);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-drawer-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.mobile-drawer-close:active {
  background: rgba(239, 107, 115, 0.2);
  color: #ef6b73;
}

.mobile-drawer-sync {
  margin: 12px 0 16px;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.mobile-drawer-nav button {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #cad8ee;
  text-align: left;
  padding: 13px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-drawer-nav button:active {
  background: rgba(255, 255, 255, 0.08);
}

.mobile-drawer-nav button.active {
  background: rgba(47, 125, 246, 0.18);
  border-color: rgba(47, 125, 246, 0.4);
  color: #fff;
}

.mobile-drawer-nav .nav-icon {
  font-size: 16px;
  width: 20px;
  display: grid;
  place-items: center;
}

.mobile-drawer-nav .nav-label {
  flex: 1;
}

.mobile-drawer-nav .nav-current-dot {
  color: #2f7df6;
  font-size: 10px;
}

.mobile-drawer-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none !important; }
  .mobile-header { display: flex !important; }
  .main { padding: 18px 16px 36px; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .diagnosis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .dash-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }
  .dash-title-row h2 {
    font-size: 20px;
  }
  .dash-subtitle {
    font-size: 12px;
    margin-top: 4px;
  }
  .dash-btn-new {
    width: 100%;
    justify-content: center;
    padding: 13px;
    font-size: 14px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(47, 125, 246, 0.35);
  }

  .grid.cols-4 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .metric {
    padding: 14px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(16, 29, 49, 0.95) 0%, rgba(10, 18, 32, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  .metric .label {
    font-size: 11px;
    font-weight: 700;
    color: #8da4c4;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .metric .value {
    font-size: 24px;
    font-weight: 800;
    margin: 4px 0 2px;
    color: #fff;
    letter-spacing: -0.02em;
  }
  .metric .sub {
    font-size: 11px;
    color: #627b9f;
    line-height: 1.2;
  }

  .grid.cols-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .panel {
    padding: 16px 14px;
    border-radius: 14px;
    margin-top: 0;
  }
  .panel h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #e4ecf7;
  }

  .list-item {
    padding: 12px 10px;
    gap: 10px;
    border-radius: 10px;
  }
  .list-item strong {
    font-size: 14px;
  }
  .list-item .small {
    font-size: 11px;
  }

  .main {
    padding: 16px 14px 36px;
  }
}

@media (max-width: 650px) {
  .grid.cols-2, .field-grid, .form-grid, .diag-list, .answers, .choices { grid-template-columns: 1fr; }
}

/* ---------- LOGIN PAGE ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: 
    radial-gradient(circle at 20% 20%, rgba(240, 168, 75, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(239, 107, 115, 0.08) 0%, transparent 45%),
    linear-gradient(180deg, #07101c 0%, #0a1423 100%);
  position: relative;
  overflow: hidden;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 27, 45, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(47, 125, 246, 0.08);
  padding: 40px 32px;
  text-align: center;
  position: relative;
  z-index: 10;
  animation: loginFadeIn 0.35s ease-out;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 22px;
}

.login-logo {
  max-width: 250px;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5));
}

.login-header h1 {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.login-header p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 26px;
  text-align: left;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cad8ee;
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 17, 31, 0.85);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.login-field input:focus {
  border-color: #2f7df6;
  background: rgba(8, 17, 31, 1);
  box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.25);
}

.login-btn-submit {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #2f7df6 0%, #1e5fc2 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 10px 24px rgba(47, 125, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.login-btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #3d88fa 0%, #266dd3 100%);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(47, 125, 246, 0.45);
}

.login-btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.login-btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-error {
  background: rgba(239, 107, 115, 0.12);
  border: 1px solid rgba(239, 107, 115, 0.35);
  color: #fca5a5;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: shake 0.25s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.login-footer-hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* ---------- SIDEBAR USER PROFILE & LOGOUT ---------- */
.sidebar-user {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f7df6, #65a4ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user-meta {
  min-width: 0;
  flex: 1;
}

.sidebar-user-email {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.sidebar-user-role {
  font-size: 10px;
  color: var(--warning);
  font-weight: 600;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-logout {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239, 107, 115, 0.25);
  background: rgba(239, 107, 115, 0.06);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 107, 115, 0.16);
  border-color: rgba(239, 107, 115, 0.45);
  color: #fff;
}

/* ---------- EQUIPE / ACESSOS (ADMIN) ---------- */
.team-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.team-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.team-table-wrap {
  overflow-x: auto;
}

.team-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.team-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.team-table td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(36, 55, 82, 0.5);
  vertical-align: middle;
}

.team-table tr:last-child td {
  border-bottom: none;
}

.team-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f7df6, #65a4ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.team-avatar.admin {
  background: linear-gradient(135deg, #f0a84b, #e65100);
}

.team-user-name {
  font-weight: 700;
  color: #fff;
  display: block;
}

.team-user-email {
  font-size: 12px;
  color: var(--muted);
}

.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-role.admin {
  background: rgba(240, 168, 75, 0.15);
  border: 1px solid rgba(240, 168, 75, 0.35);
  color: #fbbf24;
}

.badge-role.pesquisador {
  background: rgba(47, 125, 246, 0.15);
  border: 1px solid rgba(47, 125, 246, 0.35);
  color: #93c5fd;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-status.active {
  background: rgba(40, 192, 138, 0.15);
  border: 1px solid rgba(40, 192, 138, 0.35);
  color: #85e5bd;
}

.badge-status.inactive {
  background: rgba(239, 107, 115, 0.15);
  border: 1px solid rgba(239, 107, 115, 0.35);
  color: #fca5a5;
}

.team-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action-sm {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text);
}

.btn-action-sm:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-action-sm.danger {
  border-color: rgba(239, 107, 115, 0.3);
  background: rgba(239, 107, 115, 0.1);
  color: #fca5a5;
}

.btn-action-sm.danger:hover {
  background: rgba(239, 107, 115, 0.2);
}

.btn-action-sm.success {
  border-color: rgba(40, 192, 138, 0.3);
  background: rgba(40, 192, 138, 0.1);
  color: #85e5bd;
}

.btn-action-sm.success:hover {
  background: rgba(40, 192, 138, 0.2);
}

.team-invite-card {
  padding: 24px;
  border-radius: 16px;
  background: rgba(47, 125, 246, 0.05);
  border: 1px solid rgba(47, 125, 246, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-invite-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-invite-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.team-invite-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.team-invite-step {
  padding: 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
}

.team-invite-step strong {
  display: block;
  color: var(--warning);
  margin-bottom: 4px;
}

.pesquisador-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cad8ee;
  font-size: 11px;
  font-weight: 600;
}

/* ---------- MODAL DIALOG (CADASTRO DE PESQUISADOR) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 18, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 16px;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  width: 100%;
  max-width: 480px;
  background: rgba(15, 27, 45, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(47, 125, 246, 0.15);
  padding: 28px;
  position: relative;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0;
}

.modal-header p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: rgba(239, 107, 115, 0.2);
  color: #fff;
  border-color: rgba(239, 107, 115, 0.4);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-form .login-field label {
  color: #cad8ee;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  display: block;
}

.modal-form .login-field input,
.modal-form .login-field select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 17, 31, 0.9);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.modal-form .login-field input:focus,
.modal-form .login-field select:focus {
  border-color: #2f7df6;
  box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.25);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

