/* ============================================================
   CLÍNICA POLLYANY POLICARPO - DASHBOARD DE RESULTADOS (CSS)
   Design Luxo Executivo: Dark Plum & Ouro Champanhe
   ============================================================ */

:root {
  --bg-primary: #120A17;
  --bg-secondary: #1C1123;
  --bg-card: rgba(28, 17, 35, 0.78);
  --bg-card-hover: rgba(38, 24, 48, 0.9);
  --gold-primary: #DCC397;
  --gold-light: #F5E5C9;
  --gold-dark: #C39C65;
  --gold-glow: rgba(220, 195, 151, 0.25);
  --text-main: #FFFFFF;
  --text-muted: rgba(255, 255, 255, 0.65);
  --text-sub: rgba(255, 255, 255, 0.45);
  --border-card: 1px solid rgba(220, 195, 151, 0.16);
  --border-card-hover: 1px solid rgba(220, 195, 151, 0.35);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-family: 'Outfit', sans-serif;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(220, 195, 151, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(138, 43, 226, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────────────────────────
   MODAL DE LOGIN
   ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 14, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px var(--gold-glow);
  text-align: center;
  position: relative;
}

.modal-badge {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  background: rgba(220, 195, 151, 0.12);
  border: 1px solid rgba(220, 195, 151, 0.3);
  color: var(--gold-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.25rem;
}

.modal-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.8rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.input-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(18, 10, 23, 0.85);
  border: 1px solid rgba(220, 195, 151, 0.25);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.input-group input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 60%, var(--gold-dark) 100%);
  color: #120A17;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 20px rgba(220, 195, 151, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(220, 195, 151, 0.45);
}

/* ─────────────────────────────────────────────────────────────
   LAYOUT DO DASHBOARD
   ───────────────────────────────────────────────────────────── */
.dashboard-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Barra Superior */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1.25rem 1.75rem;
  background: var(--bg-card);
  border: var(--border-card);
  border-radius: var(--radius-md);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  color: #120A17;
  box-shadow: 0 4px 15px var(--gold-glow);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #FFF;
  letter-spacing: -0.01em;
}

.brand-tag {
  font-size: 0.8rem;
  color: var(--gold-primary);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(220, 195, 151, 0.4);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ─────────────────────────────────────────────────────────────
   BARRA DE FILTROS
   ───────────────────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1.25rem 1.75rem;
  background: var(--bg-card);
  border: var(--border-card);
  border-radius: var(--radius-md);
  backdrop-filter: blur(14px);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quick-dates {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.date-chip {
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.date-chip:hover {
  color: #fff;
  border-color: rgba(220, 195, 151, 0.4);
}

.date-chip.active {
  background: var(--gold-primary);
  color: #120A17;
  border-color: var(--gold-light);
  box-shadow: 0 4px 12px var(--gold-glow);
}

.filter-custom {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.date-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  font-size: 0.82rem;
  outline: none;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  background: var(--gold-primary);
  color: #120A17;
  border: none;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-sm:hover {
  background: var(--gold-light);
}

.select-input {
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.select-input option {
  background: #1C1123;
  color: #fff;
}

/* ─────────────────────────────────────────────────────────────
   GRADE DE KPIS
   ───────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  opacity: 0.6;
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(220, 195, 151, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 25px var(--gold-glow);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon {
  font-size: 1.25rem;
}

.kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.kpi-hint {
  font-size: 0.8rem;
  color: var(--text-sub);
}

/* ─────────────────────────────────────────────────────────────
   CARDS DE SEÇÃO E TABELAS
   ───────────────────────────────────────────────────────────── */
.section-card {
  background: var(--bg-card);
  border: var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFF;
}

.section-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 1.5rem;
}

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: rgba(220, 195, 151, 0.04);
}

.table-empty {
  text-align: center;
  color: var(--text-sub);
  padding: 2.5rem !important;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-gold {
  background: rgba(220, 195, 151, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(220, 195, 151, 0.35);
}

.badge-green {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.badge-gray {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ─────────────────────────────────────────────────────────────
   ANÁLISE DE VÍDEOS & FUNIL
   ───────────────────────────────────────────────────────────── */
.video-stats-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-mini {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-mini__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-mini__val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold-light);
}

.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.funnel-step {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.funnel-step__info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.highlight-gold {
  color: var(--gold-light) !important;
  font-weight: 700;
}

.funnel-bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.funnel-fill {
  height: 100%;
  background: rgba(220, 195, 151, 0.45);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.gold-fill {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)) !important;
  box-shadow: 0 0 12px var(--gold-glow);
}

.cross-conversion-card {
  background: rgba(220, 195, 151, 0.06);
  border: 1px solid rgba(220, 195, 151, 0.25);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.cross-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.85rem;
}

.cross-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.cross-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cross-item__rate {
  font-size: 1.8rem;
  font-weight: 800;
  color: #4ade80;
  line-height: 1;
}

.cross-item__rate.muted {
  color: #f87171;
}

.cross-item__desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ─────────────────────────────────────────────────────────────
   RODAPÉ
   ───────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-sub);
  padding-top: 1rem;
}

/* Responsividade */
@media (max-width: 900px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .quick-dates {
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
}
