:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --info: #0ea5e9;
    --accent: #8b5cf6;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius-lg: 16px;
    --radius-md: 10px;
    
    --senado-color: #f59e0b;
    --camara-color: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    background-attachment: fixed;
}

/* ==========================================================================
   Navegación
   ========================================================================== */
.admin-nav, .public-nav {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-main);
}

/* ==========================================================================
   Layout General
   ========================================================================== */
.admin-container, .public-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 160px);
}

.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ==========================================================================
   Botones
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #475569;
}

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

.actions-bar {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ==========================================================================
   Tablas (Admin)
   ========================================================================== */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.admin-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

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

.admin-table tbody tr {
    transition: background-color 0.2s;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   Formularios (Admin)
   ========================================================================== */
.form-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    max-width: 800px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    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);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-main);
    font-weight: normal;
}

/* ==========================================================================
   Tarjetas / Grid (Reportes Públicos)
   ========================================================================== */
.congresistas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.congresista-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.congresista-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.2);
}

.card-header-color {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 0;
    opacity: 0.8;
}

.congresista-foto {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-color);
    margin: 0 auto 1rem auto;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    transition: transform 0.5s;
}

.congresista-card:hover .congresista-foto {
    transform: scale(1.05);
}

.congresista-info {
    position: relative;
    z-index: 1;
}

.congresista-nombre {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.congresista-partido {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

.congresista-contacto {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ==========================================================================
   Badges y Elementos UI
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-senado { background: rgba(245, 158, 11, 0.2); color: var(--senado-color); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-camara { background: rgba(16, 185, 129, 0.2); color: var(--camara-color); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-estado { background: rgba(139, 92, 246, 0.2); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }

.color-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid rgba(255,255,255,0.2);
}

.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.alert-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* ==========================================================================
   Filtros (Reportes)
   ========================================================================== */
.filter-bar {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-bar select {
    padding: 0.6rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: var(--radius-md);
    min-width: 200px;
}

/* ==========================================================================
   Perfil Individual
   ========================================================================== */
.profile-header {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    display: flex;
    gap: 3rem;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.profile-header .card-header-color {
    height: 100%;
    width: 15px;
    left: 0;
    top: 0;
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255,255,255,0.1);
    box-shadow: var(--glass-shadow);
}

.profile-details h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.profile-details p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Dashboard Cards
   ========================================================================== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--glass-shadow);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-card .number {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #60a5fa, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.congresista-card {
    animation: fadeIn 0.6s ease-out forwards;
}
