/* ==========================================
   Pinches - Sistema de Diseño Institucional
   Tema: Profesional/Educativo (Light-Theme)
   ========================================== */

:root {
    /* Paleta de Colores Institucional */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    --text-primary: #0f172a;     /* Slate 900 */
    --text-secondary: #334155;   /* Slate 700 */
    --text-muted: #64748b;       /* Slate 500 */
    
    --primary: #1e3a8a;          /* Navy Blue */
    --primary-hover: #1e40af;    /* Medium Blue */
    --primary-light: #eff6ff;    /* Light Blue */
    --primary-border: #bfdbfe;   /* Light Blue Border */
    
    --accent: #0f766e;           /* Teal */
    --accent-hover: #115e59;     
    --accent-light: #f0fdfa;
    
    --success: #166534;          /* Green */
    --success-light: #f0fdf4;
    --success-border: #bbf7d0;
    
    --danger: #991b1b;           /* Red */
    --danger-light: #fef2f2;
    --danger-border: #fecaca;
    
    --warning: #854d0e;          /* Amber */
    --warning-light: #fffbeb;
    --warning-border: #fef08a;

    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);
    
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
}

/* Reset y Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Decoración de Fondo (Sutil, no intrusiva) */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
}

.circle-1 {
    top: -5%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: #3b82f6;
}

.circle-2 {
    bottom: -5%;
    left: 5%;
    width: 500px;
    height: 500px;
    background: #0d9488;
}

/* Contenedor Principal */
.app-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Cabecera */
.app-header {
    text-align: center;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.logo-area {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 2.2rem;
    color: var(--primary);
    filter: drop-shadow(0 2px 4px rgba(30, 58, 138, 0.15));
}

.app-header h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.4rem;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.badge {
    font-size: 0.8rem;
    font-weight: 600;
    vertical-align: middle;
    padding: 3px 10px;
    border-radius: 50px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    color: var(--primary);
    margin-left: 8px;
    font-family: var(--font-sans);
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Tarjetas y Contenedores */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-desc {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Sección de Instrucciones de CSV */
.instruction-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: 4px 8px 8px 4px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.instruction-box h4 {
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--primary);
}

.instruction-box ul {
    list-style: disc;
    padding-left: 20px;
}

.instruction-box li {
    margin-bottom: 4px;
}

/* Dropzone (Carga de CSV) */
.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: var(--transition-smooth);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: #f1f5f9;
}

.dropzone-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    color: var(--primary);
}

.dropzone-text {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 500;
}

.browse-link {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.dropzone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Barra de Información de Archivo Cargado */
.file-info-bar {
    display: flex;
    align-items: center;
    background: var(--success-light);
    border: 1px solid var(--success-border);
    padding: 12px 18px;
    border-radius: 8px;
    margin-top: 15px;
    gap: 12px;
    color: var(--success);
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    flex-grow: 1;
    font-weight: 600;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* Fila de Encabezado de Sección */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.count-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Configuración de Parámetros */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.config-group input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: var(--transition-smooth);
}

.config-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Botones */
.actions-row {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 24px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: white;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #7f1d1d;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* Panel de Estadísticas Post-Cálculo */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.students { background: #eff6ff; color: #1e40af; }
.stat-icon.subjects { background: #f0fdfa; color: #0f766e; }
.stat-icon.blocks { background: #f0fdf4; color: #166534; }
.stat-icon.cancelled { background: #fef2f2; color: #991b1b; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Tablas */
.preview-table-container h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.table-wrapper {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th, td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #f1f5f9;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: var(--transition-smooth);
}

tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

tbody tr:hover {
    background-color: #eff6ff;
}

/* Pestañas */
.tabs-row {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    padding-bottom: 4px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: #f1f5f9;
}

.tab-btn.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.tab-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Sección de Acciones en Pestañas */
.tab-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

/* Diseños Dinámicos de Resultados */

/* 1. Bloques Horarios */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.block-card {
    border-radius: 8px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.block-card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.block-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary);
}

.block-subjects {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.block-subject-item {
    background: #f8fafc;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
}

.subject-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.subject-item-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.subject-item-count {
    font-size: 0.75rem;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    padding: 1px 8px;
    border-radius: 50px;
    color: var(--primary);
    font-weight: 600;
}

.subject-item-students {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-height: 70px;
    overflow-y: auto;
    padding-left: 6px;
    border-left: 2px solid #e2e8f0;
    line-height: 1.4;
}

/* 2. Distribución de Aulas */
.aulas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.aula-card {
    border-radius: 8px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.aula-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.aula-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
}

.aula-card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    background: #f1f5f9;
    padding: 1px 8px;
    border-radius: 50px;
}

.aula-students-list {
    max-height: 250px;
    overflow-y: auto;
}

.aula-student-item {
    font-size: 0.85rem;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.aula-student-item:hover {
    background: #f8fafc;
}

.student-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.student-item-optativas {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.subject-tag {
    font-size: 0.65rem;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    color: var(--primary);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}

/* 3. Asignaturas Canceladas */
.cancelled-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cancelled-card {
    border-radius: 8px;
    padding: 15px 20px;
    background: var(--danger-light);
    border: 1px solid var(--danger-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.cancelled-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--danger);
}

.cancelled-card-meta {
    font-size: 0.8rem;
    color: var(--danger);
    font-weight: 600;
    background: #fee2e2;
    padding: 2px 10px;
    border-radius: 50px;
    border: 1px solid var(--danger-border);
}

.cancelled-card-students {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-style: italic;
    font-size: 0.9rem;
}

/* Pie de Página */
.app-footer {
    text-align: center;
    margin-top: auto;
    padding: 30px 0 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* Spinner de Carga */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-card {
    padding: 30px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.hidden {
    display: none !important;
}

/* Personalización de scrollbars en tablas y listas */
.table-wrapper::-webkit-scrollbar,
.subject-item-students::-webkit-scrollbar,
.aula-students-list::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track,
.subject-item-students::-webkit-scrollbar-track,
.aula-students-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.table-wrapper::-webkit-scrollbar-thumb,
.subject-item-students::-webkit-scrollbar-thumb,
.aula-students-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover,
.subject-item-students::-webkit-scrollbar-thumb:hover,
.aula-students-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Alertas de Procesamiento */
.alert-box {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    line-height: 1.4;
}

.alert-box.error {
    background: var(--danger-light);
    border-color: var(--danger-border);
    color: var(--danger);
}

.alert-box.warning {
    background: var(--warning-light);
    border-color: var(--warning-border);
    color: var(--warning);
}

.alert-box-icon {
    font-size: 1.25rem;
}

.alert-box-content {
    flex-grow: 1;
}

.alert-box-content strong {
    font-weight: 700;
}

/* ==========================================
   Estadísticas y Barras de Progreso
   ========================================== */

/* Diseño de dos columnas para Vista Previa */
.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .preview-grid {
        grid-template-columns: 1fr;
    }
}

.preview-stats-container {
    display: flex;
    flex-direction: column;
}

.preview-stats-container h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.stats-bars-list {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

/* Fila individual de barra de progreso */
.stats-bar-wrapper {
    margin-bottom: 14px;
}

.stats-bar-wrapper:last-child {
    margin-bottom: 0;
}

.stats-bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.stats-bar-name {
    font-weight: 600;
    color: var(--text-secondary);
}

.stats-bar-count {
    color: var(--text-muted);
    font-weight: 500;
}

.stats-bar-outer {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}

.stats-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50px;
    width: 0; /* Dinámico */
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.subject-max-input-container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.subject-max-input {
    width: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    font-size: 0.75rem;
    text-align: center;
    padding: 1px 3px;
    font-weight: 600;
    color: var(--primary);
    background: #ffffff;
    transition: var(--transition-smooth);
}

.subject-max-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.15);
}

.subject-max-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Pestaña de Comparación de Estadísticas (Resultados) */
.stats-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stats-comparison-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.stats-comparison-card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-md);
}

.stats-comparison-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.stats-comparison-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.stats-comparison-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comparison-bar-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comparison-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comparison-bar-val {
    font-weight: 600;
}

.bar-comparison-outer {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
}

.bar-comparison-inner {
    height: 100%;
    border-radius: 50px;
    width: 0; /* Dinámico */
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-comparison-inner.initial {
    background: var(--text-muted);
}

.bar-comparison-inner.assigned {
    background: linear-gradient(90deg, var(--accent) 0%, #0d9488 100%);
}

.bar-comparison-inner.assigned.cancelled {
    background: var(--danger);
}

.diver-badge {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid #99f6e4;
    margin-left: 6px;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: middle;
}

/* ==========================================
   Propuestas y Reasignaciones Especiales
   ========================================== */
.proposal-selector-container {
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.proposal-selector-label {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.proposal-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.proposal-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 6px;
}

.proposal-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.proposal-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.proposal-btn .proposal-changes-badge {
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 0.75rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.proposal-btn.active .proposal-changes-badge {
    background: rgba(255, 255, 255, 0.2);
}

.subject-tag.changed-subject {
    background: #ffedd5 !important;
    color: #ea580c !important;
    border: 1px solid #fed7aa !important;
    box-shadow: 0 1px 2px rgba(234, 88, 12, 0.1);
}

