/* ============================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ============================================================================ */
:root {
  --bg-main: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --accent-primary: #0f172a;
  --accent-hover: #1e293b;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto; /* Empuja el footer siempre hacia el fondo de la pantalla */
}

.max-w-7xl {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================================
   2. TARJETAS MINIMALISTAS & KPIS
   ============================================================================ */
.card-minimal {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.card-minimal:hover {
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.05);
}

.kpi-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 4px;
}

/* ============================================================================
   3. NAVEGACIÓN (TABS)
   ============================================================================ */
.nav-tabs-minimal {
  border-bottom: 1px solid var(--border-color);
  gap: 8px;
}

.nav-tabs-minimal .nav-link {
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 8px;
  background: transparent;
  transition: all 0.15s ease-in-out;
}

.nav-tabs-minimal .nav-link:hover {
  color: var(--text-main);
  background-color: #f1f5f9;
}

.nav-tabs-minimal .nav-link.active {
  color: #ffffff;
  background-color: var(--accent-primary);
  font-weight: 600;
}

/* ============================================================================
   4. TABLAS
   ============================================================================ */
.table-minimal {
  margin-bottom: 0;
  vertical-align: middle;
}

.table-minimal th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  background-color: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
}

.table-minimal td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
  color: #334155;
}

.table-minimal tbody tr {
  transition: all 0.15s ease-in-out;
}

.table-minimal tbody tr:last-child td {
  border-bottom: none;
}

.table-minimal tbody tr:hover {
  background-color: var(--bg-main);
}

/* ============================================================================
   5. INSIGNIAS / BADGES SUBTLES
   ============================================================================ */
.badge-subtle {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-subtle-primary { background-color: #e0f2fe; color: #0369a1; }
.badge-subtle-success { background-color: #dcfce7; color: #15803d; }
.badge-subtle-warning { background-color: #fef3c7; color: #b45309; }
.badge-subtle-secondary { background-color: #f1f5f9; color: #475569; }
.badge-subtle-danger { background-color: #ffe4e6; color: #be123c; }

/* ============================================================================
   6. FORMULARIOS Y BOTONES
   ============================================================================ */
.form-control-minimal,
.form-select-minimal {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  padding: 8px 12px;
  background-color: #ffffff;
  transition: all 0.15s ease-in-out;
}

.form-control-minimal:focus,
.form-select-minimal:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
  outline: none;
}

.btn-minimal {
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease-in-out;
}

.btn-minimal-dark {
  background-color: var(--accent-primary);
  color: #ffffff;
  border: 1px solid var(--accent-primary);
}

.btn-minimal-dark:hover, 
.btn-minimal-dark:focus {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

.btn-minimal-outline {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-minimal-outline:hover, 
.btn-minimal-outline:focus {
  background-color: #f1f5f9;
  color: var(--text-main);
}

/* ============================================================================
   7. MODALES
   ============================================================================ */
.modal-content-minimal {
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.modal-header-minimal {
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
}

.modal-footer-minimal {
  border-top: 1px solid var(--border-color);
  padding: 12px 24px;
}

/* ============================================================================
   ESTILOS PARA HEADER MINIMALISTA
   ============================================================================ */
.header-minimal {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo-img {
  object-fit: contain;
  transition: transform 0.2s ease;
}

.logo-img:hover {
  transform: scale(1.02);
}

/* Enlace de Usuario */
.nav-link-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px !important;
  border-radius: 20px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-main, #0f172a) !important;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.15s ease-in-out;
}

.nav-link-user:hover, 
.nav-link-user:focus {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--accent-primary, #0f172a);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* Dropdown Personalizado */
.dropdown-menu-minimal {
  border-radius: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  padding: 6px;
  min-width: 210px;
}

.dropdown-menu-minimal .dropdown-item {
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  transition: all 0.15s ease;
}

.dropdown-menu-minimal .dropdown-item:hover {
  background-color: #f8fafc;
  color: var(--text-main, #0f172a);
}

.dropdown-menu-minimal .dropdown-item.text-danger:hover {
  background-color: #fef2f2;
  color: #991b1b;
}

.text-xs {
  font-size: 0.7rem;
}

.uppercase {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================================
   ESTILOS PARA FOOTER MINIMALISTA
   ============================================================================ */
.footer-minimal {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-muted, #64748b);
  font-size: 0.875rem;
}

.footer-minimal strong {
  color: var(--text-main, #0f172a);
  font-weight: 600;
}

/* Enlace a Celema.co */
.footer-link {
  color: var(--text-muted, #64748b);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
}

.footer-link:hover {
  color: var(--accent-primary, #0f172a);
  text-decoration: underline;
}

/* ============================================================================
   8. LOGIN (INDEX)
   ============================================================================ */
.login-card-container {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  margin: auto;
}

.card-login {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  padding: 2.5rem 2rem;
}

.logo-login {
  height: 60px;
  object-fit: contain;
}

.toggle-password-btn {
  border: 1px solid var(--border-color, #e2e8f0);
  background: #ffffff;
  color: var(--text-muted, #64748b);
  padding: 0 12px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.toggle-password-btn:hover {
  color: var(--text-main, #0f172a);
}