/*
File: style.css
Propósito: Define toda la apariencia visual de la aplicación.
Estructura:
1. :root - Variables globales de colores y fuentes.
2. Estilos de Login - Apariencia de la página de inicio de sesión.
3. Layout Principal - Estructura de la barra lateral y el área de contenido.
4. Componentes - Estilos para elementos reutilizables como tablas, widgets, modales, etc.
5. Responsive - Media queries que adaptan el diseño para tablets y móviles.
*/

:root {
    --primary-color: #FFBF00;
    --secondary-color: #f5a623;
    --dark-color: #FFBF00;
    --light-color: #000000;
    --white-color: #ffffff;
    --gray-color: #000000;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    --sidebar-width: 220px;
}

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: #f8f9fa;
    color: var(--dark-color);
}

/* --- ESTILOS DE LOGIN --- */
.login-body { display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, var(--primary-color), var(--dark-color)); }
.login-container { padding: 40px; background-color: var(--white-color); border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); text-align: center; width: 90%; max-width: 350px; }
.login-container h2 { margin-bottom: 10px; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.form-group button, .btn-primary, .btn-secondary { width: 100%; padding: 12px; border: none; border-radius: 4px; background-color: var(--primary-color); color: var(--white-color); font-size: 16px; cursor: pointer; transition: background-color 0.3s ease; }
.btn-secondary { background-color: var(--secondary-color); }
.form-group button:hover, .btn-primary:hover { filter: brightness(110%); }
.btn-secondary:hover { filter: brightness(110%); }
.error-message { color: var(--danger-color); background-color: #fdd; border: 1px solid var(--danger-color); padding: 10px; border-radius: 4px; margin-bottom: 15px; }


/* --- LAYOUT PRINCIPAL --- */
.app-container { display: flex; }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--primary-color);
    color: var(--white-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}
.sidebar-header {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}
.sidebar-header img {
    height: 40px;
    max-width: 80%;
}
.sidebar-menu { list-style: none; padding: 0; margin: 0; flex-grow: 1; }
.sidebar-menu li a { display: block; padding: 15px 20px; color: var(--light-color); text-decoration: none; transition: background-color 0.3s ease; }
.sidebar-menu li a:hover, .sidebar-menu li a.active { background-color: rgba(0,0,0,0.1); }
.sidebar-menu li a i { margin-right: 10px; width: 20px; text-align: center; }
.sidebar-footer { padding: 20px; text-align: center; border-top: 1px solid rgba(255,255,255,0.2); color: #000000; }
.sidebar-footer a { color: var(--light-color); text-decoration: none; opacity: 0.8; color: #000000; }
.sidebar-footer a:hover { opacity: 1; }

.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}
.main-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 25px;
    background-color: var(--white-color);
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 999;
    height: 60px;
    box-sizing: border-box;
}
.main-header h1 { font-size: 1.8em; margin: 0; }
.header-actions-group {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}
.top-bar-icons a {
    color: var(--dark-color);
    font-size: 1.5em;
    margin-left: 20px;
}
.menu-toggle-btn { display: none; background: none; border: none; font-size: 1.5em; cursor: pointer; color: var(--dark-color); }

#content-area { padding: 25px; }
.loader { text-align: center; padding: 50px; font-size: 1.5em; color: var(--gray-color); }

/* --- COMPONENTES --- */

/* Tablas */
.content-table { width: 100%; border-collapse: collapse; box-shadow: 0 2px 15px rgba(0,0,0,0.05); background-color: var(--white-color); }
.content-table thead { background-color: #f8f9fa; color: var(--dark-color); text-align: left; }
.content-table th, .content-table td { padding: 12px 15px; }
.content-table tbody tr { border-bottom: 1px solid #dddddd; }
.actions i { margin: 0 5px; color: var(--dark-color); cursor: pointer; font-size: 1.1em; }
.actions .btn-secondary, .actions .btn-primary { padding: 8px 12px; font-size: 0.8em; margin: 4px; width: auto; display: inline-block; }
.edit-btn:hover { color: var(--secondary-color); }
.delete-btn:hover { color: var(--danger-color); }
.status-pendiente, .status-en-revision { background-color: #f1c40f; color: #fff; padding: 3px 8px; border-radius: 12px; font-size: 0.8em; white-space: nowrap; }
.status-firmado, .status-pagado, .status-recibido, .status-activo { background-color: var(--success-color); color: #fff; padding: 3px 8px; border-radius: 12px; font-size: 0.8em; white-space: nowrap; }
.status-finalizado, .status-en-pausa { background-color: var(--gray-color); color: #fff; padding: 3px 8px; border-radius: 12px; font-size: 0.8em; white-space: nowrap; }

/* Dashboard Widgets */
.dashboard-header-filters { margin-bottom: 20px; }
.dashboard-grid-main { display: grid; grid-template-columns: 1.5fr 1fr; grid-template-rows: auto 1fr; gap: 25px; width: 100%; }
.dashboard-widget { background: var(--white-color); padding: 20px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

/* --- WIDGET DEL GRÁFICO (ACTUALIZADO) --- */
.chart-widget {
    grid-column: 1 / 2;
    display: flex;
    flex-direction: column; /* Apila los elementos verticalmente */
    align-items: flex-start; /* Alinea el título a la izquierda */
    gap: 20px;
}
.chart-widget h3 {
    width: 100%;
    margin: 0;
}
.chart-container {
    width: 180px;
    height: 180px;
    position: relative;
    align-self: center; /* Centra el gráfico en el medio */
}
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Centra la leyenda */
    gap: 15px 25px; /* Espacio entre elementos de la leyenda */
    width: 100%;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
}
.chart-legend p {
    margin: 0;
    font-size: 1em;
}

/* --- WIDGET DE AVISOS (ACTUALIZADO) --- */
.notices-widget { grid-column: 2 / 3; }
.notices-widget h3 { margin-top: 0; }
.notices-widget ul { margin: 0; padding: 0; list-style: none; }
.notices-widget li a { 
    display: flex; 
    justify-content: space-between; 
    padding: 12px 5px; 
    border-bottom: 1px solid #f0f0f0; 
    text-decoration: none; 
    color: var(--dark-color);
    border-radius: 4px; /* Añadido para el efecto hover */
    transition: background-color 0.2s ease; /* Añadido para el efecto hover */
}
/* --- NUEVA REGLA HOVER --- */
.notices-widget li a:hover {
    background-color: #f5f5f5;
}
.notices-widget li a span { 
    font-size: 0.8em; 
    color: var(--gray-color); 
    background-color: #e9ecef; 
    padding: 3px 8px; 
    border-radius: 12px; 
}

.today-widget { grid-column: 1 / 3; }
.schedule-container { display: flex; flex-direction: column; }
.schedule-item { display: flex; border-top: 1px solid #f0f0f0; min-height: 60px; }
.schedule-time { flex-basis: 100px; padding: 20px 15px; color: var(--gray-color); font-weight: bold; border-right: 1px solid #f0f0f0; }
.schedule-event { flex-grow: 1; background-color: #FFFBEB; border-left: 4px solid var(--primary-color); padding: 10px 20px; margin: 10px 0; display: flex; align-items: center; }
.has-event .schedule-time { color: var(--primary-color); }

/* Filtros de Envíos */
.filters-bar { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; padding: 15px; background-color: var(--white-color); border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.filters-bar span { display: flex; align-items: center; gap: 8px; font-size: 0.9em; font-weight: 500; }
.filters-bar select, .filters-bar input[type="date"] { padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; background-color: #f9f9f9; }

/* Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: #fefefe; margin: 10vh auto; padding: 20px; border: 1px solid #888; width: 90%; max-width: 600px; border-radius: 8px; position: relative; animation: slide-down 0.4s; }
.close-btn { color: #aaa; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; cursor: pointer; }
@keyframes slide-down { from {top: -100px; opacity: 0} to {top: 10vh; opacity: 1} }


/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .dashboard-grid-main { grid-template-columns: 1fr; }
    .chart-widget, .notices-widget, .today-widget { grid-column: 1 / 2; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
    .app-container.sidebar-visible .sidebar { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .menu-toggle-btn { display: block; }

    #add-new-btn { width: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 0; display: flex; align-items: center; justify-content: center; margin-left: 10px; flex-shrink: 0; }
    #add-new-btn i.fas.fa-plus { font-size: 1.2rem; margin: 0; }

    .content-table thead { display: none; }
    .content-table, .content-table tbody, .content-table tr, .content-table td { display: block; width: 100%; }
    .content-table tr { margin-bottom: 15px; border: 1px solid #ddd; border-radius: 8px; }
    .content-table td { text-align: right; padding-left: 50%; position: relative; border-bottom: 1px solid #eee; overflow-wrap: break-word; word-break: break-all; padding-right: 15px; box-sizing: border-box; }
    .content-table td:last-child { border-bottom: none; }
    .content-table td::before { content: attr(data-label); position: absolute; left: 15px; width: calc(50% - 30px); text-align: left; font-weight: bold; }
    .content-table td.actions { padding-left: 15px; text-align: center; }
    .content-table td.actions::before { display: none; }
    .content-table td.no-results-cell { padding: 15px; text-align: center; font-style: italic; color: var(--gray-color); }
    .content-table td.no-results-cell::before { content: ""; }
    .content-table td .current-user-notice { display: block; width: 100%; text-align: center; font-style: italic; padding: 5px 0; }
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-nav h2 {
    margin: 0;
    font-size: 1.5em;
}
.calendar-nav-btn {
    padding: 8px 15px;
    background-color: var(--light-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--dark-color);
    font-weight: bold;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e0e0e0;
    border: 1px solid #e0e0e0;
}
.calendar-header {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background-color: #f8f9fa;
}
.calendar-day {
    background-color: var(--white-color);
    min-height: 120px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}
.calendar-day:not(.other-month):hover {
    background-color: #fdfdfd;
    outline: 1px solid var(--primary-color);
}
.calendar-day.other-month {
    background-color: #f5f5f5;
    cursor: default;
}
.day-number {
    font-weight: bold;
}
.calendar-day.today .day-number {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.calendar-event {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

/* Responsive para el calendario */
@media (max-width: 768px) {
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    .calendar-header {
        font-size: 0.8em;
        padding: 8px 2px;
    }
    .calendar-event {
        font-size: 0.7em;
        padding: 2px 4px;
    }
}

/* --- ESTILOS PARA EL MÓDULO DE CAMPAÑAS --- */

.campaign-summary {
    background: var(--white-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}
.campaign-summary h3 {
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark-color);
    font-size: 1.2em;
}
.campaign-summary h3 i {
    color: var(--secondary-color);
}
.campaign-summary-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}
.campaign-summary-stats div span {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: var(--dark-color);
}
.campaign-summary-stats div small {
    color: var(--gray-color);
    font-size: 0.9em;
}

/* --- ESTILOS PARA MENSAJERÍA --- */
.messaging-container {
    display: flex;
    height: calc(100vh - 150px); /* Ajustar altura según tu layout */
    background: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
}
.conversations-list {
    width: 300px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    background: #f8f9fa;
}
.conversation-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.conversation-item:hover {
    background-color: #f1f3f5;
}
.conversation-item.active {
    background-color: var(--secondary-color);
    color: var(--white-color);
}
.conversation-item h4 {
    margin: 0 0 5px 0;
    font-size: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.conversation-item p {
    margin: 0;
    font-size: 0.85em;
    opacity: 0.7;
}
.unread-badge {
    background-color: var(--danger-color);
    color: white;
    font-size: 0.7em;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 12px;
    line-height: 1;
}

.chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.chat-placeholder {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-color);
    font-size: 1.2em;
}
.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.message-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 70%;
}
.message-bubble p {
    margin: 0;
    word-wrap: break-word;
}
.message-bubble.sent {
    background-color: var(--primary-color);
    color: var(--white-color);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.message-bubble.received {
    background-color: #e9ecef;
    color: #000000; 
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.message-timestamp {
    display: block;
    font-size: 0.75em;
    margin-top: 5px;
    opacity: 0.8;
    text-align: right;
}

.chat-input-form {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
}
.chat-input-form textarea {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    resize: none;
    height: 40px;
    font-family: var(--font-family);
    font-size: 1em;
}
.chat-input-form button {
    width: 40px;
    height: 40px;
    margin-left: 10px;
    border-radius: 50%;
    font-size: 1.2em;
    padding: 0;
    flex-shrink: 0;
}

/* --- ESTILOS PARA NOTIFICACIONES --- */
.icon-wrapper {
    position: relative;
    display: inline-block;
}
.notification-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7em;
    font-weight: bold;
    line-height: 1;
    min-width: 18px;
    text-align: center;
    box-sizing: border-box;
    border: 2px solid var(--white-color);
}

.search-bar {
    margin-bottom: 20px;
}

.search-bar form {
    display: flex;
    width: 100%;
    max-width: 400px;
}

.search-bar input[type="search"] {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 10px 15px;
    font-size: 1em;
    border-radius: 4px 0 0 4px; /* Esquinas redondeadas solo a la izquierda */
    outline: none;
}
.search-bar input[type="search"]:focus {
    border-color: var(--primary-color);
}

.search-bar button {
    width: 50px;
    border: 1px solid var(--primary-color);
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 0 4px 4px 0; /* Esquinas redondeadas solo a la derecha */
    cursor: pointer;
    font-size: 1.1em;
}

.form-group select.multi-select {
    height: 150px; /* Mayor altura para ver varias opciones */
    padding: 10px; /* Padding interno */
}

.form-group select.multi-select option {
    padding: 5px; /* Espaciado entre opciones */
}

.form-group.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
}

.form-group.checkbox-group input[type="checkbox"] {
    width: auto; /* El checkbox no debe ocupar el 100% del ancho */
}

.filters-bar.contract-filters form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filters-bar.contract-filters input,
.filters-bar.contract-filters select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.filters-bar.contract-filters input[type="search"] {
    flex-grow: 1; /* El buscador ocupa el espacio sobrante */
    min-width: 200px;
}

.filters-bar.contract-filters button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: var(--white-color);
    cursor: pointer;
}
.filters-bar.contract-filters button:hover {
    filter: brightness(110%);
}

/* El estado 'Pendiente' y 'Activo' reutilizan los estilos existentes */
.status-cerrado {
    background-color: var(--danger-color);
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    white-space: nowrap;
}

/* --- ESTILOS PARA LA BARRA DE FILTROS (GENÉRICO) --- */
/* Estas reglas se aplicarán tanto a los filtros de contratos como a los de marcas */

.filters-bar form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filters-bar input,
.filters-bar select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    font-family: var(--font-family);
    font-size: 1em;
}

.filters-bar input[type="search"] {
    flex-grow: 1;
    min-width: 150px;
}

.filters-bar button {
    padding: 9px 15px;
    border: none;
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: var(--white-color);
    cursor: pointer;
    font-size: 0.9em;
}
.filters-bar button:hover {
    filter: brightness(110%);
}

.content-table thead th a.sortable-header {
    text-decoration: none;
    color: inherit; /* Hereda el color del texto de la cabecera */
    display: block;
}

.content-table thead th a.sortable-header:hover {
    color: var(--secondary-color); /* Cambia de color al pasar el ratón */
}

.content-table thead th a.sortable-header .fas {
    margin-left: 5px;
    opacity: 0.5;
}

.content-table thead th a.sortable-header:hover .fas {
    opacity: 1;
}

.payments-header {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}
.payments-header .search-bar {
    flex-grow: 1;
    margin-bottom: 0;
}
.payment-chart-container {
    height: 100px;
    width: 100%;
    max-width: 400px;
    background-color: var(--white-color);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Indicadores de Tipo de Pago */
.payment-type {
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
}
.payment-type.cobro-cobrado {
    background-color: var(--success-color);
}
.payment-type.cobro-pendiente {
    background-color: var(--primary-color);
}
.payment-type.gasto {
    background-color: var(--danger-color);
}

.dashboard-header-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    background-color: var(--white-color);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.dashboard-header-filters form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.dashboard-header-filters select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    font-family: var(--font-family);
    font-size: 0.9em;
}

#docs-modal-body h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.document-upload-form {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
}
.document-upload-form h4 {
    margin-top: 0;
}

.document-list h4 {
    margin-top: 0;
}
.document-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.document-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.document-list li:hover {
    background-color: #f5f5f5;
}
.document-list li a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: bold;
}
.document-list li a i {
    margin-right: 10px;
}
.document-list li span {
    font-size: 0.85em;
    color: var(--gray-color);
}

/* --- ESTILOS PARA EL COMPARADOR DE CAMPAÑAS --- */

.campaign-comparator {
    background: var(--white-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}
.campaign-comparator h3 {
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark-color);
    font-size: 1.2em;
}
.campaign-comparator h3 i {
    color: var(--secondary-color);
}
#comparator-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}
.comparator-team {
    flex: 1;
    min-width: 200px;
}
.comparator-team strong {
    display: block;
    margin-bottom: 5px;
}
.comparator-team select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.comparator-results {
    display: flex;
    gap: 20px;
}
.team-stats {
    flex: 1;
    display: flex;
    justify-content: space-around;
    text-align: center;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}
.team-stats div span {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--dark-color);
}
.team-stats div small {
    color: var(--gray-color);
    font-size: 0.9em;
}
.team-stats p {
    color: var(--gray-color);
    font-style: italic;
}

/* --- ESTILOS PARA A SECCIÓN DE CAMPAÑAS E ESTADÍSTICAS --- */

.view-header-actions {
    margin-bottom: 20px;
    text-align: right;
}
.view-header-actions .btn-secondary {
    width: auto;
    display: inline-block;
}

/* Modal de Estadísticas */
.stats-summary {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
}
.stats-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
}
.stats-summary-grid {
    display: flex;
    justify-content: space-around;
}
.stats-summary-grid div span {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: var(--dark-color);
}
.stats-summary-grid div small {
    color: var(--gray-color);
    font-size: 0.9em;
}

.stats-breakdown h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.contract-list-in-table {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left; /* Sobrescribe el text-align: right de la celda en móvil */
}

.contract-list-in-table li {
    margin-bottom: 5px;
}

.contract-list-in-table li:last-child {
    margin-bottom: 0;
}

.contract-list-in-table a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
}

.contract-list-in-table a:hover {
    text-decoration: underline;
}

.dual-list-selector {
    display: flex;
    gap: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
}
.dual-list-selector .list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.dual-list-selector .list-container strong {
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}
.dual-list-selector ul {
    list-style: none;
    padding: 0;
    margin: 0;
    height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f9f9f9;
}
.dual-list-selector li {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}
.dual-list-selector li:hover {
    background-color: #e9ecef;
}
.dual-list-selector li:last-child {
    border-bottom: none;
}
.dual-list-selector .hidden-inputs {
    display: none; /* Estes campos non necesitan ser visibles */
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.image-thumbnail {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    height: 120px;
}

.image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra el espacio sin deformarse */
}

.delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-thumbnail:hover .delete-image-btn {
    opacity: 1;
}
