/* ========== Planeación — Plat_MonsterPlus ========== */
/* Pautas.razor (listado CRUD) + PautaCrear.razor (wizard) */
/* Usa las variables CSS globales definidas en app.css para dark/light automático */

/* === Page header layout === */
.planeacion-page .contenedor-header.planeacion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.planeacion-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.planeacion-header-actions .btn-execute {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* === Body container — usa .camara-body de app.css === */

/* === Grid de pautas === */
.pautas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
    align-items: stretch;
}

/* === Pauta card === */
.pauta-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
}

.pauta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pauta-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--border-glow);
    border-color: var(--primary-color);
}

.pauta-card:hover::before {
    opacity: 1;
}

.light-mode .pauta-card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.light-mode .pauta-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--border-glow);
}

/* === Card top (badge row) === */
.pauta-card-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 22px;
}

/* === Badges de estado === */
.pauta-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pauta-badge-borrador {
    background: rgba(240, 116, 0, 0.12);
    color: #f07400;
    border-color: rgba(240, 116, 0, 0.35);
}

.pauta-badge-confirmada {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(240, 116, 0, 0.30);
}

.pauta-badge-archivada {
    background: rgba(128, 128, 128, 0.14);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* === Card body === */
.pauta-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pauta-info-label {
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
    min-width: 60px;
}

.pauta-info-value {
    font-size: 12.5px;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pauta-info-name {
    font-weight: 700;
    font-size: 13.5px;
}

.pauta-info-orange {
    color: var(--primary-color);
    font-weight: 700;
}

.pauta-info-period {
    display: flex;
    flex-direction: column;
    white-space: normal;
}

.pauta-info-date {
    font-size: 10.5px;
    font-weight: 400;
    color: var(--text-secondary);
}

.pauta-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pauta-info-row svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

/* === Card footer (actions row) === */
.pauta-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.pauta-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.pauta-action-btn:hover:not(:disabled) {
    background: var(--bg-glass-hover);
    border-color: var(--border-color);
    color: var(--primary-color);
}

.pauta-action-btn:active:not(:disabled) {
    transform: scale(0.94);
}

.pauta-action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pauta-action-btn-danger:hover:not(:disabled) {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
}

/* === Loading state === */
.planeacion-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 13.5px;
}

.planeacion-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #F07400, #ff9a3c, #00b4ff, #F07400);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
    animation: planeacionSpin 0.8s linear infinite;
    filter: drop-shadow(0 0 8px rgba(240, 116, 0, 0.25));
}

@keyframes planeacionSpin {
    to { transform: rotate(360deg); }
}

/* === Empty state === */
.planeacion-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 90px 20px;
    gap: 14px;
    text-align: center;
}

.planeacion-empty-icon {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    color: var(--primary-color);
    border: 2px dashed var(--border-color);
    margin-bottom: 6px;
}

.planeacion-empty h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.planeacion-empty p {
    margin: 0 0 8px;
    font-size: 13.5px;
    color: var(--text-secondary);
    max-width: 440px;
    line-height: 1.55;
}

.planeacion-empty .btn-execute {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* === Plan card — componente reutilizable de Planeación (independiente de industria) === */
.plan-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.plan-card-header {
    background: var(--primary-gradient);
    color: white;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px 12px 0 0;
}

/* Header del card Periodo con el resumen de rango centrado */
.plan-card-header-with-summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
}

.plan-card-header-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.plan-card-header-summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    min-width: 0;
}

.plan-card-header-summary .plan-cal-range-arrow {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
}

.plan-card-header-summary .plan-cal-range-dates {
    font-size: 11px;
    font-weight: 400;
    font-style: italic;
    color: rgba(255, 255, 255, 0.75);
}

.plan-card-header-summary .plan-cal-range-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.plan-card-header-summary .plan-cal-range-empty {
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
}

.plan-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Dentro de camara-body los cards se estiran y centran su contenido */
.planeacion-page .camara-body > .plan-card {
    flex: 1;
}

.planeacion-page .camara-body > .plan-card > .plan-card-body {
    justify-content: center;
    align-items: center;
    overflow: visible;
}

/* Card body stretch — inputs/textareas ocupan todo el ancho (Brief Details) */
.planeacion-page .camara-body > .plan-card > .plan-card-body.wizard-form-stretch {
    align-items: stretch;
}

.planeacion-page .camara-body > .plan-card > .plan-card-body.wizard-form-stretch .wizard-form-group {
    align-items: stretch;
}

.wizard-form-stretch .wizard-input-prefix {
    max-width: 240px;
    align-self: center;
}

.wizard-form-stretch .wizard-form-row {
    flex-wrap: nowrap;
}

.wizard-form-stretch .wizard-form-row > .wizard-form-group {
    flex: 1;
    min-width: 0;
}

/* Dentro de cards centrados, los form-group y chips también centran */
.planeacion-page .camara-body > .plan-card > .plan-card-body .wizard-form-group {
    align-items: center;
}

.planeacion-page .camara-body > .plan-card > .plan-card-body .wizard-chip-group {
    justify-content: center;
}

/* ========== Wizard (PautaCrear.razor) ========== */

/* === Stepper === */
.wizard-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px 16px 8px;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 60px;
}

.wizard-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    background: var(--bg-card);
    transition: all 0.25s ease;
}

.wizard-step.active .wizard-step-number {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 12px rgba(240, 116, 0, 0.4);
}

.wizard-step.completed .wizard-step-number {
    background: var(--primary-color);
    border-color: transparent;
    color: #fff;
}

.wizard-step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: color 0.2s ease;
}

.wizard-step.active .wizard-step-label,
.wizard-step.completed .wizard-step-label {
    color: var(--primary-color);
}

.wizard-step-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 4px;
    margin-bottom: 22px;
    transition: background 0.3s ease;
    min-width: 20px;
    max-width: 80px;
}

.wizard-step-line.completed {
    background: var(--primary-gradient);
}

/* === Wizard footer === */
.wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    gap: 12px;
}

.wizard-footer-info {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.wizard-btn-secondary {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.wizard-btn-secondary:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.wizard-btn-secondary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* === Wizard form === */
.wizard-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wizard-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.wizard-form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wizard-form-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    /* sin overflow hidden: permite que dropdowns absolutes se extiendan sin recortarse */
    overflow: visible;
}

/* Cuando un dropdown está abierto, elevar su contenedor por encima de hermanos */
.custom-dropdown-container:has(.custom-dropdown-list) {
    z-index: 1000;
}

/* Asegurar que los contenedores de formulario no recorten los dropdowns */
.wizard-form-group { overflow: visible; }

/* Variante "open upward" para dropdowns ubicados cerca del fin del body
   (Cliente/Marca en Step 1) — la lista crece hacia arriba en vez de hacia abajo */
.custom-dropdown-up .custom-dropdown-list {
    top: auto;
    bottom: calc(100% + 4px);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

.wizard-form-row > .wizard-form-group {
    flex: 1;
    min-width: 200px;
}

.wizard-form-row-inner {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wizard-form-row-inner select,
.wizard-form-row-inner input {
    flex: 1;
    min-width: 0;
}

.wizard-range-sep {
    color: var(--text-secondary);
    font-weight: 700;
    flex-shrink: 0;
}

.wizard-input-prefix {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wizard-input-prefix span {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.wizard-input-prefix input {
    flex: 1;
}

/* === Select styling (remove native chrome) === */
.wizard-form select.modern-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b0b0b0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}

/* === Number inputs — hide spinner === */
.wizard-form input[type="text"][inputmode="numeric"],
.wizard-form input[type="number"] {
    -moz-appearance: textfield;
}

.wizard-form input[type="number"]::-webkit-outer-spin-button,
.wizard-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* === Gender slider (Step 2) === */
.wizard-gender-control {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
}

.wizard-gender-end {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 56px;
}

.wizard-gender-pct {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.wizard-gender-name {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.wizard-gender-name svg {
    color: var(--primary-color);
}

.wizard-gender-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #00b4ff, #F07400);
    outline: none;
    cursor: pointer;
}

.wizard-gender-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}

.wizard-gender-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.wizard-gender-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* === Chip selectors (Step 2) === */
.wizard-chip-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wizard-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-secondary);
    transition: all 0.18s ease;
    user-select: none;
}

.wizard-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.wizard-chip.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(240, 116, 0, 0.3);
}

.wizard-chip input[type="checkbox"] {
    display: none;
}

.wizard-chip.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hint "Read-only. Use Duplicate" junto al badge en la card de una pauta guardada */
.pauta-readonly-hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.85;
}

.pauta-readonly-hint svg {
    color: #00b4ff;
    flex-shrink: 0;
}

.ranking-table tr.row-readonly {
    cursor: default;
}

/* === Validation error === */
.wizard-validation-error {
    margin: 0 16px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 500;
}

/* === Conflict modal === */
.conflicto-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
}

.conflicto-modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 28px 24px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.conflicto-modal-icon {
    color: #f07400;
    margin-bottom: 12px;
}

.conflicto-modal-container h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--text-primary);
}

.conflicto-modal-container p {
    margin: 0 0 20px;
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.conflicto-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.conflicto-btn-danger {
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transition: all 0.15s ease;
}

.conflicto-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* === Table row selected === */
.row-selected {
    background: rgba(240, 116, 0, 0.08) !important;
    box-shadow: inset 3px 0 0 0 #f07400;
}

.row-hovered {
    outline: 1px solid var(--primary-color);
    outline-offset: -1px;
}

/* ========== Step 3 — Dashboard Sitios & KPIs ========== */

/* KPI bar horizontal — sticky top */
.step3-kpi-bar {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    flex-wrap: nowrap;
    position: relative;
}

.step3-kpi-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 8px;
    min-width: 0;
    flex: 1 1 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.step3-kpi-item:hover {
    border-color: rgba(240, 116, 0, 0.35);
    transform: translateY(-1px);
}

.step3-kpi-item.step3-kpi-wide {
    flex: 1.5 1 0;
}


.step3-kpi-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.step3-kpi-val {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    white-space: nowrap;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.step3-kpi-val.step3-kpi-orange {
    color: #F07400;
}

.step3-kpi-val.step3-kpi-cyan {
    color: #00b4ff;
}

.step3-kpi-val.step3-kpi-danger {
    color: #ef4444;
}

.step3-score-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 3px;
}

.step3-score-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #F07400, #00b4ff);
    transition: width 0.6s ease;
}

.step3-kpi-val-count {
    font-size: 20px;
}

.step3-kpi-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: planeacionSpin 0.85s linear infinite;
    margin-left: 8px;
    flex-shrink: 0;
}

/* Dashboard grid principal */
.step3-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.step3-left {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.step3-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    min-width: 0;
}

/* Card body dentro de step3-left: limitar altura y ocultar overflow */
.step3-left > .plan-card > .plan-card-body {
    overflow: hidden;
    min-height: 0;
}

/* Toolbar: botón + filtro */
.step3-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.step3-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.step3-btn-icon:hover {
    border-color: #ff3b30;
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.08);
}

.step3-filter-dropdown {
    flex-shrink: 0;
    width: 120px;
}

.step3-filter-dropdown .custom-dropdown-list {
    z-index: 10;
}

.step3-filter-input {
    flex: 1;
    min-width: 0;
    font-size: 12px;
}

/* Score badge semáforo */
.wt1-score {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.wt1-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wt1-score-badge.wt1-score-high { background: #34c759; box-shadow: 0 0 6px rgba(52, 199, 89, 0.5); }
.wt1-score-badge.wt1-score-mid  { background: #ffcc00; box-shadow: 0 0 6px rgba(255, 204, 0, 0.5); }
.wt1-score-badge.wt1-score-low  { background: #ff3b30; box-shadow: 0 0 6px rgba(255, 59, 48, 0.5); }

/* Tabla scroll contenido */
.step3-table-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
}


/* Mapa */
.step3-map-card {
    flex: 3;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.step3-map-container {
    flex: 1;
    min-height: 180px;
    position: relative;
}

/* Preview sitio */
.step3-preview-card {
    flex: 2;
    min-height: 0;
}

.step3-preview-body {
    padding: 12px;
    display: flex;
    gap: 14px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}

.step3-preview-img {
    width: 45%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.step3-preview-noimg {
    width: 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-glass);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    flex-shrink: 0;
}

.step3-preview-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
    justify-content: center;
}

.step3-preview-addr {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}

.step3-preview-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.step3-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step3-detail-label {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 70px;
    flex-shrink: 0;
}

.step3-detail-value {
    font-size: 12.5px;
    color: var(--text-primary);
    font-weight: 500;
}

.step3-detail-highlight {
    color: var(--primary-color);
    font-weight: 700;
}

.step3-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    flex: 1;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
}

/* Override: en Step 3 el camara-body no hace scroll — lo hace la tabla internamente */
.planeacion-page .camara-body:has(.step3-dashboard) {
    overflow-y: hidden;
}

.planeacion-page .camara-body > .step3-kpi-bar,
.planeacion-page .camara-body > .step3-dashboard {
    flex: unset;
}

.planeacion-page .camara-body > .step3-dashboard {
    flex: 1;
}

/* Responsive: stack en pantallas pequeñas */
@media (max-width: 1024px) {
    .step3-dashboard {
        grid-template-columns: 1fr;
    }

    .step3-map-card {
        min-height: 240px;
    }

    .step3-table-scroll {
        max-height: 350px;
    }
}

@media (max-width: 640px) {
    .step3-kpi-bar {
        gap: 0;
        padding: 8px;
    }

    .step3-kpi-item {
        padding: 4px 8px;
    }

    .step3-kpi-val {
        font-size: 14px;
    }

    .step3-preview-body {
        flex-direction: column;
    }

    .step3-preview-img,
    .step3-preview-noimg {
        width: 100%;
        height: 140px;
    }
}

/* ========== Step 4 — Summary ========== */
.s4-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.s4-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

.s4-card {
    display: flex;
    flex-direction: column;
}

.s4-detail-body {
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.s4-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12.5px;
}

.s4-detail-row:last-child {
    border-bottom: none;
}

.s4-detail-label {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.s4-detail-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.s4-val-orange { color: var(--primary-color); }
.s4-val-cyan { color: #00b4ff; }
.s4-val-danger { color: #ff3b30; }

.s4-detail-date {
    display: block;
    font-size: 10.5px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* Fila de inversión */

/* KPIs grid */
.s4-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.s4-kpi-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    position: relative;
    min-height: 78px;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.s4-kpi-card:hover {
    border-color: rgba(240, 116, 0, 0.35);
    transform: translateY(-1px);
}

.s4-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Overrides de color — especificidad mayor para ganarle a .s4-kpi-value */
.s4-kpi-value.s4-val-orange { color: var(--primary-color); }
.s4-kpi-value.s4-val-cyan   { color: #00b4ff; }
.s4-kpi-value.s4-val-danger { color: #ff3b30; }

.s4-kpi-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 1400px) {
    .s4-kpi-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 1024px) {
    .s4-top-row { grid-template-columns: 1fr; }
    .s4-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .s4-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== Popup del mapa — forzar colores de Plus (naranja) ========== */
/* Screen's markers.css carga después y usa #7B2D8E; este override con mayor especificidad lo corrige */
.planeacion-page .mp-popup-header-title,
.step3-map-card .mp-popup-header-title {
    color: #F07400 !important;
    background: rgba(240, 116, 0, 0.05) !important;
}

.planeacion-page .mp-popup-action,
.step3-map-card .mp-popup-action {
    color: #00b4ff !important;
    background: rgba(0, 180, 255, 0.08) !important;
    border-color: rgba(0, 180, 255, 0.15) !important;
}

.planeacion-page .mp-status-icon,
.step3-map-card .mp-status-icon {
    color: #F07400 !important;
}

/* ========== Calendario de Quincenas (Step 1 — Brief) ========== */
.plan-cal-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.plan-cal-year-nav {
    display: flex;
    justify-content: center;
    padding: 10px 0.8rem 14px;
    position: relative;
}

/* Row interna con el mismo ancho que el calendario (12 meses × 130px + 11 gaps
   de 0.16rem), para que el left del year-group coincida con el left del
   primer mes y el badge quede centrado sobre el calendario. */
.plan-cal-year-row {
    display: grid;
    grid-template-columns: 1fr minmax(0, auto) 1fr;
    align-items: center;
    gap: 16px;
    width: calc(12 * 130px + 11 * 0.16rem);
    max-width: 100%;
}

.plan-cal-year-group {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 16px;
}

.plan-cal-year-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.plan-cal-year-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(240, 116, 0, 0.08);
}

.plan-cal-year-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.plan-cal-year {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    min-width: 60px;
    text-align: center;
}

.plan-cal-body {
    padding: 0.8rem;
    padding-top: 0;
    overflow-x: auto;
    overflow-y: hidden;
    height: auto;
    text-align: center;
}

.plan-cal-months {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.16rem;
    padding-bottom: 0.4rem;
}

.plan-cal-month {
    background: var(--bg-primary);
    border-radius: 9.6px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    width: 130px;
    min-width: 130px;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plan-cal-month:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 116, 0, 0.1);
}

.plan-cal-month-hd {
    background: linear-gradient(135deg, #F07400, #00b4ff);
    padding: 0.4rem;
    text-align: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.plan-cal-month-bd {
    display: flex;
    gap: 5px;
    padding: 0.6rem;
}

.plan-cal-q {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6.4px;
    font-size: 0.72rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0.5rem;
    min-height: 36px;
    flex: 1;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    user-select: none;
}

.plan-cal-q:hover:not(.dis):not(.sel) {
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.1), rgba(0, 180, 255, 0.1));
    border-color: #F07400;
    transform: scale(1.05);
}

.plan-cal-q.sel {
    background: linear-gradient(135deg, #F07400, #00b4ff) !important;
    color: white !important;
    border-color: transparent !important;
    font-weight: 700;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(240, 116, 0, 0.4);
}

.plan-cal-q.sel:hover {
    transform: scale(1.08);
}

.plan-cal-q.in-range {
    background: linear-gradient(135deg, #F07400, #00b4ff) !important;
    color: white !important;
    border-color: transparent !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(240, 116, 0, 0.25);
}

.plan-cal-q.dis {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Nota informativa: motor de audiencia ajusta por feriados/puentes/vacaciones
   + indicación de acción (seleccionar quincena inicio/fin). Se aloja en la
   misma row del selector de año, centrada horizontalmente. */
.plan-audcal-note {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 180, 255, 0.08);
    border: 1px solid rgba(0, 180, 255, 0.35);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.plan-audcal-note > svg {
    flex-shrink: 0;
    color: #00b4ff;
}

.plan-audcal-note-label {
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.plan-audcal-note-sep {
    color: var(--text-secondary);
    opacity: 0.6;
    flex-shrink: 0;
}

.plan-audcal-note-desc {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}

.plan-audcal-note-step {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

/* === Badge responsive === */
/* En anchos medios, ocultar la descripción larga; queda label · step. */
@media (max-width: 1200px) {
    .plan-audcal-note-desc,
    .plan-audcal-note-sep--desc {
        display: none;
    }
}

/* En anchos angostos, el badge pasa debajo del selector de año (el grid se
   colapsa a una sola columna y ambos elementos se apilan). */
@media (max-width: 768px) {
    .plan-cal-year-row {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 10px;
        justify-items: center;
    }

    .plan-cal-year-group {
        justify-self: center;
    }

    .plan-audcal-note {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
}

/* Móvil: reducir padding y tamaño de texto del badge. */
@media (max-width: 480px) {
    .plan-audcal-note {
        padding: 6px 10px;
        font-size: 11px;
    }

    .plan-audcal-note-step {
        font-size: 10px;
    }
}

/* Chips informativos de contexto estacional (Step 1) */
.plan-season-context {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-glass);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    margin-top: 8px;
}

.plan-season-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.plan-season-header > svg {
    flex-shrink: 0;
    color: #F07400;
}

.plan-season-label {
    font-weight: 700;
    color: var(--text-primary);
}

.plan-season-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.plan-season-chip {
    flex: 0 0 calc(50% - 4px);
    max-width: calc(50% - 4px);
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--chip-color, #F07400) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--chip-color, #F07400) 35%, transparent);
    border-left: 3px solid var(--chip-color, #F07400);
    cursor: help;
    overflow: hidden;
    white-space: nowrap;
}

.plan-season-chip-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.plan-season-chip-sep {
    color: var(--text-secondary);
    opacity: 0.6;
    flex-shrink: 0;
}

.plan-season-chip-desc {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}


/* === Responsive === */
@media (max-width: 768px) {
    .plan-cal-month {
        min-width: 110px;
        width: 110px;
    }

    .plan-cal-year-row {
        width: calc(12 * 110px + 11 * 0.16rem);
    }

    .plan-cal-q {
        font-size: 0.68rem;
        padding: 0.4rem;
        min-height: 32px;
    }
}

/* === Responsive === */
@media (max-width: 640px) {
    .pautas-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .planeacion-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .planeacion-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .wizard-stepper {
        gap: 0;
        padding: 14px 8px;
    }

    .wizard-step-label {
        font-size: 9px;
    }

    .wizard-form-row {
        flex-direction: column;
    }

    .kpi-grid {
        flex-direction: column;
    }
}

/* ============================================================
   Botón "Volver a Mis Simulaciones" en el header del wizard
   ============================================================ */
.plan-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.plan-back-btn:hover {
    color: #F07400;
    border-color: rgba(240, 116, 0, 0.5);
    background: rgba(240, 116, 0, 0.06);
    transform: translateX(-1px);
}

.planeacion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.planeacion-header > h4 { flex: 0 0 auto; }
.planeacion-header > .plan-back-btn { flex: 0 0 auto; }
.planeacion-header > .plan-disclaimer {
    flex: 1 1 auto;
    margin: 0;
    justify-content: center;
    overflow: hidden;
    min-width: 0;
}

/* ============================================================
   Banner de aviso: borrador activo (en Pautas.razor)
   ============================================================ */
.draft-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(255, 204, 0, 0.10), rgba(240, 116, 0, 0.10));
    border: 1px solid rgba(255, 204, 0, 0.35);
    border-left: 3px solid #f5b800;
    border-radius: 8px;
    margin: 0 0 12px 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-primary);
}

.draft-notice > svg {
    flex-shrink: 0;
    color: #f5b800;
}

.draft-notice-text {
    flex: 1;
}

.draft-notice-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    background: #f5b800;
    border: none;
    border-radius: 6px;
    color: #1a1a1a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.draft-notice-btn:hover {
    background: #ffcc00;
    transform: translateY(-1px);
}

/* ============================================================
   Disclaimer banner (transparencia del simulador) — compacto en header
   ============================================================ */
.plan-disclaimer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: linear-gradient(90deg, rgba(240, 116, 0, 0.08), rgba(0, 180, 255, 0.08));
    border: 1px solid rgba(240, 116, 0, 0.25);
    border-left: 3px solid #F07400;
    border-radius: 8px;
    font-size: 11.5px;
    line-height: 1.3;
    color: var(--text-primary);
    cursor: help;
    white-space: nowrap;
    overflow: hidden;
}

.plan-disclaimer-icon {
    flex-shrink: 0;
    color: #F07400;
}

.plan-disclaimer-title {
    font-weight: 700;
    color: #F07400;
    flex-shrink: 0;
}

.plan-disclaimer-inline {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ============================================================
   Semáforo de presupuesto (Step 3) — barra tricolor
   ============================================================ */
.budget-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 3px;
    cursor: help;
}

.budget-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.budget-bar-fill.budget-bar-ok {
    background: linear-gradient(90deg, #34c759, #5cd87a);
}

.budget-bar-fill.budget-bar-warn {
    background: linear-gradient(90deg, #f5b800, #ffcc00);
}

.budget-bar-fill.budget-bar-danger {
    background: linear-gradient(90deg, #ff3b30, #ff6b60);
    animation: budgetPulse 1.4s ease-in-out infinite;
}

@keyframes budgetPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

/* tooltip para KPIs — hover reveal */
.step3-kpi-item[title] { cursor: help; }
