/* ═══════════════════════════════════════════════════════════
   MERCADO PÚBLICO — BUSCADOR DE LICITACIONES Y CONVENIOS
   ESTIGIA — blanco, grafito y azules tecnológicos
   Fuentes: Electrolize (títulos), Michroma (etiquetas), Inter (cuerpo)
   ═══════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --white: #FFFFFF;
    --navy: #222222;
    --navy-light: #344a5a;
    --navy-dark: #050a0d;
    --cyan: #3aaee8;
    --teal: #b6ecfa;
    --gray-50: #f5f9fc;
    --gray-100: #edf5f9;
    --gray-200: #d8e7ef;
    --gray-300: #bfd3de;
    --gray-400: #94a9b5;
    --gray-500: #647782;
    --gray-600: #52636d;
    --gray-700: #354550;
    --gray-800: #222222;
    --text-primary: #222222;
    --text-secondary: #52636d;
    --text-muted: #70838e;
    --border: #d8e7ef;
    --shadow-sm: 0 1px 3px rgba(21, 57, 77, 0.06);
    --shadow-md: 0 10px 28px rgba(21, 57, 77, 0.09);
    --shadow-lg: 0 18px 44px rgba(21, 57, 77, 0.12);
    --shadow-xl: 0 24px 60px rgba(21, 57, 77, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-title: 'Electrolize', 'Segoe UI', sans-serif;
    --font-subtitle: 'Michroma', 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--gray-50);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(circle at 8% 0%, rgba(182, 236, 250, 0.35), transparent 28rem),
        radial-gradient(circle at 92% 22%, rgba(58, 174, 232, 0.10), transparent 34rem);
    background-attachment: fixed;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
    background: var(--navy-dark);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.navbar-brand img {
    width: 50px;
    height: 38px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: opacity var(--transition);
}

.navbar-brand img:hover {
    opacity: 0.85;
}

.brand-divider {
    width: 1px;
    height: 32px;
    background: #4a4844;
}

.navbar-title {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    color: #f7f5f1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.navbar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #bbb7b0;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 6px rgba(58, 174, 232, 0.5);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 6px rgba(58, 174, 232, 0.5); }
    50% { box-shadow: 0 0 12px rgba(58, 174, 232, 0.8); }
}

/* ── Accent Bar ───────────────────────────────────────────── */
.accent-bar {
    height: 3px;
    background: linear-gradient(90deg, #2b2b2b, var(--cyan), #2b2b2b);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ── Main Container ──────────────────────────────────────── */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.page-header p {
    font-family: var(--font-subtitle);
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ── Search Card ──────────────────────────────────────────── */
.search-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.search-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--teal));
}

.search-card:hover {
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-family: var(--font-subtitle);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title .icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(58, 174, 232, 0.1), rgba(182, 236, 250, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* ── Form Layout ──────────────────────────────────────────── */
.search-form {
    display: grid;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row.single {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-family: var(--font-subtitle);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.form-group .hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Radio Group ──────────────────────────────────────────── */
.radio-group {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gray-50);
}

.radio-option {
    flex: 1;
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    cursor: pointer;
    font-family: var(--font-subtitle);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    text-align: center;
    border-right: 1px solid var(--border);
    user-select: none;
}

.radio-option:last-child label {
    border-right: none;
}

.radio-option input[type="radio"]:checked + label {
    background: var(--navy);
    color: var(--white);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--navy);
}

.radio-option label:hover {
    background: rgba(38, 38, 38, 0.04);
}

.radio-option input[type="radio"]:checked + label:hover {
    background: var(--navy-light);
}

/* ── Select / Input ───────────────────────────────────────── */
select,
input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 42px;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(58, 174, 232, 0.12);
}

input[type="text"]::placeholder {
    color: var(--gray-400);
}

/* Custom text field (Otros) */
.custom-input-wrapper {
    display: none;
    margin-top: 8px;
    animation: slideDown 0.3s ease-out;
}

.custom-input-wrapper.visible {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-subtitle);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
    user-select: none;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(38, 38, 38, 0.25);
}

.btn-primary:hover {
    background: var(--navy-light);
    box-shadow: 0 6px 20px rgba(38, 38, 38, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(38, 38, 38, 0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-download {
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    color: var(--navy);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(58, 174, 232, 0.25);
}

.btn-download:hover {
    box-shadow: 0 6px 20px rgba(58, 174, 232, 0.35);
    transform: translateY(-1px);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner.dark {
    border-color: rgba(38, 38, 38, 0.15);
    border-top-color: var(--navy);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Results Section ──────────────────────────────────────── */
.results-section {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

.results-section.visible {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Results Header ───────────────────────────────────────── */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.results-count {
    font-family: var(--font-subtitle);
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.results-count span {
    color: var(--cyan);
    font-weight: 700;
}

.results-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(58, 174, 232, 0.08);
    border: 1px solid rgba(58, 174, 232, 0.2);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--navy);
}

/* ── Table ─────────────────────────────────────────────────── */
.table-wrapper {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.results-table thead {
    background: var(--navy);
}

.results-table thead th {
    padding: 14px 16px;
    font-family: var(--font-subtitle);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--white);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border-bottom: 2px solid var(--cyan);
}

.results-table tbody tr {
    transition: background var(--transition);
    border-bottom: 1px solid var(--gray-100);
}

.results-table tbody tr:hover {
    background: rgba(58, 174, 232, 0.03);
}

.results-table tbody tr:last-child {
    border-bottom: none;
}

.results-table tbody td {
    padding: 14px 16px;
    color: var(--text-primary);
    vertical-align: top;
    line-height: 1.5;
}

.results-table .col-codigo {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--navy);
    font-weight: 600;
    white-space: nowrap;
}

.results-table .col-nombre {
    max-width: 280px;
    font-weight: 500;
}

.results-table .col-organismo {
    max-width: 180px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.results-table .col-estado {
    white-space: nowrap;
}

.results-table .col-monto {
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
}

.results-table .col-fecha {
    white-space: nowrap;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.results-table .col-acciones {
    white-space: nowrap;
    text-align: center;
}

/* ── Estado Badges ────────────────────────────────────────── */
.estado-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.estado-badge.publicada {
    background: rgba(182, 236, 250, 0.12);
    color: #0a8a6d;
    border: 1px solid rgba(182, 236, 250, 0.3);
}

.estado-badge.desierta {
    background: rgba(251, 191, 36, 0.1);
    color: #92400e;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.estado-badge.revocada,
.estado-badge.suspendida {
    background: rgba(239, 68, 68, 0.08);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.estado-badge.default {
    background: rgba(38, 38, 38, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--gray-200);
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    padding: 20px 0;
}

.pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.pagination button:hover:not(:disabled):not(.active) {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--navy);
}

.pagination button.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
    font-weight: 700;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0 16px;
}

/* ── Loading Overlay ──────────────────────────────────────── */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.loading-overlay.visible {
    display: flex;
}

.loading-content {
    text-align: center;
    animation: fadeInUp 0.3s ease-out;
}

.loading-spinner-lg {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.loading-content p {
    font-family: var(--font-subtitle);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.loading-content .loading-detail {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.loading-content .loading-title {
    font-weight: 600;
    color: var(--text-primary);
}

.loading-progress-wrap {
    margin-top: 20px;
    width: 320px;
    max-width: 90vw;
}

.loading-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--teal));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.loading-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.75rem;
}

.loading-elapsed {
    color: var(--text-muted);
    font-weight: 500;
}

.loading-percent {
    color: var(--cyan);
    font-weight: 600;
    font-family: var(--font-subtitle);
}

@keyframes indeterminate {
    0%   { width: 0%; margin-left: 0; }
    50%  { width: 60%; margin-left: 20%; }
    100% { width: 0%; margin-left: 100%; }
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state h3 {
    font-family: var(--font-subtitle);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* ── Error State ──────────────────────────────────────────── */
.error-banner {
    display: none;
    padding: 16px 20px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    animation: fadeInUp 0.3s ease-out;
}

.error-banner.visible {
    display: flex;
    align-items: center;
    gap: 12px;
}

.error-banner .error-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.error-banner .error-text {
    font-size: 0.88rem;
    color: #991b1b;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 32px 24px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

.footer p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.footer a {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.footer a:hover {
    color: var(--navy);
}

/* ── Tooltip ──────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--white);
    background: var(--navy);
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

/* ── Download All Bar ─────────────────────────────────────── */
.download-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(58, 174, 232, 0.06), rgba(182, 236, 250, 0.06));
    border: 1px solid rgba(58, 174, 232, 0.15);
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.download-bar p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.download-bar p strong {
    color: var(--navy);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
        height: 64px;
    }

    .navbar-brand img {
        height: 32px;
    }

    .navbar-title {
        font-size: 0.95rem;
    }

    .navbar-status {
        display: none;
    }

    .main-container {
        padding: 24px 16px 40px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .search-card {
        padding: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
    }

    .radio-option label {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .radio-option:last-child label {
        border-bottom: none;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .results-table {
        min-width: 700px;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .navbar-brand .brand-divider,
    .navbar-brand .navbar-title-text {
        display: none;
    }

    .search-card {
        padding: 20px;
    }

    .btn {
        width: 100%;
    }
}

/* ══════════════════════════════════════════════════════════════
   NAVIGATION TABS
   ══════════════════════════════════════════════════════════════ */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-family: var(--font-subtitle);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--navy);
    background: rgba(38, 38, 38, 0.04);
}

.nav-link.active {
    background: var(--navy);
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(38, 38, 38, 0.2);
}

/* ══════════════════════════════════════════════════════════════
   KPI CARDS
   ══════════════════════════════════════════════════════════════ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--teal));
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-card.highlight::before {
    height: 4px;
    background: linear-gradient(90deg, var(--teal), var(--cyan), var(--teal));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

.kpi-card .kpi-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
    display: block;
}

.kpi-card .kpi-value {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.1;
    margin-bottom: 4px;
}

.kpi-card .kpi-label {
    font-family: var(--font-subtitle);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-card .kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.kpi-card .kpi-sub.positive {
    color: #0a8a6d;
}

.kpi-card .kpi-sub.negative {
    color: #991b1b;
}

/* ══════════════════════════════════════════════════════════════
   CHARTS GRID
   ══════════════════════════════════════════════════════════════ */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card h3 {
    font-family: var(--font-subtitle);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container {
    position: relative;
    width: 100%;
    max-height: 320px;
}

/* ══════════════════════════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════════════════════════ */
.progress-section {
    display: none;
    margin: 32px 0;
    animation: fadeInUp 0.4s ease-out;
}

.progress-section.visible {
    display: block;
}

.progress-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.progress-card h3 {
    font-family: var(--font-subtitle);
    font-size: 1.1rem;
    color: var(--navy);
    margin-bottom: 24px;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--gray-100);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--teal));
    border-radius: 6px;
    transition: width 0.5s ease-out;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.progress-text {
    font-family: var(--font-subtitle);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.progress-phase {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(58, 174, 232, 0.08);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--navy);
    margin-top: 12px;
}

/* ══════════════════════════════════════════════════════════════
   COMPETITOR CARDS
   ══════════════════════════════════════════════════════════════ */
.competitors-section {
    margin-bottom: 32px;
}

.competitors-section h2 {
    font-family: var(--font-title);
    font-size: 1.2rem;
    color: var(--navy);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.competitor-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    transition: all var(--transition);
}

.competitor-card:hover {
    box-shadow: var(--shadow-md);
}

.competitor-info h4 {
    font-family: var(--font-subtitle);
    font-size: 0.88rem;
    color: var(--navy);
    margin-bottom: 4px;
}

.competitor-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.competitor-info .organismo {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.competitor-ganador {
    text-align: right;
}

.competitor-ganador .ganador-name {
    font-family: var(--font-subtitle);
    font-size: 0.82rem;
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 2px;
}

.competitor-ganador .ganador-rut {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.competitor-ganador .ganador-calif {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 4px;
    background: rgba(251, 191, 36, 0.1);
    color: #92400e;
}

/* ══════════════════════════════════════════════════════════════
   ANALYSIS DASHBOARD
   ══════════════════════════════════════════════════════════════ */
.dashboard-section {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

.dashboard-section.visible {
    display: block;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-title {
    font-family: var(--font-title);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--navy);
}

.dashboard-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.section-title {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — ANALYSIS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar-nav {
        display: none;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .competitor-card {
        grid-template-columns: 1fr;
    }

    .competitor-ganador {
        text-align: left;
    }
}

/* ══════════════════════════════════════════════════════════════
   ESTIMATE BOX & ELAPSED TIMER
   ══════════════════════════════════════════════════════════════ */
.estimate-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(58, 174, 232, 0.05), rgba(182, 236, 250, 0.05));
    border: 1px solid rgba(58, 174, 232, 0.15);
    border-radius: var(--radius-md);
    margin-top: 4px;
}

.estimate-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.estimate-content {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.estimate-label {
    font-family: var(--font-subtitle);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--navy);
}

.estimate-value {
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    background: rgba(58, 174, 232, 0.12);
    padding: 2px 10px;
    border-radius: 8px;
}

.estimate-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.estimate-cache {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.elapsed-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 20px;
    background: rgba(38, 38, 38, 0.04);
    border-radius: var(--radius-sm);
}

.elapsed-icon {
    font-size: 1rem;
}

.elapsed-time {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.05em;
}

.elapsed-sep {
    color: var(--gray-300);
}

.elapsed-est {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── Estigia: ajustes de identidad y legibilidad ── */
.navbar-nav {
    background: #242424;
    border-color: #474747;
}

.nav-link { color: #c9c6c0; }
.nav-link:hover { color: #fff; background: #343434; }
.nav-link.active {
    background: var(--cyan);
    color: #1f1f1f;
    box-shadow: none;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: #0c6fb8;
    font-family: var(--font-subtitle);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.page-header h1 {
    max-width: 780px;
    margin: 0 auto 10px;
    font-size: clamp(2.1rem, 5vw, 3.15rem);
    line-height: 1.04;
}

.page-header p { max-width: 720px; }
.search-card { border-color: #d9d5ce; }
.search-card::before { background: var(--cyan); }
.card-title .icon { background: rgba(58, 174, 232, 0.12); }

.btn-primary {
    background: linear-gradient(135deg, #0c6fb8, #3aaee8);
    box-shadow: 0 8px 22px rgba(12, 111, 184, 0.22);
}
.btn-primary:hover { background: linear-gradient(135deg, #075985, #2196d2); }
.btn-download { background: var(--cyan); color: #222222; }

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(58, 174, 232, 0.13);
}

@media (max-width: 768px) {
    .navbar-brand img { width: 44px; height: 34px; }
    .navbar-title, .brand-divider, .navbar-status { display: none; }
    .page-header h1 { font-size: 2.1rem; }
}

/* ── Acabado Estigia ─────────────────────────────────────── */
.accent-bar {
    background: linear-gradient(90deg, #050a0d, #3aaee8, #b6ecfa, #050a0d);
}

.navbar {
    background: rgba(5, 10, 13, 0.96);
    border-bottom-color: rgba(182, 236, 250, 0.16);
    backdrop-filter: blur(18px);
}

.brand-divider { background: rgba(182, 236, 250, 0.28); }

.navbar-title::before {
    content: 'ESTIGIA';
    display: block;
    color: #b6ecfa;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    line-height: 1.1;
}

.page-header { padding-top: 18px; }
.page-header h1 { color: #222222; text-wrap: balance; }
.page-header p { line-height: 1.75; }

.search-card,
.chart-card,
.kpi-card,
.progress-card,
.empty-state,
.table-wrapper {
    border-color: rgba(58, 174, 232, 0.20);
}

.search-card::before,
.kpi-card::before {
    background: linear-gradient(90deg, #0c6fb8, #3aaee8, #b6ecfa);
}

.card-title .icon {
    color: #0c6fb8;
    background: rgba(182, 236, 250, 0.36);
    border: 1px solid rgba(58, 174, 232, 0.18);
}

.radio-option input:checked + label {
    color: #222222;
    background: rgba(182, 236, 250, 0.42);
}

.results-table thead th {
    background: #050a0d;
    color: #ffffff;
}

.results-table tbody tr:hover { background: rgba(182, 236, 250, 0.18); }

.nav-link.active {
    background: linear-gradient(135deg, #b6ecfa, #3aaee8);
    color: #222222;
}

.footer {
    background: #ffffff;
    border-top-color: rgba(58, 174, 232, 0.20);
}

@media (max-width: 480px) {
    .navbar-brand img { width: 42px; }
}

/* ── Autenticación Estigia ───────────────────────────────── */
.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 84% 18%, rgba(58, 174, 232, 0.22), transparent 30rem),
        radial-gradient(circle at 14% 90%, rgba(182, 236, 250, 0.10), transparent 30rem),
        #050a0d;
    color: #ffffff;
    display: grid;
    place-items: center;
    padding: 32px;
}

.auth-shell {
    width: min(1120px, 100%);
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(380px, 1.08fr);
    overflow: hidden;
    border: 1px solid rgba(182, 236, 250, 0.18);
    border-radius: 28px;
    background: rgba(6, 13, 18, 0.82);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.44);
    backdrop-filter: blur(18px);
}

.auth-panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(38px, 6vw, 74px);
    border-right: 1px solid rgba(182, 236, 250, 0.14);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: auto;
    color: #b6ecfa;
    font-family: var(--font-subtitle);
    letter-spacing: 0.12em;
}

.auth-brand img {
    width: 46px;
    height: 36px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.auth-brand div { display: grid; gap: 2px; }
.auth-brand span { font-size: 1rem; }
.auth-brand small { color: rgba(255, 255, 255, 0.56); font-size: 0.54rem; }

.auth-copy { margin: 70px 0 34px; }
.auth-kicker {
    display: inline-block;
    margin-bottom: 18px;
    color: #b6ecfa;
    font-family: var(--font-subtitle);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
}

.auth-copy h1 {
    margin-bottom: 20px;
    color: #ffffff;
    font-family: var(--font-title);
    font-size: clamp(2.15rem, 4.2vw, 4rem);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.auth-copy p {
    max-width: 48ch;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.98rem;
}

.google-signin {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    border: 1px solid rgba(182, 236, 250, 0.32);
    border-radius: 999px;
    background: #ffffff;
    color: #222222;
    font-family: var(--font-body);
    font-size: 0.94rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.google-signin:hover {
    transform: translateY(-1px);
    border-color: #b6ecfa;
    box-shadow: 0 10px 30px rgba(58, 174, 232, 0.18);
}

.google-signin:disabled { opacity: 0.46; cursor: not-allowed; }
.google-signin:disabled:hover { transform: none; box-shadow: none; }

.google-mark {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid #d8e7ef;
    border-radius: 50%;
    color: #0c6fb8;
    font-family: Arial, sans-serif;
    font-weight: 700;
}

.auth-alert {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid rgba(248, 113, 113, 0.32);
    border-radius: 12px;
    background: rgba(248, 113, 113, 0.10);
    color: #fecaca;
    font-size: 0.84rem;
}

.auth-setup-note,
.auth-privacy {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.46);
    font-size: 0.72rem;
    line-height: 1.55;
    text-align: center;
}

.auth-visual {
    position: relative;
    min-height: 650px;
    overflow: hidden;
    display: grid;
    place-items: end start;
    padding: 54px;
    background:
        linear-gradient(145deg, rgba(182, 236, 250, 0.03), rgba(58, 174, 232, 0.08)),
        #030709;
}

.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 62% 38%, rgba(182, 236, 250, 0.18), transparent 16rem);
}

.auth-visual > span {
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, 0.80);
    font-family: var(--font-title);
    font-size: clamp(1.45rem, 2.7vw, 2.7rem);
    line-height: 1.04;
    letter-spacing: -0.025em;
}

.orbit {
    position: absolute;
    top: 46%;
    left: 53%;
    border: 1px solid rgba(182, 236, 250, 0.40);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(-24deg);
}

.orbit-one { width: 430px; height: 170px; }
.orbit-two { width: 300px; height: 116px; border-style: dashed; opacity: 0.5; }
.orbit-core {
    position: absolute;
    top: 37%;
    left: 72%;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #b6ecfa;
    box-shadow: 0 0 44px rgba(182, 236, 250, 0.85);
}

.navbar-account {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    max-width: 220px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 0.72rem;
}

.user-chip img,
.user-initial {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border: 1px solid rgba(182, 236, 250, 0.32);
    border-radius: 50%;
    object-fit: cover;
}

.user-initial { display: grid; place-items: center; background: #0c6fb8; }
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-button {
    padding: 7px 11px;
    border: 1px solid rgba(182, 236, 250, 0.24);
    border-radius: 999px;
    background: transparent;
    color: #b6ecfa;
    font-size: 0.7rem;
    cursor: pointer;
}
.logout-button:hover { background: rgba(182, 236, 250, 0.08); }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; max-width: 620px; }
    .auth-panel { min-height: 650px; border-right: 0; }
    .auth-visual { display: none; }
    .user-email, .navbar-status { display: none; }
}

@media (max-width: 560px) {
    .auth-page { padding: 0; }
    .auth-shell { min-height: 100vh; border: 0; border-radius: 0; }
    .auth-panel { min-height: 100vh; padding: 34px 24px; }
    .auth-copy { margin: 56px 0 30px; }
    .navbar-account { gap: 7px; }
    .user-chip { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   INTELIGENCIA DE LICITACIÓN — veredicto, factores y gráficos
   ═══════════════════════════════════════════════════════════ */

/* Los nombres de licitación llegan como un solo token largo en mayúsculas
   (por ejemplo SN16-SEP-CONTRATACION...) y desbordarían la pantalla estrecha. */
.intel-header h1,
.intel-header p { overflow-wrap: anywhere; }

.intel-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Bloque propio del informe: no reutiliza .dashboard-section, que nace oculta
   y la revela JavaScript en el panel de análisis. Esta vista se entrega
   renderizada por el servidor y debe verse sin ejecutar scripts. */
.intel-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 26px 28px;
    margin-bottom: 22px;
}

.intel-section.intel-hero {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: center;
}

.intel-hero-medidor { display: flex; justify-content: center; }
.intel-medidor { width: 100%; max-width: 260px; height: auto; }

.intel-veredicto {
    font-family: var(--font-title);
    font-size: 2rem;
    line-height: 1.2;
    margin: 4px 0 10px;
    color: var(--text-primary);
}

.intel-nivel-muy_alta { color: #2fa678; }
.intel-nivel-alta { color: var(--cyan); }
.intel-nivel-media { color: #c98118; }
.intel-nivel-baja { color: #c2661f; }
.intel-nivel-muy_baja { color: #c23b3b; }
.intel-nivel-retrospectivo,
.intel-nivel-indeterminado { color: var(--gray-500); }

.intel-veredicto-resumen {
    color: var(--text-secondary);
    max-width: 60ch;
    margin-bottom: 14px;
}

.intel-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.intel-chip {
    font-family: var(--font-body);
    font-size: 0.72rem;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.intel-chip-aviso {
    background: rgba(214, 69, 69, 0.08);
    border-color: rgba(214, 69, 69, 0.35);
    color: #a33030;
}

.intel-confianza-alta { background: rgba(47, 166, 120, 0.12); border-color: rgba(47, 166, 120, 0.4); color: #1f7754; }
.intel-confianza-media { background: rgba(58, 174, 232, 0.12); border-color: rgba(58, 174, 232, 0.4); color: #1d7ba8; }
.intel-confianza-baja { background: rgba(232, 163, 58, 0.14); border-color: rgba(232, 163, 58, 0.45); color: #9c6512; }
.intel-confianza-nula { background: var(--gray-100); color: var(--text-muted); }

/* ── Gráficos ─────────────────────────────────────────────── */
.intel-grafico { margin: 14px 0 6px; }
.intel-grafico svg { width: 100%; height: auto; max-width: 100%; }
.intel-grafico-scroll { overflow-x: auto; padding-bottom: 6px; }
.intel-grafico-scroll svg { min-width: 560px; }

/* ── Lectura ejecutiva ────────────────────────────────────── */
.intel-lectura {
    color: var(--text-secondary);
    line-height: 1.75;
    max-width: 78ch;
    margin-bottom: 14px;
}

.intel-riesgo {
    border-left: 3px solid var(--cyan);
    background: var(--gray-50);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.intel-riesgo p:last-child { color: var(--text-secondary); }

.intel-recomendaciones {
    margin: 10px 0 16px 20px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.intel-recomendaciones li { margin-bottom: 9px; max-width: 80ch; }

.intel-aviso {
    background: rgba(232, 163, 58, 0.1);
    border: 1px solid rgba(232, 163, 58, 0.4);
    color: #8a5a10;
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.intel-aviso-neutro {
    background: var(--gray-100);
    border-color: var(--border);
    color: var(--text-secondary);
    margin-top: 16px;
}

.intel-fuente, .intel-evidencia {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 82ch;
}

.intel-fuente { margin-top: 14px; }

/* ── Banderas rojas ───────────────────────────────────────── */
.intel-banderas { list-style: none; display: grid; gap: 12px; }

.intel-bandera {
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    background: var(--white);
}

.intel-bandera p { color: var(--text-secondary); font-size: 0.92rem; }
.intel-bandera .intel-evidencia { margin-top: 6px; }

.intel-bandera-cabecera {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.intel-severidad-tag {
    font-family: var(--font-subtitle);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 4px;
}

.intel-severidad-alta { border-left-color: #d64545; }
.intel-severidad-alta .intel-severidad-tag { background: rgba(214, 69, 69, 0.14); color: #a33030; }
.intel-severidad-media { border-left-color: #e8a33a; }
.intel-severidad-media .intel-severidad-tag { background: rgba(232, 163, 58, 0.16); color: #8a5a10; }
.intel-severidad-baja { border-left-color: var(--gray-400); }
.intel-severidad-baja .intel-severidad-tag { background: var(--gray-100); color: var(--text-muted); }

/* ── Bloques desplegables y listas de datos ───────────────── */
.intel-detalle {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 12px;
    background: var(--gray-50);
}

.intel-detalle summary {
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.86rem;
    color: var(--cyan);
    font-weight: 500;
}

.intel-detalle summary:hover { color: var(--navy-light); }
.intel-detalle[open] summary { margin-bottom: 12px; }

.intel-componentes dt {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.88rem;
    margin-top: 10px;
}

.intel-componentes dd {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.6;
    max-width: 82ch;
}

.intel-omitidos {
    margin: 8px 0 0 18px;
    color: var(--text-muted);
    font-size: 0.83rem;
    line-height: 1.7;
}

.intel-datos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px 24px;
    margin: 16px 0;
}

.intel-datos dt {
    font-family: var(--font-subtitle);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.intel-datos dd { color: var(--text-primary); font-size: 0.93rem; }

.intel-disclaimer {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.7;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin: 28px 0 10px;
}

@media (max-width: 860px) {
    .intel-section { padding: 20px 18px; }
    .intel-section.intel-hero { grid-template-columns: 1fr; gap: 18px; }
    .intel-veredicto { font-size: 1.6rem; }
    .intel-datos { grid-template-columns: 1fr; }
}
