/* styles.css */
/* Sistema de Notas de Crédito - Casa Ayala del Noroeste S.A. de C.V. */

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

/* Variables de Diseño (Premium Theme - Rojo, Amarillo, Blanco) */
:root {
  --primary-color: #7f1d1d; /* Dark Red/Burgundy */
  --primary-light: #991b1b; /* Crimson Red */
  --accent-color: #dc2626; /* Bright Red */
  --accent-hover: #b91c1c; /* Darker Red */
  --accent-light: #fef2f2; /* Light Pink/Red tint */
  --bg-color: #fafafa; /* Off-white */
  --panel-bg: #ffffff; /* White panels */
  --text-color: #1e293b; /* Dark Slate for high readability */
  --text-muted: #64748b; /* Slate 500 */
  --border-color: #fee2e2; /* Light Red border */
  --success-color: #15803d; /* Sober Green */
  --warning-color: #eab308; /* Yellow/Amber */
  --danger-color: #b91c1c; /* Red */
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --font-family: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  font-size: 14px;
  height: 100vh;
  overflow: hidden;
}

/* Contenedor Principal (Layout de Panel) */
#app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Barra Lateral (Sidebar) */
#sidebar {
  display: none !important;
}

/* Área de Contenido Principal (Pantalla Completa) */
#main-content {
  flex: 1;
  margin-left: 0 !important;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  background-color: var(--bg-color);
}

/* Estilo personalizado de la barra de desplazamiento (Scrollbar / Slidebar) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Navegación Horizontal en Header */
.nav-links-horizontal {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 4px;
}

.nav-links-horizontal .nav-item {
  margin-bottom: 0;
}

.nav-links-horizontal .nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--text-color);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-links-horizontal .nav-link i {
  font-size: 14px;
}

.nav-links-horizontal .nav-link:hover {
  background-color: var(--accent-light);
  color: var(--primary-color);
}

.nav-links-horizontal .nav-link.active {
  background-color: var(--accent-color);
  color: white;
  border-left: none;
  padding-left: 12px;
}

/* Barra de Cabecera (Header) */
#top-header {
  height: 60px;
  background-color: var(--primary-light);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  color: white;
}

#top-header #header-user-info {
  color: white !important;
}

#top-header .btn-secondary {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: white !important;
}

#top-header .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.3) !important;
}

/* Barra de Navegación Horizontal (Por debajo del Header) */
#top-navbar {
  height: 50px;
  background-color: var(--panel-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 32px;
  overflow-x: auto;
}

.header-title h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
}

.user-selector-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-label {
  font-weight: 500;
  color: var(--text-muted);
}

.user-dropdown {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: white;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  outline: none;
}

.user-dropdown:focus {
  border-color: var(--accent-color);
}

/* Contenido Principal de las Vistas */
.view-container {
  padding: 20px 24px;
  flex: 1;
}

.hidden {
  display: none !important;
}

/* Paneles y Tarjetas (Cards) */
.card {
  background-color: var(--panel-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Dashboard Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background-color: var(--panel-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--accent-color);
}

.metric-card.danger::before { background-color: var(--danger-color); }
.metric-card.success::before { background-color: var(--success-color); }
.metric-card.warning::before { background-color: var(--warning-color); }

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.metric-card.danger .metric-icon { background-color: #fef2f2; color: var(--danger-color); }
.metric-card.success .metric-icon { background-color: #ecfdf5; color: var(--success-color); }
.metric-card.warning .metric-icon { background-color: #fffbeb; color: var(--warning-color); }

.metric-info {
  flex: 1;
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tablas Modernas */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

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

.table-modern th {
  background-color: #f8fafc;
  color: var(--primary-color);
  padding: 14px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

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

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

.table-modern tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges / Etiquetas de Estado */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-draft { background-color: #f1f5f9; color: #475569; }
.badge-emitted { background-color: #dbeafe; color: #1d4ed8; }
.badge-signed { background-color: #d1fae5; color: #065f46; }
.badge-cancelled { background-color: #fee2e2; color: #991b1b; }

/* Botones con micro-animaciones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--font-family);
  outline: none;
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-secondary {
  background-color: white;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.btn-secondary:hover {
  background-color: #fffdf5;
  border-color: var(--warning-color);
  color: var(--primary-color);
}

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

.btn-danger:hover {
  background-color: #9f1239;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(190, 18, 60, 0.2);
}

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

.btn-success:hover {
  background-color: #115e59;
}

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

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

/* Formularios de Captura */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-family: var(--font-family);
  font-size: 13px;
  outline: none;
  background-color: white;
  color: var(--text-color);
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control[disabled] {
  background-color: #f1f5f9;
  cursor: not-allowed;
  color: var(--text-muted);
}

/* Botón de Autorización Especial */
.auth-special-container {
  background-color: #fffbeb;
  border: 1px dashed var(--warning-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-special-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b45309;
  font-weight: 700;
}

/* Tabla editable de productos */
.table-editable {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  table-layout: auto;
}

.table-editable-container,
.form-group .table-editable {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

.table-editable th {
  background-color: #f8fafc;
  padding: 6px 3px;
  font-weight: 600;
  font-size: 11px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.table-editable td {
  padding: 4px 3px;
  border: 1px solid var(--border-color);
  vertical-align: middle;
  text-align: center;
}

.table-editable input.form-control,
.table-editable select.form-control {
  padding: 3px 6px;
  font-size: 11.5px;
  height: 30px;
  width: 100%;
  box-sizing: border-box;
}

/* Recuadros reducidos y proporcionados según el tipo de dato */
.table-editable .nf-code-input,
.table-editable td:nth-child(1) input {
  max-width: 95px;
  margin: 0 auto;
}

.table-editable .nf-cant-input,
.table-editable td:nth-child(2) input {
  max-width: 55px;
  margin: 0 auto;
  text-align: center;
}

.table-editable td:nth-child(3) input {
  max-width: 55px;
  margin: 0 auto;
  text-align: center;
}

.table-editable td:nth-child(4) input {
  max-width: 95px;
  margin: 0 auto;
  text-align: center;
}

.table-editable .nf-unit-input,
.table-editable td:nth-child(7) input {
  max-width: 85px;
  margin: 0 auto;
  text-align: right;
  font-weight: 600;
}

.table-editable .nf-importe-row,
.table-editable td:nth-child(10) input {
  max-width: 95px;
  margin: 0 auto;
  text-align: right;
  font-weight: 600;
}

.table-editable .btn-danger {
  padding: 0;
  font-size: 11px;
  height: 28px;
  width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* Estructura para subir fotos de incidencias */
.image-upload-wrapper {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background-color: #fafafa;
  transition: all 0.2s ease;
  position: relative;
}

.image-upload-wrapper:hover,
.image-upload-wrapper.highlight {
  border-color: var(--accent-color);
  background-color: var(--accent-light);
}

.image-preview-container {
  margin-top: 15px;
  position: relative;
  display: inline-block;
}

.image-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.remove-image-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
}

/* Caja de Razones (Causa de Devolución) en el formulario */
.reasons-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  background-color: #fafafa;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.reason-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s;
}

.reason-option:hover {
  background-color: #f1f5f9;
}

.reason-option input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Estilo para los descuentos escalonados */
.discounts-inputs {
  display: flex;
  gap: 12px;
  align-items: center;
}

.discounts-inputs input {
  width: 70px;
  text-align: center;
}

.discount-sum-info {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Visor de firmas en panel digital */
.signatures-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.signature-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  background-color: #f8fafc;
}

.signature-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.signature-status {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  color: var(--text-muted);
  font-weight: 500;
}

.signature-status.signed {
  color: var(--success-color);
  font-weight: 700;
  font-style: normal;
}

/* Tarjetas de Presupuesto mensual */
.budget-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  background-color: white;
  box-shadow: var(--shadow-sm);
}

.budget-progress-bar {
  height: 10px;
  border-radius: 5px;
  background-color: #e2e8f0;
  overflow: hidden;
  margin: 12px 0 6px 0;
}

.budget-progress-fill {
  height: 100%;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.budget-progress-fill.warning {
  background-color: var(--warning-color);
}

.budget-progress-fill.danger {
  background-color: var(--danger-color);
}

.budget-text-summary {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================
   ESTILOS DE IMPRESIÓN (EXACTOS AL PDF)
   ========================================== */
@media print {
  /* Ocultar toda la interfaz de la web para evitar hojas en blanco iniciales */
  #sidebar, #top-header, .btn, .no-print, header, nav, .app-container, #main-content, .view-container, .view-section {
    display: none !important;
  }
  
  body {
    background-color: white !important;
    color: black !important;
    font-size: 9px !important;
    font-family: "Courier New", Courier, monospace !important;
  }

  /* Mostrar exclusivamente el contenedor de impresión #print-area desde el origen */
  #print-area {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Ajustes de página para encuadre en 1 sola hoja */
  @page {
    size: letter portrait;
    margin: 3mm 4mm 3mm 4mm;
  }
  
  /* Formato Nota de Crédito Impresa */
  .print-page {
    page-break-after: always;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .print-page:last-child {
    page-break-after: avoid;
  }

  /* Formato Duplicado (Original y Copia) */
  .nota-print-container {
    border: 1px solid black;
    padding: 6px;
    margin-bottom: 12px;
    position: relative;
    background: white;
  }

  .print-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    border: 1px solid black;
    padding: 2px 8px;
    font-weight: bold;
    font-size: 10px;
    text-transform: uppercase;
  }
  
  /* Encabezado */
  .print-header {
    display: grid;
    grid-template-columns: 80px 1fr 180px;
    align-items: center;
    border-bottom: 1px solid black;
    padding-bottom: 6px;
    margin-bottom: 6px;
  }
  
  .print-logo-placeholder {
    width: 60px;
    height: auto;
  }

  .print-logo-placeholder svg {
    width: 100%;
    height: auto;
  }
  
  .print-company-info {
    text-align: center;
    line-height: 1.2;
  }
  
  .print-company-title {
    font-size: 11px;
    font-weight: bold;
  }

  .print-company-subtitle {
    font-size: 8px;
  }
  
  .print-meta-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid black;
    text-align: center;
  }

  .print-meta-header {
    grid-column: 1 / -1;
    border-bottom: 1px solid black;
    font-weight: bold;
    padding: 2px;
  }

  .print-meta-box span {
    border-right: 1px solid black;
    padding: 2px;
  }

  .print-meta-box span:last-child {
    border-right: none;
  }
  
  .print-folio-container {
    grid-column: 1 / -1;
    border-top: 1px solid black;
    display: flex;
    justify-content: space-between;
    padding: 4px;
    font-weight: bold;
    font-size: 11px;
  }

  .print-folio-number {
    color: red;
  }

  /* Campos Cliente, Factura, Fecha */
  .print-fields-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 9px;
  }

  .print-field {
    border-bottom: 1px solid black;
    padding-bottom: 2px;
  }

  .print-field-label {
    font-weight: bold;
  }

  /* Tabla de razones */
  .print-reasons-container {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 10px;
    border: 1px solid black;
    padding: 4px;
    margin-bottom: 6px;
  }

  .print-reasons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
  }

  .print-reason-item {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .print-reason-box {
    width: 10px;
    height: 10px;
    border: 1px solid black;
    display: inline-block;
    text-align: center;
    line-height: 8px;
    font-weight: bold;
    font-size: 8px;
  }

  .print-instruction-box {
    border: 1px solid black;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    font-weight: bold;
    line-height: 1.2;
  }

  /* Tabla de productos */
  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 6px;
  }

  .print-table th, .print-table td {
    border: 1px solid black;
    padding: 3px;
    font-size: 8px;
    text-align: left;
  }

  .print-table th {
    text-align: center;
    font-weight: bold;
    background-color: #eee;
  }

  .print-table td.right, .print-table th.right {
    text-align: right;
  }

  .print-table td.center, .print-table th.center {
    text-align: center;
  }

  /* Espaciador para la tabla si tiene pocos registros (emular las líneas en blanco del formato) */
  .print-table tbody tr {
    height: 16px;
  }

  /* Campos inferiores */
  .print-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1fr;
    border: 1px solid black;
    margin-bottom: 6px;
  }

  .print-bottom-cell {
    border-right: 1px solid black;
    padding: 4px;
  }

  .print-bottom-cell:last-child {
    border-right: none;
  }

  .print-bottom-label {
    font-weight: bold;
    display: block;
    font-size: 7px;
  }

  .print-bottom-value {
    font-size: 9px;
  }

  /* Sección de firmas oficial */
  .print-signatures-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    margin-top: 6px !important;
    padding-top: 2px !important;
  }

  .print-signature-box {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
  }

  .print-signature-space {
    height: 18px !important;
  }

  .print-signature-line {
    border-top: 1.5px solid #000000 !important;
    margin-top: 14px !important;
    padding-top: 2px !important;
    font-weight: 800 !important;
    font-size: 9px !important;
    color: #000000 !important;
    text-transform: none !important;
  }

  /* Impresión Resumen Físico */
  .print-summary-sheet {
    min-height: 98vh;
    page-break-after: always;
    box-sizing: border-box;
    padding: 5px 0;
  }

  /* Impresión Lotes y Notas Individuales (Encuadre exacto de 1 sola hoja sin desborde de firmas) */
  .print-lote-sheet {
    height: 99.5vh !important;
    max-height: 99.5vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    page-break-after: always;
    page-break-inside: avoid !important;
    box-sizing: border-box !important;
    padding: 1px 0 !important;
    overflow: hidden !important;
  }
  
  .print-lote-sheet:last-child {
    page-break-after: avoid;
  }

  .print-lote-sheet .nota-print-container {
    height: 49.2% !important;
    max-height: 49.2% !important;
    margin-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    padding: 4px 6px !important;
    overflow: hidden !important;
  }
}

/* Marca de Agua Transversal para Impresión */
.nota-print-container {
  position: relative !important;
}

.print-watermark {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-42deg);
  font-size: 88px;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.04) !important;
  pointer-events: none;
  z-index: 0;
  text-transform: uppercase;
  letter-spacing: 12px;
  white-space: nowrap;
}

.print-cancel-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 88px;
  font-weight: 900;
  color: rgba(220, 38, 38, 0.15) !important;
  border: 10px solid rgba(220, 38, 38, 0.20);
  padding: 15px 30px;
  border-radius: 15px;
  pointer-events: none;
  z-index: 1000;
  text-transform: uppercase;
  letter-spacing: 12px;
  white-space: nowrap;
}

/* ==========================================
   ESTILOS DE LOGIN Y SIMULADOR DE EMAIL
   ========================================== */
#login-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--primary-color);
  background-image: radial-gradient(circle at top right, #991b1b 0%, #7f1d1d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: white;
  width: 460px;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg), 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

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

.login-logo {
  width: 55px;
  height: 55px;
  background-color: var(--warning-color);
  color: var(--primary-color);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 26px;
  margin-bottom: 12px;
}

.login-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
}

.login-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.login-helper-box {
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  font-size: 11px;
}

.login-helper-box h4 {
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-helper-box ul {
  list-style: none;
  line-height: 1.6;
}

/* Simulador de Toasts de Email */
#email-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 350px;
}

.email-toast {
  background: #1e293b;
  color: #f8fafc;
  border-left: 4px solid var(--accent-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  font-size: 11px;
  animation: slideIn 0.3s ease;
  position: relative;
}

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

.email-toast-header {
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.email-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-weight: bold;
}

.email-toast-close:hover {
  color: white;
}

.email-toast-body p {
  margin-bottom: 4px;
}

/* Estilos de Desbloqueo de Administrador */
#btn-show-unlock-admin, #btn-back-to-login {
  transition: all 0.2s ease;
}

#btn-show-unlock-admin:hover {
  color: var(--accent-hover) !important;
  text-decoration: underline !important;
}

#btn-back-to-login:hover {
  color: var(--primary-color) !important;
  text-decoration: underline !important;
}

/* Autocomplete de Clientes */
.autocomplete-container {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 4px;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.15s ease;
  color: var(--text-color);
}

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

.autocomplete-item:hover {
  background-color: #f1f5f9;
}

.autocomplete-item-code {
  font-weight: 700;
  color: var(--accent-hover);
  font-size: 11px;
  background-color: var(--accent-light);
  padding: 2px 6px;
  border-radius: 4px;
}


