:root {
    /* UTH Colors */
    --primary: #007A33;
    --primary-light: #009940;
    --white: #FFFFFF;
    --bg-light: #F4F6F8;
    --text-dark: #444444;
    --text-muted: #777777;
    
    /* Indicators */
    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
    --info: #17A2B8;

    /* Shadows & Radii */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;

    /* Transitions */
    --transition: all 0.3s ease;
}

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

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* Views Management */
.view {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.view.active {
    display: block;
    opacity: 1;
}

#main-layout.active {
    display: flex;
    height: 100vh;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.btn-large {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.btn-text {
    background: transparent;
    color: var(--primary);
}

.btn-text:hover {
    background: rgba(0, 51, 102, 0.05);
}

.btn-icon {
    background: transparent;
    color: var(--text-dark);
    padding: 8px;
    font-size: 1.2rem;
}

.btn-icon:hover {
    color: var(--primary);
}

.btn:disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Forms */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.error-msg {
    color: var(--danger);
    font-size: 13px;
    margin-top: 10px;
    min-height: 18px;
}

/* Login View (Split Screen) */
.login-container {
    height: 100vh;
    display: flex;
    background: var(--white);
}

.login-image-side {
    flex: 1;
    background: url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?auto=format&fit=crop&q=80') center/cover no-repeat;
    position: relative;
    display: none;
}

@media (min-width: 768px) {
    .login-image-side {
        display: block; /* Solo se muestra en pantallas medianas/grandes */
    }
}

.login-image-side .overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(0,122,51,0.9) 0%, rgba(0,153,64,0.8) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
}

.login-image-side .overlay h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.login-image-side .overlay p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 500px;
}

.login-form-side {
    flex: 1;
    max-width: 600px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-light);
}

.login-card {
    background: var(--white);
    padding: 50px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    max-width: 140px;
    margin-bottom: 20px;
}

.login-header {
    margin-bottom: 35px;
}

.login-header h2 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.public-links {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Main Layout */
.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.sidebar-logo {
    max-width: 220px;
    width: 100%;
    object-fit: contain;
}

.badge {
    background: var(--primary);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    gap: 12px;
}

.sidebar-nav li a:hover, .sidebar-nav li a.active {
    background: rgba(0, 51, 102, 0.05);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
}

/* Cards & Dashboards */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 24px;
    color: var(--primary);
}

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

.project-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card.evaluated {
    background: #f8f9fa;
    border: 1px solid #eee;
}

.card.evaluated .card-title {
    color: var(--text-muted);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.card-code {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
    background: #eee;
    padding: 4px 8px;
    border-radius: 4px;
}

.card-body {
    flex: 1;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.card-body p {
    margin-bottom: 6px;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 51, 102, 0.1);
    color: var(--primary);
    margin-right: 5px;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--white);
    color: var(--text-dark);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid var(--primary);
}

.toast.show {
    transform: translateX(0);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }

/* ==========================================
   Responsive Design (Móviles y Tablets)
   ========================================== */
@media (max-width: 768px) {
    #main-layout.active {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        flex: none;
    }
    
    .sidebar-header {
        padding: 15px 20px;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0;
    }

    .sidebar-nav ul {
        display: flex;
    }

    .sidebar-nav li a {
        padding: 15px 20px;
        white-space: nowrap;
        border-right: none;
        border-bottom: 3px solid transparent;
    }

    .sidebar-nav li a:hover, .sidebar-nav li a.active {
        border-right: none;
        border-bottom: 3px solid var(--primary);
        background: transparent;
    }
    
    .sidebar-footer {
        padding: 15px 20px;
    }

    .main-content {
        padding: 20px 15px;
    }

    .projects-grid {
        grid-template-columns: 1fr; /* Una sola columna en celulares */
    }

    .login-card {
        padding: 25px 20px;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .toast {
        min-width: calc(100vw - 40px);
        bottom: 20px;
        right: 20px;
    }
}
