/* ============================================================
   CotiApp — Gestión de Cotizaciones © 2026
   styles.css
   Desarrollado por Carlos Mejía
   ============================================================ */

:root {
  --azul: #1a3a6b;
  --azul-medio: #2555a0;
  --azul-claro: #3a70c2;
  --amarillo: #f5c400;
  --amarillo-oscuro: #d4a800;
  --rojo: #c0392b;
  --blanco: #ffffff;
  --gris-claro: #f4f6fa;
  --gris-borde: #dde3ef;
  --gris-texto: #555e72;
  --negro: #111827;
  --sombra: 0 4px 24px rgba(26,58,107,0.13);
  --sombra-lg: 0 8px 40px rgba(26,58,107,0.18);
  --radio: 10px;
}

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

body {
  font-family: 'Barlow', sans-serif;
  background: var(--gris-claro);
  color: var(--negro);
  min-height: 100vh;
  padding-bottom: 34px;
}

/* ===== TOPBAR ===== */
.topbar {
  background: var(--azul);
  color: var(--blanco);
  padding: 0 32px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.22);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-logo {
  width: 36px; height: 36px;
  background: var(--amarillo);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900; font-size: 18px;
  color: var(--azul);
}
.topbar-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 20px;
  letter-spacing: 0.5px;
}
.topbar-title span { color: var(--amarillo); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.topbar-badge {
  background: var(--amarillo);
  color: var(--azul);
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
}

/* ===== LAYOUT ===== */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 62px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  background: var(--blanco);
  border-right: 1px solid var(--gris-borde);
  padding: 24px 0;
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  overflow-y: auto;
}
.sidebar-section { padding: 0 16px 8px; }
.sidebar-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: #aab; text-transform: uppercase;
  padding: 0 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--gris-texto);
  transition: all .18s;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--gris-claro); color: var(--azul); }
.nav-item.active { background: var(--azul); color: var(--blanco); }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
.nav-count {
  margin-left: auto;
  background: var(--amarillo);
  color: var(--azul);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}
.nav-item.active .nav-count { background: rgba(255,255,255,0.25); color: white; }
.sidebar-divider { height: 1px; background: var(--gris-borde); margin: 12px 16px; }
.sidebar-company {
  margin: 16px 16px 0;
  background: var(--gris-claro);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px; color: var(--gris-texto);
}
.sidebar-company strong { display: block; color: var(--azul); font-size: 13px; margin-bottom: 2px; }

/* ===== MAIN ===== */
.main { padding: 32px; overflow-y: auto; }

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== STATS ROW ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--blanco);
  border-radius: var(--radio);
  padding: 20px;
  box-shadow: var(--sombra);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--azul-claro);
}
.stat-card.amarillo::before { background: var(--amarillo); }
.stat-card.rojo::before { background: var(--rojo); }
.stat-card.verde::before { background: #27ae60; }
.stat-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 32px; font-weight: 700;
  color: var(--azul);
}
.stat-label { font-size: 12px; color: var(--gris-texto); margin-top: 2px; }
.stat-icon {
  position: absolute; right: 16px; top: 16px;
  font-size: 28px; opacity: 0.12;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px; font-weight: 700;
  color: var(--azul);
}
.page-subtitle { font-size: 13px; color: var(--gris-texto); margin-top: 1px; }

/* ===== BUTTONS ===== */
.btn {
  padding: 9px 20px; border-radius: 7px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .18s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-primary { background: var(--azul); color: white; }
.btn-primary:hover { background: var(--azul-medio); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,58,107,0.3); }
.btn-amarillo { background: var(--amarillo); color: var(--azul); }
.btn-amarillo:hover { background: var(--amarillo-oscuro); }
.btn-outline { background: transparent; border: 1.5px solid var(--gris-borde); color: var(--gris-texto); }
.btn-outline:hover { border-color: var(--azul); color: var(--azul); }
.btn-danger { background: var(--rojo); color: white; }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-icon { padding: 7px 10px; }

/* ===== TABLE ===== */
.table-wrap {
  background: white;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
}
.table-toolbar {
  padding: 16px 20px;
  display: flex; gap: 10px; align-items: center;
  border-bottom: 1px solid var(--gris-borde);
  flex-wrap: wrap;
}
.search-input {
  flex: 1; min-width: 180px;
  padding: 8px 14px;
  border: 1.5px solid var(--gris-borde);
  border-radius: 7px;
  font-size: 13px; font-family: 'Barlow', sans-serif;
  outline: none;
  transition: border .18s;
}
.search-input:focus { border-color: var(--azul-claro); }
.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--gris-borde);
  border-radius: 7px;
  font-size: 13px; font-family: 'Barlow', sans-serif;
  outline: none; background: white; cursor: pointer;
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--azul); }
thead th {
  padding: 13px 16px; text-align: left;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}
tbody tr {
  border-bottom: 1px solid var(--gris-borde);
  transition: background .15s;
}
tbody tr:hover { background: #f0f4fb; }
tbody td { padding: 13px 16px; font-size: 13px; }
.badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.badge-pendiente { background: #fff3cd; color: #856404; }
.badge-enviada   { background: #cfe2ff; color: #084298; }
.badge-aprobada  { background: #d1e7dd; color: #0a3622; }
.badge-rechazada { background: #f8d7da; color: #58151c; }
.badge-vencida   { background: #e2e3e5; color: #41464b; }
.table-actions { display: flex; gap: 5px; }
.action-btn {
  background: none; border: none; cursor: pointer;
  padding: 5px 8px; border-radius: 5px;
  font-size: 14px; transition: background .15s;
}
.action-btn:hover { background: var(--gris-claro); }
.quot-num { font-weight: 700; color: var(--azul); font-family: 'Barlow Condensed', sans-serif; font-size: 15px; }
.client-name { font-weight: 600; }
.client-contact { font-size: 11px; color: var(--gris-texto); }
.amount { font-weight: 700; font-family: 'Barlow Condensed', sans-serif; font-size: 15px; color: var(--azul); }

/* ===== MODAL ===== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,50,0.5);
  z-index: 200; display: none;
  align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: 14px;
  width: 100%; max-width: 860px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-header {
  background: var(--azul);
  color: white;
  padding: 18px 24px;
  border-radius: 14px 14px 0 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px; font-weight: 700;
}
.modal-close {
  background: rgba(255,255,255,0.15); border: none;
  color: white; width: 32px; height: 32px;
  border-radius: 6px; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: rgba(255,255,255,0.25); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gris-borde);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ===== FORM ===== */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full   { grid-column: 1 / -1; }
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--azul);
}
.form-input,
.form-select,
.form-textarea {
  padding: 9px 13px;
  border: 1.5px solid var(--gris-borde);
  border-radius: 7px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px; outline: none;
  transition: border .18s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--azul-claro);
  box-shadow: 0 0 0 3px rgba(58,112,194,0.12);
}
.form-textarea { resize: vertical; min-height: 70px; }
.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px; font-weight: 700;
  color: white;
  background: var(--azul-medio);
  padding: 7px 14px; border-radius: 6px;
  margin: 18px 0 12px;
  letter-spacing: 0.5px;
}

/* ===== ITEMS TABLE (in form) ===== */
.items-table-wrap {
  border: 1.5px solid var(--gris-borde);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.items-table { width: 100%; border-collapse: collapse; }
.items-table thead { background: var(--azul); }
.items-table thead th {
  padding: 9px 12px; font-size: 11px;
  font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: rgba(255,255,255,0.9);
  text-align: left;
}
.items-table tbody tr { border-bottom: 1px solid var(--gris-borde); }
.items-table tbody td { padding: 7px 8px; }
.items-table .td-num   { width: 60px; }
.items-table .td-precio { width: 130px; }
.items-table .td-total  { width: 130px; }
.items-table .td-del    { width: 36px; }
.item-input {
  width: 100%; padding: 6px 9px;
  border: 1.5px solid transparent; border-radius: 5px;
  font-family: 'Barlow', sans-serif; font-size: 13px;
  background: var(--gris-claro);
  outline: none; transition: all .15s;
}
.item-input:focus { border-color: var(--azul-claro); background: white; }
.item-total-cell {
  font-weight: 700;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; color: var(--azul);
  padding: 6px 9px; display: block;
}
.del-btn {
  background: none; border: none; cursor: pointer;
  color: #c0392b; font-size: 16px;
  padding: 4px 6px; border-radius: 4px;
  transition: background .15s;
}
.del-btn:hover { background: #fde; }

/* ===== TOTALS ===== */
.totals-box { display: flex; justify-content: flex-end; margin-top: 4px; }
.totals-inner {
  width: 280px;
  border: 1.5px solid var(--gris-borde);
  border-radius: 8px; overflow: hidden;
}
.totals-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; font-size: 13px;
  border-bottom: 1px solid var(--gris-borde);
}
.totals-row:last-child { border-bottom: none; }
.totals-row.total-final {
  background: var(--azul); color: white; font-weight: 700;
  font-family: 'Barlow Condensed', sans-serif; font-size: 16px;
}
.totals-row .tl { color: var(--gris-texto); font-size: 12px; }
.totals-row.total-final .tl { color: rgba(255,255,255,0.8); }
.totals-row .tv { font-weight: 700; font-family: 'Barlow Condensed', sans-serif; font-size: 15px; color: var(--azul); }
.totals-row.total-final .tv { color: white; font-size: 16px; }

/* ===== PREVIEW OVERLAY ===== */
.preview-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,50,0.65);
  z-index: 300; display: none;
  align-items: flex-start; justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.preview-overlay.open { display: flex; }
.preview-container {
  background: white;
  width: 794px;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  font-family: 'Barlow', sans-serif;
}
.preview-toolbar {
  background: var(--azul);
  padding: 12px 20px;
  display: flex; gap: 10px; align-items: center;
}
.preview-toolbar span { color: white; font-size: 14px; font-weight: 600; margin-right: auto; }

/* ===== DOCUMENT STYLES ===== */
.doc { padding: 32px 36px; }
.doc-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.doc-logo-area { display: flex; align-items: center; gap: 14px; }
.doc-vm-logo {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, #f5c400 50%, #1a3a6b 50%);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900; font-size: 36px; color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.doc-company-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px; font-weight: 900; color: var(--azul);
  line-height: 1.1;
}
.doc-slogan {
  display: inline-block;
  background: var(--azul); color: white;
  font-style: italic; font-size: 11px;
  padding: 2px 10px; border-radius: 3px; margin-top: 3px;
}
.doc-badge-wrap { text-align: right; }
.doc-badge-label {
  background: var(--azul); color: white;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 700;
  padding: 5px 18px; border-radius: 5px;
  letter-spacing: 2px;
}
.doc-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 700; color: var(--azul);
  text-align: right; margin-top: 4px;
}
.doc-date { font-size: 12px; color: var(--gris-texto); text-align: right; }
.doc-date strong { color: var(--negro); }
.doc-stripe {
  height: 5px;
  background: linear-gradient(90deg, var(--amarillo) 0%, var(--amarillo-oscuro) 50%, var(--rojo) 100%);
  margin: 10px 0; border-radius: 3px;
}
.doc-section-header {
  background: var(--azul); color: white;
  padding: 6px 14px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px; font-weight: 700; letter-spacing: 0.8px;
  border-radius: 5px 5px 0 0; margin-top: 14px;
}
.doc-client-box {
  border: 1.5px solid var(--gris-borde);
  border-top: none; padding: 12px 14px;
  border-radius: 0 0 5px 5px;
}
.doc-client-name { font-size: 16px; font-weight: 700; color: var(--azul); margin-bottom: 4px; }
.doc-client-row  { font-size: 12px; margin-bottom: 2px; }
.doc-client-row strong { color: var(--negro); }
.doc-greeting { font-size: 13px; margin: 14px 0 8px; color: var(--gris-texto); }
.doc-greeting strong { color: var(--azul); }

/* Document items table */
.doc-items { width: 100%; border-collapse: collapse; margin: 10px 0; }
.doc-items thead { background: var(--azul); }
.doc-items thead th {
  padding: 9px 12px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: white; text-align: left;
}
.doc-items thead th:nth-child(3),
.doc-items thead th:nth-child(4) { text-align: right; }
.doc-items tbody tr  { border-bottom: 1px solid var(--gris-borde); }
.doc-items tbody td  { padding: 9px 12px; font-size: 12px; vertical-align: top; }
.doc-items tbody td:nth-child(3),
.doc-items tbody td:nth-child(4) {
  text-align: right; font-weight: 700;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px; color: var(--azul);
}
.doc-items .item-desc-main   { font-weight: 700; margin-bottom: 2px; }
.doc-items .item-desc-detail { font-size: 11px; color: var(--gris-texto); }
.doc-items tfoot tr:nth-child(1) td { background: #f0f4fb; }
.doc-items tfoot tr:nth-child(2) td { background: #dde8f7; }
.doc-items tfoot tr:nth-child(3) td { background: var(--azul); color: white; }
.doc-items tfoot td { padding: 7px 12px; font-size: 12px; font-weight: 600; }
.doc-items tfoot td:last-child {
  text-align: right;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 700;
}
.doc-items tfoot tr:nth-child(3) td { color: white; }

/* Condiciones */
.doc-condiciones {
  border: 1.5px solid var(--gris-borde); border-radius: 5px;
  padding: 12px 14px; margin-top: 14px; font-size: 12px;
}
.doc-cond-title {
  background: var(--azul); color: white;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 0.8px;
  padding: 4px 10px; border-radius: 4px;
  display: inline-block; margin-bottom: 8px;
}
.doc-cond-item { margin-bottom: 4px; color: var(--gris-texto); }
.doc-cond-item strong { color: var(--negro); }

/* Footer doc */
.doc-footer {
  margin-top: 14px;
  background: var(--azul); color: white;
  padding: 8px 14px; border-radius: 5px;
  display: flex; flex-direction: column;
  align-items: center; font-size: 11px; text-align: center; gap: 2px;
}
.doc-footer strong { font-size: 12px; letter-spacing: 0.5px; }

/* Signature */
.doc-signature-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin: 10px 0 0; font-size: 12px;
}
.doc-cordial  { color: var(--gris-texto); }
.doc-sig-name { font-weight: 700; color: var(--azul); text-align: right; font-size: 13px; }

/* ===== PRODUCTS PAGE ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.product-card {
  background: white; border-radius: var(--radio);
  padding: 18px; box-shadow: var(--sombra);
  border-left: 4px solid var(--azul);
  position: relative;
}
.product-card-name    { font-weight: 700; font-size: 15px; color: var(--azul); margin-bottom: 4px; }
.product-card-desc    { font-size: 12px; color: var(--gris-texto); margin-bottom: 10px; }
.product-card-price   { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 700; color: var(--azul); }
.product-card-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 5px; }

/* ===== CLIENTS PAGE ===== */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.client-card {
  background: white; border-radius: var(--radio);
  padding: 18px; box-shadow: var(--sombra);
}
.client-card-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--azul); color: white;
  font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.client-card-name { font-weight: 700; font-size: 15px; color: var(--azul); }
.client-card-info { font-size: 12px; color: var(--gris-texto); margin-top: 4px; }
.client-card-info span { display: block; }

/* ===== SETTINGS ===== */
.settings-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.settings-card {
  background: white; border-radius: var(--radio);
  padding: 24px; box-shadow: var(--sombra);
}
.settings-card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 700; color: var(--azul);
  margin-bottom: 18px;
  padding-bottom: 10px; border-bottom: 2px solid var(--amarillo);
}

/* ===== LOGO UPLOADER ===== */
.logo-uploader {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1.5px solid var(--gris-borde);
}
.logo-preview-wrap {
  width: 110px; height: 90px;
  border: 2px dashed var(--gris-borde);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--gris-claro);
  flex-shrink: 0;
  transition: border .2s;
}
.logo-placeholder {
  font-size: 11px; color: #aab;
  text-align: center; padding: 8px;
}
#logo-preview-img {
  display: none;
  width: 100%; height: 100%;
  object-fit: contain; padding: 6px;
}
.logo-hint { font-size: 11px; color: var(--gris-texto); line-height: 1.5; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--gris-texto);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--azul); color: white;
  padding: 12px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--sombra-lg);
  z-index: 999;
  transform: translateY(80px); opacity: 0;
  transition: all .3s;
  display: flex; align-items: center; gap: 8px;
}
.toast.show    { transform: translateY(0); opacity: 1; }
.toast.success { background: #27ae60; }
.toast.error   { background: var(--rojo); }

/* ===== PRINT ===== */
@media print {
  /* Ocultar absolutamente todo */
  body > *                { display: none !important; }

  /* Ocultar barra de créditos */
  body > div[style*='position: fixed'][style*='bottom: 0'] { display: none !important; }

  /* Mostrar solo el overlay de preview */
  #preview-overlay        { display: block !important; position: static !important;
                            background: none !important; padding: 0 !important;
                            overflow: visible !important; }

  /* Ocultar toolbar dentro del overlay */
  .preview-toolbar        { display: none !important; }

  /* Contenedor sin sombra */
  .preview-container      { box-shadow: none !important; border-radius: 0 !important;
                            width: 100% !important; }

  /* Documento ocupa todo el ancho */
  .doc                    { padding: 20px 28px !important; }

  /* Sin saltos de página en filas */
  .doc-items tbody tr     { page-break-inside: avoid; }
}

/* ===== LOGIN SCREEN ===== */
.login-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #1a3a6b 0%, #2555a0 50%, #1a3a6b 100%);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.login-overlay.hidden { display: none; }
.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  text-align: center;
}
.login-logo {
  width: 72px; height: 72px;
  background: var(--amarillo);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900; font-size: 32px; color: var(--azul);
  margin: 0 auto 16px;
}
.login-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px; font-weight: 700; color: var(--azul);
  margin-bottom: 4px;
}
.login-subtitle { font-size: 13px; color: var(--gris-texto); margin-bottom: 28px; }
.login-field { text-align: left; margin-bottom: 16px; }
.login-field label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--azul); margin-bottom: 6px;
}
.login-field input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--gris-borde); border-radius: 8px;
  font-family: 'Barlow', sans-serif; font-size: 14px; outline: none;
  transition: border .18s;
}
.login-field input:focus { border-color: var(--azul-claro); box-shadow: 0 0 0 3px rgba(58,112,194,0.12); }
.login-btn {
  width: 100%; padding: 12px;
  background: var(--azul); color: white;
  border: none; border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 8px;
  transition: background .18s;
}
.login-btn:hover { background: var(--azul-medio); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error {
  background: #fde8e8; border: 1px solid #f5c6cb;
  color: #c0392b; border-radius: 7px;
  padding: 10px 14px; font-size: 13px;
  margin-bottom: 14px; display: none;
}
.login-error.show { display: block; }
.login-footer { font-size: 11px; color: #bbb; margin-top: 20px; }


/* ===== APP LOADER ===== */
#app-loader {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(255,255,255,0.8);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
}
.loader-spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--gris-borde);
  border-top-color: var(--azul);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }