:root {
    /* Color Palette - Modern Dark Theme */
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --sidebar-bg: rgba(15, 23, 42, 0.7);
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-border: 1px solid rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.4);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    /* Accents */
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    --accent-glow: 0 0 20px rgba(99, 102, 241, 0.4);

    --success-color: #10b981;
    --danger-color: #ef4444;

    color-scheme: dark;
    /* Forces browser native controls (selects, scrollbars) to dark mode */
}

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

body {
    background: var(--bg-gradient);
    background-size: cover;
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Glassmorphism Utilities */
.glass-effect {
    backdrop-filter: blur(10px);
    /* Reduced from 12px */
    -webkit-backdrop-filter: blur(10px);
    border: var(--card-border);
}

/* ... (lines 47-77 skipped) ... */

.login-box {
    background: rgba(30, 41, 59, 0.9);
    /* More solid */
    backdrop-filter: blur(10px);
    /* Reduced from 16px */
    padding: 3rem;
    /* ... */
}

/* ... (lines 137-140) ... */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    /* Reduced from 20px */
    /* ... */
}

/* ... (lines 390-393) ... */
tbody tr:hover {
    background: rgba(45, 55, 72, 0.8);
    /* Removed transform: scale(1.005) - Causes layout thrashing/lag */
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Login */
#login-container {
    position: fixed;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(16px);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Spacing between elements */
}

.login-box h2 {
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: 1px;
    color: white;
}

.login-box input {
    background: rgba(15, 23, 42, 0.8);
    /* Mucho más oscuro, background sólido casi */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 14px;
    font-size: 1rem;
}

/* Autofill Fix */
.login-box input:-webkit-autofill,
.login-box input:-webkit-autofill:hover,
.login-box input:-webkit-autofill:focus,
.login-box input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(15, 23, 42, 0.95) inset !important;
    -webkit-text-fill-color: white !important;
    caret-color: white;
}

.login-box button {
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}

/* Dashboard Layout */
#dashboard-container {
    display: flex;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#dashboard-container.visible {
    opacity: 1;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    color: white;
    margin-bottom: 3rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: -webkit-linear-gradient(45deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-item {
    padding: 12px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateX(5px);
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, transparent 100%);
    color: #a5b4fc;
    border-left: 3px solid #6366f1;
}

.menu-item.logout {
    margin-top: auto;
    color: #f87171;
}

.menu-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.main-content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
    position: relative;
}

/* Sections */
h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: white;
}

/* Added more margin bottom */
.section {
    display: none;
    padding-bottom: 50px;
}

.section.active {
    display: block;
    animation: slideUp 0.4s ease-out;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.card h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

/* Increased margin for form groups */

/* Forms input */
input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: white;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

/* Custom Select Styling */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
    /* Space for arrow */
    cursor: pointer;
}

/* Option styling (limited support but helps in some browsers) */
option {
    background: #1e293b;
    /* Dark Slate */
    color: white;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background-color: rgba(0, 0, 0, 0.6);
    /* Slightly darker on focus */
}

/* File Input Styling */
input[type="file"] {
    position: relative;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

input[type="file"]:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: white;
}

input[type="file"]::file-selector-button {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    margin-right: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-hover);
}

/* Buttons */
button {
    transition: all 0.2s;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    font-size: 0.95rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.5);
}

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

.btn-secondary {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Icon Buttons (Actions) */
.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit {
    color: #a5b4fc;
}

.btn-edit:hover {
    background: rgba(99, 102, 241, 0.2);
    color: white;
    transform: scale(1.1);
}

.btn-delete {
    color: #fca5a5;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: white;
    transform: scale(1.1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: 10px;
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 0 20px;
}

tbody tr {
    background: rgba(30, 41, 59, 0.4);
    transition: transform 0.2s, background 0.2s;
}

tbody tr:hover {
    background: rgba(45, 55, 72, 0.6);
    transform: scale(1.005);
}

td {
    padding: 20px;
    border: none;
}

td:first-child {
    border-radius: 10px 0 0 10px;
}

td:last-child {
    border-radius: 0 10px 10px 0;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal.visible {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #1e293b;
    padding: 2.5rem;
    border-radius: 16px;
    width: 500px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--text-secondary);
    transition: 0.2s;
}

.close:hover {
    color: white;
    transform: rotate(90deg);
}

/* Tester Output */
pre {
    background: #0f172a;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #a5b4fc;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}