:root {
    --primary-color: #D32F2F;
    /* Red from the logo request */
    --primary-hover: #b71c1c;
    --text-color: #333;
    --text-light: #666;
    --bg-overlay: rgba(255, 255, 255, 0.9);
    --input-bg: #f0f4f8;
    --input-border: #dce0e4;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    /* Changed to Poppins */
}

body {
    background-image: url('imagenes/fondo-login.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Align to right like the reference */
    padding-right: 10%;
    /* Spacing from right */
}

/* Semi-transparent overlay for better text readability if needed on the left */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    /* Slight darken of background image */
    z-index: -1;
}

.login-container {
    width: 100%;
    max-width: 450px;
    height: 100vh;
    /* Full height card on right */
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    position: absolute;
    right: 0;
    top: 0;
    animation: slideInLeft 0.8s ease-out forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.login-card {
    width: 100%;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container img {
    max-width: 220px;
    /* Slightly larger logo on login? User asked to enlarge logo, usually implies dashboard too */
    height: auto;
}

.login-instruction {
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 0.95rem;
    text-align: left;
}

/* Floating Label Inputs */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--primary-color);
    background: white;
}

.input-group label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.input-group input:focus+label,
.input-group input:not(:placeholder-shown)+label {
    top: 5px;
    font-size: 0.75rem;
    color: var(--primary-color);
    background: transparent;
    /* Or white if crossing border */
    transform: translateY(0);
}

/* Tweaking padding for floating label effect when focused */
.input-group input:focus,
.input-group input:not(:placeholder-shown) {
    padding-top: 25px;
    padding-bottom: 5px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
}

.forgot-password {
    text-align: right;
    margin-bottom: 30px;
}

.forgot-password a {
    color: #4285f4;
    /* Typical link blue, or use primary if preferred */
    text-decoration: none;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    /* Orange/Red from logo */
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
}

.login-btn:hover {
    background-color: var(--primary-hover);
}

.footer-links {
    margin-top: 20px;
    text-align: left;
}

.footer-links a {
    color: #4285f4;
    text-decoration: none;
    font-size: 0.9rem;
}

.login-footer {
    margin-top: 50px;
    text-align: center;
    color: var(--text-light);
}

.login-footer p {
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.login-footer h3 {
    font-size: 1rem;
    color: var(--text-color);
}

/* Responsiveness */
@media (max-width: 768px) {
    body {
        justify-content: center;
        padding-right: 0;
        background-position: left;
    }

    .login-container {
        max-width: 100%;
        background: rgba(255, 255, 255, 0.95);
        /* Slight transparency on mobile */
    }
}

/* --- DASHBOARD STYLES --- */

.dashboard-body {
    background-image: none;
    /* Override login bg */
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    height: auto;
    padding-right: 0;
    min-height: 100vh;
}

.dashboard-body::before {
    display: none;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Collapsed State (Desktop only usually) */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-logo {
    display: none;
    /* Or replace with small icon if available */
}

.sidebar.collapsed .sidebar-header {
    height: 60px;
    justify-content: center;
}

/* Show small logo or icon in collapsed state if desired, for now keeping simple */

.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .arrow-right {
    display: none;
}

.sidebar.collapsed .sidebar-footer .collapse-btn i {
    transform: rotate(180deg);
}

.sidebar-header {
    height: 80px;
    /* Taller header for bigger logo */
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #eee;
    padding: 10px;
    transition: all 0.3s;
}

.sidebar-logo {
    max-height: 80px;
    /* Enlarge Logo further */
    transition: max-height 0.3s;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
    padding-top: 20px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    /* More padding */
    color: var(--text-light);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.2s;
    font-size: 0.95rem;
    white-space: nowrap;
    /* Prevent text wrapping when collapsing */
    overflow: hidden;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    color: var(--primary-color);
    background: #fff5f5;
    border-left: 4px solid var(--primary-color);
}

.icon-container {
    width: 24px;
    text-align: center;
    margin-right: 15px;
    font-size: 1.1rem;
}

.sidebar-nav li a .arrow-right {
    margin-left: auto;
    font-size: 0.8rem;
    color: #ccc;
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid #eee;
    text-align: right;
}

.collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-light);
    padding: 5px 10px;
    transition: transform 0.3s;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
    /* When sidebar is collapsed */
}

/* Top Bar */
.top-bar {
    height: 70px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background: var(--text-color);
    border-radius: 1px;
}

.top-bar-title {
    font-size: 1.3rem;
    /* Slightly larger */
    font-weight: 600;
    color: var(--text-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Content Area */
.content-wrapper {
    padding: 40px;
    flex: 1;
    /* Push footer down */
}

.page-title {
    font-size: 2.2rem;
    color: #ccc;
    /* Lighter as per screenshot */
    font-weight: 300;
    margin-bottom: 25px;
}

.status-tag {
    display: inline-block;
    background-color: #FFA726;
    /* Adjusted orange */
    color: white;
    padding: 10px 25px;
    border-radius: 2px;
    font-size: 1rem;
    margin-bottom: 35px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.03);
    padding: 25px;
    transition: transform 0.2s;
    border: 1px solid #f5f5f5;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.card-header h2 {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 400;
}

.card-icon {
    color: #bbb;
    font-size: 0.9rem;
}

.info-row {
    margin-bottom: 18px;
    font-size: 1rem;
}

.info-row.highlight {
    font-weight: 500;
    color: var(--primary-color);
}

.info-row .label {
    color: #999;
    display: block;
    font-size: 0.85em;
    margin-bottom: 4px;
}

.info-row .value {
    color: var(--text-color);
    font-weight: 400;
}

/* Footer Styles */
.main-footer {
    padding: 20px 40px;
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.main-footer a {
    color: #777;
    text-decoration: none;
    font-weight: 600;
}

.main-footer a:hover {
    color: var(--primary-color);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* Dashboard Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        /* Fixed width on mobile, no collapse state usually */
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-footer {
        display: none;
        /* Hide collapse button on mobile */
    }

    .main-content {
        margin-left: 0;
    }

    .main-content.expanded {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .top-bar-title {
        display: none;
        /* Hide on small screens */
    }

    .content-wrapper {
        padding: 20px;
    }

    .page-title {
        font-size: 1.8rem;
    }
}

/* User Profile & Dropdown */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    position: relative;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.user-profile:hover {
    background-color: #f5f5f5;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    margin-top: 10px;
    border: 1px solid #eee;
}

.user-dropdown.show {
    display: flex;
}

.dropdown-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #fdfdfd;
}

.dropdown-header strong {
    display: block;
    color: var(--text-color);
    font-size: 0.9rem;
}

.dropdown-header span {
    display: block;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 5px;
}

.dropdown-item {
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.dropdown-item i {
    margin-right: 10px;
    width: 16px;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.text-danger {
    color: #d32f2f !important;
}

.text-danger:hover {
    background-color: #fff5f5;
}

/* Sidebar Logout Specifics */
.sidebar-nav ul {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.logout-item {
    margin-top: auto;
    /* Push to bottom if the spacer index doesn't work or as fallback */
    border-top: 1px solid #f0f0f0;
}

.logout-item a {
    color: #D32F2F !important;
}

.logout-item a:hover {
    background-color: #fff5f5 !important;
}