
/* =============================================
   EXECUTIVE SUMMARY CARD (traffic light)
   ============================================= */

.summary-card {
    display: flex;
    align-items: stretch;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2em;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

.summary-indicator {
    width: 8px;
    min-height: 100%;
    flex-shrink: 0;
}

.summary-content {
    padding: 1.3em 1.6em;
    flex: 1;
}

.summary-verdict {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.4em;
    line-height: 1.3;
}

.summary-detail {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.55;
    margin-bottom: 0.9em;
}

.summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.summary-action {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3em 0.8em;
    border-radius: 14px;
    line-height: 1.4;
}

/* --- GREEN state --- */
.summary-green {
    background: linear-gradient(135deg, #f0fdf0 0%, #f8fff8 100%);
    border-color: #c3e6cb;
}

.summary-green .summary-indicator {
    background: linear-gradient(180deg, #28a745 0%, #20c041 100%);
}

.summary-green .summary-verdict {
    color: #1a6b2a;
}

.summary-green .summary-action {
    background-color: #d4edda;
    color: #1a6b2a;
}

/* --- YELLOW state --- */
.summary-yellow {
    background: linear-gradient(135deg, #fffdf0 0%, #fffef8 100%);
    border-color: #f5e0a0;
}

.summary-yellow .summary-indicator {
    background: linear-gradient(180deg, #e6a817 0%, #ffc107 100%);
}

.summary-yellow .summary-verdict {
    color: #856404;
}

.summary-yellow .summary-action {
    background-color: #fff3cd;
    color: #856404;
}

/* --- RED state --- */
.summary-red {
    background: linear-gradient(135deg, #fdf0f0 0%, #fff8f8 100%);
    border-color: #f5c6cb;
}

.summary-red .summary-indicator {
    background: linear-gradient(180deg, #dc3545 0%, #e04555 100%);
}

.summary-red .summary-verdict {
    color: #842029;
}

.summary-red .summary-action {
    background-color: #f8d7da;
    color: #842029;
}


/* =============================================
   TENDENCIAS AI REPORT SECTION
   ============================================= */

.div_is_tendencias {
    margin: 2em 0;
    width: 100%;
    padding: 2.5em 3em;
    border: none;
    border-left: 4px solid #319F1C;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8faf8 100%);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    font-family: 'Nunito', 'Arial', sans-serif;
    font-size: 1.05rem;
    color: #333;
    line-height: 1.7;
    text-align: left;
}

/* Report header — icon + title row */
.tendencias-report-header {
    display: flex;
    align-items: center;
    gap: 0.8em;
    margin-bottom: 1.2em;
}

.tendencias-report-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #319F1C 0%, #3bb522 100%);
    color: white;
    flex-shrink: 0;
}

.tendencias-report-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c6e2f;
    margin: 0 0 0.1em 0;
    line-height: 1.2;
}

.tendencias-report-subtitle {
    font-size: 0.92rem;
    font-weight: 600;
    color: #6c757d;
}

/* Info bar — horizontal metadata strip */
.tendencias-info-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    background: #f4f7f4;
    border: 1px solid #e0e8e0;
    border-radius: 8px;
    padding: 0.7em 0;
    margin-bottom: 1.8em;
}

.tendencias-info-item {
    flex: 1;
    min-width: 140px;
    padding: 0.4em 1.2em;
    display: flex;
    flex-direction: column;
    gap: 0.15em;
}

.tendencias-info-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #868e96;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tendencias-info-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.tendencias-info-dates {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: #6c757d;
    margin-top: 1px;
}

.tendencias-info-divider {
    width: 1px;
    background-color: #dee2e6;
    align-self: stretch;
    margin: 0.3em 0;
}

/* AI content area */
.tendencias-ai-content {
    margin-top: 0.5em;
}

@media (max-width: 768px) {
    .tendencias-info-bar {
        flex-direction: column;
    }
    .tendencias-info-divider {
        width: 100%;
        height: 1px;
        margin: 0;
    }
    .tendencias-report-header {
        flex-direction: column;
        text-align: center;
    }
}

.div_is_tendencias h2 {
    margin-bottom: 0.8em;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c6e2f;
}

.div_is_tendencias h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid #e8f5e9;
}

.div_is_tendencias h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-top: 1.2em;
    margin-bottom: 0.5em;
}

.div_is_tendencias p {
    margin-bottom: 0.8em;
}

.div_is_tendencias a {
    color: #319F1C;
    text-decoration: none;
    font-weight: 600;
}

.div_is_tendencias a:hover {
    text-decoration: underline;
}

.div_is_tendencias ul {
    padding-left: 1.2em;
}

.div_is_tendencias li {
    margin-bottom: 0.4em;
}

.div_is_tendencias table {
    margin-top: 0.5em;
    margin-bottom: 1em;
}

.div_is_tendencias table th {
    background-color: #f1f8f1;
    font-weight: 600;
}


/* =============================================
   DATA TABLES — zebra stripes + better spacing
   ============================================= */

.table-hover tbody tr:nth-child(even) {
    background-color: #f7faf7;
}

.table-hover tbody tr:hover {
    background-color: #e8f5e9;
}

.table thead tr {
    background-color: #319F1C !important;
    color: white;
}

.table thead th {
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.6em 0.5em;
    white-space: nowrap;
    border: none;
}

.div_reporte1_celda {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.2em 0;
}


/* =============================================
   FILTER AREA — card wrapper
   ============================================= */

.form_generar_reporte {
    background-color: #fafcfa;
    border: 1px solid #e0e8e0;
    border-radius: 8px;
    padding: 1.5em 1.5em 0.5em 1.5em;
    margin-bottom: 2em;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.form_generar_reporte .btn-success {
    padding: 0.5em 2em;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.filtro-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3em;
    display: block;
}

.form_generar_reporte .form-group {
    margin-bottom: 1em;
}

.form_generar_reporte select.form-control,
.form_generar_reporte input.form-control {
    height: calc(2.25rem + 2px);
    font-size: 0.88rem;
}

/* Select2 — match native input height and style */
.form_generar_reporte .select2-container .select2-selection--single {
    height: calc(2.25rem + 2px);
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.88rem;
    padding: 0;
    display: flex;
    align-items: center;
}
.form_generar_reporte .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 1;
    padding-left: 0.75rem;
    color: #495057;
}
.form_generar_reporte .select2-container .select2-selection--single .select2-selection__arrow {
    height: calc(2.25rem + 2px);
}
.form_generar_reporte .select2-container--focus .select2-selection--single,
.form_generar_reporte .select2-container--open .select2-selection--single {
    border-color: #319F1C;
    box-shadow: 0 0 0 0.18rem rgba(49, 159, 28, 0.18);
    outline: none;
}

/* Select2 dropdown panel */
.select2-dropdown {
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 2px;
}
.select2-results__option {
    font-size: 0.85rem;
    padding: 6px 12px;
}
.select2-results__option--highlighted {
    background-color: #e8f5e9 !important;
    color: #2c3e50 !important;
}
.select2-results__option[aria-selected="true"] {
    background-color: #319F1C !important;
    color: white !important;
}
.select2-results__group {
    font-size: 0.75rem;
    font-weight: 700;
    color: #319F1C;
    padding: 8px 12px 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
}
.select2-search--dropdown .select2-search__field:focus {
    border-color: #319F1C;
    box-shadow: 0 0 0 0.18rem rgba(49, 159, 28, 0.18);
    outline: none;
}


/* =============================================
   CHART CONTAINERS — consistent card style
   ============================================= */

/* The parent wrapper around each report block */
.container-fluid .row > div > div[style*="background-color: #ebebeb"] {
    background-color: #ffffff !important;
    border: 1px solid #e8ece8;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    padding: 1.5em !important;
}


/* =============================================
   TENDENCIAS LANDING — card hover effects
   ============================================= */

.div_dashboard_mainmenu {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    border: 1px solid #e8ece8;
}

.div_dashboard_mainmenu:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(49, 159, 28, 0.15);
    border-color: #319F1C;
}

.div_dashboard_mainmenu:hover h4 {
    color: #319F1C;
}

.div_dashboard_mainmenu:hover svg {
    color: #319F1C !important;
    transform: scale(1.1);
    transition: transform 0.2s ease, color 0.2s ease;
}

.div_dashboard_mainmenu svg {
    transition: transform 0.2s ease, color 0.2s ease;
}

.div_dashboard_mainmenu h4 {
    transition: color 0.2s ease;
}

.div_dashboard_mainmenu .btn-info {
    background-color: #319F1C;
    border-color: #319F1C;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 0.45em 1.5em;
    border-radius: 20px;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.div_dashboard_mainmenu .btn-info:hover {
    background-color: #267a16;
    border-color: #267a16;
    transform: scale(1.05);
}


/* =============================================
   OBSERVATIONS SECTION
   ============================================= */

div[style*="background-color:#d9d7d7"] {
    background-color: #f5f7f5 !important;
    border: 1px solid #e0e8e0;
    border-radius: 6px;
    padding: 1em !important;
}


/* =============================================
   BACK LINK — subtle but clear
   ============================================= */

a[href="/tendencias"],
a[href="/dashboard"] {
    color: #319F1C;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

a[href="/tendencias"]:hover,
a[href="/dashboard"]:hover {
    text-decoration: underline;
}


/* =============================================
   NODATA / ERROR STATES
   ============================================= */

.div_is_tendencias.bg-light {
    background: linear-gradient(135deg, #ffffff 0%, #f8faf8 100%) !important;
    border-left: 4px solid #319F1C;
}

.text-warning.mb-3 {
    color: #e67e22 !important;
}

.text-danger.mb-3 {
    color: #dc3545 !important;
}


/* =============================================
   INSECT CAPTURE BOXES (campos_custom detail)
   ============================================= */

/* The individual station/bolsa boxes */
.col-sm-6.col-md-3 > div[style*="border:1px solid gray"] {
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    background-color: #fcfcfc !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    text-align: center;
}

.col-sm-6.col-md-3 > div[style*="border:1px solid gray"]:hover {
    box-shadow: 0 3px 8px rgba(49, 159, 28, 0.12);
    transform: translateY(-1px);
}

/* Station label */
.col-sm-6.col-md-3 > div[style*="border:1px solid gray"] > div[style*="color: blue"] {
    color: #6c757d !important;
    font-size: 0.72em !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

/* Count value */
.col-sm-6.col-md-3 > div[style*="border:1px solid gray"] > div[style*="font-size: 1.2em"] {
    font-weight: 700 !important;
    font-size: 1.3em !important;
    color: #2c3e50;
}


/* =============================================
   STICKY FIRST COLUMN + HEADER for data tables
   ============================================= */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .table thead th:first-child,
.table-responsive .table tbody th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #319F1C;
}

.table-responsive .table tbody th:first-child {
    background-color: #fff;
    border-right: 2px solid #dee2e6;
    z-index: 1;
}

.table-responsive .table tbody tr:nth-child(even) th:first-child {
    background-color: #f7faf7;
}

.table-responsive .table tbody tr:hover th:first-child {
    background-color: #e8f5e9;
}

/* Sticky header row */
.table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}


/* =============================================
   NAVBAR ALIGNMENT FIX
   ============================================= */

.navbar-nav {
    align-items: center;
}

.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

.navbar-nav .btn_mainmenu_newreport {
    margin: 0 0.5em;
    padding: 0.35em 1em;
    white-space: nowrap;
}

.navbar-nav .dropdown-toggle {
    white-space: nowrap;
}

.navbar .container {
    flex-wrap: nowrap;
}


/* =============================================
   TEXTO ENTRIES (estaciones inaccesibles, etc.)
   ============================================= */

.textos-section {
    margin-top: 2.5em;
}

.textos-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 0.8em;
    padding-bottom: 0.4em;
    border-bottom: 2px solid #e8f5e9;
}

.td-texto-entries {
    vertical-align: top;
    padding: 0.4em 0.5em !important;
}

.texto-entry {
    display: flex;
    align-items: baseline;
    gap: 0.6em;
    padding: 0.35em 0.5em;
    margin-bottom: 3px;
    border-radius: 4px;
    background-color: #f8f9fa;
    border-left: 3px solid #dee2e6;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.texto-entry:hover {
    background-color: #e8f5e9;
    border-left-color: #319F1C;
}

.texto-entry-date {
    font-size: 0.72rem;
    color: #868e96;
    font-weight: 600;
    min-width: 5.5em;
    flex-shrink: 0;
}

.texto-entry-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2c3e50;
}


/* =============================================
   OBSERVACIONES — timeline-style cards
   ============================================= */

.observaciones-section {
    margin-top: 2.5em;
}

.observaciones-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.15rem;
    margin-bottom: 1em;
    padding-bottom: 0.4em;
    border-bottom: 2px solid #e8f5e9;
}

.observaciones-month-card {
    margin-bottom: 1.2em;
    border-radius: 8px;
    border: 1px solid #e0e8e0;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.observaciones-month-header {
    background: linear-gradient(135deg, #319F1C 0%, #3bb522 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.5em 1.2em;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.observaciones-month-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.3em 0;
}

.observacion-item {
    display: flex;
    align-items: flex-start;
    gap: 1em;
    padding: 0.6em 1.2em;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.observacion-item:last-child {
    border-bottom: none;
}

.observacion-item:hover {
    background-color: #f8faf8;
}

.observacion-date {
    font-size: 0.75rem;
    color: #868e96;
    font-weight: 600;
    min-width: 6.5em;
    flex-shrink: 0;
    padding-top: 2px;
    white-space: nowrap;
}

.observacion-text {
    font-size: 0.9rem;
    color: #343a40;
    line-height: 1.5;
}

/* Campos custom – capture/station boxes */
.campos-custom-section {
    margin-top: 3em;
}

.campos-custom-section > h4 {
    font-weight: 700;
    font-size: 1.05rem;
    color: #2c3e50;
    margin-bottom: 1.2em;
}

.campos-custom-group {
    margin-top: 1.8em;
}

.campos-custom-group > h5 {
    font-weight: 700;
    font-size: 0.95rem;
    color: #495057;
    margin-bottom: 0.6em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid #e8ece8;
}

.campos-custom-group .table th {
    font-size: 0.85rem;
    font-weight: 700;
    color: #319F1C;
    vertical-align: middle;
    white-space: nowrap;
}

.cc-box {
    background: white;
    border: 1px solid #e0e8e0;
    border-radius: 6px;
    padding: 6px 10px;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.cc-box:hover {
    border-color: #319F1C;
    box-shadow: 0 1px 4px rgba(49, 159, 28, 0.12);
}

.cc-box-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #868e96;
    letter-spacing: 0.02em;
}

.cc-box-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}
