/* =========================================================
   DengueCare Admin Dashboard - Estilos
   ========================================================= */

/* === LOGIN === */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #fff 0%, #fdf5f5 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.login-logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-text);
  margin-bottom: 6px;
}

.login-logo span { color: var(--color-accent); }

.login-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* === DASHBOARD LAYOUT === */
.dashboard {
  min-height: 100vh;
  background: #fff;
}

.dash-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dash-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  text-decoration: none;
}

.dash-logo span { color: var(--color-accent); }

.dash-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.dash-nav-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.dash-nav-btn:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.dash-nav-btn.active {
  background: var(--color-accent-glow);
  color: var(--color-accent);
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.dash-logout {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem;
  transition: var(--transition);
}

.dash-logout:hover {
  background: var(--color-red-bg);
  color: var(--color-red);
  border-color: var(--color-red-border);
}

.dash-main {
  padding: 28px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.dash-section { display: none; }
.dash-section.active { display: block; animation: fadeIn 0.3s ease both; }

/* === FILTROS === */
.dash-filters {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
}

.dash-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-filter-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-filter-field input,
.dash-filter-field select {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text);
  outline: none;
  min-width: 160px;
}

.dash-filter-field input:focus,
.dash-filter-field select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.dash-btn {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.dash-btn:hover {
  background: var(--color-accent-dark);
}

.dash-btn.outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.dash-btn.outline:hover {
  background: var(--color-surface-2);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* === KPIs === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-accent);
}

.kpi-card.green::before { background: var(--color-green); }
.kpi-card.yellow::before { background: var(--color-yellow); }
.kpi-card.red::before { background: var(--color-red); }

.kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* === GRÁFICOS === */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.chart-card.full { grid-column: 1 / -1; }

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}

.chart-subtitle {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.chart-canvas-wrap {
  flex: 1;
  position: relative;
  min-height: 240px;
}

/* === TABLA DE CASOS === */
.cases-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cases-table {
  width: 100%;
  border-collapse: collapse;
}

.cases-table thead {
  background: var(--color-surface-2);
}

.cases-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.cases-table td {
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.cases-table tbody tr:hover {
  background: var(--color-surface-2);
}

.cases-table .cell-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.tag-DSSA, .tag-A {
  background: var(--color-green-bg);
  color: var(--color-green);
  border: 1px solid var(--color-green-border);
}

.tag-DCSA, .tag-B1, .tag-B2 {
  background: var(--color-yellow-bg);
  color: var(--color-yellow);
  border: 1px solid var(--color-yellow-border);
}

.tag-DG, .tag-C {
  background: var(--color-red-bg);
  color: var(--color-red);
  border: 1px solid var(--color-red-border);
}

.cases-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pagination button {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--color-text);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* === LOADING / EMPTY === */
.dash-loading,
.dash-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.dash-loading::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@media (max-width: 680px) {
  .dash-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .dash-nav { justify-content: center; }
  .dash-main { padding: 16px; }
  .dash-filters { flex-direction: column; align-items: stretch; }
  .dash-filter-field input,
  .dash-filter-field select { min-width: 0; width: 100%; }
  .charts-grid { grid-template-columns: 1fr; }
  .cases-table { font-size: 0.78rem; }
  .cases-table th:nth-child(n+5),
  .cases-table td:nth-child(n+5) { display: none; }
}
