:root {
    --verde-claro: #008757;
    --blanco: #ffffff;
    --amarillo-dorado: #C99E67;
    --gris-suave: #f5f5f5;
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-gray: #f5f6fa;
    --border-color: #dcdde1;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--gris-suave);
    color: #222;
    min-height: 100vh;
    display: flex;
}

.sidebar {
    background: var(--verde-claro);
    color: #222;
    width: 240px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 5rem;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
    z-index: 999;
    transition: transform 0.3s ease;
}

.logo {
    margin-bottom: 2rem;
    color: var(--amarillo-dorado);
    font-weight: bold;
    font-size: 1.4rem;
    text-align: center;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
}

.logo-img {
    width: 45px;
    height: auto;
}

.sidebar nav ul {
    list-style: none;
    width: 100%;
}

.sidebar nav ul li {
    width: 100%;
}

.sidebar nav ul li a {
    display: block;
    padding: 1rem 2rem;
    color: #222;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: bold;
    border-left: 5px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
    background: var(--amarillo-dorado);
    color: var(--blanco);
    border-left: 5px solid var(--blanco);
}

.main-content {
    margin-left: 240px;
    padding: 2rem;
    width: 100%;
    min-height: 100vh;
    background: var(--blanco);
}

header h1 {
    color: var(--verde-claro);
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4rem;
    }
}

.maquina-card {
    background: var(--gris-suave);
    border: 2px solid var(--verde-claro);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.maquina-card:hover {
    box-shadow: 0 4px 16px rgba(143, 209, 158, 0.2);
    border-color: var(--amarillo-dorado);
}

.maquina-card img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.maquina-card span {
    font-weight: bold;
    color: var(--verde-claro);
    font-size: 1.1rem;
}

/* Estilos de la página de inicio de sesión */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
    color: #333;
}

.form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.login-button {
    padding: 12px;
    background:rgb(0, 135, 87);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-button:hover {
    background: #0056b3;
}

.forgot-password {
    text-align: center;
    margin-top: 15px;
}

.forgot-password a {
    color:rgb(0, 135, 87);
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Estilos exclusivos para index.php */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.stat-info {
    flex-grow: 1;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    margin: 5px 0;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

.operativas { background-color: #e3f2fd; color: #1976d2; }
.mantenimiento { background-color: #fff3e0; color: #f57c00; }
.alertas { background-color: #fce4ec; color: #c2185b; }
.total { background-color: #e8f5e9; color: #388e3c; }

.recent-activity {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.activity-list {
    list-style: none;
    padding: 0;
}

.activity-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
}

.activity-info {
    flex-grow: 1;
}

.activity-time {
    color: #666;
    font-size: 0.8em;
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background: var(--verde-claro);
    color: var(--blanco);
    border: none;
    border-radius: 4px;
    padding: 0.8rem;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: var(--amarillo-dorado);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

/* Estilos para el formulario de mantenimiento */
.mantenimiento-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 20px auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.btn-submit {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.btn-submit:hover {
    background-color: #2980b9;
}

/* Estilos para la tabla de mantenimiento */
.mantenimiento-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mantenimiento-table th,
.mantenimiento-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.mantenimiento-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.mantenimiento-table tr:hover {
    background-color: var(--light-gray);
}

/* Estilos para los estados */
.estado-pendiente {
    color: var(--warning-color);
}

.estado-en-proceso {
    color: var(--secondary-color);
}

.estado-completado {
    color: var(--success-color);
}

/* Estilos para el usuario y cierre de sesión */
.user-info {
    margin-top: auto;
    padding: 15px;
    border-top: 1px solid #eee;
}

.username {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
}

.logout {
    color: #dc3545;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.logout:hover {
    color: #c82333;
}

.logout i {
    font-size: 16px;
}