/* Overrides globales: la base visual es /css/slds-theme.css (la misma que eContracts)
   con los colores y la tipografía del sistema de diseño CSIC. */
:root {
    --slds-color-brand: #1e40af;
    --slds-color-brand-dark: #1e3a5f;
    --slds-color-brand-darker: #172e4b;
    --slds-color-brand-light: #dbeafe;
}

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
}

.sidebar {
    background: linear-gradient(180deg, #172e4b 0%, #1e40af 100%) !important;
}

.top-brand-csic {
    height: 34px;
    width: auto;
}

.blazor-error-boundary {
    background: var(--slds-color-danger);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    color: white;
    border-radius: var(--slds-radius-medium);
}

.blazor-error-boundary::after {
    content: "Se ha producido un error.";
}

.content {
    padding-top: 1.25rem;
}

h1:focus {
    outline: none;
}

/* Registros dados de baja (fbaja informada), como la clase "baja" de la app PHP. */
tr.baja td {
    color: #94a3b8;
    text-decoration: line-through;
}

.table-selected > td {
    background-color: var(--slds-color-brand-light) !important;
}

.importe {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Filtros sobre los listados de mantenimiento. */
.filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.filtros .form-control,
.filtros .form-select {
    min-width: 180px;
}

.tabla-scroll {
    max-height: calc(100vh - 290px);
    overflow: auto;
}

.tabla-scroll thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

/* ---- Filtros plegables (Components/Shared/Filtros.razor) ---- */
.filtros-panel {
    margin-bottom: 0.75rem;
}

.filtros-toggle {
    border: 1px solid var(--slds-color-border, #dddbda);
    background: #f8fafc;
    color: #334155;
    border-radius: 6px;
    padding: 0.2rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.filtros-toggle:hover {
    background: #eef2ff;
}

.filtros-flecha {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.filtros-panel.cerrado .filtros-flecha {
    transform: rotate(-90deg);
}

.filtros-panel.cerrado .filtros {
    display: none;
}

.filtros-panel .filtros {
    margin-bottom: 0;
}

/* ---- Cabecera fija: la tarjeta de los listados ocupa la altura de la ventana y solo
   se desplaza la tabla (título, botones, filtros y nombres de columna siempre visibles). ---- */
@media (min-width: 641px) and (min-height: 560px) {
    .content > .slds-card:has(> .tabla-scroll) {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 3.25rem - 1.25rem - 1rem);
        margin-bottom: 0;
    }

    .content > .slds-card:has(> .tabla-scroll) > .tabla-scroll {
        flex: 1 1 auto;
        min-height: 160px;
        max-height: none;
    }

    .content > .slds-card:has(> .tabla-scroll) > * {
        flex-shrink: 0;
    }
}

.tabla-scroll thead th {
    box-shadow: inset 0 -1px 0 var(--slds-color-border, #dddbda);
}

/* slds-theme pone overflow:hidden en .table (para redondear esquinas) y eso anula el
   position:sticky de las cabeceras: dentro de .tabla-scroll el redondeo lo hace el contenedor. */
.tabla-scroll {
    border: 1px solid var(--slds-color-border, #dddbda);
    border-radius: var(--slds-radius-medium, 0.5rem);
}

.tabla-scroll > .table {
    overflow: visible;
    border: 0;
    border-radius: 0;
}

.tabla-scroll thead th {
    background: #fafaf9;
    z-index: 2;
}
