/* directores.css - Estilos Premium para la Vista de Directores */

/* Menú de navegación lateral */
.sidebar-menu {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-left-color: var(--border-color);
}

.menu-item.active {
    background-color: rgba(30, 122, 63, 0.15);
    color: #2ecc71;
    border-left-color: #2ecc71;
}

.menu-icon {
    font-size: 16px;
}

/* Modificaciones del sidebar original */
.sidebar {
    width: 200px; /* Aumentado ligeramente para mejor lectura del texto de menú */
}

/* KPI GRID */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.kpi-card {
    background: linear-gradient(135deg, #1f2022 0%, #151617 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: #555;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--text-muted);
}

.kpi-card.highlight-blue::before {
    background-color: var(--color-blue-light);
}

.kpi-card.highlight-green::before {
    background-color: var(--color-green);
}

.kpi-card.highlight-red::before {
    background-color: var(--color-red);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    font-size: 18px;
    opacity: 0.8;
}

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.kpi-footer {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* FILA DE GRÁFICOS */
.charts-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.chart-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.chart-card.flex-1 {
    flex: 1;
    min-width: 300px;
}

.chart-card.flex-2 {
    flex: 1.8;
    min-width: 450px;
}

.chart-card-header {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 10px;
}

.chart-card-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
}

.chart-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
    height: 150px;
}

/* Gráfico de Barras Horizontales (SVG/HTML) */
.bar-chart-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.bar-label {
    width: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    flex-grow: 1;
    height: 18px;
    background-color: var(--bg-table);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.02);
}

.bar-fill {
    height: 100%;
    background-color: var(--color-blue);
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.1, 0.8, 0.3, 1);
    width: 0; /* Animado en JS */
}

.bar-value {
    width: 45px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Gráfico de Rosca / Dona SVG */
.donut-chart-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    width: 100%;
    flex-wrap: wrap;
}

.donut-svg-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
}

.donut-svg-wrapper svg {
    transform: rotate(-90deg);
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.donut-center-lbl {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-label {
    color: var(--text-secondary);
    flex-grow: 1;
}

.legend-val {
    font-weight: 700;
    color: var(--text-primary);
}

/* CRONOGRAMA DE HITOS CRÍTICOS (Línea de Tiempo) */
.timeline-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.section-header {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 10px;
}

.section-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    padding-left: 20px;
}

/* Línea vertical de fondo */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    display: flex;
    background-color: var(--bg-filter);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    align-items: center;
    position: relative;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.timeline-item:hover {
    border-color: #666;
    transform: translateX(4px);
}

/* Punto de la línea de tiempo */
.timeline-dot {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--border-color);
    border: 2px solid var(--bg-card);
    z-index: 2;
}

.timeline-item.urgente-hoy { border-left: 4px solid var(--color-red); }
.timeline-item.urgente-hoy .timeline-dot { background-color: var(--color-red); }

.timeline-item.urgente-media { border-left: 4px solid var(--color-orange); }
.timeline-item.urgente-media .timeline-dot { background-color: var(--color-orange); }

.timeline-item.urgente-baja { border-left: 4px solid var(--color-green); }
.timeline-item.urgente-baja .timeline-dot { background-color: var(--color-green); }

.timeline-item.urgente-pasado { border-left: 4px solid var(--text-muted); opacity: 0.6; }
.timeline-item.urgente-pasado .timeline-dot { background-color: var(--text-muted); }

.timeline-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 20px;
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
}

.timeline-dep {
    color: var(--color-blue-light);
}

.timeline-id {
    color: var(--text-secondary);
    font-family: 'Consolas', monospace;
}

.timeline-hito-type {
    background-color: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    color: var(--text-primary);
}

.timeline-name {
    font-size: 12px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}

.timeline-date-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 150px;
    flex-shrink: 0;
}

.timeline-date-val {
    font-size: 13px;
    font-weight: 700;
    color: white;
}

.timeline-days-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 4px;
    text-transform: uppercase;
}

.days-red {
    background-color: rgba(231, 76, 60, 0.15);
    color: var(--color-red);
}

.days-orange {
    background-color: rgba(241, 196, 15, 0.15);
    color: var(--color-orange);
}

.days-green {
    background-color: rgba(46, 204, 113, 0.15);
    color: var(--color-green);
}

.days-grey {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* TABLA DE LICITACIONES ACTIVAS CON MEDICAMENTOS */
.table-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 10px;
}

.table-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
}

.table-section-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.table-filters {
    display: flex;
    gap: 10px;
}

.table-filters input[type="text"],
.table-filters select {
    background-color: var(--bg-input);
    color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    height: 32px;
    font-family: inherit;
    outline: none;
}

.table-filters input[type="text"] {
    width: 250px;
}

.table-filters input:focus,
.table-filters select:focus {
    border-color: var(--color-blue-light);
}

.meds-events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.meds-events-table th {
    background-color: var(--bg-table);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.meds-events-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #222325;
    color: white;
    vertical-align: middle;
}

.meds-events-table tr:hover {
    background-color: rgba(255,255,255,0.02);
}

.meds-events-table td.dep-cell {
    font-weight: 700;
    color: var(--color-cyan);
}

.meds-events-table td.id-cell {
    font-family: 'Consolas', monospace;
    font-weight: 600;
    color: var(--text-secondary);
}

.meds-events-table td.name-cell {
    font-weight: 500;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meds-events-table td.status-cell span {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.meds-events-table td.status-cell span.vigente {
    background-color: rgba(46, 204, 113, 0.15);
    color: var(--color-green);
}

.meds-events-table td.status-cell span.aclaraciones {
    background-color: rgba(241, 196, 15, 0.15);
    color: var(--color-orange);
}

.btn-open-folder-tbl {
    background-color: var(--color-blue);
    color: white;
    border: none;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-open-folder-tbl:hover {
    background-color: var(--color-blue-hover);
}
