:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  --sky-50: #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-200: #bae6fd;
  --sky-300: #7dd3fc;
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;
  --sky-600: #0284c7;
  --sky-700: #0369a1;
  --sky-800: #075985;
  --sky-900: #0c4a6e;
  
  --facu-celeste: #0ea5e9;

  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  --spacing-10: 3rem; 
  --spacing-12: 4rem; 

  --border-radius: 0.5rem;
  --border-radius-lg: 1rem;
  --border-radius-full: 9999px;

  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition-all: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-w: 320px; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--blue-50), var(--sky-100));
  color: #000000;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-layout { display: flex; height: 100vh; }


.sidebar {
  width: var(--sidebar-w);
  background: white;
  border-right: 1px solid var(--blue-200);
  display: flex;
  flex-direction: column;
  padding: var(--spacing-10); 
  z-index: 20;
  box-shadow: 4px 0 24px rgba(0,0,0,0.02);
}

.sidebar-header {
  margin-bottom: var(--spacing-12);
  text-align: center;
}

.logo-circle {
  width: 140px;
  height: auto;
  background: transparent;
  color: white;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.5rem;
  margin: 0 auto var(--spacing-6);
}

.sidebar-header h2 { font-size: 1.5rem; font-weight: 900; color: #000000; line-height: 1.2; }
.sidebar-header h2 span { color: var(--facu-celeste); display: block; }

.filter-group { margin-bottom: var(--spacing-8); }
.filter-group label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 900;
  color: #000000;
  margin-bottom: var(--spacing-3);
  letter-spacing: 0.1em;
  opacity: 0.5;
}

select {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--blue-100);
  background: var(--blue-50);
  font-family: inherit;
  font-size: 1rem;
  color: #000000;
  outline: none;
  cursor: pointer;
  transition: var(--transition-all);
  font-weight: 700;
}
select:hover { border-color: var(--blue-300); background: white; }
select:focus { border-color: var(--facu-celeste); background: white; box-shadow: 0 0 0 4px var(--blue-100); }


.main-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-10); 
  display: flex;
  flex-direction: column;
  gap: var(--spacing-10);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--spacing-4);
}

#election-name { font-size: 3rem; font-weight: 950; color: #000000; letter-spacing: -0.05em; line-height: 1; }
#last-update { font-size: 0.9rem; color: #000000; opacity: 0.5; font-weight: 700; margin-top: 0.5rem; display: block; }

.stat-pill {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--blue-100);
}
.stat-pill .label { font-size: 0.9rem; color: #000000; font-weight: 800; opacity: 0.4; }
.stat-pill .value { font-weight: 900; color: var(--facu-celeste); font-size: 1.25rem; }

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-10);
}


.card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-8);
  box-shadow: var(--shadow);
  border: 1px solid var(--blue-100);
}

.hero-card {
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-10) var(--spacing-12);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--blue-200);
  box-shadow: var(--shadow-lg);
}

.hero-content h4 { font-size: 1rem; text-transform: uppercase; color: #000000; opacity: 0.4; font-weight: 900; letter-spacing: 0.2em; margin-bottom: 1rem; }
.hero-content h2 { font-size: 3.5rem; color: #000000; font-weight: 950; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.5rem; }
.hero-content .percent { font-size: 6rem; font-weight: 1000; color: #000000; line-height: 1; display: block; }

.hero-logo {
  width: 180px; height: 180px; background: white; border-radius: var(--border-radius-lg);
  padding: var(--spacing-6); display: flex; align-items: center; justify-content: center; border: 1px solid var(--blue-100);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.02);
}
.hero-logo img { width: 100%; height: 100%; object-fit: contain; }


.section-title { margin-bottom: var(--spacing-6); display: flex; align-items: center; gap: 1rem; }
.section-title h3 { font-size: 1.75rem; font-weight: 950; color: #000000; letter-spacing: -0.02em; }
#total-votos-badge { background: #000000; color: white; padding: 0.5rem 1rem; border-radius: var(--border-radius-full); font-size: 0.8rem; font-weight: 900; }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: var(--spacing-6); }
.result-card {
  background: white; border-radius: var(--border-radius-lg); padding: var(--spacing-6);
  display: flex; align-items: center; gap: var(--spacing-6); border: 1px solid var(--blue-100); transition: var(--transition-all);
}
.result-card:hover { transform: translateY(-4px) scale(1.02); border-color: var(--facu-celeste); box-shadow: var(--shadow-lg); }

.list-logo { width: 80px; height: 80px; background: white; border-radius: var(--border-radius); padding: var(--spacing-3); border: 1px solid var(--blue-100); }
.list-logo img { width: 100%; height: 100%; object-fit: contain; }

.list-info { flex: 1; }
.list-info h5 { font-size: 1.4rem; font-weight: 900; color: #000000; line-height: 1.2; }
.list-info p { font-size: 0.9rem; color: #000000; opacity: 0.4; font-weight: 800; margin-top: 4px; }

.list-value { text-align: right; }
.list-value .val-pct { font-size: 2rem; font-weight: 1000; color: #000000; line-height: 1; }
.list-value .val-votos { font-size: 0.9rem; color: #000000; opacity: 0.4; font-weight: 800; margin-top: 4px; }


.claustros-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--spacing-6); }
.claustro-card {
  background: white; padding: var(--spacing-8); border-radius: var(--border-radius-lg);
  text-align: center; border: 1px solid var(--blue-100); transition: var(--transition-all);
}
.claustro-card h6 { font-size: 0.8rem; text-transform: uppercase; color: #000000; opacity: 0.4; font-weight: 900; margin-bottom: 0.75rem; letter-spacing: 0.1em; }
.claustro-card .count { font-size: 2.5rem; font-weight: 1000; color: #000000; line-height: 1; margin-bottom: 0.5rem; display: block; }
.claustro-card .label { font-size: 0.9rem; color: var(--facu-celeste); font-weight: 900; }

.loader {
  width: 48px; height: 48px; border: 4px solid var(--blue-100); border-radius: 50%;
  border-top-color: #000000; animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 4rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }


.consejo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-8);
}
.claustro-board {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-6);
    box-shadow: var(--shadow);
    border: 1px solid var(--blue-100);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    transition: var(--transition-all);
}
.claustro-board:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--blue-200);
}
.claustro-board-header {
    border-bottom: 2px solid var(--blue-50);
    padding-bottom: var(--spacing-3);
    margin-bottom: var(--spacing-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.claustro-board-header h4 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--blue-900);
}
.list-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    padding: var(--spacing-3);
    border-radius: var(--border-radius);
    background: var(--sky-50);
    border: 1px solid var(--sky-100);
    transition: var(--transition-all);
}
.list-row:hover {
    background: white;
    border-color: var(--blue-200);
}
.list-row-logo {
    width: 54px; height: 54px;
    background: white; border-radius: var(--border-radius);
    padding: 6px;
    border: 1px solid var(--blue-100);
    flex-shrink: 0;
}
.list-row-logo img { width: 100%; height: 100%; object-fit: contain; }
.list-row-info { flex: 1; min-width: 0; }
.list-row-info h5 { 
    font-size: 1.05rem; 
    font-weight: 800; 
    color: #000; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.adhesion-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    background: var(--blue-100);
    color: var(--blue-800);
    border-radius: 6px;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.list-row-stats {
    text-align: right;
    flex-shrink: 0;
}
.list-row-stats .pct {
    font-size: 1.35rem;
    font-weight: 950;
    color: #000;
    line-height: 1;
}
.list-row-stats .votos {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 800;
    margin-top: 4px;
}


.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    padding: 8px 16px;
    border-radius: var(--border-radius-full);
    border: 1px solid var(--border);
}
.toggle-label {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
    cursor: pointer;
}
.toggle-label.active {
    color: var(--blue-600);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--blue-600);
}
input:checked + .slider:before {
  transform: translateX(24px);
}


.modal-blurred {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-blurred.active {
    display: flex;
}
.modal-blurred-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    width: 400px;
    max-width: 90%;
    border: 1px solid rgba(0,0,0,0.1);
}


.acta-paper {
    background: white;
    border: 1px solid #000;
    padding: 20px;
    font-family: Arial, sans-serif;
    color: #000;
}
.acta-header {
    display: flex;
    justify-content: flex-end;
    border: 2px solid #000;
    margin-bottom: 20px;
}
.acta-header-box {
    border-left: 2px solid #000;
    padding: 10px;
    min-width: 200px;
}
.acta-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 0.9rem;
}
.acta-header-row input, .acta-header-row select {
    border: none;
    border-bottom: 1px solid #000;
    margin-left: 10px;
    flex: 1;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    background: transparent;
    padding: 2px;
    border-radius: 0;
    outline: none;
}
.acta-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000;
}
.acta-table th, .acta-table td {
    border: 1px solid #000;
    padding: 8px;
    text-align: center;
}
.acta-table th {
    font-size: 0.75rem;
    font-weight: bold;
}
.acta-table .text-left { text-align: left; }
.acta-table input[type="number"] {
    width: 60px;
    text-align: center;
    border: none;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    background: transparent;
    outline: none;
}
.acta-table input:focus {
    background: #f0f8ff;
}
.acta-table input:disabled {
    background: #e5e7eb;
    color: transparent;
    cursor: not-allowed;
}
.acta-table .total-row {
    font-weight: bold;
    background: #f8fafc;
}
.acta-table .total-val {
    font-size: 1.2rem;
}


/* Responsiveness */
@media (max-width: 1024px) {
    .app-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    
    body {
        overflow-y: auto;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--blue-200);
        padding: var(--spacing-6);
    }
    
    .sidebar-header {
        display: flex;
        align-items: center;
        text-align: left;
        margin-bottom: var(--spacing-6);
    }
    
    .logo-circle {
        width: 80px;
        margin: 0 var(--spacing-4) 0 0;
    }
    
    .sidebar-header h2 {
        font-size: 1.2rem;
    }
    
    .filter-group {
        margin-bottom: 0;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        padding: var(--spacing-4);
        overflow: visible;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-4);
    }
    
    #election-name {
        font-size: 2rem;
    }
    
    .hero-card {
        flex-direction: column;
        padding: var(--spacing-6);
        text-align: center;
    }
    
    .hero-content h2 {
        font-size: 2.2rem;
    }
    
    .hero-content .percent {
        font-size: 4rem;
        margin: var(--spacing-4) 0;
    }
    
    .hero-logo {
        margin: var(--spacing-4) auto 0;
        width: 120px;
        height: 120px;
    }
    
    .hero-content > div {
        flex-direction: column !important;
        text-align: center;
    }
    
    .hero-content > div > div {
        align-items: center !important;
        justify-content: center !important;
    }
    
    .consejo-grid, .claustros-grid, .results-grid {
        grid-template-columns: 1fr;
    }
    
    .list-row {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-2);
    }
    
    .list-row-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .list-row-stats {
        text-align: center;
        margin-top: var(--spacing-2);
    }
    
    .especiales-row {
        flex-direction: column;
        align-items: center !important;
        text-align: center;
    }
    
    .especiales-row > div:last-child {
        margin-left: 0 !important;
        margin-top: var(--spacing-2);
    }
    
    .modal {
        padding: 1.5rem;
    }
}
