@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.6);
  --bg-card-hover: rgba(17, 24, 39, 0.8);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --accent: #14b8a6; /* Teal */
  --accent-glow: rgba(20, 184, 166, 0.2);
  
  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-lg: 16px;
  --radius-md: 10px;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(20, 184, 166, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
  }
  50% {
    box-shadow: 0 0 35px rgba(99, 102, 241, 0.3);
  }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Login Page Container */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

.login-background-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: 20%;
  left: 15%;
  animation: spin-slow 20s linear infinite;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  bottom: 10%;
  right: 10%;
  animation: spin-slow 25s linear infinite reverse;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 420px;
  padding: 40px;
  z-index: 10;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

/* Custom Logo */
.logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
  animation: pulseGlow 4s infinite;
}

.logo-icon {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 24px;
  color: white;
}

.login-header h2 {
  font-size: 24px;
  color: var(--text-main);
  margin-bottom: 8px;
}

.login-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 18px;
}

.form-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: var(--transition-smooth);
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
  padding-right: 40px !important;
  color: var(--text-main) !important;
  background-color: #0d1321 !important; /* Fondo oscuro sólido */
}

select.form-input option {
  background-color: #0b0f19 !important; /* Fondo negro para opciones */
  color: #ffffff !important; /* Texto blanco legible */
  padding: 12px;
}

.form-input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Button */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Messages */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
  animation: fadeInUp 0.3s ease;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}

/* Main Dashboard Structure */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: rgba(10, 15, 26, 0.95);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
  z-index: 100;
  transition: var(--transition-smooth);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 35px;
}

.sidebar-logo .logo-container {
  width: 42px;
  height: 42px;
  margin-bottom: 0;
  border-radius: 10px;
}

.sidebar-logo h3 {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, white, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-menu {
  list-style: none;
  flex-grow: 1;
}

.sidebar-item {
  margin-bottom: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.sidebar-link i {
  font-size: 18px;
}

.sidebar-link:hover, .sidebar-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 20px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 16px;
}

.user-info {
  overflow: hidden;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

/* Main Content Area */
.main-content {
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Header */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content-header h1 {
  font-size: 28px;
}

.content-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.branch-badge {
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.2);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Cards & Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-3px);
}

.stat-info h4 {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: white;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary);
}

/* Content Sections */
.dashboard-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  animation: fadeInUp 0.5s ease;
}

.dashboard-section h2 {
  font-size: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

/* Spinner Loader */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin-slow 1s linear infinite;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .main-content {
    padding: 20px;
  }
}

/* Tablas Modernas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.modern-table th {
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-title);
  font-size: 14px;
}

.modern-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

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

.modern-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges de Existencias */
.badge-stock {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-stock.low {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-stock.ok {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-stock.none {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Ventanas Modales */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: rgba(15, 22, 38, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.05);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 35px;
  position: relative;
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.show .modal-container {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 20px;
  color: white;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: white;
  transform: rotate(90deg);
}

/* Área de subida de archivos (Upload Zone) */
.upload-zone {
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 45px 30px;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-bottom: 20px;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.04);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.05);
}

.upload-zone i {
  font-size: 44px;
  color: var(--text-muted);
  margin-bottom: 15px;
  transition: var(--transition-smooth);
}

.upload-zone:hover i, .upload-zone.dragover i {
  color: var(--primary);
  transform: translateY(-4px);
}

.upload-zone h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.upload-zone p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Barra de progreso */
.progress-container {
  margin-top: 20px;
  display: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-md);
  animation: fadeInUp 0.3s ease;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 500;
}

.progress-bar-wrapper {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* Resultados de importación */
.import-results {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: none;
  animation: fadeInUp 0.4s ease;
}

.import-results-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.result-stat {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.result-stat-val {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.result-stat-lbl {
  font-size: 11px;
  color: var(--text-secondary);
}

.error-details-list {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  padding: 15px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  color: #f87171;
  max-height: 150px;
  overflow-y: auto;
}

/* Diseño del Panel de Caja (Ventas) */
.sales-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 25px;
  align-items: start;
}

.cart-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.checkout-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 40px;
}

.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Filas del Multimedio de Pago */
.payment-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  animation: fadeInUp 0.25s ease;
}

.btn-remove-payment {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.btn-remove-payment:hover {
  background: rgba(239, 68, 68, 0.2);
  color: white;
}

/* Estilos de Impresión de Recibo */
@media print {
  body * {
    visibility: hidden;
  }
  
  #modal-ticket,
  #modal-ticket * {
    visibility: visible;
  }
  
  #modal-ticket {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: #ffffff !important;
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  
  #modal-ticket .modal-container {
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    background: #ffffff !important;
    color: #000000 !important;
  }
  
  .no-print {
    display: none !important;
  }
}

/* Autocomplete Search Suggestions Dropdown */
.search-suggestions {
  position: absolute;
  top: 105%;
  left: 0;
  width: 100%;
  background: #0f1626;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 999;
  max-height: 250px;
  overflow-y: auto;
}

.search-suggestion-item {
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestion-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.search-suggestion-item .item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.search-suggestion-item .item-name {
  font-weight: 600;
  color: white;
  font-size: 14px;
}

.search-suggestion-item .item-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.search-suggestion-item .item-stock-price {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-suggestion-item .item-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}

.search-suggestion-item .item-stock {
  font-size: 11px;
}

.search-suggestion-item .stock-ok {
  color: var(--success);
}

.search-suggestion-item .stock-low {
  color: var(--warning);
}

.search-suggestion-item .stock-empty {
  color: var(--danger);
}


