/* Reset y variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --secondary: #6b7280;
    --light: #f3f4f6;
    --dark: #1f2937;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9fafb;
}

/* Contenedores */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar público */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-acciones {
    padding: 0.5rem 1rem;
    background: #eff6ff;
    border-radius: 8px;
    color: var(--primary);
}

.user-acciones small {
    font-weight: 600;
}

/* Login Box */
.login-box {
    max-width: 450px;
    margin: 100px auto;
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.logo h2 {
    font-size: 1.2rem;
    color: var(--secondary);
    font-weight: normal;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.login-footer p {
    margin-top: 0.5rem;
    color: var(--secondary);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.form-help {
    margin-top: 0.25rem;
    margin-bottom: 0;
    color: var(--secondary);
    font-size: 0.85rem;
}

/* Formularios */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-align: center;
}

.btn:hover {
    background: #4b5563;
}

.btn-primary {
    background: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: var(--secondary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* Votaciones */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.votaciones-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.votacion-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: all 0.3s;
}

.votacion-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.votacion-card.votada {
    border-color: var(--success);
    background: #f0fdf4;
}

.votacion-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.votacion-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
    flex: 1;
}

.votacion-descripcion {
    color: #6b7280;
    margin-bottom: 1rem;
}

.votacion-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--light);
    border-radius: 6px;
}

.votacion-info small {
    color: #4b5563;
}

/* Opciones de votación */
.opciones-list {
    margin: 1.5rem 0;
}

.opcion-item {
    display: flex;
    align-items: start;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.opcion-item:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.opcion-item input[type="radio"] {
    margin-right: 1rem;
    margin-top: 0.25rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.opcion-content {
    flex: 1;
}

.opcion-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--dark);
}

.opcion-content small {
    color: #6b7280;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

/* Resultados */
.resultados-header {
    text-align: center;
    margin-bottom: 2rem;
}

.resultados-header h1 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.stats-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
}

.resultados-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.resultado-item {
    margin-bottom: 2rem;
}

.resultado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.resultado-header h3 {
    font-size: 1.25rem;
    color: var(--dark);
}

.resultado-votos {
    font-weight: 600;
    color: var(--primary);
    text-align: right;
}

.resultado-votos strong {
    display: block;
    font-size: 1.1rem;
}

.resultado-votos small {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: normal;
}

.resultado-descripcion {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 40px;
    background: var(--light);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.5s ease;
}

.progress-text {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h2 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: #6b7280;
}

/* Admin Layout */
.admin-navbar {
    background: var(--dark);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav-brand h1 {
    font-size: 1.5rem;
    color: white;
}

.admin-nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.admin-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid var(--border);
    padding: 1rem 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover {
    background: var(--light);
    color: var(--primary);
}

.nav-item.active {
    background: #eff6ff;
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.nav-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 0;
}

.admin-content {
    flex: 1;
    padding: 2rem;
    background: #f9fafb;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--dark);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card.stat-active {
    border-left: 4px solid var(--success);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    flex: 1;
}

/* Panel */
.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2,
.panel-header h3 {
    margin: 0;
    color: var(--dark);
}

/* Tabla */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--light);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
    background: #f9fafb;
}

.table .actions {
    display: flex;
    gap: 0.5rem;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6b7280;
}

/* Form Panel */
.form-panel {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--light);
    border-radius: 8px;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.opcion-item input[type="text"] {
    flex: 1;
    margin-right: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-horizontal {
    max-width: 800px;
}

.search-form {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    margin: 1rem 0;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .nav-item {
        padding: 0.5rem 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .votacion-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
