/* ============================================================================
   Facturas SAT · Portal FEL — Tema claro, elegante y formal
   ============================================================================ */
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --border: #e6e9f2;
  --border-soft: #eef1f7;
  --text: #16233b;
  --muted: #667085;
  --navy: #0f2b4c;
  --navy-2: #1e3a8a;
  --accent: #1d4ed8;
  --accent-dark: #1e40af;
  --accent-soft: #eef4ff;
  --green: #15803d;
  --red: #c0392b;
  --amber: #b45309;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 16px -4px rgba(16, 24, 40, 0.12), 0 2px 6px -2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 24px 64px -12px rgba(15, 23, 42, 0.28), 0 8px 24px -8px rgba(15, 23, 42, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------ Encabezado ------------------------------ */
.topbar {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 16px 0;
  box-shadow: var(--shadow-md);
  margin-bottom: 26px;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 800; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.brand-text h1 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: 0.01em; line-height: 1.1; }
.brand-text .subtitle { color: rgba(255, 255, 255, 0.72); font-size: 12.5px; }
.sesion-top {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
}
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #d9f7e6;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 5px 12px;
  border-radius: 999px;
}
.btn-sm { padding: 7px 12px; font-size: 13px; }
.topbar .btn-ghost { color: rgba(255, 255, 255, 0.92); }
.topbar .btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.topbar .btn-secondary { background: rgba(255, 255, 255, 0.14); color: #fff; }
.topbar .btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); }

main { padding-bottom: 70px; }

/* ------------------------------ Tarjetas ------------------------------ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 22px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--text); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.card-head h2 { margin: 0; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.form-actions { display: flex; align-items: flex-end; }

/* ------------------------------ Inputs ------------------------------ */
input, select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}
input::placeholder { color: #a3adc2; }

/* ------------------------------ Botones ------------------------------ */
.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.06s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(29, 78, 216, 0.55);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 16px -4px rgba(29, 78, 216, 0.65); filter: brightness(1.04); }
.btn-secondary { background: var(--accent-soft); color: var(--accent-dark); }
.btn-secondary:hover:not(:disabled) { background: #e2eafd; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-soft); }

.hint { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.muted { color: var(--muted); }

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12.5px;
  font-weight: 700;
  vertical-align: middle;
}

/* ------------------------------ Progreso ------------------------------ */
.progress-track {
  height: 8px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #3b82f6);
  border-radius: 999px;
  transition: width 0.2s;
}
.progress span { font-size: 12.5px; }

/* ------------------------------ Tablas ------------------------------ */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.table-wrap table { border-collapse: separate; border-spacing: 0; }
table { width: 100%; font-size: 12.5px; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  background: #f2f4f9;
  color: #41516b;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap; /* datos cortos (fecha, NIT, totales…): una sola línea */
}
/* Solo las columnas de texto largo (nombres/descripciones) van en multilínea */
#tabla td:nth-child(5),
#an-tabla td:nth-child(1),
.factura-items td:nth-child(2) {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fafbfd; }
tbody tr:hover { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.col-check { width: 30px; }

/* Ancho mínimo para las columnas de texto largo (respetan el multilínea) */
#an-tabla th:nth-child(1), #an-tabla td:nth-child(1) { min-width: 190px; }
#tabla th:nth-child(5), #tabla td:nth-child(5) { min-width: 160px; }
.factura-items th:nth-child(2), .factura-items td:nth-child(2) { min-width: 170px; }

.estado-vigente { color: var(--green); font-weight: 700; }
.estado-anulada { color: var(--red); font-weight: 700; }
.estado-rechazada { color: var(--red); font-weight: 700; }
.estado-desconocido { color: var(--amber); font-weight: 700; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent-dark); }
.link-btn:disabled { opacity: 0.5; cursor: wait; }

/* Código interno bajo la descripción (leyenda, sin perder la descripción de la factura) */
.prod-codigo {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-codigo {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 10.5px;
  font-weight: 600;
}
td.acciones { white-space: nowrap; }
td.acciones .link-btn + .link-btn { margin-left: 8px; }

/* Vista de códigos: formulario en grid alineado */
#form-codigo .form-actions { margin: 0; }

/* Normalización en masa */
.masivo-busqueda {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.masivo-q { flex: 1 1 260px; min-width: 0; }
.masivo-filtrar-label { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.btn-fila {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 8px;
}
.btn-fila:hover { background: #f1f5f9; color: var(--red); }
.masivo-codigo { min-width: 0; }
.masivo-tipo { flex: 0 1 190px; min-width: 0; }
.masivo-radios { display: flex; align-items: center; gap: 14px; }
.masivo-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.masivo-radio input { accent-color: var(--accent); }
.badge-descartado {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.masivo-busqueda .btn { flex: 0 0 auto; }
#masivo-tabla .masivo-cant {
  width: 90px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
}
#masivo-tabla input[type="checkbox"] { transform: scale(1.1); }

/* Combobox con búsqueda en vivo (para elegir código, puede haber miles) */
.combo { position: relative; }
.combo input { width: 100%; }
.combo-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 264px;
  overflow: auto;
  padding: 4px;
}
.combo-opt {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 8px;
}
.combo-opt.active { background: var(--accent); color: #fff; }
.combo-empty { padding: 10px 12px; color: var(--muted); font-size: 13px; }
#masivo-codigo { flex: 1 1 220px; min-width: 0; }

/* ------------------------------ Toast ------------------------------ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 13px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  max-width: 90vw;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
.hidden { display: none !important; }

/* ------------------------------ Login ------------------------------ */
.login-card { max-width: 460px; margin: 60px auto; }
.login-card h2 { font-size: 22px; font-weight: 800; color: var(--navy); }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.login-form .btn { align-self: stretch; margin-top: 6px; padding: 12px; font-size: 15px; }

/* ------------------------------ Resumen / acciones ------------------------------ */
.resumen { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.resumen .mini {
  flex: 1 1 150px;
  background: linear-gradient(180deg, #fafbfd, #f5f6fa);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}
.resumen .mini .k { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.resumen .mini .v { font-size: 19px; font-weight: 800; color: var(--text); margin-top: 3px; }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }

/* ------------------------------ Menú del panel (dashboard) ------------------------------ */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.dash-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.08s, box-shadow 0.15s, border-color 0.15s;
}
.dash-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.dash-tile:active { transform: translateY(0); }
.dash-tile:disabled { opacity: 0.55; cursor: not-allowed; }
.dash-ico {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  background: var(--accent-soft);
  border-radius: 12px;
}
.dash-t { font-size: 15px; font-weight: 700; color: var(--text); }
.dash-d { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* Barra de PERIODO DE TRABAJO (siempre visible) */
.periodo-bar {
  background: linear-gradient(120deg, #eaf1ff, #f4f8ff);
  border-bottom: 1px solid #dbe7ff;
  box-shadow: var(--shadow-sm);
}
.periodo-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
}
.periodo-ico { font-size: 22px; }
.periodo-txt { font-size: 16px; font-weight: 600; color: var(--text); }
.periodo-txt b { font-size: 18px; font-weight: 800; color: var(--navy); letter-spacing: 0.01em; }
.periodo-tipo { font-size: 13px; font-weight: 700; color: var(--accent-dark); }
.periodo-estado {
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: var(--amber);
}
.periodo-estado.sellado { background: #dcfce7; color: var(--green); }

/* ------------------------------ Análisis ------------------------------ */
.an-head { margin: 6px 0 18px; }
.an-head h2 { font-size: 22px; font-weight: 800; color: var(--navy); margin: 0; }
.an-head .muted { margin: 2px 0 0; font-size: 13px; }
.an-select { min-width: 0; flex: 0 1 320px; max-width: min(460px, 100%); }
.an-selector { flex: 1 1 auto; min-width: 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.an-search { min-width: 0; flex: 1 1 220px; max-width: 320px; }
.chart-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid #d3e0fb;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  margin: 10px 0 6px;
}
.chart-wrap { position: relative; height: 320px; margin: 12px 0 18px; }
#an-chart { cursor: pointer; }
#an-prod-nombre { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
table.compact { font-size: 12.5px; }
table.compact td, table.compact th { padding: 8px 12px; }

/* ------------------------------ Modal (carga) ------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 34, 0.52);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
}
.modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 26px 30px;
  width: min(440px, 92vw);
  animation: modal-in 0.18s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal h3 { margin: 0 0 14px; font-size: 17px; font-weight: 700; color: var(--text); }
.modal .progress-track { margin: 8px 0 14px; }
.modal .muted { font-size: 13px; margin: 0; }
.modal-acciones { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.modal-acciones .btn { width: 100%; padding: 11px; font-size: 14px; }
/* Modal de normalización: formulario limpio y botones en fila */
.norm-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.norm-campo { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.norm-campo input { width: 100%; }
.norm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-acciones-row { display: flex; gap: 8px; margin-top: 18px; }
.modal-acciones-row .btn { flex: 1 1 auto; padding: 10px; }
.modal-lg { width: min(780px, 94vw); max-height: 88vh; overflow: auto; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px; height: 32px;
  border: none;
  border-radius: 9px;
  background: #f2f4f9;
  color: #41516b;
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  z-index: 2;
}
.modal-close:hover { background: #e4e8f1; }

/* ------------------------------ Modal de factura (estilo factura) ------------------------------ */
.factura { font-size: 13.5px; color: var(--text); }
.factura-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-soft);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.factura-emisor { display: flex; gap: 12px; align-items: center; }
.factura-marca {
  width: 48px; height: 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--navy));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.factura-empresa { font-weight: 800; font-size: 15px; color: var(--text); }
.factura-nit { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.factura-titulo { text-align: right; }
.factura-doc { font-size: 20px; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: 0.04em; }
.factura-num { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 2px; }
.factura-uuid { font-size: 11px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.factura-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  font-size: 12.5px;
  background: #fafbfd;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.factura-meta span { color: var(--muted); }
.factura-items { width: 100%; border-collapse: collapse; }
.factura-items thead th { background: var(--accent-soft); color: var(--accent-dark); }
.factura-totales {
  margin-top: 16px;
  margin-left: auto;
  width: min(340px, 100%);
  border-top: 2px solid var(--border-soft);
  padding-top: 12px;
}
.factura-total-fila {
  display: flex; justify-content: space-between;
  padding: 5px 0; font-size: 13.5px; color: var(--muted);
}
.factura-total-fila.total {
  font-size: 17px; font-weight: 800; color: var(--navy);
  border-top: 1px solid var(--border);
  margin-top: 8px; padding-top: 10px;
}

/* ------------------------------ Paginación ------------------------------ */
.paginacion {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 0 8px;
}
.paginacion .btn { font-size: 13px; padding: 7px 14px; }
.paginacion .btn:disabled { opacity: 0.4; }
#pag-info { font-size: 13px; color: var(--muted); }

/* ------------------------------ Scrollbars (elegante) ------------------------------ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9d2e0; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #aab6c9; background-clip: padding-box; }

/* ============ Ajuste global: letra MÁS PEQUEÑA en toda la app ============ */
body { font-size: 13px; }
h1, .brand-text h1 { font-size: 19px; }
h2, .card h2 { font-size: 14px; }
table { font-size: 11px; }
thead th { font-size: 9.5px; }
.btn { font-size: 12.5px; padding: 8px 13px; }
.btn-sm { font-size: 12px; padding: 6px 10px; }
input, select { font-size: 12.5px; padding: 8px 10px; }
.hint { font-size: 11.5px; }
.badge { font-size: 11.5px; }
.link-btn { font-size: 12px; }
.grid label, .login-form label { font-size: 11.5px; }
.dash-t { font-size: 13px; }
.dash-d { font-size: 11.5px; }
.dash-ico { font-size: 19px; width: 38px; height: 38px; }
.periodo-txt { font-size: 14px; }
.periodo-txt b { font-size: 15px; }
.periodo-tipo { font-size: 12px; }
.periodo-estado { font-size: 11.5px; }
.sesion-top { font-size: 12px; }
.pill { font-size: 11.5px; }
.an-head h2 { font-size: 18px; }
#an-prod-nombre { font-size: 13px; }
.modal h3 { font-size: 15px; }
.modal .muted { font-size: 12px; }
.combo-opt, .combo-empty { font-size: 12px; }
.resumen .mini .k { font-size: 10px; }
.resumen .mini .v { font-size: 16px; }
.factura { font-size: 12px; }
.factura-marca { font-size: 19px; width: 42px; height: 42px; }
.factura-empresa { font-size: 13px; }
.factura-nit { font-size: 11.5px; }
.factura-doc { font-size: 17px; }
.factura-num { font-size: 13px; }
.factura-uuid { font-size: 10px; }
.factura-meta { font-size: 11.5px; }
.factura-total-fila { font-size: 12px; }
.factura-total-fila.total { font-size: 15px; }
.paginacion .btn { font-size: 12px; }
#pag-info { font-size: 12px; }
.login-card h2 { font-size: 19px; }
.login-form .btn { font-size: 13px; padding: 10px; }
.chart-hint { font-size: 11.5px; }
.prod-codigo { font-size: 10px; }
.badge-codigo { font-size: 9.5px; }
.masivo-filtrar-label { font-size: 12px; }
.btn-fila { font-size: 14px; }
.masivo-radio { font-size: 12px; }

/* Marca clicable -> menú principal */
#brand-home { cursor: pointer; }
/* Combobox del proveedor en el análisis (buscador integrado) */
.an-selector .combo { flex: 1 1 320px; min-width: 0; max-width: 460px; }

/* Selector de tipo (compras/ventas) en el análisis */
.an-tipo {
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d9e6;
  background: #fff;
  color: #1f2937;
}
/* Modal sincronizar: tipo de DTE + info de meses sellados */
.sync-form { margin: 10px 0 6px; }
.sync-form select {
  font-size: 12.5px;
  padding: 8px 10px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d1d9e6;
  background: #fff;
  color: #1f2937;
}
#sync-info { line-height: 1.55; }

/* Menú contextual de fila (clic derecho) en Normalizar en masa */
.ctx-menu {
  position: fixed;
  z-index: 100;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 5px;
  display: flex;
  flex-direction: column;
}
.ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  border-radius: 7px;
  cursor: pointer;
}
.ctx-item:hover { background: #f1f5f9; }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover { background: #fef2f2; }
.ctx-item + .ctx-item { margin-top: 2px; }

/* Badge de contraparte en Normalizar en masa (se llega desde «Por normalizar») */
.masivo-provider {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #1d4ed8;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}
