/* =====================================================================
   RESET CORE - SKIN "SOFT HUMAN" (Amigable, Cálido, Flotante)
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. VARIABLES GLOBALES (El Motor)
   --------------------------------------------------------------------- */
:root {
    /* Paleta Cálida / Human-Centric */
    --bg-main: #fafaf9; /* Crema/Piedra muy suave, no blanco puro */
    --bg-card: #ffffff;
    --text-main: #3f3f46; /* Gris Zinc, menos agresivo que el negro/pizarra */
    --text-muted: #71717a;
    
    /* Acentos Amigables */
    --brand-primary: #6366f1; /* Índigo vibrante y moderno */
    --brand-accent: #f43f5e;  /* Rosa/Sandía en lugar de Ámbar duro */
    --brand-danger: #ef4444;  /* Rojo suave */
    --brand-success: #10b981; /* Verde esmeralda fresco */
    --brand-warning: #f59e0b;
    
    /* Geometría y Profundidad (Soft UI) */
    --border-color: #f4f4f5; /* Bordes casi invisibles */
    --radius: 16px; /* Curvas amplias y amables */
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.05); /* Sombras difusas que hacen flotar */
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);

    /* Tipografía */
    --font-ui: 'Inter', 'Nunito', system-ui, -apple-system, sans-serif;
    --font-data: 'JetBrains Mono', monospace;
}

/* ---------------------------------------------------------------------
   2. BASE Y ESTRUCTURA (El Chasis)
   --------------------------------------------------------------------- */
body { 
    font-family: var(--font-ui); 
    background: var(--bg-main); 
    /* Eliminamos la grilla matemática para un fondo limpio y relajante */
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
}

#body_login { display: flex; justify-content: center; align-items: center; }
#body_interno { padding: 2rem; }

/* Encabezados Globales */
.header-section { margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; }
.header-title { margin: 0; color: var(--text-main); font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; }
.header-desc { color: var(--text-muted); margin-top: 5px; font-size: 0.95rem; }

/* ---------------------------------------------------------------------
   3. COMPONENTES UI (Las Piezas)
   --------------------------------------------------------------------- */

/* --- Tarjetas y Paneles --- */
.card, .card-section, .panel, .card-admin, .history-card, .trash-container, .table-container, .chart-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    transition: box-shadow 0.3s ease;
}
.card:hover, .panel:hover { box-shadow: var(--shadow-lg); }
.card-admin h3, .panel-header { margin-top: 0; text-transform: uppercase; letter-spacing: 1px; font-size: 0.95rem; }

/* --- Formularios --- */
.form-group { margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label, label { font-weight: 700; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.input-full, .input-edit, .textarea-edit, .search-bar {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid transparent;
    border-radius: 12px; /* Inputs suaves */
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    background: #f4f4f6; /* Fondo gris muy suave */
    transition: all 0.3s ease;
}
.input-full:focus, .input-edit:focus, .textarea-edit:focus, .search-bar:focus {
    outline: none;
    border-color: transparent;
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); /* Halo índigo suave */
}
.textarea-edit { min-height: 80px; resize: vertical; }

/* --- Botones --- */
.btn, .btn-submit, .btn-sm {
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 100px; /* Forma de píldora (muy amigable) */
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 0.95rem;
}
.btn-primary { background: var(--text-main); color: white; }
.btn-primary:hover { background: #27272a; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-accent { background: var(--brand-primary); color: white; }
.btn-accent:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
.btn-danger { background: var(--brand-danger); color: white; }
.btn-link-danger { color: var(--brand-danger); background: none; border: none; cursor: pointer; font-weight: 800; font-size: 1rem; padding: 0; transition: color 0.2s;}
.btn-link-danger:hover { color: #b91c1c; }

/* --- Modales (Dialogs) --- */
dialog {
    margin: 5vh auto;
    width: 600px;
    max-width: 95vw;
    max-height: 90vh;
    border: none;
    border-radius: 24px; /* Modales extra amigables */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 0; 
    background: var(--bg-card);
    color: var(--text-main);
}
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { 
    background: rgba(63, 63, 70, 0.4); /* Backdrop más cálido */
    backdrop-filter: blur(5px); 
}
.modal-header { 
    padding: 1.5rem 2rem; 
    border-bottom: 1px solid var(--border-color); 
    background: #fafaf9; 
    display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; 
}
.modal-body { padding: 1.5rem 2rem; overflow-y: auto; flex: 1; }
dialog > div:last-child { flex-shrink: 0; }
.btn-close { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--text-muted); transition: color 0.2s; }
.btn-close:hover { color: var(--brand-danger); }

/* --- Tablas --- */
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { background: #fafaf9; padding: 1rem; text-align: left; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; border-bottom: 2px solid var(--border-color); letter-spacing: 0.5px; }
td { padding: 1rem; border-bottom: 1px solid var(--border-color); font-size: 0.95rem; color: var(--text-main); }
tr:hover td { background-color: #fafaf9; }

/* --- Etiquetas y Alertas --- */
.badge, .status-pill, .meta-tag, .project-tag-small, .project-badge, .log-tag, .wip-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 800; /* Píldoras redonditas */
    text-transform: uppercase; font-family: var(--font-ui); /* Quitamos la fuente técnica aquí para ser más amables */
    letter-spacing: 0.5px;
}
.alert-banner { padding: 1.5rem; border-radius: var(--radius); margin-bottom: 2.5rem; display: flex; align-items: center; gap: 1.2rem; border: 1px solid; box-shadow: var(--shadow-sm); }
.danger-zone { border: 1px solid #fecaca; background: #fef2f2; padding: 2rem; border-radius: var(--radius); margin-top: 2rem; }

/* ---------------------------------------------------------------------
   4. MÓDULOS ESPECÍFICOS (Layouts)
   --------------------------------------------------------------------- */

/* =====================================================================
   NAVEGACIÓN PRINCIPAL (El Puente de Mando)
   ===================================================================== */
.main-nav { 
    background: var(--brand-primary); /* Menú Índigo vibrante */
    border-radius: 20px; 
    margin-bottom: 2.5rem; 
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2); 
    display: flex; flex-direction: column; font-family: var(--font-ui);
}

.mobile-header { display: none; }
.desktop-brand { display: flex; align-items: center; }

.nav-links { display: flex; justify-content: space-between; width: 100%; padding: 0 1rem; box-sizing: border-box; }
.nav-left, .nav-right { display: flex; align-items: center; }

.nav-item { 
    color: rgba(255,255,255,0.8); 
    text-decoration: none; font-weight: 600; padding: 1.2rem 1rem; display: flex; align-items: center; gap: 0.5rem; 
    transition: all 0.2s; background: transparent; border: none; font-size: 0.95rem; cursor: pointer; font-family: inherit;
}
.nav-item:hover { color: white; background: rgba(255,255,255,0.1); border-radius: 12px; margin: 0.2rem 0; padding: 1rem; }
.nav-item.active { border-bottom: 3px solid white; color: white; padding-bottom: calc(1.2rem - 3px); }

/* Menús Desplegables */
.dropdown { position: relative; display: inline-block; }
.dropdown-content { 
    display: none; position: absolute; right: 0; background-color: var(--bg-card); min-width: 240px; 
    box-shadow: var(--shadow-lg); z-index: 100; border-radius: 16px; overflow: hidden; border: 1px solid var(--border-color); top: 100%;
    padding: 0.5rem;
}
.dropdown:hover .dropdown-content { display: block; animation: dropFade 0.2s ease; }
@keyframes dropFade { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.dropdown-content a { 
    color: var(--text-main); padding: 0.8rem 1.2rem; text-decoration: none; display: block; font-size: 0.9rem; 
    border-radius: 8px; transition: background 0.2s; margin-bottom: 2px;
}
.dropdown-content a:hover { background-color: var(--bg-main); color: var(--brand-primary); }
.dropdown-content a.sub-active { background-color: #e0e7ff; color: var(--brand-primary); font-weight: 700; }

.dropdown-header { padding: 0.8rem 1.2rem 0.3rem 1.2rem; font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); font-weight: 800; letter-spacing: 1px; }

.notif-container { position: relative; display: flex; align-items: center; padding: 0 1.2rem; border-left: 1px solid rgba(255,255,255,0.2); height: 100%; }
.user-profile { display: flex; align-items: center; gap: 1rem; margin-left: 0; padding-left: 1.2rem; height: 100%; border-left: 1px solid rgba(255,255,255,0.2); }
/* Perfil de usuario apilado (Nombre arriba, Rol abajo) */
.user-name { 
    color: white; 
    font-size: 0.9em; 
    font-weight: 600; 
    display: flex; 
    flex-direction: column; /* Esto es lo que rompe la horizontalidad y los apila */
    align-items: center;    /* Centra el badge justo debajo del nombre */
    justify-content: center;
    line-height: 1.2;
    gap: 4px;               /* Separación milimétrica entre el nombre y la píldora */
}

/* Reseteamos cualquier margen lateral que tuviera el badge al estar originalmente al lado */
.user-name span, 
.user-name .badge {
    margin-left: 0 !important;
    font-size: 0.7em; /* Un poco más pequeño para que el nombre sea el protagonista */
    padding: 2px 8px;
}

.brand-text { color: white; font-weight: 800; font-size: 1.2em; letter-spacing: -0.5px; }
.logo-icon { background: white; color: var(--brand-primary); padding: 2px 8px; border-radius: 8px; font-size: 0.8em; margin-right: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

@media (max-width: 768px) {
    .main-nav { padding: 0; border-radius: 0; }
    .mobile-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; background: var(--brand-primary); }
    .hamburger-btn { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: 0; }
    .desktop-brand { display: none !important; }
    .nav-links { display: none; flex-direction: column; padding: 0; }
    .nav-links.show { display: flex; } 
    .nav-left, .nav-right { flex-direction: column; width: 100%; align-items: stretch; }
    .notif-container { display: none; } 
    .nav-item { padding: 1rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.1); justify-content: flex-start; }
    .nav-item.active { border-bottom: none; border-left: 4px solid white; background: rgba(0,0,0,0.1); padding-bottom: 1rem; padding-left: calc(1.2rem - 4px); }
    .dropdown-content { position: static; width: 100%; box-shadow: none; border: none; background: rgba(0,0,0,0.1); display: none; border-radius: 0; padding: 0; }
    .dropdown:focus-within .dropdown-content { display: block; }
    .dropdown-content a { color: white; border-bottom: 1px solid rgba(255,255,255,0.1); padding: 1rem 1.2rem 1rem 2.5rem; border-radius: 0; }
    .dropdown-header { background: transparent; color: rgba(255,255,255,0.6); padding-left: 1.2rem; }
    .user-profile { margin: 0; padding: 1rem 1.2rem; border-left: none; background: rgba(0,0,0,0.1); justify-content: space-between; }
    .dropdown.user-dropdown { border-left: none !important; padding-left: 0 !important; margin-left: 0 !important; }
}

/* --- Tracker (index.php) --- */
.tracker-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; align-items: center; }
.timer-display-box { text-align: center; background: white; padding: 3rem 2rem; border-radius: 24px; border: none; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; align-items: center; }
.timer-numbers { font-family: var(--font-ui); font-size: 5rem; font-weight: 900; color: var(--brand-primary); letter-spacing: -2px; line-height: 1; margin-bottom: 1.5rem; font-variant-numeric: tabular-nums; }

.btn-tracker { width: 100%; padding: 1.2rem; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; border-radius: 100px; font-weight: 800; cursor: pointer; border: none; transition: all 0.3s; }
.btn-tracker.start { background: var(--brand-primary); color: white; box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3); }
.btn-tracker.start:hover { transform: translateY(-3px); box-shadow: 0 15px 25px rgba(99, 102, 241, 0.4); }
.btn-tracker.stop { background: #fff1f2; color: #e11d48; }
.btn-tracker.stop:hover { background: #e11d48; color: white; box-shadow: 0 10px 20px rgba(225, 29, 72, 0.3); }

.recording-indicator { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 800; color: var(--brand-danger); text-transform: uppercase; opacity: 0; transition: opacity 0.3s; margin-bottom: 1rem; }
.recording-indicator.active { opacity: 1; }
.dot-pulse { width: 12px; height: 12px; background-color: var(--brand-danger); border-radius: 50%; animation: pulse-red 1.5s infinite; }

/* --- Dashboard y Proyectos --- */
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; align-items: start; }

.panel { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); display: flex; flex-direction: column; overflow: hidden; margin-bottom: 2rem; transition: box-shadow 0.3s; }
.panel-header { padding: 1.2rem 1.5rem; font-weight: 800; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; color: white; border-bottom: none; }

/* --- PROYECTOS TÁCTICOS (proyectos.php) --- */
.grid-proyectos { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 2rem; align-items: start; margin-bottom: 3rem; }
.card-proyecto { 
    background: var(--bg-card); padding: 1.8rem; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); 
    border-top: 6px solid var(--brand-primary); display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease; 
}
.card-proyecto:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.card-proyecto-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.card-proyecto-title { margin: 0; color: var(--text-main); font-size: 1.3rem; font-weight: 800; }
.card-proyecto-badges { margin-bottom: 1.2rem; }
.card-proyecto-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.card-proyecto .btn-group { margin-top: auto; padding-top: 1.5rem; display: flex; gap: 0.8rem; }
.btn-group .btn { flex: 1; text-align: center; font-size: 0.85rem; padding: 0.6rem 1rem; }
.btn-group .btn-primary { flex: 2; }
.btn-secondary { background: var(--bg-main); color: var(--text-main); border: 1px solid transparent; }
.btn-secondary:hover { background: #e4e4e7; }

.badge-owner { background: #dcfce7; color: #166534; border: none; }
.badge-guest { background: #e0e7ff; color: #3730a3; border: none; }
.badge-warning-outline { font-size: 0.75rem; background: #ffedd5; color: #c2410c; padding: 4px 12px; border-radius: 20px; font-weight: 800; border: none; }
.badge-success-outline { background: #dcfce7; color: #166534; border: none; }

.health-stats { display: flex; justify-content: space-between; font-size: 0.8rem; font-family: var(--font-ui); font-weight: 800; margin-bottom: 8px; }
.health-no-limit { font-family: var(--font-ui); font-size: 0.8rem; color: var(--text-muted); font-weight: 800; }
.health-no-limit span { color: var(--brand-primary); }
.health-bar-container { background: #f4f4f5; height: 10px; border-radius: 10px; margin: 12px 0; overflow: hidden; width: 100%; }
.health-bar-fill { height: 100%; border-radius: 10px; transition: width 0.5s ease-in-out; }

.panel-form { overflow: visible; margin-bottom: 2.5rem; }
.form-inline-row { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-end; }
.fg-grow { flex-grow: 2; min-width: 250px; margin: 0; }
.fg-md { min-width: 200px; margin: 0; }
.fg-sm { width: 120px; margin: 0; }
.fg-xs { width: 80px; margin: 0; }
.color-picker-btn { padding: 0; height: 45px; border-radius: 50%; cursor: pointer; overflow: hidden; border: 2px solid white; box-shadow: 0 2px 5px rgba(0,0,0,0.1); width: 45px;}
.btn-tall { height: 45px; }

.freezer-title { margin-top: 3rem; color: var(--text-muted); border-bottom: 2px solid var(--border-color); padding-bottom: 0.8rem; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.freezer-list { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 3rem; }
.freezer-item-info { display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem; }
.freezer-item-title { margin: 0; color: var(--text-main); font-size: 1.1rem; font-weight: 800; }

.admin-switch-label { font-size: 0.85em; color: var(--text-muted); font-weight: bold; text-transform: uppercase; }

/* Redondeo para los encabezados de los paneles */
.bg-danger { background: var(--brand-danger); }
.bg-dark   { background: var(--text-main); }
.bg-purple { background: #8b5cf6; } 
.bg-grey   { background: var(--text-muted); }

.list-item { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border-color); display: block; text-decoration: none; transition: background 0.2s; border-left: 4px solid transparent; }
.list-item:hover { background: #fafaf9; border-left-color: var(--brand-primary); }
.list-item:last-child { border-bottom: none; }

.item-title { font-weight: 800; color: var(--text-main); font-size: 1rem; margin-bottom: 8px; line-height: 1.3; }
.item-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; flex-wrap: wrap; gap: 8px; color: var(--text-muted);}
.meta-status { font-weight: 800; font-family: var(--font-ui); color: var(--brand-primary); }

.row-pausado { display: flex; justify-content: space-between; align-items: center; background: white; padding: 1.2rem 1.5rem; border-radius: var(--radius); border-left: 6px solid var(--text-muted); margin-bottom: 0.8rem; box-shadow: var(--shadow-sm); }

.admin-switch-container { display: flex; align-items: center; gap: 10px; background: white; padding: 6px 12px; border-radius: 100px; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.admin-switch-pill { display: flex; background: #f4f4f5; border-radius: 100px; overflow: hidden; padding: 2px; gap: 2px; }
.admin-switch-pill a { padding: 6px 16px; border-radius: 100px; text-decoration: none; font-size: 0.85em; font-weight: 800; transition: all 0.3s; color: var(--text-muted); }

@media (max-width: 1400px) { .dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* =====================================================================
   MÓDULO KANBAN (kanban.php)
   ===================================================================== */
.kanban-board { display: flex; gap: 1.5rem; overflow-x: auto; padding-bottom: 1.5rem; min-height: calc(100vh - 300px); align-items: stretch; }
.kanban-col { 
    background: #f4f4f6; /* Fondo suave para columnas */
    border-radius: 20px; 
    flex: 1; min-width: 320px; 
    padding: 1.2rem; 
    display: flex; flex-direction: column; gap: 1rem; 
    border: 1px dashed #e4e4e7; 
    transition: background 0.3s; 
}
.kanban-col.wip-alert { background: #fef2f2; border-color: #fecaca; border-style: solid; }

.kanban-col-header { font-weight: 800; padding-bottom: 1rem; border-bottom: 2px solid #e4e4e7; margin-bottom: 0.5rem; display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; font-size: 0.85rem; color: var(--text-main); }
.kanban-col-actions { display: flex; align-items: center; gap: 8px; }

.kanban-card { background: var(--bg-card); padding: 1.5rem; border-radius: 16px; box-shadow: var(--shadow-sm); cursor: grab; position: relative; border: none; border-left: 6px solid var(--brand-primary); transition: transform 0.2s, box-shadow 0.2s; user-select: none; }
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.kanban-card:active { cursor: grabbing; transform: scale(0.98); }
.kanban-card.blocked { background: #fffbeb; border-left-color: #f59e0b; }

.card-title-box { font-weight: 800; margin-bottom: 8px; color: var(--text-main); line-height: 1.4; font-size: 1.05rem; }
.card-meta-box { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.card-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 15px; border-top: 1px solid var(--border-color); padding-top: 10px; }
.card-footer-icons { display: flex; flex-direction: column; gap: 5px; }
.card-icons-row { display: flex; gap: 10px; align-items: center; }

.wip-badge { font-family: var(--font-ui); font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; font-weight: 800; }
.wip-badge.ok { background: white; color: var(--text-muted); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.wip-badge.full { background: var(--brand-danger); color: white; }

.priority-badge { font-family: var(--font-ui); font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; }
.blocked-alert { font-size: 0.75rem; color: #b91c1c; margin-top: 10px; background: #fee2e2; padding: 6px 10px; border-radius: 8px; font-weight: 700; display: inline-block; }
.date-badge { font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; display: inline-block; font-weight: 800; color: white; }
.date-danger { background: var(--brand-danger); }
.date-warning { background: var(--brand-accent); }
.date-safe { background: var(--text-muted); }

.icon-badge { font-size: 0.85rem; font-weight: 800; margin-right: 8px; }
.icon-comments { color: var(--brand-primary); }
.icon-links { color: var(--brand-accent); }

.checklist-indicator { font-size: 0.8rem; font-weight: 800; }
.check-done { color: var(--brand-success); }
.check-pend { color: var(--text-muted); }

.kanban-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.action-box { background: white; padding: 1.8rem; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: none; }
.action-box-title { color: var(--text-main); font-weight: 800; display: block; margin-bottom: 1.2rem; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }

.modal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.comment-container { max-height: 300px; overflow-y: auto; background: #fafaf9; padding: 1.5rem; border-radius: 16px; display: flex; flex-direction: column; gap: 1rem; border: 1px solid var(--border-color); }
.comment-box { max-width: 85%; padding: 1rem 1.2rem; border-radius: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: none; }
.comment-mine { align-self: flex-end; background: var(--brand-primary); color: white; border-bottom-right-radius: 4px; }
.comment-other { align-self: flex-start; background: white; border-bottom-left-radius: 4px; }
.comment-meta { font-size: 0.75em; opacity: 0.8; margin-bottom: 6px; font-weight: 800; text-transform: uppercase; color: inherit; }
.comment-text { font-size: 0.95em; line-height: 1.5; color: inherit; }
.mention-dropdown { position: absolute; bottom: 100%; left: 0; background: white; border: none; border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 150px; overflow-y: auto; z-index: 1000; width: 100%; margin-bottom: 10px; }
.mention-item { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid var(--border-color); font-size: 0.95em; color: var(--text-main); font-weight: 600; }
.mention-item:hover { background: #e0e7ff; color: var(--brand-primary); }

.arena-modal { width: 600px; text-align: center; padding: 3rem; }
.arena-vs-container { display: flex; gap: 2rem; justify-content: center; align-items: stretch; margin: 2.5rem 0; }
.arena-btn { flex: 1; min-height: 140px; font-size: 1.1rem; white-space: normal; padding: 2rem; line-height: 1.5; border-radius: 20px; }
.arena-vs-text { font-weight: 900; color: var(--text-muted); font-size: 1.5rem; display: flex; align-items: center; }
.arena-progress { font-size: 0.9em; color: var(--text-muted); margin-bottom: 1.5rem; font-family: var(--font-ui); font-weight: 800; }

.mb-1 { margin-bottom: 1rem; }
.mt-1 { margin-top: 1rem; }
.hidden { display: none; }

/* --- CONFIGURACIÓN DE PROYECTO (proyecto_detalle.php) --- */
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2.5rem; align-items: start; }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 5px; font-weight: 800; letter-spacing: 0.5px; }
.breadcrumb a { color: inherit; text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--brand-primary); }
.badge-readonly { background: #ffedd5; color: #92400e; margin-top: 10px; }

.readonly-box { background: #fafaf9; border: 1px solid var(--border-color); padding: 1.5rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.readonly-value { font-family: var(--font-ui); font-size: 1.4rem; font-weight: 900; color: var(--brand-primary); margin-bottom: 1.5rem; }
.color-preview { display: flex; align-items: center; gap: 10px; font-family: var(--font-ui); font-weight: 800; color: var(--text-main); }
.color-swatch { display: inline-block; width: 28px; height: 28px; border-radius: 50%; border: none; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

.stats-container { display: flex; flex-wrap: wrap; gap: 1rem; }
.stat-pill { background: white; padding: 0.8rem 1.2rem; border-radius: 100px; font-size: 0.85rem; border: 1px solid var(--border-color); font-family: var(--font-ui); font-weight: 800; color: var(--text-muted); box-shadow: var(--shadow-sm); }
.stat-pill span { color: var(--brand-primary); font-size: 1.1em; margin-right: 6px;}

.admin-table { width: 100%; border-collapse: collapse; min-width: unset; }
.admin-table td { padding: 1.2rem 0; border-bottom: 1px solid var(--border-color); }
.admin-table tr:last-child td { border-bottom: none; }
.td-right { text-align: right; }
.td-meta { color: var(--text-muted); font-family: var(--font-ui); font-size: 0.85rem; font-weight: 600; }

.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.form-row { display: flex; gap: 1rem; margin-bottom: 1.5rem; align-items: center; }
.status-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.w-100 { width: 100%; }
.mt-1 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0 !important; }
.text-danger { color: var(--brand-danger); }
.danger-desc { font-size: 0.9rem; color: var(--text-muted); margin: 0.8rem 0 1.5rem 0; line-height: 1.5; }

.form-close-modal { margin: 0; padding: 0; display: flex; }
.form-row-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0; }
.input-link-title { flex: 1; min-width: 140px; margin-bottom: 0 !important; }
.input-link-url { flex: 2; min-width: 200px; margin-bottom: 0 !important; }

/* =====================================================================
   MÓDULO DE ANALÍTICA (reportes.php)
   ===================================================================== */
.filter-bar { background: var(--bg-card); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: none; display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; margin-bottom: 2.5rem; }
.filter-bar .form-group { margin-bottom: 0; flex: 1; min-width: 200px; }
.filter-actions { display: flex; gap: 1rem; align-items: center; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.kpi-card { background: white; padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow-md); border: none; border-top: 6px solid var(--brand-primary); display: flex; flex-direction: column; justify-content: center; transition: transform 0.3s; }
.kpi-card:hover { transform: translateY(-4px); }
.kpi-title { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; font-weight: 800; margin-bottom: 1rem; letter-spacing: 1px; }
.kpi-value { font-size: 2.8rem; font-weight: 900; color: var(--text-main); font-family: var(--font-ui); line-height: 1; margin-bottom: 0.5rem; }
.kpi-value span { font-size: 0.4em; color: var(--text-muted); font-weight: 700; margin-left: 4px; text-transform: none; }
.kpi-desc { font-size: 0.9rem; color: var(--text-muted); }

.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 2rem; margin-bottom: 2.5rem; }
.chart-container { height: 300px; width: 100%; position: relative; padding: 1.5rem; }

.bg-success { background: var(--brand-success); border-bottom: none; }
.rate-input-box { display: flex; align-items: center; gap: 10px; background: white; padding: 6px 15px; border-radius: 100px; border: none; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.rate-label { margin: 0; font-size: 0.75rem; color: var(--text-main); font-weight: 800; text-transform: uppercase; }
.rate-input { width: 100px; padding: 0.4rem; margin: 0; border: none; background: #f4f4f5; font-weight: 800; text-align: center; border-radius: 100px; font-family: var(--font-ui); color: var(--brand-primary); }

.celda-num { text-align: center; font-family: var(--font-ui); font-weight: 700; color: var(--text-muted); }
.celda-valor { text-align: right; font-family: var(--font-ui); font-weight: 800; color: var(--text-main); }
.progress-bg { background: #f4f4f5; height: 8px; border-radius: 10px; width: 100%; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 10px; transition: width 0.5s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.8em; margin-bottom: 6px; font-weight: 800; text-transform: uppercase; }

.badge-color { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 10px; vertical-align: middle; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border: 2px solid white; }
.table-footer { background: #fafaf9; border-top: 2px solid var(--border-color); font-weight: 800; }
.table-footer td { color: var(--text-main); padding: 1.5rem 1rem; }

.text-mono { font-family: var(--font-ui); font-weight: 800; font-size: 1.05em; color: var(--brand-primary); }
.text-right { text-align: right; }
.text-muted-italic { color: var(--text-muted); font-style: italic; font-size: 0.9em; }

@media (max-width: 768px) { .charts-grid { grid-template-columns: 1fr; } .rate-input-box { width: 100%; justify-content: space-between; } }

/* =====================================================================
   LOG DE ACTIVIDAD (log_actividad.php)
   ===================================================================== */
.log-date { font-family: var(--font-ui); font-size: 0.85rem; color: var(--text-muted); font-weight: 700; }
.log-user { color: var(--text-main); font-size: 1.05rem; font-weight: 800; }
.log-project { color: var(--text-muted); font-size: 0.95rem; font-weight: 600; }
.badge-action { background: #e0e7ff; color: var(--brand-primary); padding: 6px 12px; border-radius: 20px; font-weight: 800; font-size: 0.75rem; border: none; display: inline-block; font-family: var(--font-ui); text-transform: uppercase; }
.log-task { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }

/* =====================================================================
   PAPELERA DE RECICLAJE (papelera.php)
   ===================================================================== */
.section-title { color: var(--text-main); margin-bottom: 1.5rem; font-weight: 800; font-size: 1.3rem; }
.trash-container { display: flex; flex-direction: column; gap: 1.2rem; margin-bottom: 3.5rem; }
.trash-item { background: white; border: none; border-radius: var(--radius); padding: 1.8rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; box-shadow: var(--shadow-sm); transition: transform 0.3s, box-shadow 0.3s; border-left: 6px solid var(--text-muted); }
.trash-item:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.trash-item .item-details { display: flex; flex-direction: column; gap: 0.6rem; flex: 1; min-width: 250px; }
.trash-item .item-title { font-size: 1.2rem; font-weight: 800; color: var(--text-main); margin: 0; }
.trash-item .item-meta { font-size: 0.9rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 0.4rem; }
.action-buttons { display: flex; gap: 1rem; align-items: center; }
.owner-tag { font-size: 0.75rem; font-family: var(--font-ui); background: #f4f4f5; padding: 4px 10px; border-radius: 20px; font-weight: 800; color: var(--text-muted); display: inline-block; width: fit-content; }
.hidden-item { display: none !important; }

/* =====================================================================
   GESTOR DE FLUJOS (flujos.php)
   ===================================================================== */
.flow-builder-container { padding: 2rem; }
.columna-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; background: #fafaf9; padding: 1rem; border-radius: 16px; border: 1px dashed var(--border-color); }
.drag-handle { cursor: grab; color: var(--text-muted); font-size: 1.5rem; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.input-wip { width: 90px; padding: 0.8rem; border: none; border-radius: 12px; font-family: var(--font-ui); text-align: center; font-weight: 800; background: white; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
.input-wip:focus { outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
.color-picker-sm { padding: 0; width: 48px; height: 48px; cursor: pointer; border: 3px solid white; border-radius: 50%; background: transparent; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.stage-badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 8px 8px 0; padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; border: none; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.wip-limit-tag { background: rgba(255,255,255,0.3); padding: 2px 8px; border-radius: 12px; font-family: var(--font-ui); font-size: 0.85em; }

/* =====================================================================
   GESTOR DE PLANTILLAS (plantillas.php)
   ===================================================================== */
.template-builder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.template-section { background: #fafaf9; padding: 2rem; border: none; border-radius: 20px; margin-top: 2rem; box-shadow: inset 0 2px 10px rgba(0,0,0,0.02); }
.metadata-section { background: #fffbeb; padding: 2rem; border-radius: 20px; margin-top: 2rem; border: none; box-shadow: inset 0 2px 10px rgba(245, 158, 11, 0.05); }
.metadata-title { color: #d97706; margin-top: 0; font-size: 1.2rem; font-weight: 800; }
.metadata-inputs { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.metadata-input-wrapper { flex: 1; min-width: 200px; }
.metadata-label { font-size: 0.85em; color: #d97706; font-weight: 800; display: block; margin-bottom: 0.5rem; }
.metadata-input { border: none !important; background: white !important; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.metadata-input:focus { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2) !important; }
.checklist-builder-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.code-tag { font-size: 0.85em; color: var(--brand-primary); background: #e0e7ff; padding: 4px 10px; border-radius: 8px; font-family: var(--font-data); font-weight: 700; }
.badge-owner-small { font-size: 0.75em; color: var(--brand-accent); font-weight: 800; display: block; margin-top: 6px; }

/* =====================================================================
   PILOTO AUTOMÁTICO (automatizaciones.php)
   ===================================================================== */
.automation-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 2.5rem; align-items: start; }
@media (max-width: 992px) { .automation-grid { grid-template-columns: 1fr; } }
.reference-box { background: #fafaf9; padding: 1.5rem; border-radius: 16px; border: 2px dashed #c7d2fe; margin-bottom: 1.5rem; }
.reference-label { color: var(--brand-primary); font-weight: 800; font-size: 0.85em; text-transform: uppercase; display: block; margin-bottom: 0.8rem; }
.badge-rule { background: #fffbeb; color: #d97706; padding: 6px 12px; border-radius: 20px; font-weight: 800; font-size: 0.85em; font-family: var(--font-ui); border: none; display: inline-block; }

/* =====================================================================
   CONSOLA SUPERADMIN (admin_usuarios.php)
   ===================================================================== */
.superadmin-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2rem; align-items: center; }
.superadmin-form-grid .input-full { margin-bottom: 0; }
.admin-limits-row { display: flex; align-items: center; gap: 10px; margin-bottom: 0; }
.admin-limits-row span { font-size: 1.2rem; }
.input-inline { width: 70px; padding: 0.6rem; border: none; border-radius: 8px; font-family: var(--font-ui); text-align: center; font-weight: 800; background: #f4f4f5; }
.input-inline:focus { outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); background: white; }
.date-inline { padding: 0.6rem; border: none; border-radius: 8px; font-family: var(--font-ui); font-weight: 800; color: var(--text-main); background: #f4f4f5; }
.status-activa { background: #dcfce7; color: #166534; border: none; }
.status-suspendida { background: #fee2e2; color: #b91c1c; border: none; }

/* =====================================================================
   MI EQUIPO (mi_equipo.php)
   ===================================================================== */
.team-stats-box { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.team-stats-box strong { color: var(--text-main); font-size: 1.1rem; }
.team-stats-box span { font-weight: 900; color: var(--brand-accent); font-family: var(--font-ui); font-size: 1.6rem; }
.infra-progress-bg { background: #f4f4f5; height: 12px; border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
.infra-progress-fill { height: 100%; background: var(--brand-accent); transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 10px; }
.form-team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; align-items: end; }
.alert-limit { background: #fffbeb; border: none; padding: 2.5rem; text-align: center; border-radius: 20px; margin-bottom: 3rem; box-shadow: var(--shadow-sm); }
.alert-limit h4 { color: #d97706; margin: 0 0 0.8rem 0; font-size: 1.3rem; }
.alert-limit p { color: #92400e; margin: 0; font-weight: 600; font-size: 1.05rem; }

/* =====================================================================
   ANUNCIOS GLOBALES (anuncios.php)
   ===================================================================== */
.announcements-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 2.5rem; align-items: start; }
@media (max-width: 992px) { .announcements-grid { grid-template-columns: 1fr; } }
.alert-success { background: #dcfce7; color: #166534; padding: 1.2rem 2rem; border-radius: 16px; border: none; margin-bottom: 2.5rem; font-weight: 800; display: flex; align-items: center; gap: 0.8rem; box-shadow: var(--shadow-sm); }
.md-toolbar { display: flex; gap: 6px; padding: 10px 12px; background: #fafaf9; border: 2px solid transparent; border-bottom: none; border-radius: 12px 12px 0 0; flex-wrap: wrap; }
.btn-md { background: white; border: 1px solid var(--border-color); color: var(--text-muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 800; font-family: var(--font-ui); transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.btn-md:hover { background: var(--brand-primary); color: white; transform: translateY(-1px); border-color: var(--brand-primary); }
.md-textarea { border-radius: 0 0 12px 12px !important; min-height: 180px; margin-bottom: 0 !important; border-top-color: var(--border-color); }
.md-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 10px; }
.md-hint b { color: var(--text-main); }
.md-hint i { color: var(--text-main); font-style: italic; }
.anuncio-title { color: var(--text-main); font-size: 1.2rem; font-weight: 800; display: block; margin-bottom: 6px; }
.anuncio-body { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

/* =====================================================================
   CENTRO DE MANDO / DOCUMENTACIÓN (ayuda.php)
   ===================================================================== */
.layout-wrapper { display: grid; grid-template-columns: 280px 1fr; gap: 4rem; align-items: start; }
.sidebar { position: sticky; top: 40px; background: transparent; padding: 1rem 0; border: none; box-shadow: none; }
.sidebar h4 { text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 1.5rem; border-bottom: 2px solid var(--border-color); padding-bottom: 0.8rem; }
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { margin-bottom: 1rem; }
.sidebar-nav a { text-decoration: none; color: var(--text-muted); font-size: 0.95rem; font-weight: 700; transition: color 0.2s; display: block; padding: 8px 12px; border-radius: 8px; }
.sidebar-nav a:hover { color: var(--brand-primary); background: white; }
.main-content { max-width: 900px; padding-top: 1rem; }
.doc-section { margin-bottom: 5rem; scroll-margin-top: 40px; }
.doc-section h2 { font-size: 2rem; color: var(--text-main); margin-bottom: 2rem; border-left: none; padding-left: 0; display: flex; align-items: center; gap: 15px; }
.doc-section p { line-height: 1.8; color: var(--text-muted); font-size: 1.1rem; margin-bottom: 1.8rem; }
.doc-section ul { margin-bottom: 1.8rem; padding-left: 1.5rem; }
.doc-section li { margin-bottom: 1rem; color: var(--text-muted); line-height: 1.6; font-size: 1.05rem; }
.callout { padding: 2rem; border-radius: 20px; border-left: none; margin: 2.5rem 0; box-shadow: var(--shadow-sm); }
.callout strong { display: block; margin-bottom: 0.8rem; font-size: 1.2rem; }
.callout.success { background: #f0fdf4; color: #166534; }
.callout.warning { background: #fffbeb; color: #92400e; }
.callout.info { background: #eff6ff; color: #1e40af; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin: 2.5rem 0; }
.status-card { padding: 1.8rem; border-radius: 20px; background: white; border: none; box-shadow: var(--shadow-md); transition: transform 0.3s; }
.status-card:hover { transform: translateY(-5px); }
.status-card strong { display: block; margin-bottom: 0.8rem; font-size: 1.1rem; }
.status-card p { font-size: 0.95rem; margin: 0; line-height: 1.5; color: var(--text-muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 992px) { .layout-wrapper { grid-template-columns: 1fr; } .sidebar { display: none; } }

/* --- BITÁCORA DE VERSIONES (versiones.php) --- */
.timeline { max-width: 900px; margin: 0 auto 5rem auto; display: flex; flex-direction: column; gap: 3rem; }
.version-card { background: white; border: none; border-radius: 24px; padding: 3rem; box-shadow: var(--shadow-md); position: relative; transition: transform 0.3s ease, box-shadow 0.3s; }
.version-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.version-card.actual { border-top: 8px solid var(--brand-primary); }
.version-card.pasada { opacity: 0.9; }
.v-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.v-number { font-family: var(--font-ui); font-weight: 900; color: white; font-size: 1.1rem; background: var(--brand-primary); padding: 6px 16px; border-radius: 100px; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3); }
.v-date { font-family: var(--font-ui); font-size: 0.9rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.v-title { margin: 0 0 2rem 0; font-size: 1.8rem; color: var(--text-main); font-weight: 900; letter-spacing: -0.5px; }
.change-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1.2rem; }
.change-list li { display: flex; align-items: flex-start; gap: 1.2rem; line-height: 1.6; color: var(--text-muted); font-size: 1rem; }
.badge-vers { font-family: var(--font-ui); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; padding: 4px 12px; border-radius: 20px; white-space: nowrap; margin-top: 3px; letter-spacing: 0.5px; }
.badge-vers-funcion { background: #dcfce7; color: #166534; }
.badge-vers-seguridad { background: #fee2e2; color: #b91c1c; }
.badge-vers-arquitectura { background: #e0e7ff; color: #3730a3; }
.badge-vers-fix { background: #ffedd5; color: #c2410c; }

/* =====================================================================
   MIS PREFERENCIAS (usuarios.php)
   ===================================================================== */
.preferences-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 850px) { .preferences-grid { grid-template-columns: 1fr; } }
.tz-preview-box { background: white; padding: 3rem; border-radius: 24px; border: none; box-shadow: var(--shadow-md); display: flex; flex-direction: column; justify-content: center; height: 100%; text-align: center; }
.clock-item { margin-bottom: 2.5rem; }
.clock-item:last-child { margin-bottom: 0; }
.clock-label { display: block; font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1rem; }
.clock-server { font-family: var(--font-ui); font-size: 1.5rem; color: var(--text-muted); font-weight: 800; }
.clock-local { font-family: var(--font-ui); font-size: 3.5rem; font-weight: 900; color: var(--brand-success); line-height: 1; letter-spacing: -1px; }
.clock-label-server { color: var(--text-muted); }
.clock-label-local { color: var(--brand-success); }

/* =====================================================================
   SISTEMA DE ACCESO INDUSTRIAL (login.php)
   ===================================================================== */
#body_login { background: var(--bg-main); display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; padding: 1rem; }
.login-card { background: var(--bg-card); width: 100%; max-width: 440px; padding: 3.5rem 3rem; border-radius: 24px; border: none; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.brand-header { text-align: center; margin-bottom: 3rem; }
.logo-box { font-weight: 900; font-size: 2.2rem; color: var(--text-main); letter-spacing: -1px; display: flex; align-items: center; justify-content: center; }
.logo-icon { background: var(--brand-primary); color: white; padding: 4px 12px; border-radius: 12px; margin-right: 12px; font-size: 1.4rem; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3); }
.subtitle { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; margin-top: 15px; font-weight: 700; }
.btn-submit { background: var(--brand-primary); color: white; border: none; width: 100%; padding: 1.2rem; border-radius: 100px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: all 0.3s; margin-top: 1.5rem; box-shadow: 0 10px 20px rgba(99, 102, 241, 0.25); }
.btn-submit:hover { transform: translateY(-3px); box-shadow: 0 15px 25px rgba(99, 102, 241, 0.35); }
.btn-submit:active { transform: scale(0.98); }
.footer-links { margin-top: 2.5rem; text-align: center; }
.footer-links .link { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; font-weight: 700; transition: color 0.2s; }
.footer-links .link:hover { color: var(--brand-primary); }
.version-tag { position: absolute; bottom: 15px; right: 20px; font-family: var(--font-ui); font-size: 0.75rem; color: var(--text-muted); font-weight: 800; opacity: 0.6; }

/* =====================================================================
   COMUNICADOS DEL ADMINISTRADOR (rediseñado)
   ===================================================================== */
.announcements-inbox { margin-bottom: 2.5rem; }
.announcements-inbox-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.ann-header-label { font-size: 0.85rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.ann-unread-badge { background: var(--brand-primary); color: white; border: none; font-size: 0.75rem; font-weight: 800; font-family: var(--font-ui); padding: 4px 10px; border-radius: 20px; box-shadow: 0 2px 5px rgba(99, 102, 241, 0.3); }
.btn-archive-all { font-size: 0.85rem; color: var(--text-muted); background: white; border: 1px solid var(--border-color); cursor: pointer; padding: 6px 14px; border-radius: 100px; font-family: inherit; font-weight: 700; transition: all 0.2s; box-shadow: var(--shadow-sm); }
.btn-archive-all:hover { background: #f4f4f5; color: var(--text-main); }
.ann-row { margin-bottom: 0.6rem; }
.ann-bar { display: flex; align-items: center; justify-content: space-between; background: white; border: none; border-left: 4px solid var(--brand-primary); border-radius: 16px; padding: 1.2rem 1.5rem; cursor: pointer; transition: all 0.2s; user-select: none; box-shadow: var(--shadow-sm); }
.ann-bar:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ann-bar.is-read { border-left-color: transparent; opacity: 0.8; box-shadow: none; background: #fafaf9; }
.ann-bar-left { display: flex; align-items: center; gap: 12px; overflow: hidden; }
.ann-unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-primary); flex-shrink: 0; transition: background 0.2s; box-shadow: 0 0 8px rgba(99, 102, 241, 0.5); }
.ann-unread-dot.read { background: transparent; border: 2px solid var(--border-color); box-shadow: none; }
.ann-title-text { font-weight: 800; font-size: 1.05rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ann-meta-text { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.ann-bar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-left: 1rem; }
.ann-chevron { font-size: 0.9rem; color: var(--text-muted); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.ann-chevron.open { transform: rotate(180deg); }
.ann-dismiss-inline { font-size: 0.8rem; color: var(--text-muted); background: white; border: 1px solid var(--border-color); border-radius: 100px; padding: 6px 14px; cursor: pointer; font-family: inherit; font-weight: 800; white-space: nowrap; transition: all 0.2s; }
.ann-dismiss-inline:hover { background: #fef2f2; color: var(--brand-danger); border-color: #fecaca; }
.ann-body-collapsible { display: none; background: #fafaf9; border: none; border-radius: 0 0 16px 16px; padding: 1.5rem 2rem; margin-top: -8px; margin-bottom: 0.8rem; box-shadow: inset 0 4px 6px rgba(0,0,0,0.02); }
.ann-body-collapsible.open { display: block; animation: slideDown 0.3s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.ann-body-content { font-size: 1rem; color: var(--text-muted); line-height: 1.8; }
.ann-body-content h1, .ann-body-content h2, .ann-body-content h3 { font-size: 0.9rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--brand-primary); margin: 1.5rem 0 0.8rem; }
.ann-body-content p { margin-bottom: 1rem; }
.ann-body-content ul { padding-left: 1.5rem; }
.ann-body-content li { margin-bottom: 0.5rem; }
.ann-body-content a { color: var(--brand-primary); font-weight: 700; }
.ann-body-footer { display: flex; justify-content: flex-end; padding-top: 1.5rem; margin-top: 1.5rem; border-top: 1px solid #e4e4e7; }
.btn-mark-read { font-size: 0.9rem; background: var(--brand-primary); color: white; border: none; border-radius: 100px; padding: 8px 20px; cursor: pointer; font-family: inherit; font-weight: 800; transition: all 0.2s; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2); }
.btn-mark-read:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(99, 102, 241, 0.3); }

/* Animaciones */
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); } 70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }


/* =====================================================================
   PARCHE SOFT UI: CURVAS PERFECTAS EN PANELES
   ===================================================================== */

/* 1. Quitamos el padding global que estaba asfixiando a la cabecera */
.panel {
    padding: 0 !important; 
    border-radius: var(--radius);
    overflow: hidden; /* Esto asegura que nada sobresalga de la curva */
}

/* 2. Obligamos a la cabecera a tener la misma curvatura en la parte superior */
.panel-header {
    margin: 0 !important;
    border-radius: var(--radius) var(--radius) 0 0;
    /* Reducimos un milímetro el borde inferior para que no choque con el fondo */
    border-bottom: 1px solid rgba(0,0,0,0.05); 
}

/* 3. Redondeamos un poco más los elementos de las listas (las tareas) para que no se sientan rígidas */
.list-item {
    margin: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    border-left-width: 5px; /* Mantiene la barra de color del proyecto visible pero suave */
}
.list-item:last-child {
    margin-bottom: 0.5rem;
}

/* =====================================================================
   PARCHE RESPONSIVE: BARRA DE NAVEGACIÓN EN NOTEBOOKS
   ===================================================================== */

/* 1. Blindaje contra saltos de línea indeseados */
.brand-text, 
.nav-item, 
.user-name, 
.dropdown-header,
.desktop-brand {
    white-space: nowrap !important;
}

/* 2. Ajuste de compresión para pantallas medianas (Laptops 13"/14") */
@media (max-width: 1400px) and (min-width: 769px) {
    .nav-links {
        padding: 0 0.5rem;
    }
    
    .nav-item {
        padding: 1.2rem 0.6rem; /* Reducimos el padding horizontal de los botones */
        font-size: 0.85rem;     /* Achicamos la fuente un 10% para que respire */
    }
    
    .brand-text {
        font-size: 1rem;
    }
    
    .notif-container {
        padding: 0 0.8rem;
    }
    
    .user-profile {
        padding-left: 0.8rem;
        gap: 0.6rem;
    }
}

/* =====================================================================
   PARCHE RESPONSIVE: FORMULARIOS DE CREACIÓN (KANBAN)
   ===================================================================== */

/* 1. Transformamos el formulario en una malla fluida */
.action-box form {
    display: flex;
    flex-wrap: wrap; /* La magia: permite que los elementos caigan a la línea de abajo */
    gap: 1rem;
    align-items: center;
}

/* 2. Le decimos a los inputs y botones cómo comportarse en el espacio */
.action-box form > input,
.action-box form > select,
.action-box form > button,
.action-box form > .form-group {
    flex: 1 1 160px; /* Crecen y se encogen, pero si tienen menos de 160px de espacio, saltan de línea */
    margin-bottom: 0 !important;
    min-width: 0; /* Evita que inputs muy largos rompan la caja */
}

/* 3. Aseguramos que el input del título (que suele ser el más largo) tome más espacio si está disponible */
.action-box form input[type="text"] {
    flex: 2 1 250px; 
}


/* =====================================================================
   JERARQUÍA DE PROYECTOS Y TELEMETRÍA DEL CONGELADOR (v3.2.0)
   ===================================================================== */

/* 1. Separadores de Sección (Tabs Visuales) */
.section-separator { 
    margin: 3rem 0 1.5rem; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}
.section-separator::after { 
    content: ""; 
    flex-grow: 1; 
    height: 1px; 
    background: var(--border-color); 
}

/* 2. Badges de Nuevos Roles */
.badge-supervisor { 
    background: #fef3c7; 
    color: #92400e; 
    border: 1px solid #fde68a; 
}

/* 3. Indicadores de Inercia (Días en frío) */
.days-counter { 
    background: #e0f2fe; 
    color: #0369a1; 
    padding: 3px 10px; 
    border-radius: 6px; 
    font-weight: 800; 
    font-size: 0.75rem; 
    font-family: var(--font-data); 
    box-shadow: inset 0 0 0 1px rgba(3, 105, 161, 0.1);
}

/* 4. Estilos para los Proyectos Pausados (Filas) */
.row-pausado {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-left: 4px solid #94a3b8; /* Gris neutro por defecto */
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}
.row-pausado:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.freezer-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

/* 5. Alertas de Urgencia (Más de X días congelado) */
.congelado-aviso { 
    border-left-color: var(--brand-accent) !important; 
}
.congelado-alerta { 
    border-left-color: var(--brand-danger) !important; 
    background: #fff1f2 !important; 
    border-color: #ffe4e6;
}
.congelado-alerta .days-counter {
    background: #ffe4e6;
    color: #e11d48;
    box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.2);
}

/* 6. Responsividad para Móviles */
@media (max-width: 768px) {
    .row-pausado {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .row-pausado > div:last-child {
        width: 100%;
    }
    .row-pausado .btn {
        width: 100%;
        text-align: center;
    }
}


/* =====================================================================
   ESTADOS VACÍOS / EMPTY STATES (Soft Human)
   ===================================================================== */
.empty-state-success {
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed #a7f3d0; /* Borde verde pastel */
    border-radius: var(--radius);
    background: #f0fdf4;
    margin-top: 1rem;
    box-shadow: inset 0 2px 10px rgba(16, 185, 129, 0.05);
    transition: transform 0.3s ease;
}

.empty-state-success:hover {
    transform: translateY(-2px);
}

.empty-state-success .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 4px 6px rgba(16, 185, 129, 0.2));
}

.empty-state-success .empty-title {
    margin: 0 0 8px 0;
    color: #166534;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.3px;
}

.empty-state-success .empty-desc {
    margin: 0;
    color: #15803d;
    font-size: 0.95rem;
    font-weight: 500;
}

/* =====================================================================
   PARCHE RESPONSIVE: TRACKER MÓVIL (index.php)
   ===================================================================== */
@media (max-width: 768px) {
    /* 1. Destruimos las 2 columnas y apilamos: Formulario arriba, Reloj abajo */
    .tracker-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* 2. Reducimos el tamaño de la tipografía del reloj para que no desborde */
    .timer-numbers {
        font-size: 3.5rem !important;
        margin-bottom: 1rem;
    }

    /* 3. Ajustamos el aire interior del panel del reloj */
    .timer-display-box {
        padding: 2rem 1.5rem;
    }

    /* 4. Ajustamos el tamaño del botón de Secuencia */
    .btn-tracker {
        font-size: 0.95rem;
        padding: 1rem;
    }

    /* 5. Damos aire al contenedor principal del tracker en móviles */
    #body_interno {
        padding: 1rem; /* Menos padding lateral en celular para aprovechar la pantalla */
    }
    
    .tracker-card {
        padding: 1.5rem !important;
    }
}