/* ============================================================
   AURAY GANTT - Sistema de variables CSS
   Propuesta 1: "Industrial Professional" (light)
   Propuesta 3: "Dark Factory" (dark)
   ============================================================ */

/* ── IMPORTAR TIPOGRAFÍAS ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── VARIABLES: TEMA CLARO (Industrial Professional) ─────── */
:root,
.light-mode {
    /* Paleta principal */
    --color-primary:        #1B2A4A;
    --color-primary-hover:  #243660;
    --color-secondary:      #2D3E5C;
    --color-accent:         #F0A500;
    --color-accent-hover:   #D99400;

    /* Fondos */
    --bg-app:               #F4F5F7;
    --bg-topbar:            #1B2A4A;
    --bg-panel:             #FFFFFF;
    --bg-panel-header:      #EEF1F6;
    --bg-gantt:             #FFFFFF;
    --bg-gantt-header:      #E8EDF4;
    --bg-row-even:          #FFFFFF;
    --bg-row-odd:           #F8F9FB;
    --bg-grid:              #FFFFFF;
    --bg-grid-alt:          #F8F9FB;
    --bg-dialog:            #FFFFFF;
    --bg-overlay:           rgba(0, 0, 0, 0.5);

    /* Textos */
    --text-primary:         #1A1A2E;
    --text-secondary:       #4B5563;
    --text-muted:           #9CA3AF;
    --text-topbar:          #FFFFFF;
    --text-on-accent:       #FFFFFF;

    /* Bordes */
    --border-color:         #D1D5DB;
    --border-strong:        #9CA3AF;
    --border-focus:         #1B2A4A;

    /* Estados */
    --color-success:        #10B981;
    --color-warning:        #F59E0B;
    --color-danger:         #EF4444;
    --color-info:           #3B82F6;
    --color-maint:          #8B5CF6;

    /* Gantt específico */
    --gantt-now-line:       #DC2626;
    --gantt-now-glow:       rgba(220, 38, 38, 0.2);
    --gantt-day-line:       #E5E7EB;
    --gantt-hour-line:      #F3F4F6;
    --gantt-row-height:     36px;

    /* Scrollbar */
    --scrollbar-track:      #F1F5F9;
    --scrollbar-thumb:      #CBD5E1;
    --scrollbar-thumb-hover:#94A3B8;

    /* Transiciones */
    --transition-fast:      0.15s ease;
    --transition-std:       0.2s ease;

    /* Tamaños */
    --topbar-height:        56px;
    --left-panel-width:     195px;
    --right-panel-width:    272px;
    --row-height:           36px;

    /* Sombras */
    --shadow-sm:            0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:            0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg:            0 8px 24px rgba(0,0,0,0.15);
}

/* ── VARIABLES: TEMA OSCURO (Dark Factory) ────────────────── */
.dark-mode {
    --color-primary:        #3B82F6;
    --color-primary-hover:  #2563EB;
    --color-secondary:      #1D4ED8;
    --color-accent:         #F59E0B;
    --color-accent-hover:   #D97706;

    --bg-app:               #0D1117;
    --bg-topbar:            #161B22;
    --bg-panel:             #161B22;
    --bg-panel-header:      #1F2937;
    --bg-gantt:             #0D1117;
    --bg-gantt-header:      #111827;
    --bg-row-even:          #0D1117;
    --bg-row-odd:           rgba(255,255,255,0.02);
    --bg-grid:              #161B22;
    --bg-grid-alt:          #1A1F2B;
    --bg-dialog:            #1F2937;
    --bg-overlay:           rgba(0, 0, 0, 0.75);

    --text-primary:         #F9FAFB;
    --text-secondary:       #9CA3AF;
    --text-muted:           #4B5563;
    --text-topbar:          #F9FAFB;
    --text-on-accent:       #0D1117;

    --border-color:         #30363D;
    --border-strong:        #4B5563;
    --border-focus:         #3B82F6;

    --color-success:        #22C55E;
    --color-warning:        #EAB308;
    --color-danger:         #EF4444;
    --color-info:           #60A5FA;
    --color-maint:          #A855F7;

    --gantt-now-line:       #FF4545;
    --gantt-now-glow:       rgba(255, 69, 69, 0.35);
    --gantt-day-line:       #1F2937;
    --gantt-hour-line:      #161B22;

    --scrollbar-track:      #1F2937;
    --scrollbar-thumb:      #374151;
    --scrollbar-thumb-hover:#4B5563;

    --shadow-sm:            0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:            0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg:            0 8px 24px rgba(0,0,0,0.6);
}

/* ── RESET Y BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }

/* ── SCROLLBAR CUSTOM ─────────────────────────────────────── */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ── GESTIÓN USUARIOS (admin) ────────────────────────────── */
.btn-left-admin {
    margin-top: 4px;
    border-top: 1px solid var(--border);
}
.admin-loading {
    text-align: center;
    padding: 24px 0;
    color: var(--text-secondary);
    font-size: .9rem;
}
.admin-user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.admin-user-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.admin-user-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}
.admin-user-table .col-center { text-align: center; }
.admin-row-self td { background: rgba(var(--accent-rgb, 59,130,246), .06); }

/* Badges */
.admin-badge-yo {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    vertical-align: middle;
}
.admin-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .76rem;
    font-weight: 600;
}
.admin-badge-admin { background: #8b5cf6; color: #fff; }
.admin-badge-user  { background: var(--bg-hover, rgba(0,0,0,.07)); color: var(--text-secondary); }

/* Toggle de permiso */
.admin-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 14px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 600;
    transition: opacity .15s, transform .1s;
}
.admin-toggle:disabled { opacity: .45; cursor: not-allowed; }
.admin-toggle:not(:disabled):hover { transform: scale(1.04); }
.toggle-on  { background: #22c55e; color: #fff; }
.toggle-off { background: var(--bg-hover, rgba(0,0,0,.1)); color: var(--text-secondary); }

/* ── Botón "Plantas" en el diálogo de gestión de usuarios ────────────────── */
.btn-plantas {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card, #0f2035);
    color: var(--text-secondary);
    font-size: .78rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn-plantas:hover { background: var(--bg-hover); border-color: var(--accent, #3b82f6); color: var(--text); }
.btn-plantas-open  { background: rgba(59,130,246,.12); border-color: var(--accent, #3b82f6); color: var(--accent, #3b82f6); }
.plantas-count {
    font-size: .7rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(59,130,246,.18);
    color: var(--accent, #3b82f6);
}

/* ── Fila expandida de permisos de planta ────────────────────────────────── */
.plants-row td {
    padding: 8px 16px 12px !important;
    background: rgba(var(--accent-rgb, 59,130,246), .03);
    border-bottom: 2px solid var(--accent, #3b82f6) !important;
}
.plants-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.plants-empty {
    font-size: .8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Botón de toggle individual por planta */
.plant-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 7px;
    border: 1px solid transparent;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .1s, box-shadow .15s;
    white-space: nowrap;
}
.plant-toggle:disabled { opacity: .45; cursor: not-allowed; }
.plant-toggle:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.plant-on  { background: #22c55e; color: #fff; border-color: #16a34a; }
.plant-off { background: rgba(239,68,68,.12); color: #ef4444; border-color: rgba(239,68,68,.35); }
.plant-icon { font-size: .85rem; }
.plant-name { letter-spacing: .02em; }

/* ── Panel de máquinas: fábrica de solo lectura ──────────────────────────── */
.factory-header.factory-readonly { opacity: .75; }
.factory-readonly-badge {
    display: inline-flex;
    align-items: center;
    color: #f59e0b;
    margin-left: 3px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(245,158,11,.5));
}

/* ── SIN PERMISOS — pantalla de acceso denegado ─────────── */
/* Usa la misma estructura visual que el login (dos paneles)  */
.sp-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
}

/* Icono candado grande con color rojo */
.sp-lock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 4px;
    color: #ef4444;
    filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.45));
}

/* Badge que muestra el nombre del usuario bloqueado */
.sp-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 4px 0 16px;
    font-size: 0.88rem;
    color: #8a9bb0;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 600;
}
.sp-user-badge svg { color: #ef4444; flex-shrink: 0; }

/* Botón para cerrar sesión e ir al login */
.sp-btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-top: 4px;
}
.sp-btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    color: #ffffff;
    text-decoration: none;
}
.sp-btn-logout:active { transform: translateY(0); }

/* Iconos de estado en el panel de stats del lado ilustración */
.sp-stat-icon { font-size: 1.05rem; }

/* ── SHELL PRINCIPAL ──────────────────────────────────────── */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-app);
    color: var(--text-primary);
    transition: background var(--transition-std), color var(--transition-std);
}

.main-content {
    flex: 1;
    overflow: hidden;
    display: flex;
}

/* ── TOP BAR ──────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    color: var(--text-topbar);
    padding: 0 16px;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
    gap: 12px;
    z-index: 100;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
}

.brand-icon { font-size: 20px; opacity: 0.9; }

.brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #FFFFFF;
}

.brand-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    font-weight: 400;
    letter-spacing: 0.3px;
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 8px;
    margin-left: 2px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}

.topbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.18);
    margin: 0 4px;
}

/* Usuario conectado (chip en la barra superior) */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    cursor: default;
    border: 1px solid rgba(255,255,255,0.15);
}
.topbar-user svg {
    opacity: 0.75;
    flex-shrink: 0;
}

/* Zoom control */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 3px 8px;
}

.zoom-slider {
    width: 90px;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.zoom-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    min-width: 28px;
    text-align: right;
}

/* Botones topbar */
.btn-icon {
    background: none;
    border: none;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    font-size: 14px;
    padding: 3px 6px;
    border-radius: 4px;
    transition: all var(--transition-fast);
    line-height: 1;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); color: #FFFFFF; }

.btn-topbar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.btn-topbar:hover { background: rgba(255,255,255,0.16); color: #FFFFFF; border-color: rgba(255,255,255,0.25); }

.btn-topbar.btn-accent { background: var(--color-accent); border-color: var(--color-accent); color: #1A1A2E; font-weight: 600; }
.btn-topbar.btn-accent:hover { background: var(--color-accent-hover); }

.btn-topbar.btn-success { background: rgba(16,185,129,0.2); border-color: rgba(16,185,129,0.4); color: #10B981; }
.btn-topbar.btn-success:hover { background: rgba(16,185,129,0.3); }

/* Botón Guardar con cambios pendientes — ámbar pulsante */
.btn-topbar.btn-guardar-pendiente {
    background: rgba(245,158,11,0.25);
    border-color: rgba(245,158,11,0.6);
    color: #F59E0B;
    animation: pulse-amber 1.8s ease-in-out infinite;
}
.btn-topbar.btn-guardar-pendiente:hover { background: rgba(245,158,11,0.4); animation: none; }
.btn-topbar.btn-guardar-pendiente:disabled { opacity: 0.6; cursor: not-allowed; animation: none; }

@keyframes pulse-amber {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
    50%       { box-shadow: 0 0 0 4px rgba(245,158,11,0.30); }
}

/* Estado desactivado durante carga — botones de acción ─────────────────── */
.btn-topbar:disabled,
.btn-icon:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-topbar:disabled:hover,
.btn-icon:disabled:hover {
    background: transparent;
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
}

/* Spinner del botón Recargar mientras carga ─────────────────────────────── */
.btn-topbar.btn-loading {
    opacity: 0.75;
    pointer-events: none;
}
.btn-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(26, 26, 46, 0.35);
    border-top-color: #1A1A2E;
    border-radius: 50%;
    animation: spin-btn 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin-btn {
    to { transform: rotate(360deg); }
}

/* Badge de conteo de cambios pendientes */
.badge-cambios {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #F59E0B;
    color: #1A1A2E;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    line-height: 1;
}

.btn-icon-sm { font-size: 13px; }

.btn-theme-toggle {
    font-size: 16px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: #f87171;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.btn-logout:hover {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.5);
    color: #fca5a5;
}

.btn-diag         { color: var(--text-muted); opacity: 0.45; transition: opacity 0.2s, color 0.2s; }
.btn-diag:hover   { opacity: 1; color: #F0A500; }
.btn-diag-active  { opacity: 1 !important; color: #F0A500 !important; }

.btn-compact        { color: var(--text-muted); opacity: 0.45; transition: opacity 0.2s, color 0.2s; }
.btn-compact:hover  { opacity: 1; color: var(--color-primary); }
.btn-compact-active { opacity: 1 !important; color: var(--color-primary) !important; }

/* ── PÁGINA PRINCIPAL ─────────────────────────────────────── */
.gantt-page {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: 100%;
    position: relative;   /* ancla el skeleton loader */
}

.center-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gantt-and-info {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.gantt-main {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--bg-gantt);
}

/* ── PANEL IZQUIERDO (Máquinas) ───────────────────────────── */
.left-panel {
    width: var(--left-panel-width);
    min-width: var(--left-panel-width);
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    transition: width var(--transition-std), min-width var(--transition-std),
                border-right-width var(--transition-std);
}
.left-panel.left-panel-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-right-width: 0;
}

.machine-panel {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 8px 0;
}
/* Cuando LÍNEAS está colapsado, liberar el espacio flex para que el FilterPanel suba */
.machine-panel.machine-panel-collapsed {
    flex: 0 0 auto;
    overflow-y: hidden;
}

.machine-panel-header {
    padding: 10px 12px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
    background: var(--bg-panel-header);
}

.factory-group { border-bottom: 1px solid var(--border-color); }

.factory-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    cursor: pointer;
    background: var(--bg-panel-header);
    transition: background var(--transition-fast);
}
.factory-header:hover { background: var(--border-color); }

.factory-check { cursor: pointer; accent-color: var(--color-primary); }

.factory-name {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

/* Colores por fábrica */
.factory-auray    { color: #1565C0; }
.factory-pipex    { color: #00695C; }
.factory-duopipe  { color: #6A1B9A; }
.factory-pedrogao { color: #E65100; }
.factory-moraleda { color: #E65100; }

.dark-mode .factory-auray    { color: #60A5FA; }
.dark-mode .factory-pipex    { color: #2DD4BF; }
.dark-mode .factory-duopipe  { color: #C084FC; }
.dark-mode .factory-pedrogao { color: #FB923C; }
.dark-mode .factory-moraleda { color: #FB923C; }

.factory-toggle { font-size: 10px; color: var(--text-muted); }

.machines-list { padding: 2px 0 4px 0; }

.machine-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 22px;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.machine-row:hover { background: var(--bg-row-odd); }
.machine-row.inactive { opacity: 0.45; }

.machine-check { cursor: pointer; accent-color: var(--color-primary); }

.machine-code {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.machine-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.machine-indicator.on  { background: var(--color-success); box-shadow: 0 0 4px var(--color-success); }
.machine-indicator.off { background: var(--text-muted); }

.machine-panel-footer { padding: 8px; }

.btn-ver-todo {
    width: 100%;
    padding: 6px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.btn-ver-todo:hover { background: var(--color-primary-hover); }

.left-panel-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

.left-panel-actions { padding: 8px; }

.btn-left-action {
    width: 100%;
    padding: 7px 8px;
    background: none;
    border: 1px dashed var(--border-strong);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}
.btn-left-action:hover { background: var(--bg-panel-header); border-color: var(--color-primary); color: var(--color-primary); }

/* ── PANEL DE FILTROS ─────────────────────────────────────── */
.filter-panel { padding: 8px 10px; }

.section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 6px 0 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.filter-group { margin-bottom: 12px; }

.filter-group-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}
.filter-check:hover { color: var(--text-primary); }
.filter-check input { cursor: pointer; accent-color: var(--color-primary); }

.check-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-green      { background: var(--color-success); }
.dot-amber      { background: var(--color-warning); }
.dot-auray      { background: #1565C0; }
.dot-pipex      { background: #00695C; }
/* Estado fabricación 0-5 */
.dot-estado-0   { background: #9CA3AF; }   /* Planificada  - gris claro */
.dot-estado-1   { background: #3B82F6; }   /* Programada   - azul */
.dot-estado-2   { background: #F59E0B; }   /* Lanzada      - ámbar */
.dot-estado-3   { background: #10B981; }   /* Iniciada     - verde */
/*.dot-estado-4   { background: #6366F1; }*/   /* Terminada    - índigo */
/*.dot-estado-5   { background: #EF4444; }*/   /* Anulada      - rojo */
.dot-duopipe  { background: #6A1B9A; }
.dot-pedrogao { background: #E65100; }

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0 8px;
    margin-bottom: 6px;
    transition: border-color var(--transition-fast);
}
.search-box:focus-within { border-color: var(--color-primary); }

.search-icon { color: var(--text-muted); font-size: 11px; }

.search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 5px 6px;
    font-size: 12px;
    color: var(--text-primary);
    outline: none;
}
.search-input::placeholder { color: var(--text-muted); }

.search-clear { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 12px; padding: 0; }
.search-clear:hover { color: var(--color-danger); }

.btn-limpiar {
    width: 100%;
    padding: 6px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 4px;
}
.btn-limpiar:hover { border-color: var(--color-danger); color: var(--color-danger); }

/* ── PANEL DERECHO (Info tarea) ───────────────────────────── */
.right-panel {
    width: var(--right-panel-width);
    min-width: var(--right-panel-width);
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
    transition: width var(--transition-std), min-width var(--transition-std),
                border-left-width var(--transition-std);
}
.right-panel.right-panel-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    border-left-width: 0;
}

.task-info-panel { padding: 0; }

.info-section {
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--border-color);
}

.task-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.info-grid { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.info-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 68px;
    flex-shrink: 0;
}

.info-value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}
.info-value.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.info-value.highlight { color: var(--color-warning); font-weight: 700; }

/* Nota libre del planificador (InfoOF) */
.info-nota {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 6px 0;
    padding: 6px 8px;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 4px;
    border-left: 2px solid #F59E0B;
}
.info-nota-icon { flex-shrink: 0; font-size: 12px; }
.info-nota-text { flex: 1; word-break: break-word; }

.task-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 8px 0;
    padding: 6px 8px;
    background: var(--bg-app);
    border-radius: 4px;
    border-left: 2px solid var(--border-color);
}

.task-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.flag {
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}
.flag-blocked { background: rgba(239,68,68,0.12); color: var(--color-danger); }
.flag-fixed   { background: rgba(245,158,11,0.12); color: var(--color-warning); }
.flag-changed { background: rgba(59,130,246,0.12); color: var(--color-info); }

.no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 12px;
}
.no-selection-icon { font-size: 24px; }

/* Contadores */
.counters-section { padding: 12px; }

.counter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.counter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-app);
    transition: transform var(--transition-fast);
}
.counter-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.counter-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}
.counter-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; text-align: center; }

.counter-prog    .counter-value { color: var(--color-success); }
.counter-noprog  .counter-value { color: var(--color-warning); }
.counter-total   .counter-value { color: var(--color-primary); }
.counter-alert   .counter-value { color: var(--color-danger); }

/* ── GANTT ────────────────────────────────────────────────── */
.gantt-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-gantt);
    overflow: hidden;
}

/* Fila del header de fechas */
.gantt-header-row {
    display: flex;
    height: 42px;
    flex-shrink: 0;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-gantt-header);
    overflow: hidden;
}

.gantt-header-spacer {
    width: 90px;
    min-width: 90px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-panel-header);
}

.gantt-date-header {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.date-header-inner { position: relative; height: 100%; }

.date-cell {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 1px solid var(--border-color);
}

.date-day {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.date-month {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.hour-label {
    position: absolute;
    bottom: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text-muted);
    transform: translateX(-50%);
}

.now-line-header {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--gantt-now-line);
    transform: translateX(-1px);
    z-index: 5;
}

/* Cuerpo Gantt */
.gantt-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.gantt-machine-labels {
    width: 90px;
    min-width: 90px;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
    background: var(--bg-panel);
    flex-shrink: 0;
}

.machine-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: var(--row-height);
    padding: 0 8px;
    border-bottom: 1px solid var(--border-color);
    position: relative;            /* necesario para .machine-occ-bar (position: absolute) */
}

.machine-label-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.machine-label-factory {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* ── Líneas compatibles / incompatibles al seleccionar una OF ───────────── */
.machine-label.machine-compatible {
    background: rgba(16, 185, 129, 0.14);
    border-left: 3px solid #10B981;
    transition: background 0.2s, border-left 0.2s;
}
.machine-label.machine-incompatible {
    opacity: 0.42;
    filter: grayscale(0.4);
    transition: opacity 0.2s, filter 0.2s;
}

/* ── Barra de ocupación de línea ─────────────────────────────────────────── */
.machine-occ-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    min-width: 0;
    border-radius: 0 2px 0 0;
    transition: width 0.4s ease, background 0.4s ease;
    opacity: 0.88;
}
/* Animación de pulso rojo cuando la línea está sobrecargada (>100%) */
.machine-occ-bar.occ-overload {
    animation: occ-pulse 1.4s ease-in-out infinite;
}
@keyframes occ-pulse {
    0%, 100% { opacity: 0.88; }
    50%       { opacity: 0.45; }
}

/* ── Agrupación visual por fábrica ──────────────────────────────────────── */

/* Línea separadora en la primera etiqueta de cada grupo de fábrica         */
.machine-label.factory-first {
    border-top: 2px solid rgba(140, 140, 170, 0.22);
}

/* Indicador de color por fábrica usando inset box-shadow (no altera height) */
.machine-label.factory-manzanares { box-shadow: inset 4px 0 0 0 #3B82F6; background: rgba(59,  130, 246, 0.07); }
.machine-label.factory-palau      { box-shadow: inset 4px 0 0 0 #10B981; background: rgba(16,  185, 129, 0.07); }
.machine-label.factory-duopipe    { box-shadow: inset 4px 0 0 0 #F59E0B; background: rgba(245, 158,  11, 0.07); }
.machine-label.factory-pedrogao   { box-shadow: inset 4px 0 0 0 #EF4444; background: rgba(239,  68,  68, 0.07); }
.machine-label.factory-moraleda   { box-shadow: inset 4px 0 0 0 #8B5CF6; background: rgba(139,  92, 246, 0.07); }

/* Las clases compatible/incompatible sustituyen el indicador de fábrica    */
.machine-label.machine-compatible   { box-shadow: inset 3px 0 0 0 #10B981; }
.machine-label.machine-incompatible { box-shadow: none; }

/* Franja de color sutil en las filas del canvas por fábrica                */
.bg-row-line.factory-manzanares.row-even { background: rgba(59,  130, 246, 0.055); }
.bg-row-line.factory-manzanares.row-odd  { background: rgba(59,  130, 246, 0.028); }
.bg-row-line.factory-palau.row-even      { background: rgba(16,  185, 129, 0.055); }
.bg-row-line.factory-palau.row-odd       { background: rgba(16,  185, 129, 0.028); }
.bg-row-line.factory-duopipe.row-even    { background: rgba(245, 158,  11, 0.055); }
.bg-row-line.factory-duopipe.row-odd     { background: rgba(245, 158,  11, 0.028); }
.bg-row-line.factory-pedrogao.row-even   { background: rgba(239,  68,  68, 0.055); }
.bg-row-line.factory-pedrogao.row-odd    { background: rgba(239,  68,  68, 0.028); }
.bg-row-line.factory-moraleda.row-even   { background: rgba(139,  92, 246, 0.055); }
.bg-row-line.factory-moraleda.row-odd    { background: rgba(139,  92, 246, 0.028); }

/* Línea separadora entre grupos de fábricas en el canvas                   */
.bg-row-line.factory-first-row {
    border-top: 1px solid rgba(120, 120, 160, 0.20);
}

/* ── Modo compacto (filas de 24 px) ─────────────────────────────────────── */
/* La variable --row-height se inyecta inline desde GanttContainer.razor;
   .machine-label ya usa height: var(--row-height) y se adapta sola.
   Solo necesitamos ajustar los textos internos que no caben en 24 px.       */

.gantt-wrapper.compact-mode .machine-label-factory {
    display: none;                  /* no cabe el subtítulo de fábrica en 24 px */
}
.gantt-wrapper.compact-mode .machine-label-code {
    font-size: 10px;
}
.gantt-wrapper.compact-mode .gantt-task .task-of,
.gantt-wrapper.compact-mode .gantt-task .task-pedido {
    font-size: 9px;
    line-height: 1.2;
}

/* ── Tooltip rico del Gantt ─────────────────────────────────────────────── */
.gantt-tooltip-popup {
    position: fixed;
    z-index: 99999;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    padding: 10px 13px;
    min-width: 210px;
    max-width: 300px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    font-size: 12px;
    line-height: 1.4;
}
.gtt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
}
.gtt-of {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gtt-estado-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.gtt-dot { flex-shrink: 0; }
.gtt-estado-text {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}
.gtt-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 2px 0;
    gap: 12px;
}
.gtt-lbl {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.45px;
    flex-shrink: 0;
}
.gtt-val {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 11px;
    text-align: right;
}
.gtt-desc {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-scroll-area {
    flex: 1;
    overflow: auto;
    position: relative;
}

.gantt-canvas { position: relative; }

/* Líneas de fondo */
.bg-day-line {
    position: absolute;
    top: 0;
    width: 1px;
    background: var(--gantt-day-line);
    z-index: 1;
}

.bg-hour-line {
    position: absolute;
    top: 0;
    width: 1px;
    background: var(--gantt-hour-line);
    z-index: 1;
}

.bg-row-line {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 0;
}
.row-even { background: var(--bg-row-even); }
.row-odd  { background: var(--bg-row-odd); }

/* Línea "Ahora" */
.now-line {
    position: absolute;
    top: 0;
    width: 2px;
    background: var(--gantt-now-line);
    z-index: 10;
    box-shadow: 0 0 6px var(--gantt-now-glow), 0 0 14px var(--gantt-now-glow);
    transform: translateX(-1px);
}

.dark-mode .now-line {
    box-shadow: 0 0 10px var(--gantt-now-glow), 0 0 22px var(--gantt-now-glow);
}

.now-line-label {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 8px;
    font-weight: 700;
    color: var(--gantt-now-line);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Tareas Gantt */
.gantt-task {
    position: absolute;
    border-radius: 4px;
    border: 1.5px solid transparent;
    cursor: grab;
    z-index: 5;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    user-select: none;
}
.gantt-task:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 20;
}
.gantt-task.task-blocked {
    cursor: not-allowed;
}

.gantt-task.task-selected {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 5px #3B82F6;
    z-index: 15;
    transform: translateY(-2px);
    animation: selected-pulse 2s ease-in-out infinite;
}
@keyframes selected-pulse {
    0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 5px #3B82F6; }
    50%       { box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(59, 130, 246, 0.55); }
}

.gantt-task.task-blocked { border-style: dashed; opacity: 0.85; }
.gantt-task.task-fija    { cursor: not-allowed; }
.gantt-task.task-maint   { border-style: dashed; }
.gantt-task.task-overlap {
    border: 2px solid #EF4444 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
    animation: overlap-pulse 1.8s ease-in-out infinite;
}
@keyframes overlap-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35); }
    50%       { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18); }
}

.task-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    text-align: right;
}

.task-of {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-pedido {
    font-size: 9px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-formato {
    font-size: 8px;
    opacity: 0.65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

.task-lock, .task-pin { font-size: 10px; flex-shrink: 0; }

/* Pin fija: rojo = retrasada respecto a FechaFijadaGraficador; amarillo = en plazo */
.task-pin.pin-rojo {
    background: rgba(239, 68, 68, 0.25);
    border-radius: 3px;
    outline: 1px solid #EF4444;
}
.task-pin.pin-amarillo {
    background: rgba(245, 158, 11, 0.25);
    border-radius: 3px;
    outline: 1px solid #F59E0B;
}

.task-changed-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-info);
}

/* Panel sin asignar */
.unassigned-panel {
    border-top: 1px solid var(--border-color);
    background: var(--bg-panel);
    max-height: 120px;
    overflow-y: auto;
}

.unassigned-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: var(--bg-panel-header);
    border-bottom: 1px solid var(--border-color);
}

.badge-count {
    background: var(--color-warning);
    color: #1A1A2E;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.unassigned-list { padding: 4px 0; }

.unassigned-task {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.unassigned-task:hover { background: var(--bg-row-odd); }

.ua-of  { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; min-width: 60px; color: var(--text-primary); }
.ua-pedido { font-size: 10px; color: var(--text-muted); min-width: 55px; }
.ua-desc { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── SPLITTER ─────────────────────────────────────────────── */
.vertical-splitter {
    height: 6px;
    background: var(--border-color);
    cursor: ns-resize;
    flex-shrink: 0;
    transition: background var(--transition-fast);
    position: relative;
}
.vertical-splitter:hover { background: var(--color-primary); }
.vertical-splitter::after {
    content: '⋯';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
}

/* ── TABS INFERIORES ──────────────────────────────────────── */
.bottom-area { overflow: hidden; display: flex; flex-direction: column; }

.bottom-tabs { display: flex; flex-direction: column; height: 100%; }

.tab-header-bar {
    display: flex;
    background: var(--bg-panel-header);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); background: var(--bg-row-odd); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

.tab-count {
    background: var(--border-color);
    color: var(--text-secondary);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}
.tab-count.alert { background: rgba(239,68,68,0.15); color: var(--color-danger); }

.tab-content { flex: 1; overflow: hidden; }

/* ── GRIDS DE DATOS ───────────────────────────────────────── */
.grid-container { height: 100%; overflow: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-panel-header);
    padding: 7px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    z-index: 5;
}
.data-table thead th:hover { color: var(--text-primary); background: var(--bg-row-odd); }

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
    cursor: pointer;
}
.data-table tbody tr:hover { background: var(--bg-row-odd) !important; }
.data-table tbody tr:nth-child(even) { background: var(--bg-grid-alt); }

.data-table td {
    padding: 6px 10px;
    color: var(--text-primary);
    vertical-align: middle;
    white-space: nowrap;
}

.data-table .row-noprog { background: rgba(245,158,11,0.05) !important; }
.data-table .row-alert { background: rgba(239,68,68,0.05) !important; }
.data-table tbody tr.row-selected,
.data-table tbody tr.row-selected:hover {
    background: rgba(21, 101, 192, 0.13) !important;
    box-shadow: inset 3px 0 0 0 var(--color-primary);
}

.font-bold { font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--color-danger) !important; }
.text-ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

/* Badges de estado */
.estado-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.estado-prog   { background: rgba(16,185,129,0.12); color: var(--color-success); }
.estado-noprog { background: rgba(245,158,11,0.12); color: var(--color-warning); }

/* Chips de fábrica */
.factory-chip {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.factory-chip.factory-auray    { background: rgba(21,101,192,0.12); color: #1565C0; }
.factory-chip.factory-pipex    { background: rgba(0,105,92,0.12);   color: #00695C; }
.factory-chip.factory-duopipe  { background: rgba(106,27,154,0.12); color: #6A1B9A; }
.factory-chip.factory-pedrogao { background: rgba(230,81,0,0.12);   color: #E65100; }
.factory-chip.factory-moraleda { background: rgba(230,81,0,0.12);   color: #E65100; }

.dark-mode .factory-chip.factory-auray    { color: #60A5FA; background: rgba(96,165,250,0.12); }
.dark-mode .factory-chip.factory-pipex    { color: #2DD4BF; background: rgba(45,212,191,0.12); }
.dark-mode .factory-chip.factory-duopipe  { color: #C084FC; background: rgba(192,132,252,0.12); }
.dark-mode .factory-chip.factory-pedrogao { color: #FB923C; background: rgba(251,146,60,0.12); }
.dark-mode .factory-chip.factory-moraleda {
    color: #FB923C;
    background: rgba(251,146,60,0.12);
}

/* ── DIÁLOGOS ─────────────────────────────────────────────── */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.dialog-box {
    background: var(--bg-dialog);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    min-width: 340px;
    max-width: 480px;
    width: 90%;
    animation: slideIn 0.15s ease;
}

.dialog-lg  { max-width: 520px; }
.dialog-xl  { max-width: 980px; width: 90vw; }

/* ── Tabla de confirmación de guardado ─────────────────────────── */
.confirm-table-wrap { overflow-x: auto; margin-top: 4px; }

.confirm-changes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.confirm-changes-table th,
.confirm-changes-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}
.confirm-changes-table th {
    background: var(--bg-panel-header);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.confirm-changes-table tbody tr:hover { background: var(--bg-row-hover, rgba(0,0,0,.03)); }

.cct-of       { font-weight: 700; color: var(--text-primary); font-family: var(--font-mono, monospace); }
.cct-anterior { color: #F59E0B; text-decoration: line-through; opacity: .85; }
.cct-nuevo    { color: #10B981; font-weight: 600; }
.cct-igual    { color: var(--text-secondary); }

@keyframes slideIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.dialog-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.dialog-icon { font-size: 18px; }

.dialog-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.dialog-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    transition: background 0.15s, color 0.15s;
}
.dialog-close-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

.dialog-body { padding: 20px; }

.dialog-help { color: var(--text-secondary); font-size: 12px; margin-bottom: 14px; line-height: 1.5; }

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

.btn-dialog {
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}
.btn-cancel    { background: var(--bg-app); color: var(--text-secondary); }
.btn-cancel:hover { color: var(--text-primary); }
.btn-confirm   { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.btn-confirm:hover { background: var(--color-primary-hover); }
.btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--bg-panel-header); color: var(--text-secondary); }
.btn-secondary:hover { color: var(--text-primary); }
.btn-warning   { background: #F59E0B; color: white; border-color: #F59E0B; }
.btn-warning:hover { background: #D97706; border-color: #D97706; }
.btn-danger    { background: #EF4444; color: white; border-color: #EF4444; }
.btn-danger:hover  { background: #DC2626; border-color: #DC2626; }

/* Campos de formulario en diálogos */
.form-field { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; letter-spacing: 0.3px; }
.form-input {
    width: 100%;
    padding: 7px 10px;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast);
    font-family: inherit;
}
.form-input:focus { border-color: var(--color-primary); }
.form-textarea { resize: vertical; min-height: 70px; }

/* ── TOAST NOTIFICACIONES ─────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    min-width: 260px;
    max-width: 380px;
    color: #FFFFFF;
}

.toast-success { background: var(--color-success); }
.toast-danger  { background: var(--color-danger); }
.toast-info    { background: var(--color-info); }
.toast-warning { background: var(--color-warning); color: #1A1A2E; }

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg  { overflow-wrap: break-word; word-break: break-word; line-height: 1.45; }

/* ── Toast warning: centrado, impactante, con backdrop ───────────────────── */
.toast-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.40);
    z-index: 1999;
    animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.toast-container-center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    right: auto;
    z-index: 2000;
    animation: warnPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes warnPop {
    from { transform: translate(-50%, -50%) scale(0.65); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
}
.toast-container-center .toast-warning {
    font-size: 15px;
    font-weight: 700;
    padding: 22px 30px;
    min-width: 360px;
    max-width: 560px;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45),
                0 0 0 1px rgba(245, 158, 11, 0.35);
    gap: 16px;
}
.toast-container-center .toast-icon { font-size: 28px; }

/* ── MENÚ CONTEXTUAL DEL GANTT ────────────────────────────── */
.ctx-backdrop {
    position: fixed;
    inset: 0;
    z-index: 8999;
}
.gantt-context-menu {
    position: fixed;
    z-index: 9000;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #D1D5DB);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
    min-width: 230px;
    padding: 4px 0;
    animation: ctx-appear 0.12s ease;
}
@keyframes ctx-appear {
    from { opacity: 0; transform: scale(0.93) translateY(-4px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary, #1A1A2E);
    text-align: left;
    transition: background 0.12s;
}
.ctx-item:hover {
    background: rgba(59, 130, 246, 0.09);
}
.ctx-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.ctx-separator {
    height: 1px;
    background: var(--border, #D1D5DB);
    margin: 4px 0;
}
/* Dark mode */
.dark-mode .gantt-context-menu {
    background: var(--bg-card, #1F2937);
    border-color: var(--border, #374151);
}
.dark-mode .ctx-item {
    color: var(--text-primary, #F9FAFB);
}
.dark-mode .ctx-item:hover {
    background: rgba(96, 165, 250, 0.12);
}

/* ── SKELETON LOADER ─────────────────────────────────────────────────────── */

/* Variables del shimmer — colores sólidos para contraste real */
:root {
    --sk-base:   #D4D9E2;   /* gris perla sobre fondo claro  */
    --sk-shine:  #EBEEf3;   /* destello más claro            */
    --sk-speed:  1.7s;
    --sk-radius: 4px;
}
.dark-mode {
    --sk-base:   #1E2836;   /* azul pizarra sobre dark       */
    --sk-shine:  #29384E;   /* destello más claro            */
}

/* Contenedor principal — cubre todo el gantt-page */
.gantt-skeleton {
    position: absolute;
    inset: 0;
    z-index: 600;
    display: flex;
    overflow: hidden;
    background: var(--bg-app);
    animation: sk-fadein 0.18s ease-out both;
}

@keyframes sk-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Hueso base con ola de shimmer */
.sk-bone {
    flex-shrink: 0;
    background: linear-gradient(
        90deg,
        var(--sk-base)  0%,
        var(--sk-base)  25%,
        var(--sk-shine) 45%,
        var(--sk-shine) 55%,
        var(--sk-base)  75%,
        var(--sk-base)  100%
    );
    background-size: 300% 100%;
    animation: sk-wave var(--sk-speed) ease-in-out infinite;
    border-radius: var(--sk-radius);
}

@keyframes sk-wave {
    0%   { background-position: 100% center; }
    100% { background-position:   0% center; }
}

/* ── Panel izquierdo ──────────────────────────────────────── */
.sk-left {
    width: var(--left-panel-width);
    min-width: var(--left-panel-width);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    overflow: hidden;
}

.sk-section-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    min-height: 34px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-panel-header);
}

.sk-machine-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 22px;
    height: 36px;
    border-bottom: 1px solid rgba(128,128,128,0.06);
    flex-shrink: 0;
}

.sk-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
}

/* ── Área central ─────────────────────────────────────────── */
.sk-center {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sk-top-area {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

/* ── Canvas Gantt ─────────────────────────────────────────── */
.sk-gantt {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-gantt);
    border-right: 1px solid var(--border-color);
}

.sk-date-header {
    display: flex;
    gap: 4px;
    padding: 0 10px;
    height: 38px;
    align-items: center;
    background: var(--bg-gantt-header);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sk-date-cell {
    flex: 1;
    height: 14px;
}

.sk-task-row {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 8px;
    border-bottom: 1px solid rgba(128,128,128,0.05);
    flex-shrink: 0;
}

.sk-task-bar {
    height: 22px;
    min-width: 24px;
    border-radius: 5px;
    flex-shrink: 0;
    /* Sin sk-bone: colores primarios sólidos ciclantes sin conflicto de gradiente */
    animation: sk-bar-colors 5s linear infinite;
}

@keyframes sk-bar-colors {
    0%   { background: #EF4444; }   /* rojo    */
    16%  { background: #F59E0B; }   /* naranja */
    33%  { background: #22C55E; }   /* verde   */
    50%  { background: #3B82F6; }   /* azul    */
    66%  { background: #8B5CF6; }   /* violeta */
    83%  { background: #EC4899; }   /* rosa    */
    100% { background: #EF4444; }   /* rojo    */
}

/* Caption en la parte superior */
.sk-loading-caption {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    animation: sk-pulse 2s ease-in-out infinite;
}

@keyframes sk-pulse {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 1;   }
}

/* ── Panel derecho ────────────────────────────────────────── */
.sk-right {
    width: var(--right-panel-width);
    min-width: var(--right-panel-width);
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    overflow: hidden;
}

.sk-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 14px;
    height: 33px;
    border-bottom: 1px solid rgba(128,128,128,0.06);
    flex-shrink: 0;
}

/* ── Panel inferior (grid) ────────────────────────────────── */
.sk-bottom-panel {
    height: 185px;
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-grid);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sk-tab-row {
    display: flex;
    gap: 6px;
    padding: 7px 12px;
    height: 36px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-panel-header);
    flex-shrink: 0;
}

.sk-tab {
    height: 18px;
    width: 78px;
    border-radius: 3px;
}

.sk-grid-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 14px;
    height: 30px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-gantt-header);
    flex-shrink: 0;
}

.sk-grid-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 14px;
    height: 29px;
    border-bottom: 1px solid rgba(128,128,128,0.05);
    flex-shrink: 0;
}


/* ── LOADING (spinner legacy — se mantiene por si hace falta) ─ */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 30, 0.72);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 500;
    border-radius: 8px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.15);
    border-top-color: #F0A500;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

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

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: #0f1923;
}

/* ── Panel formulario (derecha) ── */
.login-panel {
    width: 480px;
    min-width: 420px;
    order: 2;                               /* va a la derecha */
    background: #141e2b;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    z-index: 1;
    box-shadow: -4px 0 24px rgba(0,0,0,0.4);
}

/* .illustration-panel completo definido más abajo */

.login-content {
    width: 100%;
    max-width: 380px;
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container .brand-icon {
    font-size: 3rem;
    color: #4A90D9;
}

.login-logo {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
}

.app-subtitle {
    color: #4A90D9;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.login-header {
    margin-bottom: 1.75rem;
}

.login-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0 0 0.4rem;
}

.login-header p {
    color: #8a9bb0;
    font-size: 0.9rem;
    margin: 0;
}

/* ── Formulario ── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #8a9bb0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .form-control {
    width: 100%;
    background: #1a2535;
    border: 1.5px solid #2a3a52;
    border-radius: 8px;
    padding: 0.65rem 2.6rem 0.65rem 2.6rem;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.input-wrapper .form-control:focus {
    border-color: #4A90D9;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}

.input-wrapper .form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-wrapper > svg {
    position: absolute;
    left: 0.75rem;
    width: 16px;
    height: 16px;
    color: #4A90D9;
    pointer-events: none;
}

.input-wrapper .icon-left {
    left: 0.75rem;
}

.btn-toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    color: #4A90D9;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-toggle-password:hover { opacity: 1; }

.btn-toggle-password svg {
    width: 16px;
    height: 16px;
}

.validation-message {
    font-size: 0.78rem;
    color: #f87171;
}

/* ── Alerta de error ── */
.alert.alert-error {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(248,113,113,0.12);
    border: 1px solid rgba(248,113,113,0.35);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    color: #f87171;
    font-size: 0.88rem;
}

.alert.alert-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── Opciones (recordarme) ── */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

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

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid #2a3a52;
    border-radius: 4px;
    background: #1a2535;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.checkbox-wrapper input:checked + .checkbox-custom {
    background: #4A90D9;
    border-color: #4A90D9;
}

.checkbox-custom svg {
    width: 11px;
    height: 11px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.15s;
}

.checkbox-wrapper input:checked + .checkbox-custom svg { opacity: 1; }

.checkbox-label {
    font-size: 0.85rem;
    color: #8a9bb0;
}

/* ── Botón login ── */
.btn-login {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #2563eb, #4A90D9);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 0.5rem;
}

.btn-login:hover:not(:disabled) { opacity: 0.9; }
.btn-login:active:not(:disabled) { transform: scale(0.98); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-login .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Footer ── */
.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #4a5568;
}

.login-footer a {
    color: #4A90D9;
    text-decoration: none;
}

/* ── Panel ilustración (izquierda) ── */
.illustration-panel {
    flex: 1;
    order: 1;
    background: linear-gradient(160deg, #0f1923 0%, #1a2f45 50%, #0d2137 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Estrellas */
.stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 40%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 30%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 75%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 85%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 20%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 55%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 90%, rgba(255,255,255,0.4) 0%, transparent 100%);
}

/* Nubes */
.cloud {
    position: absolute;
    background: rgba(255,255,255,0.04);
    border-radius: 50px;
    animation: cloudDrift 20s ease-in-out infinite;
}

.cloud-1 { width: 200px; height: 40px; top: 15%; left: -60px; animation-delay: 0s; }
.cloud-2 { width: 140px; height: 30px; top: 30%; right: -40px; animation-delay: -8s; }

@keyframes cloudDrift {
    0%, 100% { transform: translateX(0); }
    50%       { transform: translateX(30px); }
}

/* ── Título del panel ilustración ── */
.illus-header {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem 2rem 0.5rem;
}

.illus-title {
    color: #e2e8f0;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    line-height: 1.3;
}

.illus-subtitle {
    color: #4A90D9;
    font-size: 0.82rem;
    margin: 0;
    opacity: 0.85;
}

/* ── Diagrama Gantt SVG ── */
.illus-gantt-wrapper {
    position: relative;
    z-index: 2;
    padding: 0.5rem 2rem 0.25rem;
    width: 100%;
}

.illus-gantt-svg {
    width: 85%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 6px 18px rgba(0,0,0,0.5));
    border-radius: 10px;
}

/* ── Stats ── */
.illus-stats {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.75rem 1.5rem;
    background: rgba(13,31,53,0.6);
    margin: 0 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(74,144,217,0.15);
}

.illus-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.illus-stat-value {
    color: #4A90D9;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.illus-stat-label {
    color: #8a9bb0;
    font-size: 0.72rem;
    margin-top: 2px;
}

.illus-stat-divider {
    width: 1px;
    height: 32px;
    background: rgba(74,144,217,0.2);
    margin: 0 0.5rem;
}

/* ── Features ── */
.illus-features {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem 1.5rem;
}

.illus-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(13,31,53,0.5);
    border: 1px solid rgba(74,144,217,0.12);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    color: #8a9bb0;
    font-size: 0.78rem;
    line-height: 1.4;
}

.illus-feature-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Responsive: ocultar ilustración en pantallas pequeñas */
@media (max-width: 768px) {
    .illustration-panel { display: none; }
    .login-panel { width: 100%; }
}

/* ── BOTONES TOGGLE DE PANELES LATERALES ─────────────────── */
/* Finas tiras verticales clicables en los bordes del área Gantt */
.panel-toggle-btn {
    flex-shrink: 0;
    width: 14px;
    background: var(--bg-panel-header);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
    z-index: 10;
}
.panel-toggle-btn:hover {
    background: var(--color-primary);
    color: #fff;
}
.panel-toggle-left  { border-right: 1px solid var(--border-color); }
.panel-toggle-right { border-left:  1px solid var(--border-color); }

/* En pantalla completa, el toggle izquierdo no tiene sentido */
html.gantt-fullscreen-active .panel-toggle-left { display: none !important; }

/* ── SPOTLIGHT SEARCH ────────────────────────────────────── */
.spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 24px 40px;
    animation: fadeIn 0.12s ease;
}

.spotlight-modal {
    width: 100%;
    max-width: min(96vw, 1280px);
    background: var(--bg-dialog);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: spotlightPop 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes spotlightPop {
    from { transform: scale(0.93) translateY(-12px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);     opacity: 1; }
}

.spotlight-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.spotlight-icon { color: var(--text-muted); flex-shrink: 0; }

.spotlight-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
}
.spotlight-input::placeholder { color: var(--text-muted); }

.spotlight-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 4px;
    transition: color var(--transition-fast), background var(--transition-fast);
}
.spotlight-clear:hover { color: var(--color-danger); background: rgba(239,68,68,0.08); }

.spotlight-results { max-height: 400px; overflow-y: auto; }

/* Grid de 8 columnas: TAG | OF | Artículo | Desc. artículo | Cód.Cliente | Nombre cliente | Máq | Fecha */
.ss-item {
    display: grid;
    grid-template-columns: 72px 120px 150px 1fr 95px 220px 68px 44px;
    align-items: center;
    column-gap: 12px;
    padding: 9px 18px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}
.ss-item:last-child { border-bottom: none; }
.ss-item:hover, .ss-item.ss-active {
    background: rgba(59, 130, 246, 0.09);
}
.dark-mode .ss-item:hover,
.dark-mode .ss-item.ss-active {
    background: rgba(96, 165, 250, 0.12);
}

/* Estilos comunes de celda */
.ss-item > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges de tipo */
.ss-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    text-align: center;
}
.ss-tag-of       { background: rgba(59,130,246,0.15); color: #3B82F6; }
.ss-tag-articulo { background: rgba(16,185,129,0.15); color: #10B981; }
.ss-tag-formato  { background: rgba(139,92,246,0.15); color: #8B5CF6; }
.ss-tag-centro   { background: rgba(245,158,11,0.15); color: #F59E0B; }
.ss-tag-cliente  { background: rgba(239,68,68,0.15);  color: #EF4444; }

.ss-of {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.ss-articulo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #10B981;
}

.ss-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.ss-cliente-cod {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #EF4444;
}

.ss-cliente-nombre {
    font-size: 11px;
    color: var(--text-secondary);
}

.ss-maquina {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

.ss-fecha {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

.spotlight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    background: var(--bg-panel-header);
}

.spotlight-keys {
    display: flex;
    align-items: center;
    gap: 2px;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 5px;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 10px;
    color: var(--text-secondary);
    box-shadow: 0 1px 0 var(--border-color);
    margin: 0 1px;
}

.spotlight-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.spotlight-hint {
    padding: 8px 0;
}
.sh-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-secondary);
}
.sh-item:hover { background: var(--bg-row-odd); }

/* Botón de búsqueda en TopBar */
.btn-spotlight {
    color: rgba(255,255,255,0.65);
}
.btn-spotlight:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* ── ACORDEÓN ─────────────────────────────────────────────── */
/* Cabeceras colapsables en MachinePanel, FilterPanel y TaskInfoPanel */
.accordion-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.accordion-header:hover { opacity: 0.82; }

.btn-accordion {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0 2px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    line-height: 1;
    transition: transform var(--transition-fast), color var(--transition-fast);
    transform-origin: center;
}
.btn-accordion:hover { color: var(--text-primary); }
.btn-accordion.collapsed { transform: rotate(-90deg); }

/* ── MODO PANTALLA COMPLETA ───────────────────────────────── */
/* La clase 'gantt-fullscreen-active' se añade/quita en <html> via JS.
   Blazor nunca hace DOM-diff sobre <html>, así que la clase persiste
   entre re-renders y los display:none se aplican de forma estable. */

html.gantt-fullscreen-active .topbar            { display: none !important; }
html.gantt-fullscreen-active .left-panel        { display: none !important; }
html.gantt-fullscreen-active .vertical-splitter { display: none !important; }
html.gantt-fullscreen-active .bottom-area       { display: none !important; }
html.gantt-fullscreen-active .main-content      { height: 100vh; }

/* Botón flotante para salir de pantalla completa */
.fullscreen-exit-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    background: rgba(15, 20, 35, 0.72);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    transition: background var(--transition-fast), transform var(--transition-fast);
    letter-spacing: 0.2px;
}
.fullscreen-exit-btn:hover {
    background: rgba(15, 20, 35, 0.92);
    transform: scale(1.03);
}
.fullscreen-exit-btn svg {
    opacity: 0.85;
}

.loading-text { font-size: 13px; color: #fff; font-weight: 500; white-space: nowrap; }

/* ── Banner de filtro activo en la grid de Producción ─────────────────────── */
.grid-filter-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    background: rgba(59, 130, 246, 0.10);
    border-bottom: 1px solid rgba(59, 130, 246, 0.25);
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.grid-filter-icon { font-size: 13px; }
.grid-filter-banner strong { color: #3B82F6; font-weight: 700; }
.grid-filter-clear {
    margin-left: auto;
    padding: 2px 9px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 10px;
    background: none;
    color: #3B82F6;
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.grid-filter-clear:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: #3B82F6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CRUD CLIENTES PERMITIDOS POR MÁQUINA  (.cmc-*)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Botón de acceso (TopBar, solo admin) */
.btn-clientes {
    color: rgba(255,255,255,0.65);
}
.btn-clientes:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Diálogo — anula max-width:480px heredado de .dialog-box */
.dialog-clientes {
    width: min(96vw, 1280px);
    max-width: min(96vw, 1280px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* ── Selector de planta (pills) ──────────────────────────────────────────── */
.cmc-fab-selector {
    display: flex;
    flex-wrap: nowrap;       /* una sola línea siempre */
    overflow-x: auto;        /* scroll horizontal si no caben en pantallas pequeñas */
    gap: 6px;
    padding: 12px 20px 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-panel-header);
    scrollbar-width: none;   /* ocultar scrollbar (Firefox) */
}
.cmc-fab-selector::-webkit-scrollbar { display: none; } /* ocultar scrollbar (Chrome) */

.cmc-fab-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-app);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.cmc-fab-pill:hover {
    border-color: #3B82F6;
    color: #3B82F6;
    background: rgba(59,130,246,0.06);
}
.cmc-fab-pill-active {
    background: #3B82F6;
    border-color: #3B82F6;
    color: #fff;
    font-weight: 600;
}
.cmc-fab-pill-active:hover {
    background: #2563EB;
    border-color: #2563EB;
    color: #fff;
}

/* Badge de cantidad de máquinas con restricción */
.cmc-fab-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    background: rgba(255,255,255,0.25);
    color: inherit;
    line-height: 1.4;
}
.cmc-fab-pill:not(.cmc-fab-pill-active) .cmc-fab-badge {
    background: rgba(59,130,246,0.15);
    color: #3B82F6;
}

/* Loading y estado vacío */
.cmc-loading-wrap {
    padding: 32px 20px;
    text-align: center;
}
.cmc-empty {
    padding: 28px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Cuerpo scrollable */
.cmc-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    max-height: 52vh;
}

/* Fila de máquina */
.cmc-maq-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    min-height: 38px;
}
.cmc-maq-row:hover {
    background: var(--bg-row-hover);
}

/* Bloque info de máquina (código + descripción) */
.cmc-maq-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
    flex-shrink: 0;
    padding-top: 3px;
}

.cmc-maq-cod {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.cmc-maq-desc {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

/* Área de chips */
.cmc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
    align-items: center;
}

/* Texto cuando no hay restricciones */
.cmc-sin-restriccion {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* Chip de cliente */
.cmc-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.30);
    border-radius: 12px;
    padding: 2px 5px 2px 8px;
    font-size: 11px;
    color: #3B82F6;
    white-space: nowrap;
}

/* Tooltip global (JS) — position:fixed evita recorte por overflow:auto */
.js-tooltip {
    position: fixed;
    background: #1e293b;
    color: #f1f5f9;
    padding: 5px 11px;
    border-radius: 5px;
    font-size: 11px;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.cmc-chip-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}
.cmc-chip-del {
    background: none;
    border: none;
    padding: 0 2px;
    cursor: pointer;
    color: rgba(59, 130, 246, 0.55);
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}
.cmc-chip-del:hover {
    color: #EF4444;
}

/* Botón "+ Añadir" */
.cmc-btn-add {
    padding: 2px 9px;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    background: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
}
.cmc-btn-add:hover {
    border-color: #3B82F6;
    color: #3B82F6;
    background: rgba(59, 130, 246, 0.07);
}

/* Panel inline de búsqueda de cliente */
.cmc-add-panel {
    width: 100%;
    position: relative;
    margin-top: 4px;
}
.cmc-search-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cmc-search-input {
    flex: 1;
    padding: 5px 30px 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
    transition: border-color var(--transition-fast);
}
.cmc-search-input:focus {
    border-color: #3B82F6;
}
.cmc-btn-cancel {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    line-height: 1;
    transition: color var(--transition-fast);
}
.cmc-btn-cancel:hover {
    color: #EF4444;
}

/* Dropdown de resultados */
.cmc-resultados {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.30);
    z-index: 200;
    max-height: 210px;
    overflow-y: auto;
}
.cmc-resultado {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}
.cmc-resultado:last-child {
    border-bottom: none;
}
.cmc-resultado:hover {
    background: var(--bg-row-hover);
}
.cmc-resultado-ya {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}
.cmc-resultado-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    flex-shrink: 0;
}
.cmc-resultado-desc {
    flex: 1;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cmc-resultado-badge {
    font-size: 10px;
    color: #10B981;
    white-space: nowrap;
}
.cmc-resultados-empty {
    padding: 10px 14px;
    color: var(--text-muted);
    font-size: 12px;
}

/* Footer del diálogo */
.cmc-footer-hint {
    font-size: 11px;
    color: var(--text-muted);
    flex: 1;
}
.cmc-footer-danger  { color: #EF4444; font-weight: 600; }
.cmc-footer-pending { color: #F59E0B; font-weight: 600; }

/* ── Panel de confirmación de eliminaciones ── */
.cmc-confirm-wrap {
    padding: 20px;
}
.cmc-confirm-intro {
    font-size: 13px;
    color: var(--text-primary);
    margin: 0 0 16px;
}
.cmc-confirm-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cmc-confirm-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.20);
    border-radius: 7px;
}
.cmc-confirm-maq {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 80px;
    padding-top: 2px;
    flex-shrink: 0;
}
.cmc-confirm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
/* Chip en vista de confirmación (rojo en lugar de azul) */
.cmc-chip-del-preview {
    background: rgba(239, 68, 68, 0.10) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    color: #EF4444 !important;
}
.cmc-confirm-chip-desc {
    font-size: 10px;
    color: rgba(239, 68, 68, 0.70);
    font-style: italic;
    margin-left: 3px;
}

/* ── Diálogo de exportación Excel ── */
.dialog-excel {
    width: 520px;
}
.exc-loading {
    padding: 32px 24px;
    text-align: center;
}
.exc-body {
    padding: 0;
    max-height: 420px;
    overflow-y: auto;
}
.exc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.exc-th {
    position: sticky;
    top: 0;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.exc-th-vis   { width: 54px; text-align: center; }
.exc-th-col   { text-align: left; }
.exc-th-ancho { width: 80px; text-align: center; }
.exc-tr {
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}
.exc-tr:hover {
    background: var(--bg-secondary);
}
.exc-tr-hidden {
    opacity: .45;
}
.exc-td {
    padding: 6px 10px;
    color: var(--text-primary);
}
.exc-td-vis   { text-align: center; }
.exc-td-col   { font-size: 13px; }
.exc-td-ancho { text-align: center; }
.exc-check {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--color-primary, #3B82F6);
}
.exc-input-ancho {
    width: 62px;
    padding: 3px 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 12px;
    text-align: right;
    outline: none;
}
.exc-input-ancho:focus {
    border-color: var(--color-primary, #3B82F6);
}
.exc-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-right: auto;
}
