/* Estilos generales */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Estilos para el login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.login-box {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    display: flex;
}

.login-image {
    flex: 1;
    background-color: #4e73df;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.login-image h2 {
    font-size: 28px;
    margin-bottom: 0;
    text-align: center;
    width: 100%;
    margin-top: 0;
}

.login-image-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.login-image p {
    font-size: 16px;
    margin-bottom: 0;
    margin-top: 10px;
    text-align: center;
}

.login-form {
    flex: 1;
    padding: 40px;
}

.login-form h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    max-width: 400px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4e73df;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #4e73df;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
}

.btn:hover {
    background-color: #2e59d9;
}

/* Estilos específicos para botones de gestión de producto */
.actions .btn {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Alinear todos los botones a la misma altura */
.btn {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-sizing: border-box;
    vertical-align: top;
}

/* Corregir alineación específica para botones */
.actions {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    flex-wrap: wrap;
}

.actions .btn,
.actions button.btn {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-sizing: border-box;
    vertical-align: top;
    margin: 0;
    border: none;
    outline: none;
}

/* Separar el botón Actualizar Estado del dropdown */
.change-status-section form {
    display: flex;
    align-items: center;
    gap: 15px;
}

.change-status-section select {
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn-edit {
    background-color: #28a745;
}

.btn-edit:hover {
    background-color: #218838;
}

.btn-info {
    background-color: #17a2b8;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Estilos para botones de tablas en dashboards */
.data-table .btn {
    height: 32px;
    padding: 6px 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-sizing: border-box;
    vertical-align: top;
    margin: 2px;
    text-decoration: none;
    border: none;
    outline: none;
}

.data-table td {
    vertical-align: middle;
}

.data-table .btn-small {
    height: 32px;
    padding: 6px 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-sizing: border-box;
    vertical-align: top;
    margin: 2px;
}

.btn-manage {
    background-color: #007bff;
    color: white;
}

.btn-manage:hover {
    background-color: #0056b3;
}

.error-message {
    color: #e74a3b;
    margin-top: 10px;
}

/* Estilos para el dashboard */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #4e73df;
    color: #fff;
    padding: 20px;
}

.sidebar h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

.sidebar-menu {
    list-style-type: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu a {
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.sidebar-menu a:hover {
    background-color: #2e59d9;
}

.main-content {
    flex: 1;
    padding: 20px;
}

.dashboard-header {
    background-color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.logout-btn {
    background-color: transparent;
    border: 2px solid #4e73df;
    color: #4e73df;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.logout-btn:hover {
    background-color: #4e73df;
    color: #fff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e3e6f0;
}

.data-table th {
    background-color: #f8f9fc;
    font-weight: bold;
    color: #4e73df;
}

.data-table tr:hover {
    background-color: #f8f9fc;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-danger {
    background-color: #e74a3b;
}

.btn-danger:hover {
    background-color: #be2617;
}

.btn-success {
    background-color: #1cc88a;
}

.btn-success:hover {
    background-color: #13855c;
}

/* Estilos de popup eliminados - se usan estilos inline en JavaScript */

/* Estilos para indicador de carga y mensajes de error */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 20px;
    border-radius: 5px;
    margin: 20px;
}

.error-message h3 {
    margin-top: 0;
    color: #721c24;
}

.error-message button {
    margin-top: 10px;
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.error-message button:hover {
    background-color: #c82333;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }

    .main-content {
        padding: 10px;
    }

    .data-table {
        font-size: 14px;
    }

    .btn-small {
        padding: 3px 6px;
        font-size: 12px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        max-width: 100%;
    }
}

/* Menú lateral de fases */
.process-phases {
    width: 200px;
    background-color: #f1f1f1;
    padding: 20px;
}

.process-phases ul {
    list-style-type: none;
    padding: 0;
}

.process-phases li {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.process-phases li.active {
    background-color: #4CAF50;
    color: white;
}

/* Contenido principal */
.main-content {
    flex: 1;
    padding: 20px;
}

/* Sistema de pestañas unificado */
.tabs, .unified-tabs {
    width: 100%;
    margin-top: 20px;
}

.tab-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    border-bottom: 2px solid #e9ecef;
}

.tab-links li {
    margin: 0;
}

.tab-links a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #495057;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    background-color: #f8f9fa;
}

.tab-links a:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.tab-links li.active a,
.tab-links a.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #fff;
}

.tab-content {
    padding: 20px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-top: none;
    min-height: 400px;
}

.tab {
    display: none;
}

.tab.active {
    display: block;
}

/* Estilos para fases del proceso */
.phase-link.read-only {
    opacity: 0.7;
    color: #666;
    cursor: default;
}

.phase-link.read-only:hover {
    background-color: #f5f5f5;
}

.read-only-indicator {
    font-size: 10px;
    color: #999;
    font-style: italic;
}

.phase-link.active {
    background-color: #007bff;
    color: white;
}

.phase-link.active:hover {
    background-color: #0056b3;
}

/* Contenido de fase */
#phase-content {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

/* Encabezado del producto */
.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Clase para ocultar elementos */
.hidden {
    display: none;
}

/* Estilos para Preguntas y Respuestas */
.preguntas-respuestas {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preguntas-respuestas h3 {
    margin: 0;
    color: #333;
}

.pyr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.btn-acta-pyr {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #17a2b8;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.btn-acta-pyr:hover {
    background-color: #138496;
}

/* Layout horizontal para PYR */
.pyr-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.preguntas-list {
    flex: 1;
    min-width: 0; /* Permite que se reduzca */
}

.nueva-pregunta-section {
    flex: 0 0 400px; /* Ancho fijo de 400px */
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    height: fit-content;
}

.nueva-pregunta-section h4 {
    margin-top: 0;
    color: #333;
    margin-bottom: 15px;
}

.pregunta-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.pregunta-form .char-counter {
    text-align: right;
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.pregunta-form .btn-submit {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
    width: 100%;
    transition: background-color 0.3s ease;
}

.pregunta-form .btn-submit:hover {
    background-color: #0056b3;
}

.pregunta-form .btn-submit:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.pregunta-item {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.pregunta-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.pregunta-texto {
    font-size: 1em;
    color: #333;
    margin-bottom: 10px;
}

.respuesta {
    background-color: #e9f7ef;
    border-left: 4px solid #28a745;
    padding: 10px;
    margin-top: 10px;
    font-size: 0.95em;
    color: #218838;
}

.sin-respuesta {
    font-style: italic;
    color: #888;
    font-size: 0.9em;
    margin-top: 5px;
}

.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination-container button {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    padding: 8px 12px;
    margin: 0 4px;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
}

.pagination-container button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-container button:hover:not(.active) {
    background-color: #e9e9e9;
}

.read-only-message {
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    color: #856404;
    text-align: center;
    margin-top: 20px;
}

/* Responsive para PYR */
@media (max-width: 768px) {
    .pyr-layout {
        flex-direction: column;
    }
    
    .nueva-pregunta-section {
        flex: none;
    }
}

/* Sistema de popup mejorado eliminado - se usan estilos inline en JavaScript */

#phase-content .loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

#phase-content .error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

/* Estilos para tablas */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.data-table th {
    background-color: #f2f2f2;
}

/* Estilos para formularios */
form {
    margin-bottom: 20px;
}

input[type="text"], input[type="number"], textarea {
    width: 100%;
    padding: 8px;
    margin: 5px 0 15px 0;
    display: inline-block;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    margin: 8px 0;
    border: none;
    cursor: pointer;
}

button:hover {
    opacity: 0.8;
}

/* Estilos para mensajes */
.success-message, .error-message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.success-message {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.error-message {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}

/* Estilos para la vista de detalles del producto */
.main-header {
    background-color: #f8f9fa;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    margin: 0 10px;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info span {
    margin-right: 15px;
}

.btn-return {
    background-color: #007bff;
    color: white;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 4px;
}

.top-nav {
    background-color: #343a40;
    padding: 10px 0;
}

.top-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

.top-nav li {
    margin: 0 15px;
}

.top-nav a {
    color: white;
    text-decoration: none;
}

.content-wrapper {
    display: flex;
    margin-top: 20px;
}

.process-phases {
    width: 200px;
    background-color: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #dee2e6;
}

.process-phases ul {
    list-style-type: none;
    padding: 0;
}

.process-phases li {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
}

.process-phases li.active {
    background-color: #007bff;
    color: white;
}

.main-content {
    flex: 1;
    padding: 20px;
}


/* Estilos para las migas de pan */
.breadcrumb {
    background-color: #f8f9fa;
    padding: 10px;
    margin-bottom: 20px;
}

.breadcrumb span {
    color: #6c757d;
}

.breadcrumb span.active {
    color: #007bff;
    font-weight: bold;
}

/* Estilos para las fases del proceso */
.process-phases {
    width: 200px;
    background-color: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #dee2e6;
}

.process-phases h3 {
    margin-top: 0;
}

.process-phases ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.process-phases li {
    margin-bottom: 10px;
}


.process-phases a {
    text-decoration: none;
    color: #333;
}

.process-phases li.active a {
    font-weight: bold;
    color: #007bff;
}

.process-phases .phase-link {
    display: block;
    padding: 10px;
    color: #333;
    text-decoration: none;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    margin-bottom: 5px;
}

.process-phases .phase-link.inactive {
    color: #999;
    cursor: not-allowed;
}

.process-phases .phase-link:hover:not(.inactive) {
    background-color: #e9ecef;
}

.process-phases .phase-link:hover {
    background-color: #f1f3f5;
}

.process-phases .phase-link.current {
    border-left: 3px solid #007bff;
    padding-left: 7px; /* Ajusta el padding para compensar el borde */
}

/* Elimina cualquier estilo específico para elementos activos si no lo deseas */
.process-phases li.active .phase-link {
    background-color: #ffffff;
    color: #333333;
}

/* Estilos para el contenido principal */
.main-content {
    flex: 1;
    padding: 20px;
}

/* Estilos para la lista de ofertas */
.ofertas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.oferta-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.oferta-info {
    margin-bottom: 10px;
}

.oferta-info strong {
    display: block;
    color: #333;
    margin-bottom: 5px;
}

.oferta-fecha {
    font-size: 12px;
    color: #666;
}

.procesado-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-left: 10px;
}

.oferta-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-small.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-small.btn-danger:hover {
    background: #c82333;
}

.btn-small:not(.btn-danger) {
    background: #007bff;
    color: white;
}

.btn-small:not(.btn-danger):hover {
    background: #0056b3;
}

/* Estilos específicos para página de login - Prevenir barras laterales */
body.login-page {
    display: block !important;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    background-image: url('../images/login-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Overlay sólido con 15% de transparencia sobre la imagen de fondo */
body.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.20);
    z-index: 0;
    pointer-events: none;
}

body.login-page * {
    box-sizing: border-box;
}

body.login-page .sidebar,
body.login-page .dashboard-container,
body.login-page aside.sidebar,
body.login-page .process-phases {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
}

body.login-page .login-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    z-index: 1;
}

body.login-page .login-box {
    position: relative;
    z-index: 1;
}

body.login-page footer {
    position: relative;
    z-index: 1;
}

/* Footer específico para login */
body.login-page footer {
    position: relative;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    padding: 10px 20px;
}

/* Prevenir cualquier overflow horizontal */
body.login-page,
body.login-page html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}