/* ============================================
   TECNOPRINTER ARMENIA - Styles
   Minimalist White Design with Purple Accents
   ============================================ */

:root {
  --primary: #7c3aed;
  --primary-light: #ede9fe;
  --primary-dark: #5b21b6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 64px;
  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span {
  display: none;
}

.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-200);
  min-height: var(--topbar-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-900);
  display: block;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
  display: block;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.sidebar-toggle:hover {
  color: var(--gray-700);
  background: var(--gray-100);
}

.sidebar-nav {
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

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

.nav-item i {
  font-size: 20px;
  flex-shrink: 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: var(--transition);
  min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--gray-600);
  cursor: pointer;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 8px 14px;
  max-width: 400px;
  flex: 1;
}

.search-box i {
  color: var(--gray-400);
  font-size: 18px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--gray-800);
  width: 100%;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--gray-400);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-icon {
  padding: 6px;
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 4px;
  font-size: 18px;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* ===== PAGES ===== */
.page {
  display: none;
  padding: 24px;
}

.page.active {
  display: block;
}

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

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
}

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

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.todas { background: var(--primary-light); color: var(--primary); }
.stat-icon.por_asignar { background: #fef3c7; color: #d97706; }
.stat-icon.en_proceso { background: #dbeafe; color: #2563eb; }
.stat-icon.por_entregar { background: #e0e7ff; color: #4f46e5; }
.stat-icon.entregado { background: #d1fae5; color: #059669; }
.stat-icon.sin_solucion { background: #f3f4f6; color: #6b7280; }
.stat-icon.garantia { background: #fee2e2; color: #dc2626; }
.stat-icon.eliminado { background: #f3f4f6; color: #9ca3af; }

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.card-body {
  padding: 20px;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tab {
  padding: 6px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
}

.tab:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.tab.active {
  background: var(--primary);
  color: white;
}

/* ===== TABLE ===== */
.table-container {
  overflow-x: auto;
}

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

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

.empty-state {
  text-align: center;
  color: var(--gray-400);
  padding: 40px 14px !important;
  font-style: italic;
}

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-por_asignar { background: #fef3c7; color: #92400e; }
.badge-por_asignar::before { background: #f59e0b; }

.badge-en_proceso { background: #dbeafe; color: #1e40af; }
.badge-en_proceso::before { background: #3b82f6; }

.badge-por_entregar { background: #e0e7ff; color: #3730a3; }
.badge-por_entregar::before { background: #6366f1; }

.badge-entregado { background: #d1fae5; color: #065f46; }
.badge-entregado::before { background: #10b981; }

.badge-rechazado { background: #f3f4f6; color: #1f2937; }
.badge-rechazado::before { background: #1f2937; }

.badge-sin_solucion { background: #f3f4f6; color: #6b7280; }
.badge-sin_solucion::before { background: #9ca3af; }

.badge-garantia { background: #fee2e2; color: #991b1b; }
.badge-garantia::before { background: #ef4444; }

.badge-eliminado { background: #f3f4f6; color: #9ca3af; }
.badge-eliminado::before { background: #d1d5db; }

/* Estado select (cambio rapido de estado en tablas) */
.estado-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 3px 22px 3px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  transition: box-shadow 0.15s;
  white-space: nowrap;
}
.estado-select:focus { outline: none; box-shadow: 0 0 0 2px var(--primary-light, #bfdbfe); }
.estado-select:disabled { opacity: 0.6; cursor: not-allowed; }
.estado-select.estado-por_asignar  { background-color: #fef3c7; color: #92400e; border-color: #f59e0b; }
.estado-select.estado-en_proceso   { background-color: #dbeafe; color: #1e40af; border-color: #3b82f6; }
.estado-select.estado-por_entregar { background-color: #e0e7ff; color: #3730a3; border-color: #6366f1; }
.estado-select.estado-entregado    { background-color: #d1fae5; color: #065f46; border-color: #10b981; }
.estado-select.estado-rechazado    { background-color: #f3f4f6; color: #1f2937; border-color: #1f2937; }
.estado-select.estado-sin_solucion { background-color: #f3f4f6; color: #6b7280; border-color: #9ca3af; }
.estado-select.estado-garantia     { background-color: #fee2e2; color: #991b1b; border-color: #ef4444; }
.estado-select.estado-eliminado    { background-color: #f3f4f6; color: #9ca3af; border-color: #d1d5db; }

/* Priority badges */
.priority {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.priority-alta { background: #fee2e2; color: #991b1b; }
.priority-media { background: #fef3c7; color: #92400e; }
.priority-baja { background: #d1fae5; color: #065f46; }

/* ===== FORMS ===== */
.input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.input::placeholder {
  color: var(--gray-400);
}

.textarea {
  resize: vertical;
  min-height: 60px;
}

.form-group {
  margin-bottom: 14px;
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.flex-2 {
  flex: 2;
}

fieldset {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

legend i {
  font-size: 16px;
}

.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.filter-row .input {
  max-width: 300px;
}

/* ===== AUTOCOMPLETE ===== */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}

.autocomplete-list.show {
  display: block;
}

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}

.autocomplete-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.autocomplete-item.new-client {
  color: var(--primary);
  font-weight: 500;
  border-top: 1px solid var(--gray-200);
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-large {
  max-width: 780px;
}

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

.modal-header h2 {
  font-size: 17px;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--gray-700);
  background: var(--gray-100);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== PHOTO UPLOAD ===== */
.photo-upload {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.photo-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--gray-200);
  position: relative;
}

.photo-thumb-wrapper {
  position: relative;
}

.photo-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== CONFIG PAGE ===== */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.text-muted {
  color: var(--gray-500);
  font-size: 13px;
  margin-bottom: 12px;
}

.connection-status {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-400);
}

.connection-status.connected {
  color: var(--success);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--gray-900);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== ORDER DETAIL (PDF/Print) ===== */
.orden-detalle {
  font-size: 13px;
}

.orden-detalle-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gray-900);
}

.orden-detalle-logo h2 {
  font-size: 20px;
  font-weight: 700;
}

.orden-detalle-logo span {
  font-size: 13px;
  color: var(--gray-500);
}

.orden-detalle-numero {
  text-align: right;
  background: var(--gray-900);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
}

.orden-detalle-numero strong {
  display: block;
  font-size: 15px;
}

.detalle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.detalle-section {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
}

.detalle-section h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.detalle-section p {
  margin-bottom: 4px;
  color: var(--gray-700);
}

.detalle-section strong {
  color: var(--gray-900);
}

.detalle-equipo-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.detalle-equipo-table th {
  background: var(--gray-100);
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
  border: 1px solid var(--gray-200);
}

.detalle-equipo-table td {
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  font-size: 13px;
}

.detalle-totales {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.detalle-totales table {
  border-collapse: collapse;
}

.detalle-totales td {
  padding: 4px 12px;
  font-size: 13px;
}

.detalle-totales tr:last-child td {
  font-weight: 700;
  border-top: 2px solid var(--gray-900);
}

.detalle-garantia {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
}

.detalle-garantia h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.detalle-garantia p {
  font-size: 11px;
  color: var(--gray-600);
  margin-bottom: 2px;
}

.detalle-fotos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.detalle-fotos img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

/* ===== STATUS SELECT IN TABLE ===== */
.status-select {
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 22px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: block;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }

  .detalle-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .page {
    padding: 16px;
  }

  .topbar {
    padding: 0 16px;
  }

  .modal {
    max-height: 95vh;
  }

  .modal-large {
    max-width: 100%;
  }
}

@media print {
  .sidebar, .topbar, .modal-header, .modal-footer, .btn {
    display: none !important;
  }

  .modal-overlay.show {
    position: static;
    background: none;
    padding: 0;
  }

  .modal {
    max-width: 100%;
    max-height: none;
    box-shadow: none;
    border: none;
  }

  .modal-body {
    overflow: visible;
  }
}

/* ===== LOGIN ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-icon {
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 12px;
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

.login-logo p {
  color: var(--gray-500);
  font-size: 13px;
  margin-top: 4px;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 10px;
  font-size: 15px;
}

.password-wrapper {
  position: relative;
}

.password-wrapper .input {
  padding-right: 40px;
}

.toggle-pwd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 18px;
  padding: 2px;
  line-height: 1;
}

.toggle-pwd:hover { color: var(--gray-600); }

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--gray-200);
  margin-top: auto;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-logout:hover {
  background: #fee2e2;
  color: var(--danger);
}

.btn-logout i { font-size: 20px; flex-shrink: 0; }

.sidebar.collapsed .btn-logout span { display: none; }

/* ===== LOGO UPLOAD ===== */
.logo-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  background: var(--gray-50);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== CATALOG STYLES ===== */
.catalog-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.catalog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 13px;
  gap: 8px;
}

.catalog-item span:first-child { flex: 1; }

/* Catalogo dropdown en orden */
.catalogo-dropdown {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-md);
  max-height: 180px;
  overflow-y: auto;
  margin-top: 4px;
  z-index: 10;
}

.catalog-dd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  gap: 8px;
}

.catalog-dd-item:hover { background: var(--primary-light); color: var(--primary); }

.catalog-dd-empty {
  padding: 12px;
  color: var(--gray-400);
  font-size: 12px;
  text-align: center;
}

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius);
  object-fit: contain;
}

.lightbox-actions {
  display: flex;
  gap: 8px;
}

/* ===== ALERT INFO ===== */
.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 10px;
  font-size: 12px;
  color: #1e40af;
  margin-bottom: 12px;
}

/* ===== SIDEBAR LOGO ICON ===== */
.logo-icon {
  overflow: hidden;
  position: relative;
}

