/* ==========================================================================
   BuenLex - Estructura de Layout, Header, Navegación y Métricas
   ========================================================================== */

/* Header Superior */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

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

.brand-icon {
  font-size: 2rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(245, 158, 11, 0.2));
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.brand-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #f3f4f6, #c0272d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-title {
  background: linear-gradient(90deg, #1e293b, #c0272d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-manage-users-header {
  border-color: rgba(192, 39, 45, 0.4);
  color: #f87171;
}

.btn-manage-users-header:hover {
  background: rgba(192, 39, 45, 0.15);
  border-color: rgba(192, 39, 45, 0.6);
  color: #fca5a5;
}

[data-theme="light"] .btn-manage-users-header {
  border-color: rgba(192, 39, 45, 0.4);
  color: #b91c1c;
  background: #fef2f2;
}

[data-theme="light"] .btn-manage-users-header:hover {
  background: #fee2e2;
  border-color: #c0272d;
  color: #991b1b;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
}

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

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-indicator.online {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* Navegación por Pestañas Principales (Tabs) */
.main-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--text-secondary);
}

.tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #241416, #140b0d);
  border-color: #c1282d;
  box-shadow: var(--shadow-md), 0 0 14px rgba(193, 40, 45, 0.35);
}

[data-theme="light"] .tab-btn.active {
  background: linear-gradient(135deg, #c1282d, #9b1e22);
  color: #ffffff;
  border-color: #c1282d;
  box-shadow: 0 3px 10px rgba(193, 40, 45, 0.25);
}

.tab-badge {
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(193, 40, 45, 0.18);
  color: #ef1c25;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(193, 40, 45, 0.35);
}

.tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.tab-pane {
  display: block;
}

.tab-pane.hidden {
  display: none !important;
}

/* Buscador en el Dashboard (Arriba del Calendario) */
.dashboard-search-section {
  position: relative;
  margin-bottom: 1.5rem;
  z-index: 50;
}

/* Panel de Métricas / KPIs */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.25rem;
  line-height: 1;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.bg-blue { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); }
.bg-amber { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); }
.bg-purple { background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.3); }
.bg-emerald { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }

/* Navegación Móvil Inferior */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  z-index: 99;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-family: var(--font-heading);
  cursor: pointer;
  flex: 1;
  padding: 6px 0;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item-highlight {
  position: relative;
  top: -12px;
}

.nav-btn-circle {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #c1282d, #9b1e22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(193, 40, 45, 0.45);
}
