:root {
  --dark: #3E2723; --mid: #6D4C41; --light: #D7CCC8; --paper: #F7F3F0; --gold: #B08D57;
  --red: #9E2A2B; --green: #2E7D32; --line: #E2D9D4; --text: #2b1d1a; --muted: #7a6a64;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: "Segoe UI", Calibri, system-ui, -apple-system, sans-serif; background: var(--paper);
  color: var(--text); font-size: 14px; }
a { color: var(--mid); }
header { background: var(--dark); color: #fff; }
header .wrap { display: flex; align-items: center; gap: 24px; padding: 10px 24px; max-width: 1280px; margin: 0 auto; }
header .marca { font-weight: 800; letter-spacing: .12em; font-size: 16px; color: #fff; text-decoration: none; }
header .marca small { display: block; font-weight: 500; font-size: 10px; letter-spacing: .3em; color: var(--gold); }
header nav { display: flex; gap: 4px; flex-wrap: wrap; }
header nav a { color: #e9dfdb; text-decoration: none; padding: 8px 12px; border-radius: 6px; }
header nav a:hover, header nav a.activo { background: rgba(255,255,255,.12); color: #fff; }
header .cta { margin-left: auto; }
main { max-width: 1280px; margin: 0 auto; padding: 24px; }
h1 { font-size: 22px; margin: 0 0 16px; color: var(--dark); }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--dark); text-transform: uppercase; letter-spacing: .06em; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 7px; padding: 9px 14px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--dark); color: #fff; }
.btn:hover { filter: brightness(1.15); }
.btn.sec { background: #fff; color: var(--dark); border: 1px solid var(--light); }
.btn.oro { background: var(--gold); }
.btn.rojo { background: var(--red); }
.btn.mini { padding: 5px 9px; font-size: 12px; }
.fila { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--light);
  border-radius: 6px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
input[readonly] { background: var(--paper); color: var(--muted); }
.campo { margin-bottom: 10px; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--dark); color: #fff; font-size: 12px; text-align: left; padding: 8px; font-weight: 600; }
td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: middle; }
tr:hover td { background: #fcfaf8; }
.num { text-align: right; white-space: nowrap; }
.centro { text-align: center; }
.muted { color: var(--muted); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.flash.ok { background: #e6f2e6; color: var(--green); }
.flash.error { background: #f6e3e3; color: var(--red); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 900px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.kpi b { display: block; font-size: 20px; color: var(--dark); margin-top: 2px; }
.kpi span { font-size: 12px; color: var(--muted); }
.estatus { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--light); color: var(--dark); }
.estatus.Enviada { background: #e3ecf6; color: #1f4e79; }
.estatus.Aceptada { background: #e3f1e3; color: var(--green); }
.estatus.Rechazada, .estatus.Vencida { background: #f6e3e3; color: var(--red); }
.estatus.Cancelada { background: #eee; color: #777; text-decoration: line-through; }
/* formulario de partidas */
#partidas td { padding: 6px 4px; }
#partidas input, #partidas select { padding: 6px 8px; }
#partidas .desc { min-width: 280px; }
.totales { width: 320px; margin-left: auto; }
.totales td { padding: 6px 8px; }
.totales tr.total td { background: var(--gold); color: #fff; font-weight: 700; font-size: 16px; }
.interno { border: 2px dashed var(--red); background: #fffafa; }
.interno h2 { color: var(--red); }
.alerta { color: var(--red); font-weight: 700; }
.pegajoso { position: sticky; bottom: 0; background: rgba(247,243,240,.96); padding: 12px 0; border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end; }
.letra { font-style: italic; color: var(--muted); font-size: 12px; }
dl.datos { display: grid; grid-template-columns: 150px 1fr; margin: 0; gap: 6px 10px; }
dl.datos dt { font-weight: 600; color: var(--muted); }
dl.datos dd { margin: 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--mid); }
.vacio { text-align: center; padding: 40px; color: var(--muted); }
/* sesión y usuarios */
header .sesion { display: flex; align-items: center; gap: 10px; margin-left: auto; }
header .cta + .sesion { margin-left: 0; }
header .sesion a { color: #fff; text-decoration: none; font-weight: 600; font-size: 13px; text-align: right; }
header .sesion a small { display: block; font-weight: 500; font-size: 10px; color: var(--gold); letter-spacing: .08em; }
header .sesion form { margin: 0; }
.acceso { max-width: 420px; margin: 40px auto; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text);
  margin: 0 0 6px; cursor: pointer; }
label.check input { width: auto; margin: 0; }
fieldset.permisos { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 4px; margin: 0 0 10px; }
fieldset.permisos legend { font-size: 12px; font-weight: 700; color: var(--mid); padding: 0 6px; text-transform: uppercase;
  letter-spacing: .06em; }
@media (max-width: 900px) {
  header .wrap { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  header .cta { margin-left: 0; }
  main { padding: 16px; }
  dl.datos { grid-template-columns: 120px 1fr; }
}
/* contratos */
.aviso { border-left: 4px solid var(--gold); }
.carga-taller { border-left: 4px solid var(--green); }
.carga-taller.carga-media { border-left-color: var(--gold); }
.carga-taller.carga-alta { border-left-color: var(--red); }
.documento { max-width: 860px; margin-left: auto; margin-right: auto; line-height: 1.6; text-align: justify; }
.documento p { margin: 0 0 10px; }
.documento h3 { font-size: 13px; margin: 16px 0 4px; color: var(--dark); letter-spacing: .03em; }
.documento .clausula { white-space: pre-line; }
.firmas small { margin-bottom: auto; font-weight: 700; font-size: 12px; color: var(--muted); padding-bottom: 12px; }
.firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 34px 0 8px; text-align: center; }
.firmas div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 130px;
  border-bottom: 1px solid var(--text); padding-bottom: 4px; position: relative; }
.firmas img { max-width: 100%; max-height: 80px; }
.firmas b { position: absolute; bottom: -22px; font-size: 12px; }
.firma-pad { position: relative; border: 1px dashed var(--mid); border-radius: 8px; background: #fff; }
.firma-pad canvas { display: block; width: 100%; height: 150px; touch-action: none; cursor: crosshair; }
.firma-pad .limpiar { position: absolute; top: 6px; right: 6px; }
/* producción */
.kanban { display: grid; grid-template-columns: repeat(7, minmax(210px, 1fr)); gap: 10px; overflow-x: auto;
  padding-bottom: 10px; align-items: start; }
.columna { background: #efe8e4; border-radius: 10px; min-height: 220px; display: flex; flex-direction: column; }
.columna.sobre { outline: 2px dashed var(--gold); background: #f6efe6; }
.columna header { background: var(--dark); color: #fff; font-size: 12px; font-weight: 700; padding: 8px 10px;
  border-radius: 10px 10px 0 0; display: flex; align-items: center; gap: 6px; }
.columna .paso { background: var(--gold); border-radius: 99px; width: 20px; height: 20px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; }
.columna .conteo { margin-left: auto; opacity: .7; }
.tarjetas { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tarjeta { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--mid); border-radius: 8px;
  padding: 9px 10px; font-size: 13px; }
.tarjeta[draggable] { cursor: grab; }
.tarjeta.arrastrando { opacity: .5; }
.tarjeta.atrasado { border-left-color: var(--red); }
.tarjeta.pausado { border-left-color: #999; background: #fafafa; }
.tarjeta.entregado { border-left-color: var(--green); opacity: .8; }
.tarjeta .cliente { font-weight: 600; margin-top: 4px; }
.tarjeta .desc, .tarjeta .pie { font-size: 12px; }
.tarjeta .acciones { display: flex; justify-content: space-between; margin-top: 8px; }
.tarjeta .acciones form { margin: 0; }
.btn[disabled] { opacity: .35; cursor: default; filter: none; }
.barra { height: 6px; background: var(--light); border-radius: 99px; overflow: hidden; margin: 7px 0 4px; }
.barra span { display: block; height: 100%; background: var(--gold); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--light); }
.timeline li { position: relative; padding: 0 0 16px 14px; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 3px; width: 14px; height: 14px;
  border-radius: 99px; background: #fff; border: 2px solid var(--light); }
.timeline li.hecho::before { background: var(--green); border-color: var(--green); }
.timeline li.actual::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(176,141,87,.25); }
.materiales { margin: 0 0 6px; padding-left: 18px; font-size: 13px; }
@media (max-width: 900px) {
  .firmas { grid-template-columns: 1fr; gap: 50px; }
  .kanban { grid-template-columns: repeat(7, 78vw); scroll-snap-type: x mandatory; }
  .columna { scroll-snap-align: start; }
}
/* estatus de cotizaciones: selector con color y notificaciones */
.estatus.q-borrador, select.q-borrador { background: #ecebe9; color: #5d5753; }
.estatus.q-enviada, select.q-enviada { background: #fdf0d5; color: #8a5a00; }
.estatus.q-aceptada, select.q-aceptada { background: #e3f1e3; color: var(--green); }
.estatus.q-rechazada, select.q-rechazada { background: #f6e3e3; color: var(--red); }
.estatus.q-cancelada, select.q-cancelada { background: #eee; color: #777; }
.estatus.q-cancelada { text-decoration: line-through; }
.estatus.q-vencida { background: #fbe4d6; color: #a8430f; }
.estatus-control { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.estatus-control form { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
select.sel-estatus { width: auto; padding: 4px 26px 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
  border: 1px solid transparent; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 9px) 55%; background-size: 4px 4px; background-repeat: no-repeat; }
select.sel-estatus:hover:not(:disabled) { border-color: currentColor; }
select.sel-estatus:disabled { cursor: not-allowed; opacity: .85; background-image: none; padding-right: 10px; }
select.sel-estatus option { background: #fff; color: var(--text); }
.candado { font-size: 13px; cursor: help; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px;
  max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--dark); color: #fff; padding: 11px 14px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); border-left: 4px solid var(--green); opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s; }
.toast.error { border-left-color: #e57373; }
.toast.visible { opacity: 1; transform: none; }
/* eliminar cotización y modal de confirmación */
.btn-eliminar svg { flex: none; }
.envoltura-eliminar { display: inline-block; }
.envoltura-eliminar .btn[disabled] { pointer-events: none; }
tr.saliendo td { opacity: 0; transition: opacity .25s; }
dialog.modal { border: 0; border-radius: 12px; padding: 22px; width: min(460px, calc(100vw - 32px));
  box-shadow: 0 18px 50px rgba(0,0,0,.3); color: var(--text); }
dialog.modal::backdrop { background: rgba(30,20,18,.45); }
dialog.modal h2 { margin-bottom: 8px; }
dialog.modal p { margin: 0 0 10px; line-height: 1.5; }
.modal-botones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
/* pestañas de configuración */
.pestanas { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: -4px 0 18px; flex-wrap: wrap; }
.pestanas a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-radius: 8px 8px 0 0;
  margin-bottom: -2px; border-bottom: 2px solid transparent; }
.pestanas a.activo { color: var(--dark); border-bottom-color: var(--gold); background: #fff; }
/* editor de texto enriquecido y documento del contrato */
.documento h1 { font-size: 18px; text-align: center; margin: 4px 0 14px; }
.documento h2 { font-size: 14px; margin: 18px 0 6px; text-transform: none; letter-spacing: .02em; }
.documento ul, .documento ol { margin: 0 0 10px; padding-left: 24px; }
.documento li { margin-bottom: 4px; }
.editor { border: 1px solid var(--light); border-radius: 10px; background: #fff; }
.editor-barra { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line);
  background: var(--paper); border-radius: 10px 10px 0 0; position: sticky; top: 0; z-index: 2; }
.editor-barra button { border: 1px solid var(--light); background: #fff; border-radius: 6px; padding: 5px 9px;
  font: inherit; font-size: 13px; cursor: pointer; color: var(--dark); min-width: 32px; }
.editor-barra button:hover { border-color: var(--gold); }
.editor-barra .sep { width: 1px; background: var(--light); margin: 2px 4px; }
.editor-area { min-height: 420px; max-height: 70vh; overflow: auto; padding: 18px 22px; outline: none; max-width: none; }
.editor-area:focus { box-shadow: inset 0 0 0 2px var(--gold); border-radius: 0 0 10px 10px; }
.editor-con-panel { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.panel-variables { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; margin: 0; }
.panel-variables h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mid); margin: 14px 0 6px; }
.panel-variables ul { list-style: none; margin: 0; padding: 0; }
.panel-variables li { margin-bottom: 7px; font-size: 12px; line-height: 1.35; }
.variable { display: block; border: 1px dashed var(--gold); background: #fdf8ef; color: var(--dark); border-radius: 6px;
  padding: 3px 7px; font: 600 12px/1.4 Consolas, "Courier New", monospace; cursor: pointer; margin-bottom: 2px; }
.variable:hover { background: #f6ead3; }
.firmas.documento { max-width: 860px; }
@media (max-width: 900px) {
  .editor-con-panel { grid-template-columns: 1fr; }
  .panel-variables { position: static; max-height: none; }
  .editor-area { padding: 14px; min-height: 320px; }
}
/* avances de producción: descripción larga y fotos */
.avance { margin-top: 8px; }
.texto-largo { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; font-size: 13px; color: var(--text); }
.texto-largo.plegado { max-height: calc(1.55em * 6); overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.ver-mas { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12px; font-weight: 700;
  color: var(--mid); cursor: pointer; text-decoration: underline; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 8px; }
.galeria .foto { position: relative; display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: var(--paper); margin: 0; cursor: zoom-in; }
.galeria .foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.galeria a.foto:hover img, .galeria a.foto:focus-visible img { transform: scale(1.04); }
.galeria a.foto:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.galeria .foto .accion, .galeria .foto .marcada, .galeria .foto .quitar-nueva { position: absolute; left: 4px; right: 4px;
  bottom: 4px; border-radius: 6px; font-size: 11px; font-weight: 700; text-align: center; padding: 3px 4px; }
.galeria.editable .foto { cursor: pointer; }
.galeria.editable .foto input { position: absolute; opacity: 0; pointer-events: none; }
.galeria.editable .foto .accion { background: rgba(255,255,255,.92); color: var(--red); }
.galeria.editable .foto .marcada { display: none; background: var(--red); color: #fff; }
.galeria.editable .foto:has(input:checked) img { opacity: .3; filter: grayscale(1); }
.galeria.editable .foto:has(input:checked) { border-color: var(--red); }
.galeria.editable .foto:has(input:checked) .accion { display: none; }
.galeria.editable .foto:has(input:checked) .marcada { display: block; }
.galeria.editable .foto:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.galeria.nuevas .foto { cursor: default; border-style: dashed; border-color: var(--gold); }
.galeria .quitar-nueva { left: auto; right: 4px; top: 4px; bottom: auto; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 99px; background: rgba(62,39,35,.85); color: #fff; font-size: 14px; cursor: pointer; }
.galeria .peso { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(255,255,255,.9);
  border-radius: 4px; padding: 1px 4px; color: var(--muted); }
.editar-avance { margin-top: 8px; }
.editar-avance summary { font-size: 13px; padding: 4px 0; }
.form-avance { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 6px; }
.form-avance > label { margin-top: 10px; }
.form-avance > label:first-child { margin-top: 0; }
.form-avance textarea { min-height: 130px; max-height: 60vh; resize: vertical; line-height: 1.5; }
.form-avance .contador { font-size: 11px; text-align: right; margin-top: 2px; }
.form-avance .contador.lleno { color: var(--red); font-weight: 700; }
.soltar { display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; margin: 10px 0 0 !important;
  padding: 14px; border: 2px dashed var(--light); border-radius: 10px; background: #fff; cursor: pointer; color: var(--dark);
  font-size: 13px; }
.soltar span { font-size: 11px; font-weight: 400; }
.soltar:hover, .soltar.sobre { border-color: var(--gold); background: #fdf8ef; }
.soltar:focus-within { outline: 2px solid var(--gold); }
.soltar input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.error-avance { margin: 10px 0 0; white-space: pre-line; }
.form-avance.enviando { opacity: .75; }
.form-avance.enviando .btn { pointer-events: none; }
.girando { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 99px; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
dialog.visor { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
  overflow: hidden; }
dialog.visor::backdrop { background: rgba(20,12,10,.92); }
dialog.visor[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
dialog.visor img { max-width: calc(100vw - 120px); max-height: calc(100vh - 90px); object-fit: contain; border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #fff; }
.visor-pie { color: #fff; font-size: 13px; margin-top: 10px; display: flex; gap: 12px; max-width: 90vw; }
.visor-pie .muted { color: #cbbdb7; }
.visor-titulo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visor-btn { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 44px; height: 44px;
  border-radius: 99px; font-size: 26px; line-height: 1; cursor: pointer; }
.visor-btn:hover, .visor-btn:focus-visible { background: rgba(255,255,255,.28); outline: none; }
.visor-btn.cerrar { top: 14px; right: 14px; font-size: 20px; }
.visor-btn.anterior { left: 14px; top: 50%; transform: translateY(-50%); }
.visor-btn.siguiente { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 900px) {
  .galeria { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  dialog.visor img { max-width: 100vw; max-height: calc(100vh - 150px); border-radius: 0; }
  .visor-btn.anterior, .visor-btn.siguiente { top: auto; bottom: 18px; transform: none; }
  .visor-pie { margin-bottom: 60px; }
}
/* contabilidad */
.perdida { color: var(--red) !important; }
.ganancia { color: var(--green) !important; }
.ok-txt { color: var(--green); font-weight: 700; }
.estatus.p-borrador { background: #ecebe9; color: #5d5753; }
.estatus.p-contabilizada { background: #e3f1e3; color: var(--green); }
.estatus.p-cancelada { background: #eee; color: #777; text-decoration: line-through; }
.estatus.per-abierto { background: #e3f1e3; color: var(--green); }
.estatus.per-revision { background: #fdf0d5; color: #8a5a00; }
.estatus.per-cerrado { background: #ecebe9; color: var(--dark); }
.alertas ul { margin: 0; padding-left: 18px; }
.alertas li { margin-bottom: 4px; }
.pestanas.sub { margin-top: -8px; }
.pestanas.sub a { font-size: 13px; padding: 7px 11px; }
.filtro-periodo { margin: 0; }
.grid-cuentas { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .grid-cuentas { grid-template-columns: 1fr; } #form-cuenta { position: static !important; } }
.grafica { width: 100%; height: auto; display: block; }
.grafica .rejilla { stroke: var(--line); stroke-width: 1; }
.grafica .base { stroke: var(--light); stroke-width: 1; }
.grafica .eje { fill: var(--muted); font-size: 11px; }
.grafica .hit { fill: transparent; }
.grafica .banda:hover .hit, .grafica .banda:focus .hit { fill: rgba(176,141,87,.08); }
.grafica .banda:focus { outline: none; }
.leyenda { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.barras-h { display: flex; flex-direction: column; gap: 8px; }
.fila-barra { display: grid; grid-template-columns: minmax(0, 180px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.fila-barra .etq { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-barra .pista { height: 10px; background: var(--paper); border-radius: 0 4px 4px 0; }
.fila-barra .pista i { display: block; height: 100%; background: var(--mid); border-radius: 0 4px 4px 0; min-width: 2px; }
.fila-barra b { font-weight: 600; }
.documento-reporte table td { border-bottom: 1px solid var(--line); }
.documento-reporte .sangria { padding-left: 24px; }
.documento-reporte tr.subtitulo td { font-weight: 700; color: var(--mid); background: var(--paper); }
.documento-reporte tr.subtotal td { font-weight: 700; border-top: 1px solid var(--light); }
.documento-reporte tr.total-reporte td, tr.totales-poliza td { font-weight: 700; background: #fdf8ef; }
pre.json { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; max-width: 520px; margin: 2px 0 6px;
  background: var(--paper); padding: 6px 8px; border-radius: 6px; }
@media (max-width: 700px) { .fila-barra { grid-template-columns: 1fr auto; } .fila-barra .pista { grid-column: 1 / -1; grid-row: 2; } }
@media print {
  header, .pestanas, .filtro-periodo, .pegajoso, .btn, form.fila { display: none !important; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; }
}

/* Contabilidad · ingresos, gastos y proveedores (fase 4) */
.grid-mov { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .grid-mov { grid-template-columns: 1fr; } }
fieldset.limpio { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.limpio:disabled input, fieldset.limpio:disabled select, fieldset.limpio:disabled textarea {
  background: var(--paper); color: var(--text); opacity: 1; }
.importes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 12px; }
@media (max-width: 700px) { .importes { grid-template-columns: 1fr 1fr; } }
.total-mov { display: block; font-size: 20px; font-weight: 700; color: var(--dark); padding: 5px 0; }
.nota { font-size: 12px; margin: 6px 0 0; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; }
button.enlace { background: none; border: 0; padding: 2px 0; color: var(--mid); font: inherit; font-size: 12px;
  text-decoration: underline; cursor: pointer; }
.rojo-txt { color: var(--red) !important; }
.pendiente-txt { color: #8a5a00; }
.aplicar-anticipo { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 10px; }
ul.adjuntos { list-style: none; margin: 0 0 12px; padding: 0; }
ul.adjuntos li { padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
ul.adjuntos li span { display: block; font-size: 12px; }
ul.ayuda { margin: 0; padding-left: 18px; font-size: 13px; }
ul.ayuda li { margin-bottom: 6px; }
tr.cancelado td { color: var(--muted); }
tr.cancelado td b { text-decoration: line-through; }
.estatus.m-cobrado, .estatus.m-pagado { background: #e3f1e3; color: var(--green); }
.estatus.m-por-cobrar, .estatus.m-por-pagar { background: #fdf0d5; color: #8a5a00; }
.estatus.m-parcial, .estatus.m-aplicado, .estatus.m-aplicada { background: #e4ecf7; color: #2d5a8c; }
.estatus.m-cancelada { background: #eee; color: #777; text-decoration: line-through; }
.saldo-barra { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 6px 0 2px; }
.saldo-barra i { display: block; height: 100%; background: var(--green); }
tr.conciliado td { color: var(--muted); }
.tramo-vencido { color: var(--red); }
.estatus.m-cancelado { background: #eee; color: #777; text-decoration: line-through; }
.estatus.m-vencido { background: #f6e3e3; color: var(--red); }
