/* ============================================
   Dashboard - Layout / Escala general
   ============================================ */

/* REDUCCIÓN GENERAL DEL 40% */
html { font-size: 78%; }

.dashboard-header { padding: 0.702rem 1.404rem; }
.logo { font-size: 1.3104rem; }
.subtitle { font-size: 0.7488rem; }
.user-info { font-size: 0.8424rem; }

.tabs-nav { padding: 0.468rem 1.872rem; gap: 0.702rem; }
.tab-btn { padding: 0.702rem 1.2168rem; font-size: 0.7956rem; }

.main-content { padding: 0.936rem; max-width: 100%; width: 100%; }

/* Misma compensación que core-ui pero con el padding reducido de esta hoja */
#dashboard-section > .main-content {
    padding-top: calc(var(--dashboard-top-offset, 8.25rem) + 0.936rem);
}
.content-header { margin-bottom: 0.9rem; }
.content-header h2 { font-size: 1.404rem; }

.filters-card, .table-card { padding: 0.936rem; margin-bottom: 0.936rem; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; table-layout: auto; }
.table tbody tr { white-space: nowrap; }
.table tbody tr td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.table thead th:nth-child(1), .table tbody td:nth-child(1) { width: 1%; min-width: 45px; text-align: center; }
.table thead th:nth-child(2), .table tbody td:nth-child(2) { width: auto; min-width: 156px; }
.table thead th:nth-child(3), .table tbody td:nth-child(3) { width: auto; min-width: 195px; }
.table thead th:nth-child(4), .table tbody td:nth-child(4) { width: auto; min-width: 195px; }
.table thead th:nth-child(5), .table tbody td:nth-child(5) { width: 1%; min-width: 78px; text-align: center; }
.table thead th:nth-child(6), .table thead th:nth-child(7), .table thead th:nth-child(8),
.table tbody td:nth-child(6), .table tbody td:nth-child(7), .table tbody td:nth-child(8) { width: auto; min-width: 117px; }
.table thead th:nth-child(9), .table tbody td:nth-child(9) { width: 1%; min-width: 91px; text-align: center; }
.table thead th:nth-child(10), .table tbody td:nth-child(10) { width: 1%; min-width: 91px; text-align: center; }
.table thead th:nth-child(11), .table tbody td:nth-child(11) { width: auto; min-width: 156px; }
.table thead th:nth-child(12), .table tbody td:nth-child(12) { width: 1%; min-width: 130px; text-align: center; }

.table thead th { font-size: 0.702rem; padding: 0.39rem 0.78rem; white-space: nowrap; }
.table tbody td { padding: 0.39rem 0.78rem; font-size: 0.702rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Expedientes unificados — columna Número (2): pisa .table tbody td (nowrap + ellipsis) del mismo archivo */
#tab-expedientes #expedientes-unified-table th:nth-child(2),
#tab-expedientes #expedientes-unified-table td:nth-child(2) {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    vertical-align: top !important;
}

/* .expanded en col 3: solo tablas legacy (expandirCaratula); no #expedientes-unified-table */
#tab-agenda .table tbody td:nth-child(3).expanded,
#tab-contactos .table tbody td:nth-child(3).expanded,
#tab-consultas .table tbody td:nth-child(3).expanded,
#tab-configuracion .table tbody td:nth-child(3).expanded {
    white-space: normal !important;
    word-wrap: break-word;
    max-width: none;
}
.table thead th.sortable { padding-right: 15px; }
.table thead th.sortable i { right: 4.8px; font-size: 0.51em; }

.btn { padding: 0.4212rem 0.8424rem; font-size: 0.819rem; border-radius: 5.616px; }
.btn-sm { padding: 0.3276rem 0.6552rem; font-size: 0.7488rem; }
.badge { padding: 0.3276rem 0.6084rem; font-size: 0.7488rem; }
.badge-consulta, .badge-caso, .badge-cliente-amplia, .badge-otro { padding: 0.3276rem 0.6084rem; font-size: 0.7488rem; }

h3 { font-size: 0.75rem; }
h4 { font-size: 0.66rem; }
h5, .card-title { font-size: 0.6rem; }

.sub-tabs-nav { padding: 0.6rem 1.5rem; gap: 0.5rem; margin-bottom: 1.2rem; }
.sub-tab-btn { padding: 0.85rem 1.5rem; font-size: 0.95rem; font-weight: 500; }

.form-control { padding: 0.36rem 0.54rem; font-size: 0.525rem; }
.form-label { font-size: 0.51rem; margin-bottom: 0.24rem; }
.form-select { padding: 0.36rem 0.54rem; font-size: 0.525rem; }

.pagination { font-size: 0.51rem; }
.pagination .page-link { padding: 0.3rem 0.6rem; }

/* ============================================
   Expedientes unificados — Carátula (3) y Tribunal (4)
   Última capa (después de expedientes.css): pisar .table genérico
   ============================================ */

#tab-expedientes #expedientes-unified-table .ver-mas-btn,
#tab-expedientes #expedientes-unified-table .ver-menos-btn {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* Carátula / tribunal: texto completo, multilínea (pisa .table genérico) */
#tab-expedientes #expedientes-unified-table td:nth-child(3),
#tab-expedientes #expedientes-unified-table td:nth-child(4) {
    white-space: normal !important;
    overflow: visible !important;
    vertical-align: top !important;
    text-overflow: unset !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

#tab-expedientes #expedientes-unified-table td:nth-child(3) .exp-celda-texto-completo,
#tab-expedientes #expedientes-unified-table td:nth-child(4) .exp-celda-texto-completo {
    display: block !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
}
