/* ==========================================================================
   Estilos Centrales - Control de Stock de Calzados
   ========================================================================== */

/* Importar tipografía moderna Inter de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Paleta de Colores Premium */
  --bg-primary: #f8fafc;
  --bg-sidebar: #0f172a; /* Slate oscuro */
  --sidebar-active: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  
  --primary-color: #4f46e5; /* Índigo */
  --primary-hover: #4338ca;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  
  /* Colores de Estado */
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  
  /* Sombras y Radios */
  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --card-radius: 12px;
  --btn-radius: 8px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ==========================================================================
   Diseño de Contenedores y Estructura (Layout)
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Estilo */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 24px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-menu {
  list-style: none;
  padding: 12px;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-menu li {
  margin-bottom: 4px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.sidebar-menu a:hover {
  background-color: var(--sidebar-active);
  color: var(--sidebar-text-active);
}

.sidebar-menu li.active a {
  background-color: var(--primary-color);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

/* Contenido Principal */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Evita que las tablas ensanchen el contenedor */
}

/* Navbar Superior */
.top-navbar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-light);
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-wrapper {
  padding: 24px;
  flex-grow: 1;
}

/* ==========================================================================
   Componentes Visuales (Tarjetas, Botones, Tablas)
   ========================================================================== */

/* Tarjetas */
.card-stats {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.15s ease;
}

.card-stats:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #ffffff;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
}

/* Tablas Modernas */
.table-responsive-custom {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-responsive-custom table {
  margin-bottom: 0;
}

.table-responsive-custom th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}

.table-responsive-custom td {
  padding: 14px 20px;
  vertical-align: middle;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
}

.table-responsive-custom tr:last-child td {
  border-bottom: none;
}

/* Formularios de Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-sidebar);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: #ffffff;
  border-radius: var(--card-radius);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  padding: 40px 32px;
}

/* Botones Premium */
.btn-indigo {
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: var(--btn-radius);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.15s ease;
}

.btn-indigo:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
}

/* Inputs y Controles */
.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ==========================================================================
   Pantallas Operativas (Escáner y Ventas)
   ========================================================================== */

/* Input de escáner gigante */
.scanner-input-wrapper {
  position: relative;
  margin-bottom: 24px;
}

.scanner-input {
  font-size: 1.5rem !important;
  font-weight: 600;
  padding: 16px 20px !important;
  border: 2px solid var(--primary-color) !important;
  border-radius: 10px !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

.scanner-input:focus {
  box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.2) !important;
}

/* Carrito de venta rápida */
.cart-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 24px;
  height: 100%;
}

.cart-summary {
  background-color: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  border: 1px solid var(--border-light);
}

.cart-summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.cart-summary-item:last-child {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-weight: 700;
  font-size: 1.2rem;
}

/* Badges de stock */
.badge-stock-ok {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
  font-weight: 600;
}

.badge-stock-low {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  font-weight: 600;
}

.badge-stock-none {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  font-weight: 600;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 991.98px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
  }
  
  .sidebar-brand {
    justify-content: space-between;
  }
  
  .sidebar-menu {
    display: none; /* Se puede alternar por JS */
  }
  
  .sidebar.show-menu .sidebar-menu {
    display: block;
  }
}
