/* GESSO ERP · «Cierre del mes» (js/cierremes.js; 18/11/2026). Colores de app.css (--line, --muted, --accent…). */
.cm .win-head { flex-wrap: wrap; gap: 6px 8px; }
.cm .win-head button { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.cm .win-head .cm-cerrar { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.cm .win-head .cm-cerrar.cm-reabrir { background: #fff; color: var(--accent); }
.cm-mesl { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.cm-mes { height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; background: #fff; }
.cm-estado { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-weight: 600; font-size: 12px; }
.cm-estado.abierto { background: #fff4d6; color: #7a5200; }
.cm-estado.curso { background: #eef0f4; color: #3a4556; }
.cm-estado.cerrado { background: #e3f3e8; color: #1e7a3c; }

.cm-cuerpo { padding: 12px 14px 24px; display: flex; flex-direction: column; gap: 12px; }
.cm-cuerpo.cm-recargando { opacity: .55; pointer-events: none; }
.cm-cargando, .cm-error, .cm-vacio { padding: 16px; color: var(--muted); }
.cm-error { color: var(--danger); }
.cm-intro h2 { margin: 0; font: 700 18px/1.25 var(--font-brand); }
.cm-muted { color: var(--muted); }
.cm-neg { color: var(--danger); }
.cm-fuerte { font-weight: 600; }
.cm .num { text-align: right; font-variant-numeric: tabular-nums; }
.cm small { display: block; font-size: 11.5px; font-weight: 400; color: inherit; opacity: .85; }

.cm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.cm-kpi { background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 14px; }
.cm-kpi-l, .cm-kpi-s { color: var(--muted); font-size: 12px; }
.cm-kpi-v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

.cm-resumen { background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 5px; }
.cm-resumen-t { font-weight: 700; }
.cm-frase { display: flex; gap: 8px; align-items: baseline; }
.cm-punto { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: currentColor; }
.cm-frase .cm-punto.verde { background: #1e7a3c; }
.cm-frase .cm-punto.rojo { background: #b3261e; }
.cm-frase .cm-punto.ambar { background: #c98a00; }
.cm-frase .cm-punto.gris { background: #5e6b7c; }

.cm-ajustes { background: var(--face); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.cm-link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.cm-tabla-mini { width: 100%; border-collapse: collapse; background: #fff; margin-top: 4px; }
.cm-tabla-mini th, .cm-tabla-mini td { padding: 4px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.cm-tabla-mini .num { text-align: right; }

.cm-ayuda { background: var(--accent-soft); border: 1px solid #f2c4a6; border-radius: 8px; padding: 9px 14px; display: flex; gap: 12px; align-items: flex-start; }
.cm-ayuda > div { flex: 1; min-width: 0; }
.cm-ayuda button { border: 0; background: none; font-size: 15px; color: var(--muted); }
.cm-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); }
.cm-barra button { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }

/* tabla de obras */
.cm-tablawrap { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.cm-tabla { min-width: 1080px; }
.cm-fila { display: grid; grid-template-columns: 70px minmax(240px, 2.4fr) repeat(6, minmax(105px, 1fr)) 150px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.cm-fila > div { padding: 7px 8px; min-width: 0; }
.cm-cab { background: var(--face); border-bottom: 1px solid var(--line); font-weight: 600; color: #3a4556; }
.cm-th { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.cm-th.txt, .cm-th.cm-c0 { justify-content: flex-start; }
.cm-q { width: 20px; height: 20px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); font-size: 11px; font-weight: 700; padding: 0; }
.cm-c0 { display: flex; align-items: center; gap: 4px; }
.cm-chk { width: 26px; height: 26px; border: 0; background: none; color: var(--accent); font-size: 19px; line-height: 1; padding: 0; }
.cm-chk:disabled { color: var(--muted); cursor: default; }
.cm-desp { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 5px; background: #fff; padding: 0; }
.cm-nom { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-sub { font-size: 12px; }
.cm-fila.cm-abierta { background: var(--row-hover); }
.cm-fila.cm-quitada { background: var(--face); opacity: .5; }
.cm-sitc { display: flex; justify-content: flex-end; }
.cm-pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cm-pill .cm-punto { width: 7px; height: 7px; }
.cm-pill.rojo { background: #fde7e5; color: #b3261e; }
.cm-pill.ambar { background: #fff4d6; color: #7a5200; }
.cm-pill.verde { background: #e3f3e8; color: #1e7a3c; }
.cm-pill.sin { background: #eef0f4; color: #5e6b7c; }
.cm-tot { background: var(--face); font-weight: 700; border-bottom: 0; }
.cm-grupo { border-bottom: 1px solid var(--line-soft); }
.cm-grupo > .cm-fila { border-bottom: 0; }

/* detalle de una obra */
.cm-detalle { background: var(--row-alt); border-top: 1px solid var(--line-soft); padding: 12px 14px 14px 46px; display: flex; flex-wrap: wrap; gap: 14px; }
.cm-det-izq { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cm-det-der { flex: 1 1 290px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cm-frase-obra, .cm-nota { margin: 0; }
.cm-nota { font-size: 12px; }
.cm-bloquewrap { background: #fff; border: 1px solid var(--line-soft); border-radius: 6px; overflow-x: auto; }
.cm-bloque { display: grid; grid-template-columns: 110px repeat(7, minmax(92px, 1fr)); min-width: 770px; font-size: 12.5px; }
.cm-bloque > div { padding: 4px 8px; border-bottom: 1px solid #eef0f4; }
.cm-bh { background: var(--face); font-weight: 600; color: #3a4556; }
.cm-bl { font-weight: 600; }
.cm-panel { background: #fff; border: 1px solid var(--line-soft); border-radius: 6px; padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; }
.cm-panel-t { font-weight: 700; margin-top: 2px; }
.cm-coment { font-style: italic; }
.cm-aviso { background: #fff4d6; color: #7a5200; border-radius: 4px; padding: 3px 6px; }
.cm-botones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cm-botones button { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.cm-botones .cm-prim { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.cm-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; margin-top: 4px; }
.cm-form label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.cm-form input { height: 28px; border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; color: var(--text); }
.cm-form .cm-ancho, .cm-form .cm-botones { grid-column: 1 / -1; }
.cm-barra-des { display: grid; grid-template-columns: 96px 1fr 76px; align-items: center; gap: 8px; }
.cm-barra-fondo { height: 9px; background: #eef0f4; border-radius: 5px; overflow: hidden; display: block; }
.cm-barra-val { display: block; height: 9px; background: var(--accent); border-radius: 5px; }
.cm-tram { border-top: 1px solid #eef0f4; padding-top: 4px; }
.cm-pie { font-size: 12px; }

/* imprimir o guardar en PDF: solo la hoja del cierre, A4 apaisado */
.cm-print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body.cm-imprimiendo > *:not(.cm-print) { display: none !important; }
  body.cm-imprimiendo .cm-print { display: block; font: 8.5pt/1.25 "Segoe UI", Arial, sans-serif; color: #000; }
  .cm-print .cm-p-cab { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #D4550E; padding-bottom: 4px; margin-bottom: 6px; }
  .cm-print h1 { font-size: 14pt; margin: 0; }
  .cm-print table { width: 100%; border-collapse: collapse; }
  .cm-print th, .cm-print td { border: 1px solid #c8ced8; padding: 2px 4px; text-align: left; white-space: nowrap; }
  .cm-print td.num, .cm-print th.num { text-align: right; }
  .cm-print thead th { background: #eef0f4; }
  .cm-print tr.cm-p-bloque th:first-child { font-weight: 700; }
  .cm-print .cm-neg { color: #b3261e; }
  .cm-print .cm-p-pie { margin-top: 6px; color: #444; }
}
