/* Hoja imprimible: oculta en pantalla, solo visible al imprimir (ver print.css) */
#hoja-pdf { display: none; }

/* ── BOTÓN ICONO (header) ── */
.btn-icon {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-on-dark);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  font-family: var(--font-sans);
}
.btn-icon:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.35); }

/* ── FORM ── */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.field input, .field select, .field textarea {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,169,110,0.18);
}
.field input:disabled { opacity: 0.45; cursor: not-allowed; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

/* ── FASES ── */
.fases-block {
  background: var(--bg-container);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.75rem;
}
.fases-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.75rem;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--text-main);
}
.check-row:last-child { margin-bottom: 0; }
.check-row input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.check-row label { cursor: pointer; flex: 1; }
.fase-pct {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(200,169,110,0.12);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(200,169,110,0.2);
  white-space: nowrap;
}
.check-separator { border-top: 1px dashed var(--border-color); margin: 8px 0; padding-top: 8px; }

/* ── MÉTRICAS ── */
.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.metric {
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
}
.metric .m-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 5px;
}
.metric .m-val {
  font-family: var(--font-serif);
  font-size: 21px;
  color: var(--text-main);
  font-weight: 700;
}
.metric .m-sub {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 3px;
  line-height: 1.4;
}
.metric-final {
  background: var(--bg-header);
  border-color: var(--bg-header);
}
.metric-final .m-lbl { color: rgba(232,226,217,0.6); }
.metric-final .m-val { color: var(--accent); }
.metric-final .m-sub { color: rgba(232,226,217,0.4); }
.metric-warn {
  background: #3a2a0a;
  border-color: #5a4010;
}
.metric-warn .m-lbl { color: #c8a060; }
.metric-warn .m-val { color: #e8c070; }
.metric-warn .m-sub { color: #a07840; }

/* ── ALERTAS ── */
.alerta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 12.5px;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.alerta-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alerta-warn { background: rgba(200,169,50,0.1); border: 1px solid rgba(200,169,50,0.3); color: #c8a030; }
.alerta-info { background: rgba(100,150,220,0.08); border: 1px solid rgba(100,150,220,0.2); color: #6496dc; }
.alerta-ok   { background: rgba(70,170,100,0.08); border: 1px solid rgba(70,170,100,0.2); color: #46aa64; }

/* ── DESGLOSE ── */
.desglose-wrap { margin-top: 0.25rem; }
.desglose-subtit {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.6rem;
}
.desglose-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
  gap: 12px;
}
.desglose-row:last-of-type { border-bottom: none; }
.desglose-desc { color: var(--text-muted); flex: 1; }
.desglose-amt  { font-weight: 600; color: var(--text-main); white-space: nowrap; }
.desglose-amt.orient { color: var(--text-light); font-weight: 400; }
.desglose-op {
  font-size: 11px;
  color: var(--text-light);
  font-style: italic;
  margin-left: 6px;
  white-space: nowrap;
}
.desglose-total {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 0;
  margin-top: 6px;
  border-top: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text-main);
}
.desglose-total .tot-lbl { font-weight: 700; }
.desglose-total .tot-val { font-weight: 700; color: var(--accent); }

.badge-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-right: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: 1px;
}
.badge-inc { background: rgba(100,150,220,0.12); color: #6496dc; border: 1px solid rgba(100,150,220,0.2); }
.badge-ori { background: rgba(140,140,140,0.1); color: var(--text-light); border: 1px solid var(--border-light); }

/* ── DICTAMEN ── */
.dictamen-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-size: 12.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-main);
  font-family: var(--font-sans);
}

/* ── BOTONES ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s;
  text-decoration: none;
}
.btn-primary {
  background: var(--bg-header);
  color: #fff;
  border-color: var(--bg-header);
}
.btn-primary:hover { background: #2a4060; }
.btn-accent {
  background: var(--accent);
  color: var(--bg-header);
  border-color: var(--accent);
  font-weight: 600;
}
.btn-accent:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-outline:hover { background: var(--bg-section); border-color: var(--accent); }
.btn-row { display: flex; gap: 10px; margin-top: 1rem; flex-wrap: wrap; align-items: center; }

/* ── CÁLCULO PASO A PASO ── */
.calc-paso {
  background: var(--bg-container);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  overflow: hidden;
}
.calc-paso-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 12px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.calc-num {
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: var(--bg-header);
  color: var(--accent);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  flex-shrink: 0;
  margin-top: 1px;
}
.calc-paso-titulo {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-serif);
}
.calc-paso-ayuda {
  font-size: 11px;
  color: var(--text-light);
  font-style: italic;
  margin-left: 2px;
}
.calc-paso-body {
  padding: 10px 14px;
}
.calc-linea {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
}
.calc-linea:last-child { border-bottom: none; }
.calc-lbl { color: var(--text-muted); flex: 1; }
.calc-val {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  font-family: var(--font-serif);
  font-size: 14px;
}
.calc-val.ok  { color: var(--text-main); }
.calc-val.warn { color: #c8a030; }
.calc-val.neutral { color: var(--text-muted); font-weight: 400; }
.calc-linea-sub {
  font-size: 11px;
  color: var(--text-light);
  padding: 2px 0 4px;
  font-style: italic;
}
.calc-final {
  background: var(--bg-header);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.calc-final-lbl {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: rgba(232,226,217,0.75);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.calc-final-val {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}
.calc-final-sub {
  font-size: 11px;
  color: rgba(232,226,217,0.4);
  text-align: right;
}
.calc-final-warn {
  background: #3a2a0a;
  border: 1px solid #5a4010;
}
.calc-final-warn .calc-final-lbl { color: #c8a060; }
.calc-final-warn .calc-final-val { color: #e8c070; }
.calc-final-warn .calc-final-sub { color: #a07840; }
.calc-final-penal {
  background: #1a2e20;
  border: 1px solid #2d5a38;
}
.calc-final-penal .calc-final-lbl { color: rgba(180,220,190,0.65); }
.calc-final-penal .calc-final-val { color: #7dd898; }
.calc-final-penal .calc-final-sub { color: rgba(180,220,190,0.4); }
[data-theme="dark"] .calc-final-penal { background: #0e1e12; border-color: #1e3d22; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-light);
}
.empty-icon { font-size: 36px; opacity: 0.25; margin-bottom: 0.75rem; }
.empty-txt { font-size: 13px; color: var(--text-light); }

/* ── HIDDEN ── */
.hidden { display: none !important; }
