/* Tabla responsive con scroll */
.table-responsive {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Header sticky */
thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 1;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    visibility: hidden;
}

.loading-overlay.active {
    visibility: visible;
}

.ai-card {
    background: linear-gradient(135deg, #f6fbff 0%, #ffffff 100%);
}

.ai-response {
    background: #0f172a;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    color: #e2e8f0;
}

.ai-response-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
    color: inherit;
}

.compact-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.compact-navbar .navbar-brand:hover {
    opacity: 0.9;
}

#modalCronograma {
    font-size: 0.875rem;
}

#modalCronograma td {
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
}

#modalCronograma td:first-child {
    width: 72%;
}

#modalCronograma td:last-child {
    width: 28%;
    min-width: 185px;
    white-space: nowrap;
}

#modalCronograma small {
    font-size: inherit;
}

.compact-toolbar-card .card-body {
    padding: 1rem 1.25rem;
}

.compact-actions-row .form-select,
.compact-actions-row .btn {
    min-height: 42px;
}

.compact-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.compact-actions-grid .btn {
    min-height: 42px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.15;
}

.compact-actions-grid #applyFilterBtn {
    grid-column: 1 / -1;
}

.compact-kpi-card .card-body {
    padding: 1rem 1rem 0.9rem;
}

.compact-kpi-card h2 {
    font-size: 2rem;
}

.metric-tile {
    background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    padding: 0.95rem 1rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    min-height: 100%;
}

.metric-tile-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.metric-tile-value {
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
}

#licitacionesTable td,
#licitacionesTable th,
#seguimientosTable td,
#seguimientosTable th {
    vertical-align: middle;
}

#licitacionesTable {
    table-layout: fixed;
    width: 100%;
    font-size: 0.76rem;
}

#licitacionesTable th,
#licitacionesTable td {
    padding: 0.42rem 0.28rem;
    line-height: 1.2;
}

#licitacionesTable th,
#seguimientosTable th {
    white-space: normal;
}

#licitacionesTable th:nth-child(1) { width: 7%; }
#licitacionesTable th:nth-child(2) { width: 4.5%; }
#licitacionesTable th:nth-child(3) { width: 6%; }
#licitacionesTable th:nth-child(4) { width: 5.5%; }
#licitacionesTable th:nth-child(5) { width: 6%; }
#licitacionesTable th:nth-child(6) { width: 12%; }
#licitacionesTable th:nth-child(7) { width: 22%; }
#licitacionesTable th:nth-child(8) { width: 6.5%; }
#licitacionesTable th:nth-child(9),
#licitacionesTable th:nth-child(10),
#licitacionesTable th:nth-child(11),
#licitacionesTable th:nth-child(12) { width: 6%; }
#licitacionesTable th:nth-child(13) { width: 4.5%; }

#licitacionesTable .process-cell,
#licitacionesTable .platform-cell,
#licitacionesTable .type-cell,
#licitacionesTable .money-cell,
#licitacionesTable .date-cell {
    white-space: normal;
    overflow-wrap: anywhere;
}

#licitacionesTable .entity-cell,
#licitacionesTable .object-cell {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

#licitacionesTable .badge {
    white-space: normal;
    line-height: 1.1;
}

#licitacionesTable td .btn-group,
#seguimientosTable td .btn-group {
    flex-wrap: wrap;
    gap: 0.25rem;
}

@media (max-width: 992px) {
    .compact-kpi-card h2 {
        font-size: 1.6rem;
    }

    .metric-tile-value {
        font-size: 1.2rem;
    }

    .compact-actions-grid {
        grid-template-columns: 1fr;
    }

    .compact-actions-grid #applyFilterBtn {
        grid-column: auto;
    }
}
