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

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* Pantalla de inicio de sesión (estática: no usa el tema de MudBlazor) */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f4f5f9; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 8px; padding: 28px; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.login-marca { color: #594AE2; font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.login-titulo { font-size: 1.4rem; margin: 0 0 16px; }
.login-card label { display: block; font-size: .85rem; margin: 12px 0 4px; color: #444; }
.login-card input[type=text], .login-card input[type=password] { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #bbb; border-radius: 4px; font-size: 1rem; }
.login-recordar { display: flex !important; align-items: center; gap: 8px; }
.login-boton { width: 100%; margin-top: 18px; padding: 11px; background: #594AE2; color: #fff; border: 0; border-radius: 4px; font-size: 1rem; cursor: pointer; }
.login-error { color: #c62828; font-size: .85rem; margin: 6px 0; }
.login-aviso { color: #2e7d32; font-size: .9rem; margin: 6px 0; }
.logout-form { display: inline; margin: 0; }
.logout-btn { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.7); border-radius: 4px; padding: 4px 10px; cursor: pointer; }

/* Impresión: solo el contenido de la pantalla, con cabecera (título, fecha y usuario) */
.solo-imprimir { display: none; }
@page { size: A4 landscape; margin: 10mm; }
@media print {
    .mud-appbar, .mud-drawer, .mud-snackbar-provider, .no-imprimir, #blazor-error-ui { display: none !important; }
    .mud-main-content { padding: 0 !important; margin: 0 !important; }
    .mud-container { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
    .mud-layout { display: block !important; }
    .solo-imprimir { display: block !important; font-size: 12px; margin-bottom: 8px; border-bottom: 1px solid #999; padding-bottom: 4px; }
    .mud-paper { box-shadow: none !important; }
    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #fff !important; }
    .mud-table-container { overflow: visible !important; }
    .plano-impresion { page-break-inside: avoid; }
}

/* Plano en pantalla completa: leyenda superior (categorías, almacenes y procesos) y plano ajustado a la pantalla; el selector de sector se oculta */
.plano-contenedor:fullscreen { background: #fff; padding: 8px; overflow: auto; display: flex; flex-direction: column; height: 100vh; box-sizing: border-box; }
.plano-contenedor:fullscreen .no-fs { display: none; }
.plano-contenedor:fullscreen .plano-leyenda { flex: 0 0 auto; }
.plano-contenedor:fullscreen .plano-svg-paper { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.plano-contenedor:fullscreen .plano-svg-paper > svg { flex: 1 1 auto; min-height: 0; height: auto !important; }

/* Alertas del plano: borde rojo parpadeante */
@keyframes parpadeo-alerta { 0%, 100% { opacity: 1; } 50% { opacity: .1; } }
.alerta-parpadeo { animation: parpadeo-alerta 1.1s ease-in-out infinite; }
@media print { .alerta-parpadeo { animation: none; } }

/* Leyenda del plano: títulos a la izquierda y casillas alineadas con el mismo ancho */
.leyenda-fila { display: grid; grid-template-columns: 130px 1fr; align-items: start; margin-bottom: 4px; }
.leyenda-titulo { font-size: .75rem; font-weight: 700; padding-top: 4px; }
.leyenda-chips { display: grid; }
.leyenda-chip { display: flex; justify-content: space-between; gap: 6px; color: #222; border: 1px solid #888; border-radius: 4px; padding: 3px 8px; font-size: 12px; cursor: pointer; user-select: none; box-sizing: border-box; }
.leyenda-chip .t { opacity: .75; white-space: nowrap; font-weight: 600; }
.leyenda-chip.marcado { border: 3px solid #594AE2; padding: 1px 6px; }

/* Dibujo en detalle del depósito (ficha) */
.tanque-detalle { display: flex; flex-direction: column; align-items: center; }
.tanque-detalle svg { width: 100%; max-width: 280px; height: auto; display: block; }
.tanque-leyenda { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 12px; margin-top: 4px; }
.tanque-leyenda i { display: inline-block; width: 14px; height: 11px; border: 1px solid #777; vertical-align: middle; margin-right: 4px; }

/* Impresión: tablas siempre con su aspecto normal (MudBlazor las apila por debajo de 960 px), sin botones y plano en una página */
@media print {
    .mud-table .mud-table-root .mud-table-head .mud-table-row { display: table-row !important; }
    .mud-table .mud-table-root .mud-table-foot { display: table-footer-group !important; }
    .mud-table .mud-table-root colgroup { display: table-column-group !important; }
    .mud-table .mud-table-row { display: table-row !important; }
    .mud-table .mud-table-cell { display: table-cell !important; padding: 4px 8px !important; border-bottom: 1px solid #ccc !important; text-align: start; }
    .mud-table .mud-table-cell:before { content: none !important; }
    .mud-table-toolbar, .mud-table-pagination, .mud-button-root, .mud-icon-button, .mud-switch, .mud-progress-linear { display: none !important; }
    .mud-table-container { overflow: visible !important; }
    .plano-contenedor > .mud-paper svg { width: 100% !important; height: auto !important; max-height: 118mm; }
    .plano-lateral { display: none !important; }
    .tanque-detalle svg { max-width: 220px; }
}

/* ===== Login (diseño de dos paneles, compacto) ===== */
.login-tarjeta { display: flex; width: 100%; max-width: 640px; min-height: 330px; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 24px rgba(30, 20, 120, .18); }
.login-marca-panel { flex: 0 0 220px; background: linear-gradient(160deg, #3b2fc9 0%, #594ae2 55%, #7b6df0 100%); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 24px; }
.login-logo { width: 64px; height: 64px; margin-bottom: 14px; border-radius: 14px; }
.login-nombre { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.login-lema { font-size: .9rem; opacity: .9; margin-top: 6px; }
.login-pie-marca { font-size: .72rem; opacity: .7; margin-top: 28px; }
.login-formulario { flex: 1; padding: 26px 28px; display: flex; flex-direction: column; justify-content: center; }
.login-formulario .login-titulo { font-size: 1.15rem; margin: 0 0 10px; color: #2b2f3a; }
.login-formulario label { display: block; font-size: .78rem; margin: 10px 0 3px; color: #555; }
.login-formulario input:not([type=checkbox]) {
    width: 100%; box-sizing: border-box; height: 38px; line-height: 20px; padding: 7px 10px; margin: 0;
    border: 1px solid #bbb; border-radius: 4px; font-size: .95rem; font-family: inherit; background: #fff; appearance: none; -webkit-appearance: none; }
.login-formulario input:not([type=checkbox]):focus { outline: 2px solid #594ae2; outline-offset: -1px; border-color: #594ae2; }
.login-formulario .login-recordar { display: flex !important; align-items: center; gap: 6px; margin: 10px 0 0; font-size: .8rem; }
.login-formulario .login-boton { width: 100%; height: 40px; margin-top: 14px; padding: 0; font-size: .95rem; }
.login-formulario .login-error, .login-formulario .login-aviso { font-size: .78rem; margin: 3px 0; }
@media (max-width: 640px) {
    .login-tarjeta { flex-direction: column; min-height: 0; max-width: 380px; }
    .login-marca-panel { flex: none; flex-direction: row; align-items: center; gap: 12px; padding: 14px 18px; }
    .login-logo { width: 36px; height: 36px; margin: 0; }
    .login-lema, .login-pie-marca { display: none; }
    .login-nombre { font-size: 1.2rem; }
}

/* ===== Compactar pantallas (PC y tablet) ===== */
.mud-main-content .mud-container { padding-left: 12px; padding-right: 12px; margin-top: 8px !important; margin-bottom: 8px !important; }
.mud-typography-h4 { font-size: 1.45rem !important; line-height: 1.25 !important; }
.mud-typography-h6 { font-size: 1.05rem !important; }
.mud-main-content .mud-paper.pa-3 { padding: 10px !important; }
.mud-main-content .mud-paper.pa-2 { padding: 8px !important; }
.mud-main-content .mb-4 { margin-bottom: 10px !important; }
.mud-main-content .mb-3 { margin-bottom: 8px !important; }
.mud-table-dense .mud-table-cell { padding: 4px 10px; }
.mud-dialog .mud-dialog-content { padding-top: 6px; }
.mud-main-content .mud-button-root.mud-button-outlined, .mud-main-content .mud-button-root.mud-button-filled { padding-top: 4px; padding-bottom: 4px; }
.mud-drawer .mud-nav-link { padding-top: 6px; padding-bottom: 6px; }
@media (max-width: 1279px) { .mud-main-content .mud-container { padding-left: 8px; padding-right: 8px; } }


/* Leyenda y plano más compactos (letra algo mayor y en negrita para leerla de un vistazo) */
.leyenda-chip { padding: 2px 6px; font-size: 13px; font-weight: 700; }
.leyenda-chip.marcado { padding: 0 4px; }
.leyenda-fila { margin-bottom: 2px; }
.leyenda-titulo { font-size: .78rem; padding-top: 3px; }

/* ===== Integridad visual: iconos de dos tonos (como GesLab) y botones coherentes ===== */
/* En botones rellenos el icono pasa a blanco para que se lea sobre el color */
.mud-button-filled .mud-icon-root, .mud-fab .mud-icon-root { --ic: #fff; --ic2: rgba(255,255,255,.28); }
.mud-button-filled .mud-icon-root image { filter: brightness(0) invert(1); }
.mud-appbar .mud-icon-root { --ic: #fff; --ic2: rgba(255,255,255,.3); }
.mud-button-root { text-transform: none; letter-spacing: .01em; font-weight: 500; border-radius: 4px; }
.mud-button-root .mud-button-icon-start { margin-right: 6px; margin-left: -2px; }
.mud-button-root .mud-icon-root { width: 1.2rem; height: 1.2rem; }
.mud-icon-button .mud-icon-root { width: 1.35rem; height: 1.35rem; }
.mud-nav-link .mud-nav-link-icon { width: 1.4rem; height: 1.4rem; margin-right: 12px; }
.mud-icon-button:hover { background-color: rgba(89, 74, 226, .08); }
/* Botón de peligro (eliminar) mantiene su borde rojo; los iconos ya llevan su color */

/* ===== Formularios por bloques tintados (estilo GesLab): cada grupo de datos con su color; campos blancos dentro ===== */
.grp { border-radius: 8px; border-left: 4px solid #6b7280; background: #eceff4; padding: 8px 12px 10px; }
.grp > h4 { margin: 0 0 6px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #334155; }
.grp > * + * { margin-top: 8px; }
.grp > h4 + * { margin-top: 0; }
.g-dep { background: #e7f4f2; border-left-color: #1E9E91; }
.g-can { background: #e8f6ec; border-left-color: #2E9D4F; }
.g-ana { background: #efe7f8; border-left-color: #7A3EB1; }
.g-cli { background: #e8eefb; border-left-color: #2F5FC4; }
.g-ref { background: #eceff4; border-left-color: #6b7280; }
.g-mot { background: #fdeede; border-left-color: #E8811A; }
.grp .mud-input.mud-input-underline, .grp .mud-input.mud-input-outlined { background: #fff; border-radius: 4px; }
.grp .mud-input.mud-input-underline { border: 1px solid #cfd4e0; padding-left: 8px; padding-right: 4px; }
.grp .mud-input-underline:before, .grp .mud-input-underline:after { display: none !important; }
.grp .mud-input-control { margin-top: 0; }
.grp .mud-input-label { color: #445; }
.grp .mud-simple-table, .grp .mud-simple-table .mud-table-container { background: transparent; }
.grp .mud-simple-table th { background: transparent; color: #334155; }
.grp .mud-simple-table td { border-bottom: 1px solid #ddd0ec; }
.grp .mud-alert { margin-top: 8px; }

/* Fichas: la columna de etiquetas va tintada */
.ficha-ex td:first-child { background: #e7f4f2; border-left: 4px solid #1E9E91; color: #334155; width: 48%; }
.ficha-an td:first-child { background: #efe7f8; border-left: 4px solid #7A3EB1; color: #334155; width: 36%; }
.ficha-an th { color: #334155; font-weight: 600; }
.ficha-ex td, .ficha-an td { border-bottom: 1px solid #fff !important; }

/* Tablas con muchas columnas (p. ej. revisión diaria con la analítica): celdas más ajustadas para que quepan en tablet */
.tabla-compacta .mud-table-cell { padding: 4px 6px; }
.tabla-compacta .mud-table-head .mud-table-cell { font-size: .78rem; line-height: 1.15; }

/* ===== Códigos QR de depósitos ===== */
.qr-rejilla { display: flex; flex-wrap: wrap; gap: 12px; }
.qr-tarjeta { border: 1px solid #c9c9c9; border-radius: 6px; padding: 4mm; text-align: center; background: #fff; color: #000; break-inside: avoid; }
.qr-svg { margin: 0 auto; }
.qr-svg svg { width: 100%; height: 100%; display: block; }
.qr-codigo { font-weight: 700; font-size: 1.1rem; margin-top: 2mm; }
.qr-nombre { font-size: .8rem; }
@media print { .qr-tarjeta { border: 1px dashed #999; } }

/* ===== Cabecera de las tablas: destacada respecto al contenido, con filtro por columna ===== */
.mud-table .mud-table-head .mud-table-cell {
    background: #e7e4fb; color: #2a2470; font-weight: 700; border-bottom: 2px solid #9d93ea;
    vertical-align: middle;
}
.mud-table .mud-table-head .mud-table-cell .mud-table-sort-label { font-weight: 700; color: inherit; }
.filtro-cab { display: inline-block; position: relative; vertical-align: middle; margin-left: 2px; }
.filtro-cab .mud-icon-button { padding: 2px; opacity: .55; }
.filtro-cab .mud-icon-button:hover { opacity: 1; }
.filtro-cab .filtro-cab-activo { opacity: 1; background: #b9b0f5; border-radius: 6px; }
@media print {
    .mud-table .mud-table-head .mud-table-cell { background: #e8e8e8 !important; color: #000 !important; border-bottom: 2px solid #666 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.mud-table .mud-table-head .mud-table-sort-label { display: inline-flex; align-items: center; }
.mud-table .mud-table-head .mud-table-cell { white-space: nowrap; padding-right: 10px; }
.tabla-compacta .mud-table-head .mud-table-cell { white-space: normal; }

/* ===== Filas compactas (más líneas por pantalla; misma letra; objetivos táctiles de ~32 px) ===== */
.mud-table .mud-table-body .mud-table-row { height: 32px; }
.mud-table .mud-table-body .mud-table-cell { padding: 2px 10px !important; line-height: 1.3; }
.mud-table .mud-table-head .mud-table-cell { padding-top: 4px; padding-bottom: 4px; }
.mud-table .mud-table-body .mud-icon-button { padding: 3px; }
.mud-table .mud-table-body .mud-chip { margin: 0 2px; }
/* Valores cortos en una sola línea (fechas, códigos, categorías, estados…) */
.mud-table td[data-label="Fecha"], .mud-table td[data-label="Última revisión"], .mud-table td[data-label="Depósito"], .mud-table td[data-label="Código"],
.mud-table td[data-label="Categoría"], .mud-table td[data-label="Origen"], .mud-table td[data-label="Destino"], .mud-table td[data-label="Estado"],
.mud-table td[data-label="Usuario"], .mud-table td[data-label="Rol"], .mud-table td[data-label="Referencia"] { white-space: nowrap; }
/* Columna de acciones (iconos y botones) siempre en una línea */
.mud-table .mud-table-body .mud-table-row > td:last-child { white-space: nowrap; }
