html, body {
    font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
}

.app-logo {
    height: 36px;
    width: auto;
    border-radius: 6px;
    background: white;
    padding: 2px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 180px;
}

.bar-chart .bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    font-size: 11px;
}

.bar-chart .bar .fill {
    width: 100%;
    background: var(--mud-palette-primary);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height .4s ease;
}

.email-preview {
    width: 100%;
    min-height: 420px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: white;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Syncfusion: botonera de los componentes que se abren en ModalHost */
.modal-acciones { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.campo { margin-bottom: 1rem; }
.tabla-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: .75rem; }
.tabla-titulo { margin: 0; font-size: 1.25rem; font-weight: 600; }
.tabla-herramientas { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.tabla-buscador { min-width: 16rem; }
.tabla-acciones { display: inline-flex; gap: .25rem; justify-content: flex-end; }
.tabla-cargando { padding: 1rem; text-align: center; color: #666; }

/* Formularios de los modales */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-item { min-width: 0; }
.form-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.campo .ayuda { display: block; margin-top: .125rem; color: #6b7280; font-size: .75rem; }
.campo-switch { display: flex; align-items: center; gap: .5rem; }
.alerta { padding: .6rem .9rem; margin-bottom: 1rem; border-radius: 6px; border-left: 4px solid; font-size: .875rem; }
.alerta-info { background: #eef6ff; border-color: #2f7bd9; color: #123a63; }
.alerta-aviso { background: #fff7e0; border-color: #d9a21b; color: #5c4300; }
.alerta-error { background: #fdecea; border-color: #d33a2c; color: #6b1a12; }
.alerta-exito { background: #eaf7ee; border-color: #2e9e5b; color: #145a30; }
.subir-imagen { display: flex; align-items: center; gap: .75rem; margin: .5rem 0 1rem; }
.subir-imagen-vista { height: 64px; border-radius: 6px; object-fit: cover; }
.filtro { min-width: 11rem; max-width: 15rem; }
.filtro .campo { margin-bottom: 0; }

/* Pantallas con HTML propio (RACI, simulador, incidencias) */
.tabla-simple { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: .9rem; }
.tabla-simple th, .tabla-simple td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.tabla-simple thead th { font-weight: 600; background: #f6f7f9; }
.tabla-simple tbody tr:hover { background: #fafbfc; }
.tabla-simple .derecha, .derecha { text-align: right; white-space: nowrap; }
.panel { padding: 1rem; margin-bottom: 1rem; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.panel-titulo { margin: 0; font-size: 1.05rem; font-weight: 600; }
.fila-herramientas { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.fila-titulo { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.fila-titulo h2 { margin: 0; font-size: 1.35rem; }
.espaciador { flex: 1 1 auto; }
.etiqueta { padding: .125rem .6rem; border-radius: 999px; background: #e5e7eb; font-size: .8rem; }
.etiqueta-aviso { background: #fff3cd; color: #5c4300; }
.filtro-ancho { min-width: 18rem; max-width: 26rem; }

/* Email y Seguridad */
.info-texto { white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow: auto; margin: 0; font-size: .85rem; }
.etiqueta-exito { background: #d6f0de; color: #145a30; }
.etiqueta-error { background: #fadad6; color: #6b1a12; }
.etiquetas { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #2f5fd0; color: #fff; font-weight: 600; }
.dos-columnas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .dos-columnas { grid-template-columns: 1fr; } }
.email-preview { border: 1px solid #e5e7eb; }
.permiso-celda { min-width: 8rem; }
.permiso-celda .campo { margin-bottom: 0; }
.tab-contenido { padding: 1rem .25rem; }
.fila-enviar { display: flex; align-items: flex-end; gap: .75rem; }
.fila-enviar .campo { flex: 1 1 auto; margin-bottom: 0; }
.ayuda-texto { color: #6b7280; font-size: .85rem; margin: .5rem 0; }
.datos-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem 1rem; }
.datos-completo { grid-column: 1 / -1; }
@media (max-width: 800px) { .datos-grid { grid-template-columns: 1fr; } }
.filtro-ancho { max-width: 20rem; }

/* Layout principal */
.app-shell { display: grid; grid-template-columns: 260px 1fr; grid-template-rows: 56px 1fr; grid-template-areas: "barra barra" "lateral contenido"; min-height: 100vh; }
.app-shell.menu-cerrado { grid-template-columns: 0 1fr; }
.app-barra { grid-area: barra; display: flex; align-items: center; gap: .75rem; padding: 0 1rem; background: #4f46e5; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); position: sticky; top: 0; z-index: 10; }
.app-titulo { font-size: 1.15rem; font-weight: 500; }
.app-espacio { flex: 1; }
.app-usuario { font-size: .875rem; }
.app-menu-boton, .app-salir { background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer; padding: .35rem .6rem; border-radius: 4px; }
.app-menu-boton { font-size: 1.25rem; }
.app-menu-boton:hover, .app-salir:hover { background: rgba(255,255,255,.18); }
.app-lateral { grid-area: lateral; overflow: hidden auto; border-right: 1px solid #e5e7eb; background: #fff; position: sticky; top: 56px; height: calc(100vh - 56px); }
.menu-cerrado .app-lateral { visibility: hidden; }
.app-contenido { grid-area: contenido; padding: 1.5rem; min-width: 0; }
.nav-menu { padding: .5rem 0; }
.nav-grupo summary { padding: .6rem 1rem; font-weight: 600; cursor: pointer; list-style: none; color: #374151; }
.nav-grupo summary::before { content: "▸"; display: inline-block; width: 1rem; transition: transform .15s; }
.nav-grupo[open] summary::before { transform: rotate(90deg); }
.nav-grupo summary:hover { background: #f3f4f6; }
.nav-grupo a { display: block; padding: .45rem 1rem .45rem 2.25rem; color: #374151; text-decoration: none; font-size: .9rem; }
.nav-grupo a:hover { background: #f3f4f6; }
.nav-grupo a.active { background: #eef2ff; color: #4f46e5; font-weight: 600; box-shadow: inset 3px 0 0 #4f46e5; }
@media (max-width: 800px) {
    .app-shell { grid-template-columns: 1fr; grid-template-areas: "barra" "contenido"; }
    .app-lateral { position: fixed; top: 56px; left: 0; width: 260px; z-index: 9; box-shadow: 2px 0 8px rgba(0,0,0,.2); }
    .menu-cerrado .app-lateral { display: none; }
    .app-shell.menu-cerrado { grid-template-columns: 1fr; }
}

.form-subtitulo { margin: .75rem 0 .25rem; font-size: .95rem; color: #475569; }
