/* Tableros, Gantt y matriz SKU (F7). CSS propio con las variables de Filament; soporta modo oscuro. */
.dash-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.dash-pill { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--color-gray-300); font-size: .85rem; text-decoration: none; color: inherit; background: white; }
.dark .dash-pill { background: var(--color-gray-900); border-color: var(--color-gray-700); }
.dash-pill--active { background: var(--primary-600); border-color: var(--primary-600); color: white; }

.dash-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.dash-grid--wide { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.dash-kpi { border: 1px solid var(--color-gray-200); border-radius: .75rem; padding: .9rem 1rem; background: white; }
.dark .dash-kpi { background: var(--color-gray-900); border-color: var(--color-gray-800); }
.dash-kpi-label { font-size: .8rem; color: var(--color-gray-500); }
.dash-kpi-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.dash-kpi-sub { font-size: .8rem; color: var(--color-gray-500); }

.dash-bar { height: .6rem; border-radius: 999px; background: var(--color-gray-200); overflow: hidden; position: relative; margin-top: .35rem; }
.dark .dash-bar { background: var(--color-gray-700); }
.dash-bar > span { position: absolute; inset: 0 auto 0 0; background: var(--primary-600); border-radius: 999px; }
.dash-bar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--color-gray-700); }
.dark .dash-bar > i { background: var(--color-gray-200); }

.light { display: inline-block; width: .7rem; height: .7rem; border-radius: 999px; vertical-align: middle; }
.light--red { background: #dc2626; } .light--amber { background: #f59e0b; } .light--green { background: #16a34a; }
.text-red { color: #dc2626; } .text-amber { color: #b45309; } .text-green { color: #15803d; }
.dark .text-amber { color: #fbbf24; } .dark .text-green { color: #4ade80; } .dark .text-red { color: #f87171; }

.dash-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.dash-table th, .dash-table td { padding: .45rem .5rem; border-bottom: 1px solid var(--color-gray-200); text-align: left; vertical-align: top; }
.dark .dash-table th, .dark .dash-table td { border-color: var(--color-gray-800); }
.dash-table th { font-weight: 600; color: var(--color-gray-600); white-space: nowrap; }
.dash-table td.num, .dash-table th.num { text-align: right; }
.dash-scroll { overflow-x: auto; }
.dash-golive { border: 1px solid var(--color-gray-200); border-radius: .75rem; padding: .9rem 1rem; background: white; }
.dark .dash-golive { background: var(--color-gray-900); border-color: var(--color-gray-800); }
.dash-golive h4 { font-weight: 700; font-size: .95rem; margin-bottom: .35rem; }
.dash-golive dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; font-size: .85rem; }
.dash-golive dt { color: var(--color-gray-500); }
.dash-golive details { margin-top: .6rem; font-size: .8rem; }
.dash-golive summary { cursor: pointer; color: var(--primary-600); }
.dash-golive ol { margin: .4rem 0 0 1.1rem; list-style: decimal; }
.dash-golive li { margin-bottom: .25rem; }
.dash-muted { color: var(--color-gray-500); font-size: .8rem; }
.heat-0 { color: var(--color-gray-400); } .heat-1 { background: #dcfce7; } .heat-2 { background: #fef9c3; } .heat-3 { background: #fee2e2; font-weight: 700; }
.dark .heat-1 { background: #14532d; } .dark .heat-2 { background: #713f12; } .dark .heat-3 { background: #7f1d1d; }

/* Gantt */
.gantt-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: .75rem; }
/* Filtros del Gantt (D-085): cada título centrado sobre su campo y cada campo solo del ancho que necesita. */
.gantt-toolbar label { font-size: .8rem; color: var(--color-gray-600); display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; flex: none; }
.gantt-toolbar select { width: auto; max-width: 100%; }
.gantt-toolbar .gantt-check { flex-direction: row; align-items: center; gap: .4rem; height: 2.15rem; }
/* Palancas del Gantt (D-085, D-086): el título queda centrado sobre la barra; el valor elegido va a la derecha, fuera de ese centro. */
.gantt-toolbar .gantt-slider { margin-right: 6.5rem; }
.gantt-slider-ctl { position: relative; display: inline-flex; align-items: center; height: 2.15rem; }
.gantt-slider-ctl input[type=range] { width: 11rem; accent-color: #1F3A5F; cursor: pointer; }
.gantt-slider-ctl input[type=range].is-short { width: 6rem; }
.gantt-slider-ctl output { position: absolute; left: 100%; margin-left: .5rem; white-space: nowrap; font-weight: 600; color: var(--color-gray-800); }
.dark .gantt-slider-ctl output { color: var(--color-gray-100); }
.dark .gantt-slider-ctl input[type=range] { accent-color: #BCD3F0; }
.gantt-toolbar select { border: 1px solid var(--color-gray-300); border-radius: .5rem; padding: .35rem .5rem; background: white; color: inherit; }
.dark .gantt-toolbar select { background: var(--color-gray-900); border-color: var(--color-gray-700); }
.gantt-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--color-gray-200); border-radius: .75rem; background: white; }
.dark .gantt-wrap { background: var(--color-gray-950); border-color: var(--color-gray-800); }
.gantt-wrap svg { display: block; font-family: inherit; }
.gantt-labels { position: sticky; left: 0; z-index: 1; background: white; border-right: 1px solid var(--color-gray-300); }
.dark .gantt-labels { background: var(--color-gray-950); border-color: var(--color-gray-700); }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; color: var(--color-gray-600); margin-top: .5rem; }
.gantt-legend > span:not(.gantt-export)::before { content: ''; display: inline-block; width: 1.4rem; height: .6rem; border-radius: .2rem; margin-right: .35rem; vertical-align: middle; background: var(--sw); }

/* Matriz SKU */
.matrix { border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.matrix th, .matrix td { border-bottom: 1px solid var(--color-gray-200); border-right: 1px solid var(--color-gray-100); padding: .35rem .45rem; }
.dark .matrix th, .dark .matrix td { border-color: var(--color-gray-800); }
.matrix thead th { position: sticky; top: 0; background: var(--color-gray-50); z-index: 2; font-weight: 600; vertical-align: bottom; min-width: 6.5rem; }
.dark .matrix thead th { background: var(--color-gray-900); }
.matrix .sticky-col { position: sticky; left: 0; background: white; z-index: 1; min-width: 12rem; }
.dark .matrix .sticky-col { background: var(--color-gray-950); }
.matrix thead .sticky-col { z-index: 3; }
.cell { display: block; width: 100%; text-align: left; border: 0; border-radius: .35rem; padding: .3rem .4rem; cursor: pointer; font: inherit; color: inherit; background: var(--color-gray-100); }
.cell[disabled] { cursor: default; }
.cell--done { background: #dcfce7; color: #14532d; } .cell--in_progress { background: #dbeafe; color: #1e3a8a; }
.cell--na { background: var(--color-gray-200); color: var(--color-gray-600); } .cell--pending { background: #fef3c7; color: #78350f; }
.dark .cell--done { background: #14532d; color: #dcfce7; } .dark .cell--in_progress { background: #1e3a8a; color: #dbeafe; }
.dark .cell--na { background: var(--color-gray-800); color: var(--color-gray-300); } .dark .cell--pending { background: #78350f; color: #fef3c7; }
.cell small { display: block; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9rem; }

@media print {
    .fi-sidebar, .fi-topbar, .fi-header-actions, .dash-noprint { display: none !important; }
    .fi-main { padding: 0 !important; }
    .dash-golive details { display: block; }
    .dash-golive details > * { display: block !important; }
}

/* Centrado en tableros y matriz (D-075): títulos de tarjeta, indicadores, Go-Live, fechas y números. */
.dash-centered .fi-section-header { justify-content: center; text-align: center; }
.dash-centered .fi-section-header-heading { text-align: center; width: 100%; }
.dash-centered .dash-kpi-label, .dash-centered .dash-kpi-row { text-align: center; }
.dash-kpi { text-align: center; }
.dash-kpi-row > div { text-align: center; }
.dash-table th.num, .dash-table td.num, .dash-table th.c, .dash-table td.c { text-align: center; }
.dash-golive { text-align: center; }
.dash-golive h4 { justify-content: center; }
.dash-golive dl { justify-content: center; }
.dash-golive dt { text-align: right; }
.dash-golive dd { text-align: left; }
.dash-golive details ol { display: inline-block; text-align: left; }
.matrix thead th { text-align: center; }
.matrix .sticky-col { text-align: left; }
.cell { text-align: center; }
.dash-table th { text-align: center; }

/* Tablero general con nivel de detalle (D-087): palanca centrada; tarjetas a todo el ancho con tabla de paquetes/actividades. */
.dash-toolbar { justify-content: center; }
.dash-toolbar .gantt-slider { margin-inline: 6.5rem; }
.dash-grid--full { grid-template-columns: minmax(0, 1fr); }
.dash-detail td { text-align: center; vertical-align: middle; }
.dash-detail th.is-left, .dash-detail td.is-left { text-align: left; }
.dash-detail td:first-child { width: 1.5rem; }
.dash-detail-package td { font-weight: 600; background: rgb(31 58 95 / .05); }
.dark .dash-detail-package td { background: rgb(188 211 240 / .06); }
.dash-detail-activity td { font-size: .8rem; }
.dash-detail-activity td.is-left { padding-left: 1.6rem; }
.dash-detail-activity a { color: inherit; }
.dash-detail-activity a:hover { text-decoration: underline; }
.dash-detail-progress { min-width: 9rem; }
.dash-detail-progress .dash-bar { height: .4rem; }
.dash-code { font-family: ui-monospace, monospace; font-size: .75rem; color: var(--color-gray-500); margin-right: .3rem; }
.dash-golives-row.dash-grid { margin-top: .75rem; }
.dash-detail td, .dash-detail th { white-space: nowrap; }
.dash-detail td.is-left { white-space: normal; }
.dash-detail-progress .dash-bar { width: 7rem; margin-inline: auto; }
.dash-detail th.is-left, .dash-detail td.is-left { min-width: 16rem; }

/* Divisor arrastrable entre nombres y barras del Gantt (D-093). */
.gantt-labels { position: sticky; }
.gantt-splitter { position: absolute; top: 0; right: -5px; width: 10px; height: 100%; cursor: col-resize; z-index: 3; touch-action: none; }
.gantt-splitter::after { content: ''; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: transparent; transition: background .15s; }
.gantt-splitter:hover::after, .gantt-splitter:focus-visible::after, .gantt-splitter:active::after { background: #1F3A5F; }
.dark .gantt-splitter:hover::after, .dark .gantt-splitter:focus-visible::after, .dark .gantt-splitter:active::after { background: #BCD3F0; }
.gantt-splitter:focus-visible { outline: none; }

/* Gantt (D-094): título y controles en un renglón; franja de fechas fija al bajar; el Gantt ocupa el alto disponible. */
.gantt-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 1rem; }
.gantt-top .gantt-title { margin: 0; padding-bottom: .35rem; }
.gantt-top .gantt-toolbar { margin-bottom: 0; justify-content: flex-end; }
.gantt-wrap { max-height: calc(100vh - 11rem); }
.gantt-head { position: sticky; top: 0; z-index: 2; background: white; }
.dark .gantt-head { background: var(--color-gray-950); }
.gantt-wrap .gantt-labels { z-index: 3; }
.gantt-labels .gantt-head { z-index: 4; }
.gantt-top .gantt-toolbar { gap: .6rem; }
.gantt-top .gantt-toolbar select { max-width: 15rem; }
.gantt-top .gantt-slider-ctl input[type=range] { width: 9rem; }
.gantt-top .gantt-slider-ctl input[type=range].is-short { width: 5rem; }
.gantt-top .gantt-toolbar .gantt-slider { margin-right: 5rem; }
/* Exportar Gantt (D-095): botones a la derecha de la leyenda. */
.gantt-legend { align-items: center; }
.gantt-export { margin-left: auto; display: inline-flex; gap: .5rem; order: 99; }

/* Mis Pendientes (D-104): horizonte en días hábiles junto al nivel de detalle. */
.pending-toolbar { align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }
.pending-horizon { display: flex; flex-direction: column; align-items: center; gap: .2rem; font-size: .8rem; color: var(--color-gray-600); }
.pending-horizon-ctl { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; justify-content: center; min-height: 2.15rem; }
.pending-horizon-range { width: 12rem; accent-color: #1F3A5F; cursor: pointer; margin-left: .4rem; }
.dark .pending-horizon-range { accent-color: #BCD3F0; }
.pending-horizon-out { min-width: 15rem; color: var(--color-gray-800); white-space: nowrap; }
.pending-horizon-out span { color: var(--color-gray-500); margin-left: .25rem; }
.dark .pending-horizon-out { color: var(--color-gray-100); }

/* D-106: interruptor Inicio | Fin en Mis Pendientes. */
.pending-by { display: inline-flex; align-items: center; gap: .35rem; margin-right: .6rem; padding-right: .75rem; border-right: 1px solid var(--color-gray-200); }
.dark .pending-by { border-color: var(--color-gray-700); }
.pending-by-label { color: var(--color-gray-500); }
.pending-by-label.is-active { color: #1F3A5F; font-weight: 700; }
.dark .pending-by-label.is-active { color: #BCD3F0; }
.pending-switch { position: relative; width: 2.4rem; height: 1.3rem; border-radius: 999px; background: #1F3A5F; border: 0; cursor: pointer; padding: 0; }
.pending-switch span { position: absolute; top: .15rem; left: .15rem; width: 1rem; height: 1rem; border-radius: 999px; background: white; transition: left .15s; }
.pending-switch.is-on span { left: 1.25rem; }
.pending-switch:focus-visible { outline: 2px solid #1F3A5F; outline-offset: 2px; }

/* Configuración (D-110): formularios de parámetros y matriz de autorizaciones. */
.config-actions { display: flex; align-items: center; gap: .75rem; margin-top: .9rem; }
.authz-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.25rem; }
.authz-field { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--color-gray-600); }
.authz-inline { display: inline-flex; gap: .4rem; align-items: center; }
.authz-select { border: 1px solid var(--color-gray-300); border-radius: .5rem; padding: .35rem .5rem; min-width: 18rem; background: white; color: inherit; }
.dark .authz-select { background: var(--color-gray-900); border-color: var(--color-gray-700); }
.authz-note { font-size: .85rem; color: var(--color-gray-600); margin: 0; }
/* D-113: matriz compacta, solo del ancho necesario, con líneas visibles entre renglones y columnas. */
.authz-table { border-collapse: collapse; font-size: .8rem; width: auto; }
.authz-table td, .authz-table th { text-align: center; vertical-align: middle; padding: .15rem .45rem; border: 1px solid var(--color-gray-300); }
.dark .authz-table td, .dark .authz-table th { border-color: var(--color-gray-700); }
.authz-table th { font-weight: 600; color: var(--color-gray-600); line-height: 1.15; background: var(--color-gray-50); }
.dark .authz-table th { background: var(--color-gray-800); color: var(--color-gray-300); }
.authz-table th.is-left, .authz-table td.is-left { text-align: left; white-space: nowrap; font-weight: 600; }
.authz-table tbody tr:hover td { background: rgb(31 58 95 / .05); }
.authz-hint { margin-left: .3rem; font-size: .8rem; color: var(--color-gray-500); font-weight: 400; cursor: help; }
.authz-check { width: .95rem; height: .95rem; accent-color: #1F3A5F; cursor: pointer; vertical-align: middle; }
.authz-na { color: var(--color-gray-300); }
.authz-override { background: rgb(245 158 11 / .18); }
.authz-sensitive td.is-left { color: #b45309; }
.dark .authz-sensitive td.is-left { color: #fbbf24; }
