:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --error: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background animated shapes */
.background-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 20s infinite ease-in-out alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
    opacity: 0.5;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: #fde047; /* Amarillo claro */
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
    opacity: 0.4;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: #06b6d4;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
    opacity: 0.3;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 30px) scale(1.1); }
    100% { transform: translate(-30px, -50px) scale(0.9); }
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    z-index: 10;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 15px;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 14px;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

input, select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.4);
    color: white;
    font-family: inherit;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.6);
}

select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
    padding: 10px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.5);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(99, 102, 241, 0.6);
}

.login-btn:active {
    transform: translateY(0);
}

/* Dashboard specific styles */
.dashboard-container {
    max-width: 1400px;
    width: 90%;
    margin: 40px auto;
    padding: 0 20px;
    z-index: 10;
}

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

.user-info {
    display: flex;
    gap: 15px;
}

.badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge.sede {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

.logout-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #f8fafc;
}

.card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 15px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.modal-header h3 {
    font-size: 24px;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--error);
}

/* Modal Table */
.table-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 25px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.sedes-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.sedes-table th, .sedes-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
}

.sedes-table th {
    font-weight: 600;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    background-color: var(--bg-dark);
    z-index: 10;
}

.btn-small {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.3s;
    color: white;
}

.btn-edit { background: #3b82f6; }
.btn-edit:hover { background: #2563eb; }

.btn-delete { background: #ef4444; }
.btn-delete:hover { background: #dc2626; }

/* Modal Form */
.modal-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.modal-form .form-group {
    margin-bottom: 0;
    flex-grow: 1;
}

.modal-form .form-group input {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.modal-form .form-group input:focus, .modal-form .form-group select:focus {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.modal-content.large {
    max-width: 900px;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

.modal-form .form-group select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
    font-family: inherit;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.modal-form .form-group select option {
    background-color: white;
    color: black;
}

/* Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 20px;
}
.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}
.tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}
.tab-btn:hover:not(.active) {
    color: var(--text-main);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header { flex-direction: column; gap: 15px; text-align: center; }
    .user-info { flex-wrap: wrap; justify-content: center; }
    .grid-2-col { grid-template-columns: 1fr; }
    .dashboard-container { width: 100%; padding: 0 15px; margin: 20px auto; }
    .modal-form { flex-direction: column; align-items: stretch; }
    .content-grid { grid-template-columns: 1fr; }
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .sedes-table { min-width: 700px; }
    h2 { font-size: 24px; }
    .modal-header h3 { font-size: 20px; }
    .glass-panel { padding: 25px; }
    .modal-content { width: 95%; padding: 20px; }
}
@media (max-width: 480px) {
    .dashboard-container { padding: 0 10px; }
    .card { padding: 20px; }
    .btn-small { padding: 8px 10px; font-size: 12px; }
    .login-container { padding: 10px; }
}