/* =============================================
   COMPONENTS.CSS — Planejador de Casamento
   Ramon & Hellen · 29/08/2026
   ============================================= */

/* === BASE === */
*, *::before, *::after { box-sizing: border-box; }

body.app-page {
  display: flex;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--sand-light) 0%, var(--sea-foam) 100%);
  font-family: var(--font-sans);
  color: var(--ocean-blue);
  -webkit-font-smoothing: antialiased;
}

/* === BOTÃO HAMBÚRGUER ===
   z-index:990 deixa-o ABAIXO da sidebar (z:1000). Quando a sidebar abre,
   ela cobre fisicamente o hambúrguer — sem depender de JS, classes
   ou :has(). Três camadas de defesa mesmo assim. */
.menu-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 990;
  background: var(--ocean-blue);
  color: white;
  border: none;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-float);
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
}
.menu-toggle:hover { background: var(--sea-glass); transform: scale(1.05); }
/* Defesa extra caso o navegador tenha um z-index esquisito */
body:has(.sidebar.open) .menu-toggle,
body.sidebar-aberta .menu-toggle {
  display: none !important;
}

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  top: 0;
  left: -290px;
  width: 260px;
  height: 100vh;
  background: #162d4e;          /* azul sólido, sem variável para evitar herança errada */
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,0.25);
}
.sidebar.open { left: 0; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ── Cabeçalho ── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  min-height: 56px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}
.sidebar-brand:visited,
.sidebar-brand:link { color: #ffffff; text-decoration: none; }
.sidebar-brand:hover { color: var(--sea-glass); }

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ── Botão Home ── */
.sidebar-home {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-home-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(136,194,186,0.18);
  color: #88C2BA;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(136,194,186,0.28);
  transition: all 0.2s;
}
.sidebar-home-btn:visited,
.sidebar-home-btn:link { color: #88C2BA; text-decoration: none; }
.sidebar-home-btn:hover { background: rgba(136,194,186,0.32); color: #fff; }

/* ── Lista de navegação ── */
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  flex: 1;
}
.nav-list li { display: block; }

.nav-divider {
  padding: 0.8rem 1rem 0.25rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.3);
  font-weight: 700;
  font-family: var(--font-sans);
  display: block;
}

/* ── Links de navegação ──
   Usamos grid de 2 colunas para separar ícone e texto sem depender de flex-gap.
   O ícone tem largura fixa com overflow hidden para não vazar emojis largos.
*/
.sidebar .nav-list a.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  padding: 0.45rem 0.9rem;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-left-color 0.15s, color 0.15s;
  line-height: 1.4;
  box-sizing: border-box;
  width: 100%;
}
.sidebar .nav-list a.nav-item:visited { color: rgba(255,255,255,0.8); }
.sidebar .nav-list a.nav-item:hover   {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  text-decoration: none;
}
.sidebar .nav-list a.nav-item.active {
  background: rgba(136,194,186,0.2);
  color: #88C2BA;
  border-left-color: #88C2BA;
  font-weight: 600;
}

/* Ícone: célula de largura fixa, centralizado, overflow hidden para emojis largos */
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

/* Label: ocupa o restante, cor explícita, sem overflow */
.nav-label {
  display: block;
  color: inherit;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Rodapé da sidebar ── */
.sidebar-footer {
  padding: 0.8rem 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 0.5rem;
  min-height: 52px;
}
.sidebar-user {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.6);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* === CONTEÚDO PRINCIPAL === */
.main-content {
  flex: 1;
  min-height: 100vh;
  padding: 1.5rem 1.5rem 3rem;
  max-width: 100%;
  overflow-x: hidden;
}

/* === CABEÇALHO DA PÁGINA === */
.page-header {
  margin-bottom: 2rem;
  padding-left: 3.5rem;  /* espaço para o botão hambúrguer */
}
.page-header h1 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--ocean-blue);
  margin: 0 0 0.2rem;
}
.page-header p.subtitle {
  color: #777;
  margin: 0;
  font-size: 0.9rem;
}
.page-header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* === CARDS === */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-float);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,0.9);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ocean-blue);
  margin: 0;
}

/* === STATS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-float);
  border-top: 3px solid var(--sea-glass);
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ocean-blue);
}
.stat-label {
  display: block;
  font-size: 0.72rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}
.stat-card.destaque { border-top-color: var(--gold-bronze); }

/* === BOTÕES === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn:active { transform: none; box-shadow: none; }

.btn-primary   { background: var(--ocean-blue); color: white; }
.btn-primary:hover { background: #1e4080; color: white; }
.btn-secondary { background: var(--sand-medium); color: var(--ocean-blue); }
.btn-secondary:hover { background: var(--sand-dark); color: var(--ocean-blue); }
.btn-success   { background: #2e7d32; color: white; }
.btn-success:hover { background: #1b5e20; color: white; }
.btn-danger    { background: #c62828; color: white; }
.btn-danger:hover { background: #8b0000; color: white; }
.btn-ghost     { background: transparent; color: var(--ocean-blue); border: 1px solid var(--border-light); }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-icon {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  background: none;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.btn-icon:hover { background: var(--sand-medium); }

/* === BADGES === */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-confirmado, .badge-concluido,  .badge-contratado, .badge-sim     { background: #e8f5e9; color: #2e7d32; }
.badge-pendente,   .badge-negociando, .badge-em_andamento               { background: #fff8e1; color: #e65100; }
.badge-recusado,   .badge-descartado, .badge-nao_tocar                  { background: #ffebee; color: #c62828; }
.badge-pesquisando,.badge-must_play                                      { background: #e3f2fd; color: #1565c0; }
.badge-desejada                                                          { background: #f3e5f5; color: #6a1b9a; }

/* === FORMULÁRIOS === */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group.full-width { grid-column: 1 / -1; }

label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
input, select, textarea {
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--sand-dark);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: white;
  color: var(--ocean-blue);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--sea-glass);
  box-shadow: 0 0 0 3px rgba(136,194,186,0.25);
}
textarea { resize: vertical; min-height: 80px; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* === BARRA DE FILTROS === */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  align-items: center;
}
.filter-bar input  { flex: 1; min-width: 160px; max-width: 280px; }
.filter-bar select { width: auto; min-width: 130px; }

/* === TABELAS === */
.table-responsive {
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: var(--shadow-float);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.875rem;
  min-width: unset;           /* reset do style_praia antigo */
  display: table;             /* garante display correto */
  white-space: normal;        /* reset do style_praia antigo */
}

/* Cabeçalho da tabela — override explícito */
.data-table thead th {
  background: var(--ocean-blue) !important;
  color: white !important;
  padding: 0.75rem 0.9rem !important;
  text-align: left !important;
  font-size: 0.72rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  border: none !important;
}
.data-table tbody tr { border-bottom: 1px solid var(--sand-medium); transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--sand-light); }
.data-table td {
  padding: 0.6rem 0.9rem;
  vertical-align: middle;
  color: #333;
  white-space: normal;
  border: none;
}
.data-table .td-actions { display: flex; gap: 0.35rem; }
.data-table .td-num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-row td { text-align: center; padding: 3rem; color: #bbb; font-style: italic; }

/* === ABAS === */
.tabs-container .tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--sand-medium);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-container .tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 0.65rem 1.2rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: #777;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--ocean-blue); }
.tab-btn.active { color: var(--ocean-blue); border-bottom-color: var(--ocean-blue); font-weight: 700; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* === MODAL ===
   Bulletproof: escondido por padrão via CSS. Quando o JS faz
   `modalOverlay.style.display = 'flex'`, o style inline ganha especificidade
   e sobrescreve o `display: none` da base. Sem dependência de classes. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
/* Quando o style inline tem "flex", força display:flex e aplica animação */
.modal-overlay[style*="flex"] {
  display: flex !important;
  animation: modalFadeIn 0.2s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}
.modal {
  background: white;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  transform: scale(0.95) translateY(8px);
  transition: transform 0.25s;
}
.modal-overlay.visible .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sand-medium);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
  border-radius: 16px 16px 0 0;
}
.modal-header h3 { margin: 0; font-family: var(--font-serif); color: var(--ocean-blue); font-size: 1.15rem; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: #888; padding: 4px 6px; border-radius: 4px; transition: all 0.2s; }
.modal-close:hover { background: var(--sand-medium); color: var(--ocean-blue); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sand-medium);
  position: sticky;
  bottom: 0;
  background: white;
  border-radius: 0 0 16px 16px;
}

/* === TOAST === */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--ocean-blue);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateX(120%);
  transition: all 0.3s;
  pointer-events: auto;
  max-width: 320px;
}
.toast.visible { opacity: 1; transform: translateX(0); }
.toast-sucesso { background: #2e7d32; }
.toast-erro    { background: #c62828; }
.toast-aviso   { background: #e65100; }
.toast-icon    { font-size: 1rem; flex-shrink: 0; }

/* === BARRA DE PROGRESSO === */
.progress-bar {
  height: 8px;
  background: var(--sand-medium);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sea-glass), var(--ocean-blue));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* === CHECKLIST === */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--sand-light);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 4px;
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item:hover { background: var(--sand-light); }
.checklist-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--sand-dark);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-top: 1px;
  font-size: 0.7rem;
  color: white;
}
.checklist-item.done .checklist-check { background: var(--sea-glass); border-color: var(--sea-glass); }
.checklist-item.done .checklist-check::after { content: '✓'; }
.checklist-text { flex: 1; font-size: 0.9rem; color: #333; }
.checklist-item.done .checklist-text { text-decoration: line-through; color: #bbb; }
.checklist-category {
  font-size: 0.72rem;
  background: var(--sand-medium);
  color: #666;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #bbb;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.empty-state-icon { font-size: 2.8rem; margin-bottom: 0.75rem; display: block; }
.empty-state strong { color: #888; display: block; margin-bottom: 0.35rem; }
.empty-state p { margin: 0.35rem 0; font-size: 0.9rem; }

/* === CONFIGURAÇÕES / 2FA === */
.settings-section {
  background: white;
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-float);
  border: 1px solid rgba(255,255,255,0.9);
}
.settings-section h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ocean-blue);
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.settings-section p.desc {
  color: #777;
  font-size: 0.88rem;
  margin: 0 0 1.5rem;
}
.settings-divider {
  border: none;
  height: 1px;
  background: var(--sand-medium);
  margin: 1.5rem 0;
}
.status-2fa {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}
.status-2fa.ativo   { background: #e8f5e9; color: #2e7d32; }
.status-2fa.inativo { background: #ffebee; color: #c62828; }

.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--sand-light);
  border-radius: 12px;
  border: 1px dashed var(--sand-dark);
  margin: 1rem 0;
}
.qr-wrapper canvas, .qr-wrapper img { border-radius: 8px; }
.qr-secret {
  font-family: monospace;
  font-size: 0.85rem;
  background: var(--sand-medium);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  letter-spacing: 0.15em;
  color: var(--ocean-blue);
  user-select: all;
}

/* === RESPONSIVO === */
@media (max-width: 768px) {
  .main-content { padding: 1rem 1rem 3rem; }
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .form-grid    { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.4rem; }
  .filter-bar   { flex-direction: column; align-items: stretch; }
  .filter-bar input, .filter-bar select { min-width: 100%; max-width: 100%; }
  .page-header-actions { gap: 0.5rem; }
  .modal { border-radius: 12px; }
  .modal-header, .modal-footer { border-radius: 0; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { padding-left: 3rem; }
}
