:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #ddd;
  --text: #1a1a1a;
  --text-muted: #666666;
  --black: #000000;

  --accent: #d4af37;
  --accent-hover: #c29a2e;
  --accent-contrast: #1a1206;
  --accent-ring: #a9791f;
  --danger: #b3261e;
  --danger-hover: #8f1d17;
}

body {
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--text);
}

a:hover {
  color: var(--black);
}

.topbar {
  background: var(--surface);
  color: var(--text);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1;
}

.brand-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--accent);
}

.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.layout {
  display: flex;
  align-items: flex-start;
}

.sidebar {
  width: 190px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.5rem 1rem;
  background: var(--black);
  box-sizing: border-box;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}

.sidebar a {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.sidebar a:hover {
  background: rgba(212, 175, 55, 0.14);
  color: var(--accent);
}

.sidebar a:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-ring);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.detail-grid .field-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-grid .field-value {
  font-size: 0.95rem;
  margin-top: 0.15rem;
  color: var(--text);
}

.detail-grid-compact .field-label {
  font-size: 0.8rem;
}

.detail-grid-compact .field-value {
  font-size: 1.15rem;
  font-weight: 600;
}

.topbar .tagline {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text-muted);
}

main {
  flex: 1;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
  min-width: 0;
}

main.main-wide {
  max-width: none;
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Tipografia de reportes: todo con selector main.main-wide (clase que solo
   usan los reporte_*.html y reportes.html) para no tocar Facturas,
   Documentos Soporte ni el resto de la app. */
main.main-wide h2 { font-size: 1.1rem; }
main.main-wide h3 { font-size: 0.95rem; }
main.main-wide .hint { font-size: 0.68rem; }
main.main-wide button { font-size: 0.8rem; padding: 0.45rem 0.9rem; }
main.main-wide .compact-table th,
main.main-wide .compact-table td { font-size: 0.7rem; padding: 0.3rem 0.35rem; }
main.main-wide .table-fit th,
main.main-wide .table-fit td { font-size: 0.68rem; padding: 0.25rem 0.3rem; }
main.main-wide .review-table th,
main.main-wide .review-table td { font-size: 0.72rem; }
/* numeros de ancho fijo para que las columnas de plata alineen bien */
main.main-wide .review-table,
main.main-wide .resumen-table { font-feature-settings: "tnum"; }

.compact-table th,
.compact-table td {
  padding: 0.35rem 0.4rem;
  font-size: 0.78rem;
}

.compact-table .truncate {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tabla con columnas muy fijas para que quepa en pantalla sin scroll
   horizontal (ver reporte_conciliacion_iva.html) - table-layout:fixed
   respeta siempre el ancho del contenedor en vez de crecer con el
   contenido; el texto largo se trunca con "..." (ver .truncate abajo). */
.table-fit {
  table-layout: fixed;
  width: 100%;
}

.table-fit th,
.table-fit td {
  padding: 0.25rem 0.3rem;
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-fit .truncate {
  max-width: none;
}

.proveedores-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.ingest-options {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.ingest-single {
  display: flex;
  justify-content: center;
}

.ingest-single .card {
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.ingest-single .card form {
  text-align: left;
}

.dropzone {
  border: 2px dashed #aaa;
  border-radius: 8px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  margin-top: 0.5rem;
  background: #fafafa;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone p {
  margin: 0;
  color: var(--text-muted);
  pointer-events: none;
}

.dropzone-active {
  border-color: var(--black);
  background: #eeeeee;
}

.dropzone-has-file {
  border-color: var(--black);
  border-style: solid;
}

.dropzone-has-file p {
  color: var(--black);
  font-weight: 600;
}

.progress-widget-title {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  text-decoration: none;
}

.progress-widget-title:hover {
  text-decoration: underline;
}

.progress-bar {
  background: #e6e6e6;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.cuentas-cobro-progreso {
  margin: 0.5rem 0 1rem;
  max-width: 480px;
}

.progress-bar-fill {
  background: var(--black);
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.progress-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.progress-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.progress-widget-percent {
  margin: 0.6rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Reportes: encabezado + barra de acciones */
.report-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.report-header h2 {
  margin: 0;
}

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
}

/* Reportes: seccion de KPIs (stat tiles), mismo patron que .progress-stats */
.stat-section {
  margin-bottom: 1.25rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-tile {
  padding: 0.25rem 0.75rem;
  border-left: 3px solid transparent;
}

.stat-tile-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.stat-tile-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-tile-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.stat-tile-accent { border-left-color: var(--accent); }
.stat-tile-danger { border-left-color: var(--danger); }
.stat-tile-ok { border-left-color: #155724; }
.stat-tile-warn { border-left-color: #856404; }

/* Reportes: barras horizontales (gasto/saldo/conteo por categoria) */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bar-chart-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.72rem;
}

.bar-track {
  background: #e6e6e6;
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.bar-fill-ok { background: #155724; }
.bar-fill-warn { background: #856404; }
.bar-fill-danger { background: var(--danger); }
.bar-fill-info { background: #1a4d8f; }
.bar-fill-neutral { background: #666666; }
.bar-fill-accent { background: var(--accent); }

/* Version delgada para meter dentro de una celda de tabla */
.bar-track-mini {
  background: #e6e6e6;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  min-width: 60px;
}

.bar-fill-mini {
  height: 100%;
  border-radius: 999px;
}

/* Barra angosta para "% ejecutado" dentro de una celda de tabla */
.mini-progress {
  background: #e6e6e6;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  min-width: 70px;
}

.mini-progress-fill {
  height: 100%;
  border-radius: 999px;
}

.mini-progress-fill-ok { background: #155724; }
.mini-progress-fill-warn { background: #856404; }
.mini-progress-fill-danger { background: var(--danger); }

/* Sidebar: subtitulo para agrupar enlaces dentro de un .sidebar-group */
.sidebar-subheading {
  font-size: 0.68rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.9rem 0.2rem 1.1rem;
}

/* Pagina indice de reportes: titulo de cada grupo tematico */
.reportes-group-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 1.5rem 0 0.5rem;
}

.reportes-group-title:first-child {
  margin-top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  flex: 1;
  min-width: 300px;
}

.login-page {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
}

.login-card {
  max-width: 360px;
  width: 100%;
  flex: none;
}

.login-card h2 {
  margin-top: 0;
}

.sidebar-empresa-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  font-size: 0.8rem;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
}

.sidebar-empresa-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-empresa form {
  padding: 0.3rem 0.9rem 0.6rem;
}

.sidebar-empresa select {
  width: 100%;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sidebar-group-toggle {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  font-size: 0.8rem;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s, color 0.15s;
}

.sidebar-group-toggle::-webkit-details-marker {
  display: none;
}

.sidebar-group-toggle:hover {
  background: rgba(212, 175, 55, 0.14);
  color: var(--accent);
}

.sidebar-group-toggle:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-ring);
}

.sidebar-group a {
  display: block;
  padding: 0.45rem 0.9rem 0.45rem 1.4rem;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  letter-spacing: normal;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #cfcfcf;
  white-space: normal;
  word-break: break-word;
}

.sidebar-group a:hover {
  color: var(--accent);
}

.sidebar-user {
  margin-top: auto;
  padding: 0.6rem 0.9rem 0;
  color: #bbb;
  font-size: 0.8rem;
  word-break: break-all;
}

.sidebar-logout-form {
  padding: 0 0.9rem;
}

.sidebar-logout-form button {
  width: 100%;
  background: transparent;
  border: 1px solid #555;
  color: #fff;
}

.sidebar-logout-form button:hover {
  background: #2a2a2a;
}

.sidebar-brand-footer {
  margin-top: 0.75rem;
  padding: 0.6rem 0.9rem 0;
  text-align: center;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.65rem;
  color: var(--accent);
  opacity: 0.85;
}

.login-undergold-logo {
  display: block;
  max-width: 160px;
  width: 60%;
  margin: 0 auto 1.25rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.filtro-proveedor-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.filtro-proveedor-box label {
  font-weight: 600;
  white-space: nowrap;
}

.filtro-proveedor-box input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 0.5rem 0;
}

.conceptos-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1100px;
}

.conceptos-table th,
.conceptos-table td {
  border: 1px solid var(--border);
  padding: 0.4rem;
  text-align: left;
  vertical-align: top;
}

.conceptos-table th {
  background: var(--bg);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.conceptos-table input,
.conceptos-table select {
  width: 100%;
  min-width: 90px;
  margin: 0;
}

.conceptos-table input.is-manual {
  border-color: #2e7d32;
  border-width: 2px;
  background: #f1f8f2;
}

.concepto-acciones {
  white-space: nowrap;
}

.concepto-acciones button {
  margin-top: 0;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.concepto-duplicar {
  background: #2e2e2e;
}

.badge {
  display: inline-block;
  background: #eee;
  color: var(--text-muted);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
}

.badge-warn { background: #fff3cd; color: #856404; }
.badge-ok { background: #d4edda; color: #155724; }
.badge-error { background: #f8d7da; color: #721c24; }
.badge-info { background: #cce5ff; color: #004085; }

form label {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

form input[type="password"],
form input[type="text"],
form input[type="date"],
form input[type="file"],
form select {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  box-sizing: border-box;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
}

button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--black);
  border-radius: 6px;
  background: #2e2e2e;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
}

button:hover {
  background: var(--black);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

button:active {
  background: var(--black);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transform: translateY(1px);
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-ring);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-contrast);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

button.primary:active {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transform: translateY(1px);
}

.hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.reportes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reportes-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
}

.reportes-list a {
  font-weight: 600;
  text-decoration: none;
}

.reportes-list a:hover {
  text-decoration: underline;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.alert-info {
  background: #e7f1ff;
  color: #1a4d8f;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.items-list {
  margin: 0.3rem 0 0;
  padding-left: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.review-table, .resumen-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.review-table th, .resumen-table th {
  background: #f0f0f0;
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 2;
}

.review-table th, .review-table td, .resumen-table th, .resumen-table td {
  border: 1px solid var(--border);
  padding: 0.5rem;
  font-size: 0.85rem;
  text-align: left;
}

.review-table thead tr.filter-row th {
  background: #ffffff;
  padding: 0.3rem 0.4rem;
  font-weight: normal;
}

.review-table thead tr.filter-row input,
.review-table thead tr.filter-row select {
  width: 100%;
  font-size: 0.78rem;
  padding: 0.15rem 0.25rem;
  margin-top: 0;
}

.review-table .cufe {
  font-family: monospace;
  font-size: 0.7rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.row-duplicate, .row-skipped { background: #fffbea; }
.row-error { background: #fdecea; }

.sortable-header {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-header::after {
  content: "⇅";
  opacity: 0.35;
  margin-left: 0.35rem;
  font-size: 0.8em;
}

.sortable-header.sorted-asc::after {
  content: "↑";
  opacity: 1;
}

.sortable-header.sorted-desc::after {
  content: "↓";
  opacity: 1;
}

.header-label {
  display: inline-block;
  margin-bottom: 0.3rem;
}

.column-filter-select {
  width: 100%;
  max-width: 160px;
  box-sizing: border-box;
  padding: 0.25rem 0.35rem;
  font-size: 0.75rem;
  font-weight: normal;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.row-created { background: #eaf7ec; }

.warn {
  color: #b45309;
  font-size: 0.75rem;
}

.month-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.month-filter-form label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.month-filter-form select {
  width: auto;
  margin-top: 0;
  padding: 0.4rem 0.7rem;
}

.filter-bar {
  margin-bottom: 1rem;
}

.filter-bar a {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  margin-right: 0.5rem;
  border-radius: 999px;
  border: 1px solid #ccc;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-bar a:hover {
  background: var(--black);
  color: #ffffff;
  border-color: var(--black);
}

.filter-bar a.filter-active {
  background: var(--black);
  color: #ffffff;
  border-color: var(--black);
}

.inline-form {
  display: inline-block;
  margin: 0;
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

button.danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

button.danger:active {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transform: translateY(1px);
}

button.danger.small {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.detail-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
}

.detail-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.detail-nav a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.detail-nav a.detail-nav-next {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.detail-nav a.detail-nav-next:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Filtro de fecha: boton de buscar (lupa) despues del selector de dia */
.month-filter-form .icon-button {
  margin-top: 0;
  padding: 0.4rem 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Avance de cargas: periodo mostrado y franja de acuses DIAN */
.acuse-tile {
  display: block;
  padding: 0.25rem 0.6rem;
  border-left: 3px solid transparent;
  color: inherit;
  text-decoration: none;
}

.acuse-tile:hover {
  background: rgba(0, 0, 0, 0.04);
}

.acuse-tile-ok { border-left-color: #155724; }
.acuse-tile-danger { border-left-color: var(--danger); }

.acuse-tabs a { margin-right: 0.75rem; }

/* Avance de cargas + acuses DIAN en UNA linea (ver _progress_widget.html): texto y
   numeros del mismo tamano muy pequeno, todo el ancho, sin tarjetas. Los enlaces son
   mini botones con el mismo lenguaje de .detail-nav y .filter-bar (pildora, dorado al
   pasar el mouse). */
.avance-linea {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.9rem;
  margin-bottom: 0.6rem;
  padding: 0.25rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.65rem;
  line-height: 1.3;
  color: var(--text-muted);
}

.avance-linea b {
  font-size: inherit;
  font-weight: 600;
  color: var(--text);
}

.avance-linea .progress-widget-title {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  color: var(--text);
}

.avance-bloque {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--border);
}

.avance-barra {
  display: inline-block;
  width: 70px;
  height: 5px;
  background: #e6e6e6;
  border-radius: 999px;
  overflow: hidden;
}

.avance-barra-relleno {
  display: block;
  height: 100%;
  background: var(--black);
  border-radius: 999px;
}

.avance-linea a.avance-enlace {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.avance-linea a.avance-enlace:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.avance-linea a.avance-enlace:hover b { color: inherit; }
.avance-linea a.avance-ok b { color: #155724; }
.avance-linea a.avance-mal b { color: var(--danger); }

/* Barras finas de Facturas (sincronizar y causacion automatica): mismo lenguaje que
   .avance-linea - una linea de todo el ancho, letra y controles muy pequenos - y los
   botones e inputs conservan su aspecto (negro/dorado). Las usan todas las pantallas
   con 'subir archivo' (ver _barra_subida.html). */
.barra-fina {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.9rem;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.65rem;
  line-height: 1.3;
  color: var(--text-muted);
}

.barra-fina-titulo {
  font-weight: 600;
  color: var(--text);
  cursor: help;
}

.barra-fina-info { color: var(--text-muted); font-weight: 400; }

.barra-fina-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin: 0;
}

form.barra-fina-form:first-of-type { flex: 1 1 auto; }

.barra-fina label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  font-size: inherit;
  color: var(--text-muted);
}

.barra-fina input[type="text"] {
  width: 7rem;
  margin: 0;
  padding: 0.1rem 0.4rem;
  font-size: inherit;
}

.barra-fina input[type="checkbox"] { margin: 0; }

.barra-fina button {
  margin-top: 0;
  padding: 0.15rem 0.75rem;
  font-size: inherit;
}

.barra-fina-dropzone {
  flex: 1 1 14rem;
  min-width: 12rem;
  margin: 0;
  padding: 0.15rem 0.8rem;
  border-width: 1px;
  border-radius: 6px;
}

.barra-fina-dropzone p { font-size: inherit; }
