/* Estilos de componentes compartidos. Reglas tomadas de Solvrax.System/wwwroot/css/app.css (..\Solvrax, 8acb3dfe) y de
   NavMenu.razor.css / EntradaMenuLink.razor.css, con prefijo fx- y tokens --fx-*. */

/* ── Barra de herramientas estándar ───────────────────────────── */
.fx-toolbar { border: 1px solid var(--fx-border); border-radius: 4px; background: var(--fx-surface-card); }

/* ── Tarjetas y tablas ───────────────────────────────────────── */
.fx-tarjeta { border: 1px solid var(--fx-border); }
/* Etiquetas con texto largo que se parte en vez de salirse (fuentes del asistente, FX-293). */
.fx-chips-partidos .mud-chip { height: auto; min-height: 24px; max-width: 100%; }
.fx-chips-partidos .mud-chip-content { white-space: normal; overflow-wrap: anywhere; }
.fx-fila-seleccionada > td { background: var(--fx-primary-soft) !important; }
/* En el teléfono MudTable pone rótulo y valor en un renglón que no se parte: una celda ancha sacaba de la vista TODOS los valores (FX-181). */
@media (max-width: 600px) {
    .mud-xs-table .mud-table-body .mud-table-cell { flex-wrap: wrap; gap: 2px 4px; white-space: normal; overflow-wrap: anywhere; }
    .mud-xs-table .mud-table-body .mud-table-cell > * { min-width: 0; max-width: 100%; }
    .mud-xs-table .mud-table-body .mud-button-root .mud-button-label { white-space: normal; }
    .mud-xs-table .mud-table-body .mud-chip { height: auto; min-height: 24px; }
    .mud-xs-table .mud-table-body .mud-chip-content { white-space: normal; overflow-wrap: anywhere; }
    .mud-input-control, .mud-select, .mud-input-slot { min-width: 0; max-width: 100%; }
    /* Lo mismo dentro de los diálogos, y sus botones en dos renglones si no caben (FX-273). */
    .mud-dialog .mud-dialog-content .mud-chip { height: auto; min-height: 24px; max-width: 100%; }
    .mud-dialog .mud-dialog-content .mud-chip-content { white-space: normal; overflow-wrap: anywhere; }
    .mud-dialog .mud-dialog-actions { flex-wrap: wrap; gap: 6px 0; }
    /* Tablas simples (FX-203): menos relleno y texto que se parte; los importes no. Con fx-apilable, cada fila es una tarjeta con sus rótulos (data-label). */
    .mud-simple-table table * tr > td, .mud-simple-table table * tr > th { padding: 6px 5px !important; width: auto !important; }
    .mud-simple-table table * tr > td:not(.fx-numeric), .mud-simple-table .fx-partir { overflow-wrap: anywhere; }
    /* .mud-simple-table y table en cada selector: sin ellos gana MudBlazor por especificidad (FX-240). */
    .mud-simple-table.fx-apilable table, .mud-simple-table.fx-apilable table tbody, .mud-simple-table.fx-apilable table tbody tr { display: block; width: 100%; }
    .mud-simple-table.fx-apilable table thead { display: none; }
    .mud-simple-table.fx-apilable table tbody tr { padding: 6px 0; border-bottom: 1px solid var(--fx-border); }
    .fx-apilable.mud-simple-table table * tr > td {
        display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; border: 0 !important; padding: 3px 5px !important; text-align: left !important;
    }
    .fx-apilable td[data-label]::before { content: attr(data-label); font-weight: 600; color: var(--fx-ink-muted); }
    .fx-apilable td > * { max-width: 100%; }
    .mud-simple-table.fx-pares table, .mud-simple-table.fx-pares table tbody { display: block; width: 100%; }
    .mud-simple-table.fx-pares table tbody tr { display: grid; grid-template-columns: minmax(6rem, 2fr) 3fr; }
    .mud-simple-table.fx-pares table tbody tr > td { grid-column: 2; overflow-wrap: anywhere; }
}

/* ── KPI del Dashboard ───────────────────────────────────────── */
.fx-kpi { border: 1px solid var(--fx-border); border-radius: 12px !important; }
.fx-kpi-icono {
    width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: var(--fx-primary-soft); color: var(--fx-primary);
}

/* ── Esqueleto de tabla: mismo alto de fila densa (37 px) y mismo borde que la grilla real ── */
.fx-esqueleto { border: 1px solid var(--fx-border); border-radius: 4px; overflow: hidden; background: var(--fx-surface-card); }
.fx-esqueleto-fila {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 16px; align-items: center;
    padding: 9px 16px; border-bottom: 1px solid var(--fx-border); min-height: 37px;
}
.fx-esqueleto-fila:last-child { border-bottom: none; }
.fx-esqueleto-encabezado { background: var(--fx-surface-sunk); }
@media (prefers-reduced-motion: reduce) { .fx-esqueleto .mud-skeleton-wave::after { animation: none; } }

/* ── Franja de ambiente ──────────────────────────────────────── */
.fx-franja-ambiente { display: flex; align-items: center; gap: 8px; padding: 6px 16px; font-size: 13px; line-height: 1.35; }
.fx-franja-ambiente .mud-icon-root { flex: none; }
.fx-franja-ambiente--pruebas {
    color: #fff;
    background: repeating-linear-gradient(-45deg, rgba(224, 145, 95, .22) 0 10px, transparent 10px 22px), var(--fx-ink);
}
.fx-franja-ambiente--pruebas .mud-icon-root { color: #F0B48A; }
.fx-franja-ambiente--prueba { color: var(--fx-ink); background: var(--fx-surface-sunk); border-bottom: 1px solid var(--fx-border); }
.fx-franja-ambiente--prueba .mud-icon-root { color: var(--fx-cobre); }
/* Modo soporte del Super Admin: el mismo ámbar de atención que Solvrax (#B85C00) y blanco encima (contraste 4.9:1). */
.fx-franja-soporte { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 6px 16px; font-size: 13px; line-height: 1.35; color: #fff; background: #B85C00; }
.fx-franja-soporte .mud-icon-root { flex: none; color: #fff; }
.fx-franja-soporte__texto { flex: 1 1 auto; min-width: 0; }
.fx-franja-soporte .mud-button-root { color: #fff; border-color: #fff; }

/* ── Menú lateral ────────────────────────────────────────────── */
.fx-drawer { border-right: 1px solid var(--fx-border); }
.fx-marca { border-bottom: 1px solid var(--fx-border); }
.fx-marca__producto { font-family: 'Lexend', sans-serif; font-size: 16px; font-weight: 500; color: var(--fx-primary); }
.fx-marca__empresa { font-size: 11px; color: var(--fx-ink-muted); }
.fx-menu-buscador { padding: 4px 12px 8px; }
.fx-menu-vacio { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.fx-menu-seccion { display: block; text-transform: uppercase; letter-spacing: .04em; color: var(--fx-ink-muted); }
.fx-menu-resultado { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.fx-menu-resultado__titulo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-menu-resultado__ruta { display: block; font-size: 11px; color: var(--fx-ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Módulo no construido: se ve (es el alcance del producto) pero no navega ni se parece a un enlace. */
.fx-menu-pronto {
    display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 16px; min-height: 40px;
    color: var(--fx-ink-muted); cursor: not-allowed; user-select: none;
}
.fx-menu-pronto__icono { opacity: .55; }
.fx-menu-pronto__texto { flex: 1 1 auto; min-width: 0; font-size: .875rem; }
.fx-insignia-pronto {
    flex: none; font-size: 10px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
    color: var(--fx-cobre); border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px;
}

/* ── Miga de pan, pie, secretos ──────────────────────────────── */
.fx-miga .mud-breadcrumb-item { font-size: 13px; }
.fx-pie {
    display: flex; justify-content: center; padding: 8px 16px; text-align: center;
    border-top: 1px solid var(--fx-border); color: var(--fx-ink-muted); font-size: 12px;
}
.fx-secreto {
    font-family: ui-monospace, Consolas, monospace; font-size: 15px; padding: 6px 10px;
    background: var(--fx-surface-sunk); border: 1px solid var(--fx-border); border-radius: 6px; user-select: all;
}

/* Red de seguridad del PanelFiltros (ver el comentario del componente): el título no se monta sobre el primer campo. */
.fx-panel-filtros .mud-expand-panel-content > .mud-grid { margin-top: 0; }

/* ── Reportes: vista imprimible (M19) ─────────────────────────────
   El PDF lo genera el navegador (Imprimir → Guardar como PDF). Hoja blanca de ancho carta en pantalla; en papel, sin barra,
   encabezados de tabla repetidos en cada hoja y renglones que no se parten. */
.fx-impresion { min-height: 100vh; background: var(--fx-surface); padding: 0 16px 32px; }
.fx-impresion-barra {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; max-width: 216mm; margin: 0 auto;
    padding: 10px 0; background: var(--fx-surface);
}
.fx-hoja {
    max-width: 216mm; margin: 0 auto; padding: 14mm 14mm 18mm; background: #fff; color: #0F1E2E;
    border: 1px solid var(--fx-border); border-radius: 4px; font-size: 12.5px; line-height: 1.45;
}
.fx-hoja h1 { font-family: Lexend, sans-serif; font-size: 22px; font-weight: 600; margin: 2px 0 10px; }
.fx-hoja h2 { font-family: Lexend, sans-serif; font-size: 14.5px; font-weight: 600; margin: 18px 0 6px; color: #1F3A5F; break-after: avoid; }
.fx-hoja h3 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #52606F; margin: 0 0 4px; }
.fx-hoja-titulo { border-bottom: 2px solid #1F3A5F; margin-bottom: 10px; }
.fx-hoja-marca { font-size: 11px; color: #A4532A; font-weight: 600; letter-spacing: .03em; }
.fx-reporte-meta { margin-bottom: 6px; }
.fx-reporte-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 18px; margin: 0 0 8px; }
.fx-reporte-datos dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: #52606F; }
.fx-reporte-datos dd { margin: 0; font-weight: 500; }
.fx-reporte-listas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fx-reporte-listas ul { margin: 0; padding-left: 16px; }
.fx-reporte-listas li { margin-bottom: 2px; }
.fx-reporte-leyenda { margin: 10px 0 0; padding: 8px 10px; border: 1px solid #E8C9B0; border-radius: 6px; background: #FFF4E5; color: #0F1E2E; }
.fx-cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 8px; }
.fx-cifras > div { border: 1px solid #DDE3EA; border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; }
.fx-cifras span { font-size: 10.5px; color: #52606F; }
.fx-cifras strong { font-family: Lexend, sans-serif; font-size: 17px; font-variant-numeric: tabular-nums; }
.fx-cifras em { font-style: normal; font-size: 10.5px; color: #52606F; }
.fx-dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fx-tabla-impresion { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.fx-tabla-impresion th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: #52606F;
    border-bottom: 1.5px solid #1F3A5F; padding: 4px 6px; }
.fx-tabla-impresion td { border-bottom: 1px solid #DDE3EA; padding: 4px 6px; vertical-align: top; }
.fx-tabla-impresion .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-tabla-compacta td { font-size: 11px; }
.fx-uuid { font-family: ui-monospace, Consolas, monospace; font-size: 10px; word-break: break-all; min-width: 19ch; }
/* Resultado de un reporte personalizado: en pantalla se desplaza por dentro con el encabezado fijo; en papel sale completo. */
.fx-resultado { overflow-x: auto; }
.fx-resultado-pantalla { max-height: 70vh; overflow: auto; border: 1px solid #DDE3EA; border-radius: 8px; }
.fx-resultado-pantalla thead th { position: sticky; top: 0; background: #fff; box-shadow: inset 0 -1.5px 0 #1F3A5F; }
@media print { .fx-resultado-pantalla { max-height: none; overflow: visible; } }
.fx-nota { font-size: 11px; color: #52606F; }
@media (max-width: 700px) { .fx-reporte-listas, .fx-dos-columnas { grid-template-columns: 1fr; } .fx-hoja { padding: 16px; } }

/* En el teléfono la hoja se desplaza por dentro; en papel no cambia nada (FX-277). */
@media screen and (max-width: 700px) {
    .fx-hoja { overflow-x: auto; }
    .fx-impresion-barra { flex-wrap: wrap; position: static; }
}

/* Semáforo del dashboard multiempresa (M09). */
.fx-semaforo { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

@media print {
    @page { size: letter; margin: 12mm; }
    .fx-no-imprimir { display: none !important; }
    .fx-impresion { background: #fff; padding: 0; min-height: 0; }
    .fx-hoja { max-width: none; border: none; padding: 0; }
    .fx-tabla-impresion thead { display: table-header-group; }
    .fx-tabla-impresion tr, .fx-cifras > div, .fx-reporte-leyenda { break-inside: avoid; }
    .fx-reporte-leyenda { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Ayuda: panel del «?» y página /ayuda. El manual va en un <iframe srcdoc> con sus propios estilos (manuales/assets). ── */
.fx-ayuda-panel { display: flex; flex-direction: column; }
/* Cerrado, el cajón (fuera de MudLayout) quedaba a la derecha de la ventana y daba scroll horizontal a toda la app. */
.fx-ayuda-panel.mud-drawer--closed { display: none; }
.fx-ayuda-panel .mud-drawer-content { display: flex; flex-direction: column; height: 100%; }
.fx-ayuda-cabecera {
    display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px;
    border-bottom: 1px solid var(--fx-border); background: var(--fx-surface-card);
}
.fx-ayuda-titulo { min-width: 0; display: flex; flex-direction: column; }
.fx-ayuda-panel .fx-ayuda-marco { flex: 1 1 auto; min-height: 0; }
.fx-ayuda-marco { display: block; width: 100%; height: 100%; border: 0; background: var(--fx-surface); }
.fx-ayuda-pagina { overflow: hidden; height: calc(100vh - 210px); min-height: 420px; }

/* Conector privado: pasos de instalación y comandos para copiar */
.fx-pasos { padding-left: 1.4rem; margin: 0 0 .75rem; } .fx-pasos > li { margin-bottom: .6rem; }
.fx-comando { display: flex; align-items: flex-start; gap: .25rem; margin-top: .35rem; padding: .5rem .25rem .5rem .75rem; border: 1px solid var(--mud-palette-lines-default); border-radius: 6px; background: var(--mud-palette-background-gray); }
.fx-comando code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.5; padding-top: .15rem; }
