:root {
    --bg: #f8fafc; --card: #ffffff; --text: #1e293b; --muted: #64748b;
    --border: #e2e8f0; --blue: #2563eb; --green: #10b981; --red: #ef4444;
}

body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); padding: 40px 20px; margin: 0; font-variant-numeric: tabular-nums; }
.container { max-width: 1300px; margin: auto; }

.handshake-credit { position: fixed; bottom: 20px; right: 20px; font-size: 11px; color: var(--muted); }
.handshake-credit a { color: var(--text); text-decoration: none; font-weight: 700; }

.minimal-header { margin-bottom: 35px; }
.title-input { border: none; background: transparent; font-size: 28px; font-weight: 800; width: 100%; outline: none; color: var(--text); }
.subtitle { color: var(--muted); font-size: 13px; margin-top: 4px; }

.layout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.column-title { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.card h3 { margin: 0 0 6px 0; font-size: 14px; font-weight: 700; }
.helper { font-size: 11px; color: var(--muted); margin-bottom: 15px; display: block; line-height: 1.4; }
.helper-mini { font-size: 10px; color: var(--muted); line-height: 1.3; margin-top: 6px; }
.small-title { font-size: 13px; font-weight: 700; margin-bottom: 15px; color: var(--muted); text-transform: uppercase; }
.mini-section-title { font-size: 11px; font-weight: 800; text-transform: uppercase; margin: 0 0 8px 0; color: var(--text); }

.input-group { display: flex; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; margin-bottom: 10px; }
.input-group input { border: none; padding: 12px 0; width: 100%; font-weight: 700; font-size: 15px; outline: none; }
.unit { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; }

.input-wrapper.mini { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 0 6px; }
.input-wrapper.mini input { border: none; padding: 6px; width: 100%; font-weight: 700; font-size: 13px; outline: none; text-align: center; }
.inline-unit { font-size: 11px; font-weight: 800; color: var(--muted); }

.dynamic-row { display: grid; grid-template-columns: 1fr 100px 25px; gap: 8px; margin-bottom: 8px; }
.input-wrapper-list { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding-right: 8px; }
.input-wrapper-list input { border: none; padding: 8px; width: 100%; font-weight: 700; font-size: 13px; outline: none; text-align: right; border-radius: 6px; }

.stock-deduction-box { border-left: 2px solid var(--border); padding: 5px 0 5px 20px; margin: 15px 0 15px 10px; }

.metric-row-inline { display: flex; justify-content: space-between; align-items: center; }
.value-main { font-size: 18px; font-weight: 800; color: var(--text); }
.label { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; display: block; margin-bottom: 2px;}

.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px; align-items: end; }
.price-sub-item b { font-size: 13px; font-weight: 700; display: block; margin-top: 4px; }

.suggestions-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.suggest-item { font-size: 10px; color: var(--muted); }
.suggest-item b { display: block; color: var(--text); font-size: 12px; margin-top: 2px; }

.card-nested-container { margin-bottom: 20px; }
.nested-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.nested-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.val { font-size: 15px; font-weight: 800; display: block; margin-top: 4px; }
.val-blue { font-size: 18px; font-weight: 800; color: var(--blue); display: block; margin-top: 4px; }

#actorCharts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actor-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.a-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 800; font-size: 14px; }
.a-badge { font-size: 8px; padding: 3px 6px; border-radius: 4px; color: #fff; font-weight: 900; }
.a-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; color: var(--muted); }
.a-total { border-top: 1px solid #f1f5f9; margin-top: 10px; padding-top: 10px; font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; }

.simulator-section { margin-bottom: 15px; }
.slider-legend { display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; color: var(--muted); margin-top: 18px; } 
.range-container { position: relative; height: 12px; border-radius: 6px; margin: 40px 0 10px 0; overflow: visible; } 
.range-track { width: 100%; height: 100%; position: relative; border-radius: 6px; } 
.range-fill { height: 100%; border-radius: 6px; transition: 0.1s; position: absolute; z-index: 1; }
.range-mark { position: absolute; width: 2px; height: 30px; background: #000; top: -9px; z-index: 5; }
.mark-label { position: absolute; top: -20px; left: -50px; width: 100px; text-align: center; font-size: 8px; font-weight: 900; background: #fff; padding: 2px; border: 1px solid #000; border-radius: 4px;}
.range-input { position: absolute; width: 100%; top: -10px; height: 32px; -webkit-appearance: none; background: transparent; cursor: pointer; z-index: 10; margin: 0; }
.range-input::-webkit-slider-thumb { -webkit-appearance: none; height: 22px; width: 22px; border-radius: 50%; background: #000; border: 4px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.res-item { background: #f8fafc; padding: 10px; border-radius: 8px; border: 1px solid var(--border); }
.res-item b { display: block; font-size: 13px; margin-top: 4px; }
.res-total { grid-column: span 2; border-top: 2px solid var(--border); padding-top: 15px; margin-top: 5px; }
.val-final { font-size: 24px; font-weight: 900; display: block; margin-top: 4px; }

.action-footer { display: flex; gap: 10px; margin-top: 20px; }
.btn { flex: 1; padding: 12px; border-radius: 8px; font-weight: 800; font-size: 11px; cursor: pointer; border: none; }
.btn-dark { background: #000; color: #fff; }
.btn-reset { background: #fff; border: 1px solid #fee2e2; color: var(--red); }

.divider { border-top: 1px solid var(--border); margin: 15px 0; }
.warning { color: #9a3412; background: #fff7ed; padding: 8px; border-radius: 6px; font-size: 10px; font-weight: 800; margin-top: 10px; border: 1px solid #ffedd5; display: none; }
.add-btn { width: 100%; background: none; border: 1px dashed var(--border); padding: 8px; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }

.switch { position: relative; display: inline-block; width: 34px; height: 18px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-switch { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider-switch:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider-switch { background-color: var(--blue); }
input:checked + .slider-switch:before { transform: translateX(16px); }

.distribution-bar { display: flex; height: 12px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.bar-segment { height: 100%; transition: width 0.3s ease; border-right: 1px solid rgba(255,255,255,0.2); cursor: help; } /* Cursor añadido */

.channel-row { display: grid; grid-template-columns: 1fr 60px 70px 25px; gap: 8px; align-items: center; margin-bottom: 6px; }
.channel-row input { width: 100%; padding: 8px 6px; border: 1px solid var(--border); border-radius: 6px; font-weight: 700; font-size: 12px; text-align: right; outline: none; box-sizing: border-box; }
.chan-name { text-align: right !important; }

/* INICIO DEL AÑADIDO: CSS PARA IMPRESIÓN PDF */
@media print {
    body { padding: 0; background: #fff; color: #000; }
    .container { max-width: 100%; margin: 0; }
    .handshake-credit, .action-footer, .add-btn, .helper, .helper-mini, .switch, .slider-switch, .dynamic-row button { display: none !important; }
    .layout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
    .card { padding: 12px; margin-bottom: 12px; box-shadow: none; border: 1px solid #e2e8f0; break-inside: avoid; }
    .minimal-header { margin-bottom: 20px; }
    input { border: none !important; padding: 0 !important; background: transparent !important; color: #000 !important; }
    .input-group, .input-wrapper, .text-input { border: none !important; padding: 0 !important; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    .range-input::-webkit-slider-thumb { display: none !important; }
    .range-container { margin: 25px 0 10px 0; }
    #pdf-qr-section { grid-column: span 3; text-align: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid #e2e8f0; break-inside: avoid; }
}
/* FIN DEL AÑADIDO */