html, body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --sg-brand-primary: #007da5;
    --sg-brand-primary-dark: #006b8d;
    --sg-brand-gray: #88898d;
    --sg-brand-ink: #1d1d1b;
    --sg-brand-surface: #f3f5f6;
}

a, .btn-link {
    color: var(--sg-brand-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--sg-brand-primary);
    border-color: var(--sg-brand-primary-dark);
}

.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 rgba(0, 125, 165, 0.35);
}

.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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjk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U0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

/* ===== SYNCFUSION FILTER POPUP STYLES ===== */

/* Popup contenedor (Menu filter y Excel filter) */
.e-grid .e-popup.e-filter-popup,
.e-grid .e-popup.e-excelfilter,
.e-grid .e-popup[class*="xlfl"],
.e-flmenu.e-popup {
    width: min(90vw, 280px) !important;
    min-width: 240px;
    max-width: 300px;
    background: #fff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.15) !important;
    padding: 12px !important;
}

/* Forzar color en TODOS los descendientes del popup */
.e-flmenu.e-popup *,
.e-grid .e-popup.e-filter-popup *,
.e-grid .e-popup.e-excelfilter * {
    color: #212529 !important;
    -webkit-text-fill-color: #212529 !important;
}

/* Excepción: botón primario (Filter) — texto blanco */
.e-flmenu .e-footer-content .e-primary,
.e-filter-popup .e-footer-content .e-primary {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

/* Excepción: iconos SVG no deben tener fill forzado */
.e-flmenu.e-popup svg,
.e-grid .e-popup.e-filter-popup svg {
    color: inherit !important;
    -webkit-text-fill-color: unset !important;
}

/* Popup del DropDownList del operador (se renderiza en el body, fuera del filtro) */
.e-ddl.e-popup.e-lib.e-control,
.e-dropdownlist.e-popup,
.e-popup.e-lib.e-ddl-device {
    background: #fff !important;
    color: #212529 !important;
}

.e-ddl.e-popup .e-list-item,
.e-ddl.e-popup .e-list-item span,
.e-dropdownlist.e-popup .e-list-item,
.e-popup.e-lib.e-ddl-device .e-list-item {
    color: #212529 !important;
    -webkit-text-fill-color: #212529 !important;
    background: #fff;
}

.e-ddl.e-popup .e-list-item.e-active,
.e-ddl.e-popup .e-list-item.e-hover {
    background: #007da5 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

/* Inputs dentro del popup — neutralizar herencias de Bootstrap */
.e-flmenu .e-input-group,
.e-flmenu .e-input-group.e-control-wrapper,
.e-filter-popup .e-input-group,
.e-filter-popup .e-input-group.e-control-wrapper {
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    padding: 0 8px;
    height: 34px;
    display: flex;
    align-items: center;
}

.e-flmenu .e-input-group input.e-input,
.e-flmenu .e-input-group.e-control-wrapper input.e-input,
.e-filter-popup .e-input-group input.e-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    height: auto !important;
    font-size: 0.875rem;
    color: #212529;
}

/* DropDownList del operador */
.e-flmenu .e-dropdownbase,
.e-flmenu .e-ddl,
.e-filter-popup .e-dropdownbase,
.e-filter-popup .e-ddl {
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    background: #fff !important;
    height: 34px !important;
    font-size: 0.875rem;
    color: #212529 !important;
}

/* Texto del valor seleccionado en el dropdown del operador */
.e-flmenu .e-input-value,
.e-flmenu .e-dropdownlist,
.e-flmenu .e-ddl input,
.e-flmenu .e-ddl .e-input,
.e-flmenu span.e-input-value,
.e-filter-popup .e-input-value,
.e-filter-popup .e-ddl input,
.e-filter-popup .e-ddl .e-input,
.e-filter-popup span.e-input-value {
    color: #212529 !important;
    -webkit-text-fill-color: #212529 !important;
}

/* Textos en labels y encabezados del popup */
.e-flmenu .e-flmenu-container label,
.e-flmenu .e-flmenu-container .e-label,
.e-filter-popup label,
.e-filter-popup .e-label,
.e-flmenu .e-dlg-content,
.e-filter-popup .e-popup-content {
    color: #212529 !important;
}

/* Botones Filter / Clear */
.e-flmenu .e-footer-content,
.e-filter-popup .e-footer-content {
    padding-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.e-flmenu .e-footer-content .e-btn,
.e-filter-popup .e-footer-content .e-btn {
    font-size: 0.8125rem;
    padding: 4px 12px;
    border-radius: 4px;
}

/* Excel filter: tamaño del checkbox list */
.e-grid .e-popup.e-filter-popup .e-checkboxlist,
.e-grid .e-popup.e-excelfilter .e-checkboxlist,
.e-grid .e-popup[class*="xlfl"] .e-checkboxlist {
    max-height: 220px;
    overflow-y: auto;
}

/* Excel filter: alineación correcta de los checkboxes */
.e-grid .e-excelfilter .e-checkbox-wrapper,
.e-grid .e-popup.e-excelfilter .e-checkbox-wrapper,
.e-grid .e-popup[class*="xlfl"] .e-checkbox-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
}

.e-grid .e-excelfilter .e-checkbox-wrapper .e-frame,
.e-grid .e-popup.e-excelfilter .e-checkbox-wrapper .e-frame,
.e-grid .e-popup[class*="xlfl"] .e-checkbox-wrapper .e-frame {
    flex-shrink: 0;
    margin: 0 !important;
    vertical-align: middle;
}

.e-grid .e-excelfilter .e-checkbox-wrapper .e-label,
.e-grid .e-popup.e-excelfilter .e-checkbox-wrapper .e-label,
.e-grid .e-popup[class*="xlfl"] .e-checkbox-wrapper .e-label {
    line-height: 1.3;
    vertical-align: middle;
}

/* Excel filter: fila de cada item */
.e-grid .e-excelfilter .e-checkboxlist li,
.e-grid .e-popup.e-excelfilter .e-checkboxlist li,
.e-grid .e-popup[class*="xlfl"] .e-checkboxlist li {
    display: flex !important;
    align-items: center !important;
    padding: 3px 0;
}

.e-grid .e-popup.e-filter-popup .e-xlfltr-searchdiv,
.e-grid .e-popup.e-excelfilter .e-xlfltr-searchdiv,
.e-grid .e-popup[class*="xlfl"] .e-xlfltr-searchdiv {
    max-width: 100%;
}

/* ===== SFBUTTON — ESTILOS UNIFORMES GLOBALES ===== */

/* Altura base uniforme para todos los SfButton pequeños */
.e-btn.e-small {
    height: 32px !important;
    min-width: 32px;
    padding: 0 12px !important;
    font-size: 0.8125rem !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    line-height: 1 !important;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

/* Botón primario corporativo — clase reutilizable en todos los grids */
.e-btn.btn-sg-primary {
    background-color: var(--sg-brand-primary) !important;
    border-color: var(--sg-brand-primary-dark) !important;
    color: #fff !important;
    font-weight: 500;
}

.e-btn.btn-sg-primary:hover:not(:disabled) {
    background-color: var(--sg-brand-primary-dark) !important;
    border-color: var(--sg-brand-primary-dark) !important;
}

.e-btn.btn-sg-primary:disabled {
    background-color: #7fc4d9 !important;
    border-color: #7fc4d9 !important;
    opacity: 0.7;
}

/* Botones outline — solo icono o con texto secundario */
.e-btn.e-outline.e-small {
    background: #fff !important;
    border: 1px solid #ced4da !important;
    color: #6c757d !important;
}

.e-btn.e-outline.e-small:hover:not(:disabled) {
    background: #f8f9fa !important;
    border-color: #adb5bd !important;
    color: #495057 !important;
}

/* Botones icono-only: cuadrado perfecto — solo con clase explícita e-icon-btn */
.e-btn.e-small.e-icon-btn {
    width: 32px !important;
    padding: 0 !important;
}

/* Icono dentro del botón */
.e-btn .e-btn-icon {
    font-size: 0.9rem !important;
    line-height: 1 !important;
}

/* ===== SYNCFUSION TABS (e-tab) — color corporativo ===== */
.e-tab .e-tab-header .e-tab-text,
.e-tab .e-tab-header .e-tab-wrap .e-tab-text {
    color: var(--sg-brand-primary) !important;
}

.e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text,
.e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-wrap .e-tab-text {
    color: #fff !important;
    font-weight: 600;
}

.e-tab .e-tab-header .e-indicator {
    background: var(--sg-brand-primary) !important;
}

.e-tab .e-tab-header .e-toolbar-item .e-tab-wrap:hover .e-tab-text {
    color: var(--sg-brand-primary-dark) !important;
}

.menu-root {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 20px;
    background: linear-gradient(120deg, var(--sg-brand-ink), var(--sg-brand-primary-dark));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.menu-brand a {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.2rem;
    text-decoration: none;
    letter-spacing: 0.05em;
}

.primary-menu.e-menu {
    flex: 1;
    background: transparent;
    border: none;
    box-shadow: none;
}

.primary-menu.e-menu .e-menu-item .e-anchor {
    color: #dbe5ff;
    font-weight: 500;
    font-size: 0.95rem;
    gap: 6px;
    padding: 8px 14px;
}

.primary-menu.e-menu .e-menu-item .e-anchor .e-menu-icon {
    font-size: 1rem;
}

.primary-menu.e-menu .e-menu-item.e-selected > .e-anchor,
.primary-menu.e-menu .e-menu-item.e-focused > .e-anchor,
.primary-menu.e-menu .e-menu-item:hover > .e-anchor {
    background: rgba(0, 125, 165, 0.28);
    border-radius: 6px;
}

.primary-menu.e-menu .e-submenu.e-menu {
    background: #111a2c;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.primary-menu.e-menu .e-submenu .e-menu-item .e-anchor {
    color: #f2f4ff;
}

@media (max-width: 768px) {
    .menu-root {
        flex-direction: column;
        align-items: flex-start;
    }

    .primary-menu.e-menu {
        width: 100%;
    }
}

/* Products grid: force a stable scroll container inside the page layout */
.products-page-shell {
    min-height: calc(100dvh - 140px);
    display: flex;
    flex-direction: column;
}

.products-page-header {
    flex: 0 0 auto;
}

.products-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100dvh - 260px);
    min-height: 420px;
    overflow: hidden;
}

.products-grid-wrap .e-grid {
    height: 100% !important;
    min-height: 0;
}

.products-grid-wrap .e-grid .e-gridcontent,
.products-grid-wrap .e-grid .e-content {
    overflow-y: auto !important;
    overscroll-behavior: contain;
    max-height: 100% !important;
}

@media (max-width: 992px) {
    .products-page-shell {
        min-height: calc(100dvh - 110px);
    }

    .products-grid-wrap {
        height: calc(100dvh - 280px);
        min-height: 360px;
    }
}

.products-page-title {
    margin: 0 0 12px 0;
    color: var(--sg-brand-ink);
    font-weight: 700;
    letter-spacing: 0.01em;
    text-shadow: none;
}