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;
}

/* ==========================================================================
   SpiderNet ERP - global theme
   Light lavender workspace / white cards / purple-plum primary actions. Every
   color below is a fallback only - the live values come from MainLayout's
   per-Theme inline CSS custom properties (see DynoraThemeCatalog/ThemeState),
   so switching Theme in Settings > Appearance never requires editing this file.
   ========================================================================== */

:root {
    --dynora-sidebar-bg: #FFFFFF;
    --dynora-sidebar-selected: #2563EB;
    --dynora-sidebar-muted: #6B7280;
    --dynora-sidebar-text: #374151;
    --dynora-sidebar-hover: rgba(15, 23, 42, 0.05);
    --dynora-sidebar-active-text: #FFFFFF;
    --dynora-primary: #2563EB;
    --dynora-banner-bg: #DBEAFE;
    --dynora-page-bg: #F8FAFC;
    --dynora-page-bg-top: #F8FAFC;
    --dynora-border: #E5E7EB;
    --dynora-surface: #FFFFFF;
    --dynora-text: #1F2937;
    --dynora-text-muted: #6B7280;
}

html, body {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, var(--dynora-page-bg-top) 0%, var(--dynora-page-bg) 480px);
}

/* Top app bar */
.dynora-appbar {
    background: var(--dynora-surface) !important;
    color: var(--dynora-text) !important;
    border-bottom: 1px solid var(--dynora-border);
}

.dynora-admin-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--dynora-text);
}

    .dynora-admin-chip:hover {
        background: var(--dynora-page-bg);
    }

/* The menu renders in the popover layer, outside the element that defines the --dynora-* colors,
   so it uses MudBlazor's palette (set for every theme and mode) like the other menu items. */
.dynora-logout-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: start;
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--mud-palette-error);
    cursor: pointer;
}

    .dynora-logout-menu-item:hover {
        background: var(--mud-palette-action-default-hover);
    }

/* Drawer / sidebar */
.dynora-drawer {
    background: var(--dynora-sidebar-bg) !important;
    border-right: none !important;
}

/* Modules Grid navigation removed. Grid-specific styles have been deleted. */

/* Employee Structure view switcher active state
   Uses the site's primary color and a filled appearance for the active
   button to make the currently selected view immediately obvious. */
.emp-view-switcher .mud-button-root {
    border-color: var(--dynora-primary);
}

.emp-view-switcher .mud-button-root.mud-button-filled {
    background: var(--dynora-primary) !important;
    color: var(--dynora-sidebar-active-text) !important;
}

.emp-view-switcher .mud-button-root.mud-button-outlined {
    background: transparent !important;
    color: var(--dynora-text) !important;
}

/* end grid removal */

.dynora-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 14px;
    box-sizing: border-box;
    color: var(--dynora-sidebar-muted);
}

.dynora-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 18px 6px;
}

.dynora-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--dynora-sidebar-selected);
    color: var(--dynora-sidebar-active-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
}

.dynora-brand-name {
    color: var(--dynora-sidebar-text);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
}

.dynora-brand-system { gap: 12px; padding: 6px 6px 18px 6px; }
.dynora-system-mark {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--mud-palette-primary, #594ae2), color-mix(in srgb, var(--mud-palette-primary, #594ae2) 55%, #000));
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--mud-palette-primary, #594ae2) 70%, transparent);
}
.dynora-system-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.dynora-system-name { color: var(--dynora-sidebar-text); font-weight: 800; font-size: 1.3rem; letter-spacing: .6px; }
.dynora-system-group { color: var(--dynora-sidebar-text); opacity: .65; font-size: .78rem; font-weight: 500; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dynora-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--dynora-sidebar-hover);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 14px;
}

.dynora-search-icon {
    color: var(--dynora-sidebar-muted);
}

.dynora-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--dynora-sidebar-text);
    font-size: 0.85rem;
    width: 100%;
}

    .dynora-search-input::placeholder {
        color: var(--dynora-sidebar-muted);
    }

.dynora-nav {
    flex: 1 1 auto;
    overflow-y: auto;
}

/* The Settings/Theme block sits pinned under the scrollable module list, above the dark
   mode footer - it should hug its own content, not share the sidebar's flexible space
   with the scrollable .dynora-nav above it (see NavMenu.razor). */
.dynora-nav-bottom {
    flex: 0 0 auto;
    overflow-y: visible;
}

.dynora-section-header {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--dynora-sidebar-muted);
    padding: 14px 10px 6px 10px;
}

.dynora-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: 8px;
    color: var(--dynora-sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
}

    .dynora-nav-link:hover {
        background: var(--dynora-sidebar-hover);
        color: var(--dynora-sidebar-text);
    }

    .dynora-nav-link.active {
        background: var(--dynora-sidebar-selected);
        color: var(--dynora-sidebar-active-text);
        font-weight: 600;
    }

.dynora-nav-icon {
    color: inherit;
    opacity: 0.9;
}

.dynora-nav-link-disabled {
    padding: 8px 12px 8px 40px;
    color: var(--dynora-sidebar-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.dynora-nav-no-results {
    padding: 16px 16px;
    color: var(--dynora-sidebar-muted);
    font-size: 0.85rem;
    text-align: center;
}

.dynora-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-top: 2px;
    border-radius: 8px;
    color: var(--dynora-sidebar-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
}

    .dynora-section-toggle:hover {
        background: var(--dynora-sidebar-hover);
        color: var(--dynora-sidebar-text);
    }

/* Marks the module containing the page currently being viewed, so it stays
   identifiable even while its section is collapsed (see NavMenu's _activeSectionName) -
   one calm, consistent brand-colored accent for every module now, not a distinct color
   per module. */
.dynora-section-toggle-current {
    color: var(--dynora-primary);
    box-shadow: inset 3px 0 0 0 var(--dynora-primary);
}

/* A Section's own sub-grouping (see SidebarCatalog.NavItem.Group) - a smaller, indented
   version of .dynora-section-toggle, one level deeper. Purely a navigation/visual
   grouping, same collapsible interaction pattern as the top-level Section headers. */
.dynora-nav-arrange {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    font-size: 0.75rem;
    color: var(--dynora-text-muted);
    text-decoration: none;
}

    .dynora-nav-arrange:hover {
        color: var(--dynora-primary);
    }

.dynora-subgroup-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px 7px 22px;
    margin-top: 1px;
    border-radius: 8px;
    color: var(--dynora-sidebar-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
}

    .dynora-subgroup-toggle:hover {
        background: var(--dynora-sidebar-hover);
        color: var(--dynora-sidebar-text);
    }

.dynora-nav-link-sub {
    padding-left: 34px;
}

.dynora-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-top: 10px;
    border-top: 1px solid var(--dynora-border);
    color: var(--dynora-sidebar-text);
    font-size: 0.85rem;
    cursor: pointer;
}

/* Main content */
.dynora-main {
    background: linear-gradient(180deg, var(--dynora-page-bg-top) 0%, var(--dynora-page-bg) 480px);
    min-height: 100vh;
}

.dynora-page {
    /* Narrow margins: the data uses the whole screen. */
    padding: 16px 18px 24px 18px;
}

/* Full-screen modules tiles - see Components/Layout/ModulesTiles.razor.css (scoped to
   that component) for the current glass-morphism styling. These class names are kept
   out of this global stylesheet deliberately so they can only ever affect ModulesTiles. */

/* Reusable Organization form / list page building blocks */
.dynora-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.dynora-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dynora-text);
    margin: 0;
}

.dynora-breadcrumb {
    color: var(--dynora-text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.dynora-card {
    background: var(--dynora-surface);
    color: var(--dynora-text);
    border: 1px solid var(--dynora-border);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
}

.dynora-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--dynora-primary);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.dynora-kpi-card {
    background: var(--dynora-surface);
    color: var(--dynora-text);
    border: 1px solid var(--dynora-border);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dynora-kpi-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dynora-primary);
    line-height: 1.1;
}

.dynora-kpi-card-label {
    font-size: 0.8rem;
    color: #6B7280;
}

.dynora-kpi-mini {
    text-align: center;
    padding: 10px 6px;
}

.dynora-kpi-mini-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.dynora-kpi-mini-label {
    font-size: 0.75rem;
    color: #6B7280;
    margin-top: 2px;
}

.dynora-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--dynora-banner-bg);
    color: var(--dynora-text);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.8rem;
    margin-top: 6px;
}

.dynora-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.dynora-logo-drop {
    border: 1px dashed var(--dynora-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 26px 16px;
    color: var(--dynora-text-muted);
    text-align: center;
}

.mud-button-filled.mud-button-filled-primary {
    background-color: var(--dynora-primary) !important;
}

/* Settings > Appearance - Theme picker cards */
.dynora-theme-card {
    position: relative;
    border: 1px solid var(--dynora-border);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .dynora-theme-card:hover {
        border-color: var(--dynora-primary);
    }

.dynora-theme-card-selected {
    border-color: var(--dynora-primary);
    box-shadow: 0 0 0 2px var(--dynora-primary) inset;
}

.dynora-theme-swatch {
    height: 56px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.dynora-theme-swatch-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
}

.dynora-theme-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dynora-text);
}

.dynora-theme-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* POS Floors & Tables - clickable Floor rows (select a Floor to manage its Tables) */
.cursor-pointer {
    cursor: pointer;
}

.dynora-row-selected {
    background: var(--dynora-light-banner, #F3E8F7) !important;
}

/* Shared drag-to-reorder row (Module Settings + Organization Ordering both use this exact
   shape - drag handle, numeric position input, label) so a new ordering screen never needs
   to reinvent or duplicate the styling. */
.dynora-module-settings-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--dynora-border, #E5E7EB);
    cursor: grab;
}

.dynora-module-settings-item {
    padding-left: 32px;
}

.dynora-module-settings-items {
    margin-bottom: 8px;
}

.dynora-order-input {
    width: 64px;
    flex: none;
}

/* ---------------------------------------------------------------------
   Organization Structure - Tree View: a classic CSS-only org chart
   (boxes connected by lines, each level's siblings laid out horizontally
   beneath their shared parent). Can grow wide at deep levels with many
   siblings - the outer .dynora-org-tree scrolls horizontally rather than
   compressing/wrapping, which would break the connector lines.
   --------------------------------------------------------------------- */
.dynora-org-tree {
    overflow-x: auto;
    padding: 12px 4px 24px 4px;
}

.dynora-org-tree-node {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    vertical-align: top;
}

.dynora-org-tree-box {
    border: 1px solid var(--dynora-border, #E5E7EB);
    border-left: 4px solid var(--dynora-primary, #6D4AA6);
    border-radius: 8px;
    padding: 8px 14px;
    background: var(--dynora-surface);
    display: flex;
    flex-direction: column;
    min-width: 150px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.dynora-org-tree-level {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dynora-text-muted);
}

.dynora-org-tree-name {
    font-weight: 600;
    color: var(--dynora-text);
}

.dynora-org-tree-code {
    font-size: 0.75rem;
    color: var(--dynora-text-muted);
}

.dynora-org-tree-children {
    display: flex;
    justify-content: center;
    position: relative;
    padding-top: 24px;
}

.dynora-org-tree-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 24px;
    background: var(--dynora-border, #C9C2D9);
}

.dynora-org-tree-branch {
    position: relative;
    padding: 0 14px;
}

.dynora-org-tree-branch::before {
    content: '';
    position: absolute;
    top: -24px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--dynora-border, #C9C2D9);
}

.dynora-org-tree-branch:first-child::before {
    left: 50%;
}

.dynora-org-tree-branch:last-child::before {
    right: 50%;
}

.dynora-org-tree-branch:only-child::before {
    display: none;
}

.dynora-org-tree-branch::after {
    content: '';
    position: absolute;
    top: -24px;
    left: 50%;
    width: 1px;
    height: 24px;
    background: var(--dynora-border, #C9C2D9);
}

/* ---------------------------------------------------------------------
   Global Print architecture - shared by PrintPageButton (Components/Shared)
   and every Form/List page's header action row. A consistent mechanism
   (browser print of the current page) rather than a bespoke one per page:
   .dynora-no-print hides app chrome/actions that make no sense on paper,
   .dynora-print-only reveals a page's own detailed printable layout (see
   EosSettlementForm's Print Preview section) that stays hidden on screen.
   --------------------------------------------------------------------- */
.dynora-print-only {
    display: none;
}

@media print {
    .mud-drawer, .mud-appbar, .mud-drawer-container ~ * .mud-appbar,
    .dynora-no-print, .mud-dialog-actions, .mud-snackbar-location-container,
    [class*="mud-snackbar-location-"], .mud-snackbar {
        display: none !important;
    }

    .dynora-print-only {
        display: block !important;
    }

    .mud-layout, .mud-main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .dynora-card {
        border: none;
        padding: 0;
        margin-bottom: 12px;
    }

    body, .dynora-page-content {
        background: #FFFFFF !important;
    }
}

.dynora-print-view h2 {
    margin-bottom: 4px;
}

.dynora-print-view h3 {
    margin-top: 20px;
    margin-bottom: 6px;
}

.dynora-print-table {
    width: 100%;
    border-collapse: collapse;
}

.dynora-print-table td {
    border: 1px solid #999;
    padding: 6px 10px;
    font-size: 0.9rem;
}

.dynora-print-table td:first-child {
    font-weight: 600;
    width: 260px;
    background: #F5F5F5;
}

.dynora-print-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
}

.dynora-print-signatures > div {
    width: 30%;
    text-align: center;
}

.dynora-print-sig-line {
    margin-top: 40px;
    border-top: 1px solid #333;
}

/* ---------------- Hierarchy explorer engine (Tree/Network/List views) ----------------
   Global, non-isolated CSS: this engine is shared across multiple component files
   (HierarchyTreeView/HierarchyTreeNode/HierarchyNetworkView/HierarchyListView/
   HierarchyExplorer), so Blazor CSS isolation's scope-per-owning-file model (plain,
   non-::deep selectors only reach elements literally written in the SAME .razor file)
   would not reliably apply across that component boundary. Plain global classes avoid
   that ambiguity entirely. */

.hierarchy-tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 4px;
    border-radius: 6px;
    cursor: pointer;
}

.hierarchy-tree-row:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.06);
}

.hierarchy-tree-row-selected {
    background: rgba(var(--mud-palette-primary-rgb), 0.12);
    font-weight: 600;
}

.hierarchy-tree-chevron,
.hierarchy-tree-chevron-spacer {
    display: flex;
    align-items: center;
    width: 20px;
    flex-shrink: 0;
}

.hierarchy-tree-label {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hierarchy-tree-count {
    font-size: 0.7rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.hierarchy-tree-badge {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--dynora-primary);
    background: rgba(100, 116, 139, 0.12);
    border-radius: 999px;
    padding: 1px 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.hierarchy-tree-row-accent {
    width: 3px;
    align-self: stretch;
    border-radius: 2px;
    flex-shrink: 0;
    opacity: 0.55;
}

/* The chart scrolls natively: a vertical scrollbar is always shown, a horizontal one when the
   structure is wider than the screen. Height is fitted to the window by HierarchyNetworkView.razor.js.
   Laid out left-to-right (node positions are computed that way); card text keeps its own direction. */
.hierarchy-network-viewport {
    position: relative;
    direction: ltr;
    overflow-x: auto;
    overflow-y: scroll;
    width: 100%;
    height: calc(100vh - 230px);
    min-height: 420px;
    padding: 24px;
    box-sizing: border-box;
    background: #FAFAFA;
    border: 1px solid var(--mud-palette-lines-default, #E5E7EB);
    border-radius: 12px;
    scrollbar-width: auto;
    scrollbar-color: rgba(0, 0, 0, 0.35) rgba(0, 0, 0, 0.06);
}

.hierarchy-network-viewport::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.hierarchy-network-viewport::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
}

.hierarchy-network-viewport::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Takes the zoomed size of the chart so the scroll range always covers every node;
   centred while the chart is narrower than the screen. */
.hierarchy-network-sizer {
    position: relative;
    margin-inline: auto;
}

.hierarchy-network-zoom {
    position: absolute;
    top: 0;
    left: 0;
}

.hierarchy-network-canvas {
    position: relative;
}

.hierarchy-explorer-fullscreen .hierarchy-network-viewport {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

/* The chart provides its own scrolling, so its card should not clip or add a second scrollbar. */
.hierarchy-chart-card {
    padding: 12px !important;
}

.hierarchy-network-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
}

.hierarchy-network-edge {
    fill: none;
    stroke: #9CA3AF;
    stroke-width: 2;
}

.hierarchy-network-node {
    position: absolute;
    background: var(--dynora-surface);
    color: var(--dynora-text);
    border: 1px solid var(--dynora-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 8px 10px;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
}

.hierarchy-network-node:hover {
    border-color: var(--dynora-primary);
}

/* Vertical org chart: arrowheads, dashed side branches (Level N+) and the branch toggle. */
.hierarchy-network-arrowhead {
    fill: #9CA3AF;
}

.hierarchy-network-edge-side {
    stroke-dasharray: 5 4;
}

.hierarchy-network-node-side {
    border-style: dashed;
}

.hierarchy-network-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 22px;
    height: 18px;
    padding: 0 5px;
    border: 1px solid var(--dynora-border);
    border-radius: 9px;
    background: var(--dynora-surface);
    color: var(--dynora-text);
    font-size: 0.68rem;
    line-height: 16px;
    cursor: pointer;
}

.hierarchy-network-move {
    position: absolute;
    right: 4px;
    bottom: 3px;
    display: flex;
    gap: 2px;
}

.hierarchy-network-move button {
    width: 20px;
    height: 16px;
    padding: 0;
    border: 1px solid var(--dynora-border);
    border-radius: 4px;
    background: var(--dynora-surface);
    color: var(--dynora-text);
    font-size: 0.6rem;
    line-height: 14px;
    cursor: pointer;
}

.hierarchy-network-move button:hover {
    border-color: var(--dynora-primary);
    color: var(--dynora-primary);
}

.hierarchy-network-node:has(.hierarchy-network-move) .hierarchy-network-node-tertiary {
    padding-right: 46px;
}

.hierarchy-network-node:has(.hierarchy-network-toggle) .hierarchy-network-node-title {
    padding-right: 26px;
}

.hierarchy-network-toggle:hover {
    border-color: var(--dynora-primary);
    color: var(--dynora-primary);
}

.hierarchy-network-node-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    overflow: hidden;
}

.hierarchy-network-node-text {
    min-width: 0;
    flex: 1 1 auto;
}

.hierarchy-network-node-selected {
    border-color: var(--dynora-primary);
    box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.3);
}

.hierarchy-network-node-dim {
    opacity: 0.35;
}

.hierarchy-network-node-title {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hierarchy-network-node-subtitle {
    font-size: 0.72rem;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hierarchy-network-node-tertiary {
    font-size: 0.68rem;
    color: #9CA3AF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hierarchy-explorer-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: var(--dynora-page-bg);
    padding: 16px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* ---------------------------------------------------------------------
   The printed form of a document (DocumentPrint): hidden on screen; on paper the page prints only this form, so an
   invoice or voucher prints as an organized document, not as the screen with its fields and buttons.
   --------------------------------------------------------------------- */
@media print {
    @page { size: A4; margin: 12mm; }
    :has(> .dyn-doc-print) > :not(.dyn-doc-print) { display: none !important; }
    .dyn-doc-print { display: block !important; color: #000; font-size: 11pt; }
    /* Several documents printed together (e.g. a range of transfers): each starts on its own page. */
    .dyn-doc-print + .dyn-doc-print { break-before: page; }
    /* "Print several" (bulk-print.js): only the gathered documents print, one per page. */
    body.dyn-bulk-printing > *:not(#dyn-bulk-print) { display: none !important; }
    body.dyn-bulk-printing #dyn-bulk-print { display: block !important; }
    .dyn-bulk-doc + .dyn-bulk-doc { break-before: page; }
    .dyn-bulk-doc .dyn-doc-print { display: block !important; }
    .dyn-bulk-screen .dynora-no-print, .dyn-bulk-screen button { display: none !important; }
}
#dyn-bulk-print { display: none; }
.dyn-bulk-panel { margin: -6px 0 14px; padding: 12px 14px; border: 1px solid var(--mud-palette-lines-default, #ddd); border-radius: 10px; background: var(--mud-palette-surface, #fff); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.dyn-bulk-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.dyn-bulk-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--mud-palette-text-secondary, #666); }
.dyn-bulk-row input { height: 36px; width: 130px; padding: 0 10px; border: 1px solid rgba(0,0,0,.23); border-radius: 8px; font: inherit; font-size: .9rem; background: transparent; color: var(--mud-palette-text-primary, #222); }
.dyn-bulk-row label.wide { flex: 1; min-width: 220px; }
.dyn-bulk-row label.wide input { width: 100%; }
.dyn-bulk-or { padding-bottom: 9px; color: var(--mud-palette-text-secondary, #666); }
.dyn-bulk-go { height: 36px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--mud-palette-primary, #1f3b4d); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.dyn-bulk-go:disabled { opacity: .6; cursor: default; }
.dyn-bulk-close { height: 36px; width: 36px; border: 1px solid rgba(0,0,0,.23); border-radius: 8px; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; }
.dyn-bulk-hint { margin-top: 6px; font-size: 12px; color: var(--mud-palette-text-secondary, #666); }
.dyn-bulk-progress { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--mud-palette-primary, #1f3b4d); }
.dyn-bulk-toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 3000; padding: 10px 16px; border-radius: 8px; background: #323232; color: #fff; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.dyn-doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 10px; border-bottom: 2px solid #000; margin-bottom: 12px; }
.dyn-doc-company { display: flex; align-items: center; gap: 10px; }
.dyn-doc-company img { max-height: 56px; max-width: 120px; object-fit: contain; }
.dyn-doc-company strong { display: block; font-size: 14pt; }
.dyn-doc-company span { color: #444; }
.dyn-doc-title { text-align: end; }
.dyn-doc-title h1 { margin: 0 0 4px; font-size: 17pt; }
.dyn-doc-title div { display: flex; justify-content: flex-end; gap: 8px; }
.dyn-doc-title span { color: #555; }
.dyn-doc-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px; margin: 0 0 12px; }
.dyn-doc-fields div { display: flex; gap: 8px; border-bottom: 1px dotted #999; padding: 3px 0; }
.dyn-doc-fields dt { color: #555; min-width: 90px; }
.dyn-doc-fields dd { margin: 0; font-weight: 600; }
.dyn-doc-lines { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.dyn-doc-lines th, .dyn-doc-lines td { border: 1px solid #888; padding: 4px 6px; text-align: start; }
.dyn-doc-lines th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.dyn-doc-lines .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dyn-doc-lines tr { break-inside: avoid; }
.dyn-doc-lines thead { display: table-header-group; }
.dyn-doc-lines tfoot td { font-weight: 700; background: #f5f5f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.dyn-doc-notes { border: 1px solid #888; padding: 6px 8px; margin-bottom: 12px; }
.dyn-doc-notes p { margin: 4px 0 0; white-space: pre-line; }
.dyn-doc-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 28px; break-inside: avoid; }
.dyn-doc-signs div { display: flex; flex-direction: column; gap: 28px; }
.dyn-doc-signs i { border-bottom: 1px solid #000; }

/* The Print button placed in every page header (print-button.js), styled like the header's outlined buttons. */
.dyn-print-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid rgba(0, 0, 0, .23); border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.dyn-print-btn:hover { background: rgba(0, 0, 0, .04); }
.dynora-page-header > .dyn-print-btn, .bp-title > .dyn-print-btn { margin-inline-start: auto; margin-inline-end: 8px; }
/* «Print several» sits right beside Print: only Print takes the free space before it. */
.dynora-page-header > .dyn-print-btn + .dyn-bulk-btn, .bp-title > .dyn-print-btn + .dyn-bulk-btn { margin-inline-start: 0; }
/* The Back button every screen gets (back-button.js), styled like Print; its arrow points the way back in Arabic too. */
.dyn-back-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid rgba(0, 0, 0, .23); border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; white-space: nowrap; order: -1; }
.dyn-back-btn:hover { background: rgba(0, 0, 0, .04); }
html[dir="rtl"] .dyn-back-btn svg { transform: scaleX(-1); }
.dynora-page-header > .dyn-back-btn, .bp-title > .dyn-back-btn, header.ops-header > .dyn-back-btn, .pm-head > .dyn-back-btn, .gps-head > .dyn-back-btn, .qp-head > .dyn-back-btn { margin-inline: 0 14px; align-self: center; }
/* A header without its own buttons: Back sits at the start beside the title; the title takes the free space, so Print stays at the end. */
.dynora-page-header > .dyn-back-btn + *, .bp-title > .dyn-back-btn + *, header.ops-header > .dyn-back-btn + *, .pm-head > .dyn-back-btn + *, .gps-head > .dyn-back-btn + *, .qp-head > .dyn-back-btn + * { margin-inline-end: auto; }
.dynora-page-header > .dyn-back-btn + .dyn-print-btn, .bp-title > .dyn-back-btn + .dyn-print-btn { margin-inline-start: 8px; }

/* Header bell (NotificationBell) */
.dyn-bell { width: min(380px, 92vw); max-height: 70vh; overflow-y: auto; padding: 4px 0; }
.dyn-bell-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 14px 8px; border-bottom: 1px solid var(--mud-palette-lines-default); }
.dyn-bell-empty { padding: 18px 14px; text-align: center; color: var(--mud-palette-text-secondary); }
.dyn-bell-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--mud-palette-lines-default); background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.dyn-bell-item:hover { background: var(--mud-palette-action-default-hover); }
.dyn-bell-item.is-unread { background: rgba(var(--mud-palette-primary-rgb), .08); }
.dyn-bell-item.is-unread .dyn-bell-title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; border-radius: 50%; background: var(--mud-palette-error); vertical-align: middle; }
.dyn-bell-title { font-weight: 600; }
.dyn-bell-msg { font-size: .85rem; color: var(--mud-palette-text-secondary); }
.dyn-bell-time { font-size: .75rem; color: var(--mud-palette-text-secondary); direction: ltr; text-align: end; }
/* Number boxes that hold a sum (quantity-calc.js): a small mark, and the sum shown again when the box is focused or hovered. */
input.has-calc{background-image:linear-gradient(135deg,var(--mud-palette-primary) 0 6px,transparent 6px)!important;background-repeat:no-repeat!important;background-position:top left!important}
.calc-bubble{position:fixed;z-index:3000;display:none;pointer-events:none;padding:5px 10px;border-radius:8px;background:var(--mud-palette-gray-darker,#263238);color:#fff;font:600 13px/1.4 system-ui,"Segoe UI",Tahoma,sans-serif;box-shadow:0 4px 14px rgba(0,0,0,.25);white-space:nowrap;font-variant-numeric:tabular-nums}
[data-dyn-own-back] { display: none !important; }
