/* =================================================================== */
/* ESTILOS GLOBALES Y LAYOUT PRINCIPAL
/* =================================================================== */

/* --- Estilos Generales del Body --- */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 0;
}

/* --- Layout Principal con Menú Lateral --- */
.main-layout {
    display: flex;
}

.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #ecf0f1;
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    padding: 30px 15px 25px 15px; 
    text-align: center;
    border-bottom: 1px solid #34495e;
    flex-shrink: 0;
}
.sidebar-header h3 {
    margin-top: 5px;
    margin-bottom: 0;
}
.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}
.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
}
.sidebar-nav a {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.3s;
}
.sidebar-nav a:hover {
    background-color: #34495e;
}
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #34495e;
    flex-shrink: 0;
}
.sidebar-footer a {
    display: block;
    text-align: center;
    background-color: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 4px;
    text-decoration: none;
}
.sidebar-footer a:hover { background-color: #c0392b; }

.main-content {
    margin-left: 250px; /* Mismo ancho que el sidebar */
    width: calc(100% - 250px); /* Ocupa el resto del ancho */
    padding: 30px;
    box-sizing: border-box;
}

/* Contenedor que centra el contenido dentro de .main-content */
.container {
    width: 100%;
    max-width: 1200px; /* Ancho máximo del contenido */
    margin: 0 auto; /* Centrado automático */
}


/* =================================================================== */
/* ESTILOS PARA FORMULARIOS Y PÁGINAS SIN MENÚ (LOGIN, REGISTER, ETC)
/* =================================================================== */
.centered-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.form-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
}
/* Ancho específico para formularios de login/registro */
.login-register-container {
    max-width: 600px;
}

h2 { text-align: center; color: #333; margin-bottom: 10px; }
.form-container p { text-align: center; color: #666; margin-bottom: 25px; }
fieldset { border: 1px solid #ddd; border-radius: 4px; padding: 20px; margin-bottom: 20px; }
legend { padding: 0 10px; font-weight: bold; color: #0056b3; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: #555; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 15px;
}
textarea { resize: vertical; }
button[type="submit"], .action-btn {
    width: auto; /* CORRECCIÓN: El botón se ajustará a su contenido */
    padding: 10px 20px; /* Ajustamos el padding para que se vea bien */
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}
button[type="submit"]:hover, .action-btn:hover { background-color: #0056b3; }
.form-link { text-align: center; margin-top: 20px; }
.message { padding: 15px; margin-bottom: 20px; border-radius: 4px; text-align: center; }
.message.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.password-wrapper { position: relative; width: 100%; }
.password-wrapper input { padding-right: 40px; }
.password-toggle-icon { position: absolute; top: 32%; right: 10px; transform: translateY(-50%); cursor: pointer; color: #888; }
.password-toggle-icon:hover { color: #333; }
.checkbox-group { display: flex; align-items: center; margin-bottom: 5px; }
.checkbox-group input { width: auto; margin-right: 10px; }
.danger-btn { background-color: #e74c3c !important; margin-right: 10px; }
.danger-btn:hover { background-color: #c0392b !important; }

/* --- Estilos para el Selector de Empresa en el Menú --- */
.company-selector-container { padding: 15px; background-color: #2c3e50; border-bottom: 1px solid #34495e; }
.company-selector-container label { font-size: 12px; color: #bdc3c7; display: block; margin-bottom: 5px; }
.company-selector-container select { width: 100%; padding: 8px; background-color: #ecf0f1; border: 1px solid #bdc3c7; border-radius: 4px; margin-bottom: 10px; }
.company-selector-container button, .company-selector-container .btn-add-company { width: 100%; padding: 8px; border: none; border-radius: 4px; color: white; text-align: center; cursor: pointer; text-decoration: none; display: block; box-sizing: border-box; }
#btn-switch-company { background-color: #2980b9; }
#btn-switch-company:hover { background-color: #3498db; }
.btn-add-company { background-color: #27ae60; margin-top: 10px; }
.btn-add-company:hover { background-color: #2ecc71; }