:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
    --sidebar-width: 280px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-color);
    background-color: var(--light-bg);
    line-height: 1.6;
}

/* -- LOGIN PAGE -- */
.login-body {
    background: url("img/fondo.jpg") center center / cover no-repeat fixed;
}

.login-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 100vh;
    /* Overlay para legibilidad sobre el fondo */
    background: rgba(0, 0, 0, 0.35);
    padding-right: clamp(16px, 6vw, 112px);
    padding-left: 16px;
}

@media (max-width: 700px) {
    .login-container {
        justify-content: center;
        padding-right: 16px;
        padding-left: 16px;
    }
}

.landing-content {
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(6px);
    padding: 3.5rem 1rem 2.5rem 1rem;
}

.landing-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1000px) {
    .landing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .landing-grid {
        grid-template-columns: 1fr;
    }
}

.landing-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.landing-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(52, 152, 219, 0.12);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.landing-card h3 {
    margin: 0 0 0.35rem 0;
    font-size: 1rem;
    color: var(--primary-color);
}

.landing-card p {
    margin: 0;
    color: #555;
    font-size: 0.92rem;
}

.landing-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}

@media (max-width: 900px) {
    .landing-split {
        grid-template-columns: 1fr;
    }
}

.landing-panel {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 1.25rem;
}

.landing-panel h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1rem;
}

.landing-cta {
    display: flex;
    gap: .75rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.landing-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    text-decoration: none;
    font-weight: 800;
    border-radius: 999px;
    padding: .6rem 1rem;
    background: var(--accent-color);
    color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.landing-btn.secondary {
    background: #2c3e50;
}

.landing-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #666;
    font-size: .9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 1.25rem;
    flex-wrap: wrap;
}

.landing-powered {
    font-size: 1.05rem;
    font-weight: 800;
    color: #2c3e50;
}

.landing-powered a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 900;
}

.landing-powered a:hover {
    text-decoration: underline;
}

/* Logo Top Left */
.logo-top-left {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.logo-top-left img {
    max-height: 200px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

@media (max-width: 700px) {
    .logo-top-left {
        top: 15px;
        left: 15px;
    }
    
    .logo-top-left img {
        max-height: 150px;
    }
}

.login-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card img {
    max-width: 180px;
    margin-bottom: 2rem;
}

.login-card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

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

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    resize: vertical;
}

.form-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-group textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.login-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.login-error {
    color: var(--danger-color);
    background: #fde8e8;
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    border: 1px solid var(--danger-color);
}

/* -- LAYOUT -- */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 70px 1fr;
    height: 100vh;
}

header {
    grid-column: 1 / -1;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-left nav {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background-color: #f0f4f8;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--accent-color);
    background-color: #e3f2fd;
    border-color: #bbdefb;
}

.nav-link i {
    margin-right: 0.3rem;
}

.logout-link {
    background-color: #fde8e8;
    color: var(--danger-color);
    padding: 0.4rem 1rem;
    border-radius: var(--radius);
}

.logout-link:hover {
    background-color: var(--danger-color);
    color: var(--white);
}

.sidebar {
    background-color: #fcfcfc;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

main {
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--light-bg);
}

/* -- UTILS -- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* -- SCHEDULE GRID -- */
table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

table tbody tr:hover {
    background-color: #f1f8ff !important;
}

/* Asegurar que el thead mantenga su estilo en hover */
table thead tr:hover {
    background-color: var(--primary-color) !important;
}

.schedule-grid button:hover {
    opacity: 0.8;
}

/* -- MODAL -- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

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

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

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

#pickerContent {
    max-height: 60vh;
    overflow-y: auto;
}