

html, body, #app {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: hidden; /* ← add this */
}

.mud-layout {
    overflow: auto;
    display: flex;
    flex-direction: column;
    background-color: var(--mud-palette-background-grey) !important;
    min-height: 100vh; /* ← was height:100% + min-height:100% */
}

.mud-drawer {
    background-color: var(--sb-bg) !important;
}

.mud-drawer-content {
    background: transparent !important;
}


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;
}

/*:root {
    --appbar-bg: linear-gradient(90deg, #5b4dff 0%, #7b61ff 100%);
    --appbar-text: #ffffff;
}*/
.modern-appbar {
    /*   background: var(--appbar-bg);
    color: var(--appbar-text);*/
    /*   background: linear-gradient(90deg, #5b4dff 0%, #7b61ff 100%);*/
    background: linear-gradient(90deg, #5a21b3 0%, #225bd7 100%);
   /* background: linear-gradient(90deg,#f3f6f9 0%, #f3f6f9 100%);*/
    color: white;
    height: 6vh !important;
    min-height: 6vh !important;
    padding-left: 8px;
    padding-right: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
/*.dark-theme {
    --appbar-bg: #16181d;
    --appbar-text: #f3f4f6;
}*/

.modern-navmenu {
    padding: 8px 12px;
}

    .modern-navmenu .mud-nav-link {
        border-radius: 12px;
        margin-bottom: 6px;
        padding: 10px 14px;
        transition: all 0.2s ease;
    }

        .modern-navmenu .mud-nav-link:hover {
            background-color: #f3f1ff;
        }

        .modern-navmenu .mud-nav-link.active {
            background: linear-gradient(90deg, #5b4dff 0%, #7b61ff 100%);
            color: white !important;
        }

.modern-sidebar {
    /*background: transparent !important;*/
    /*background-image: linear-gradient(180deg, #1e1b4a 0%, #1e1b4a 100%);*/
    background-color: #F3F6F9;
    /*transition: width 0.15s ease-in-out !important;*/
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

    .modern-sidebar,
    .modern-sidebar .mud-drawer-paper {
        background-color: #F3F6F9 !important;
    }

        .modern-sidebar .mud-drawer-paper {
            overflow-x: hidden;
            border-right: none;
        }

/* MINI DRAWER FIX */
.mud-drawer-mini .modern-sidebar {
    overflow-x: hidden;
}

.main-content {
    margin-top: 5px;
}

.module-card {
    border-radius: 18px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}

    .module-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 28px rgba(0,0,0,0.12);
    }

.text-muted {
    color: #6c757d;
}

.mud-menu-item:hover {
    background-color: #f4f4f4;
}

.dark-theme .mud-main-content {
    background: #111318;
    color: #f3f4f6;
}

.dark-theme .mud-paper {
    background-color: #1b1f27 !important;
    color: #f3f4f6 !important;
}

.dark-theme .mud-drawer {
    background: #16181d !important;
}

/* ── Avatar Trigger ─────────────────────────────── */
.avatar-trigger {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

    .avatar-trigger .profile-avatar {
        background: radial-gradient(circle,rgba(238, 174, 202, 1) 0%, rgba(148, 187, 233, 1) 100%);
        color: #fff;
        font-weight: 700;
        font-size: 0.85rem;
        transition: all 0.25s ease;
        box-shadow: 0 0 0 2px rgba(99,102,241,0.25);
        border-radius: 50%;
    }

    .avatar-trigger:hover .profile-avatar {
        transform: scale(1.08) rotate(2deg); /* playful tilt */
        box-shadow: 0 6px 14px rgba(99,102,241,0.35);
    }

.avatar-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 9px;
    height: 9px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid white;
}

/* ── Popover Container ──────────────────────────── */
/*.profile-popover .mud-popover {
    border-radius: 18px !important;
    overflow: hidden;
    backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(255,255,255,0.6);
    background: rgba(255, 255, 255, 0.65);
    min-width: 260px;
    animation: popoverIn 0.22s cubic-bezier(0.34,1.56,0.64,1) forwards;
    right: 8px !important;
    left: auto !important;
}
*/

.profile-popover .mud-popover {
    border-radius: 18px !important;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.65); /* translucent white */
    /*backdrop-filter: blur(12px) saturate(180%);*/ /* glass blur */
    /*-webkit-backdrop-filter: blur(12px) saturate(180%);*/ /* Safari support */
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    animation: popoverIn 0.22s cubic-bezier(0.34,1.56,0.64,1) forwards;
}


@keyframes popoverIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Header ─────────────────────────────────────── */
.pmenu-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px 16px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
}

.pmenu-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar-large {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}

.pmenu-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid white;
}

.pmenu-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pmenu-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e1b4b;
    line-height: 1.2;
}

.pmenu-email {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.2;
}

.pmenu-role {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #6366f1;
    background: rgba(99,102,241,0.1);
    border-radius: 999px;
    padding: 2px 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Divider ─────────────────────────────────────── */
.pmenu-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

/* ── Menu Items ──────────────────────────────────── */
.pmenu-items {
    padding: 6px 8px;
}

.pmenu-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: left;
}

    .pmenu-item:hover {
        background: linear-gradient(90deg, #eef2ff, #e0e7ff);
        color: #4338ca;
        transform: translateX(3px);
    }

.pmenu-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #6366f1;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.pmenu-item:hover .pmenu-item-icon {
    background: #ede9fe;
}

/* ── Danger (Sign Out) ───────────────────────────── */
.pmenu-item--danger {
    color: #ef4444;
}

    .pmenu-item--danger .pmenu-item-icon {
        color: #ef4444;
        background: #fef2f2;
        font-weight: 600;
    }

    .pmenu-item--danger:hover {
        background: #fef2f2;
        color: #b91c1c;
        transform: translateX(3px);
    }

        .pmenu-item--danger:hover .pmenu-item-icon {
            background: #fee2e2;
        }


.no-underline {
    text-decoration: none !important;
    color: inherit; /* keeps text color consistent */
}

/* ========================================
   CONTAINER
======================================== */
.spotlight-search {
    display: flex;
    align-items: center;
    position: relative;
    transition: all .35s cubic-bezier(.16,1,.3,1);
}

    .spotlight-search.open {
        min-width: 420px;
        justify-content: flex-end;
    }

/* ========================================
   SEARCH BUTTON
======================================== */
.search-trigger-btn {
    width: 40px;
    height: 40px;
    color: #fff !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,.12) !important;
    border: 1px solid rgba(255,255,255,.2) !important;
    backdrop-filter: blur(8px);
    transition: all .2s ease;
}

    .search-trigger-btn:hover {
        background: rgba(255,255,255,.2) !important;
        transform: scale(1.04);
    }

/* ========================================
   INPUT
======================================== */
.spotlight-input-wrap,
.spotlight-input {
    width: 420px;
}

.spotlight-input {
    animation: expandIn .35s cubic-bezier(.16,1,.3,1);
}

    .spotlight-input .mud-input-root {
        height: 40px;
        border-radius: 12px !important;
        border: 1.5px solid rgba(255,255,255,.35) !important;
        background: rgba(255,255,255,.16) !important;
        backdrop-filter: blur(16px);
        transition: all .25s ease;
    }

        .spotlight-input .mud-input-root:focus-within {
            background: rgba(255,255,255,.24) !important;
            border-color: rgba(255,255,255,.75) !important;
            box-shadow: 0 0 0 4px rgba(255,255,255,.08);
        }

    .spotlight-input .mud-input-outlined-border {
        border: none !important;
    }

    .spotlight-input .mud-input-slot {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .spotlight-input input {
        color: #fff !important;
        font-size: 14px !important;
        padding-left: 8px !important;
    }

        .spotlight-input input::placeholder {
            color: rgba(255,255,255,.55);
        }

    .spotlight-input .mud-input-adornment-start {
        margin-left: 12px !important;
    }

    .spotlight-input .mud-svg-icon {
        fill: rgba(255,255,255,.85) !important;
    }

/* ========================================
   DROPDOWN PANEL
======================================== */
.spotlight-popover {
    width: 420px !important;
    min-width: 420px !important;
    max-width: 420px !important;
    /*max-height: 500px !important;*/
    /*overflow-y: auto !important;*/
    overflow: hidden !important;
    padding: 8px !important;
    border-radius: 16px !important;
    background: var(--mud-palette-surface,#fff) !important;
    border: 1px solid rgba(0,0,0,.08) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06) !important;
}

.mud-dark-theme .spotlight-popover {
    background: rgba(26,26,38,.96) !important;
    border-color: rgba(255,255,255,.08) !important;
}

/* ========================================
   REMOVE MUD DEFAULT HIGHLIGHTS
======================================== */
.spotlight-popover .mud-list-item,
.spotlight-popover .mud-list-item:hover,
.spotlight-popover .mud-list-item-text,
.spotlight-popover .mud-selected-item,
.spotlight-popover .mud-primary-hover {
    background: transparent !important;
    box-shadow: none !important;
}

.spotlight-popover .mud-list-item {
    padding: 0 !important;
    margin: 2px 0 !important;
    min-height: unset !important;
}

/* ========================================
   DROPDOWN ITEM
======================================== */
.spotlight-dropdown-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border-radius: 12px;
    transition: background .15s ease, color .15s ease;
}

.menu-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
    transition: color .15s ease;
}

.menu-category {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--mud-palette-text-secondary);
    transition: color .15s ease;
}

/* ========================================
   HOVER
======================================== */
.spotlight-popover .mud-list-item:hover .spotlight-dropdown-item {
    background: rgba(108,99,204,.08);
}

.spotlight-popover .mud-list-item:hover .menu-title {
    color: #5B54C5;
}

.spotlight-popover .mud-list-item:hover .menu-category {
    color: #8B84D8;
}

/* ========================================
   SELECTED / KEYBOARD NAVIGATION
   ======================================== */
.spotlight-popover .mud-list-item[aria-selected="true"] .spotlight-dropdown-item {
    background: linear-gradient( 90deg, rgba(108,99,204,.12), rgba(108,99,204,.05) );
}

.spotlight-popover .mud-list-item[aria-selected="true"] .menu-title {
    color: #5B54C5;
    font-weight: 600;
}

.spotlight-popover .mud-list-item[aria-selected="true"] .menu-category {
    color: #8B84D8;
}

/* ========================================
   DARK MODE
======================================== */
.mud-dark-theme .spotlight-popover .mud-list-item:hover .spotlight-dropdown-item,
.mud-dark-theme .spotlight-popover .mud-list-item[aria-selected="true"] .spotlight-dropdown-item {
    background: rgba(255,255,255,.08);
}

.mud-dark-theme .spotlight-popover .menu-title {
    color: rgba(255,255,255,.95);
}

.mud-dark-theme .spotlight-popover .menu-category {
    color: rgba(255,255,255,.60);
}

/* ========================================
   ANIMATION
======================================== */
@keyframes expandIn {
    from {
        width: 40px;
        opacity: 0;
    }

    to {
        width: 420px;
        opacity: 1;
    }
}

/* ─────────────────────────────────────────────
          LIGHT THEME
 ───────────────────────────────────────────── */
:root {
    --sb-bg: #ffffff;
    --sb-surface: #f5f6fa;
    --sb-border: #e8eaf0;
    --sb-accent: #5b52f0;
    --sb-accent-soft: #eeecfe;
    --sb-accent-glow: rgba(91,82,240,0.12);
    --sb-text: #374151;
    --sb-text-muted: #9ca3af;
    --sb-active-bg: #eeecfe;
    --sb-active-text: #4338ca;
    --sb-hover-bg: #f3f4f8;
    --sb-radius: 9px;
    --sb-width: 256px;
    --sb-font: 'Sora', sans-serif;
    --sb-transition: 0.16s cubic-bezier(.4,0,.2,1);
    --sb-dot: #4b5563;
    /* =========================================
       DATAGRID
    ========================================= */
    --grid-header-bg: linear-gradient( to bottom, #2563eb 0%, #1d4ed8 100% );
    --grid-group-bg: #f3f4f8;
    --grid-hover-bg: rgba(91,82,240,0.05);
    --grid-border: rgba(0,0,0,0.06);
    --grid-text: #374151;
    --grid-header-text: #475569;
    --grid-scrollbar: rgba(100,116,139,.35);
}

/* ─────────────────────────────────────────────
          Dark THEME
  ───────────────────────────────────────────── */
html.dark-theme,
body.dark-theme {
    --sb-bg: #16181d;
    --sb-surface: #1d2128;
    --sb-border: #2a2f38;
    --sb-accent: #8b82ff;
    --sb-accent-soft: rgba(139,130,255,0.12);
    --sb-accent-glow: rgba(139,130,255,0.18);
    --sb-text: #e5e7eb;
    --sb-text-muted: #9ca3af;
    --sb-active-bg: rgba(139,130,255,0.14);
    --sb-active-text: #c7c3ff;
    --sb-hover-bg: #232833;
    --sb-heading: #f3f4f6;
    --sb-dot: #4b5563;
    /* =========================================
       DATAGRID
    ========================================= */

    --grid-header-bg: #20242c;
    --grid-group-bg: #252b35;
    --grid-hover-bg: rgba(139,130,255,.08);
    --grid-border: rgba(255,255,255,.06);
    --grid-text: #e5e7eb;
    --grid-header-text: #cbd5e1;
    --grid-scrollbar: rgba(255,255,255,.18);
}

.mud-page {
    padding: 0px 8px 5px 8px;
    border-radius: 16px;
    background: var(--sb-bg);
    border: 1px solid var(--sb-border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 16px 40px rgba(15,23,42,0.06);
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    transition: background .2s ease, border-color .2s ease;
}

.dark-theme .mud-page {
    background: var(--sb-bg);
    border: 1px solid var(--sb-border);
}



/* =========================================================
   DATA GRID
========================================================= */

.datagrid {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--grid-border);
    background: var(--sb-bg);
}
    /* =========================================================
   HEADER
========================================================= */

    .datagrid .mud-table-head th {
        background: var(--grid-header-bg) !important;
        color: white !important;
        position: sticky;
        white-space: nowrap;
        box-shadow: inset 0 -1px 0 rgba(255,255,255,.08), 0 2px 4px rgba(0,0,0,.12);
    }
    /* =========================================================
   BODY ROWS
========================================================= */

    .datagrid .mud-table-body tr {
        transition: all .18s ease;
    }

        .datagrid .mud-table-body tr:hover {
            background: rgba(59,130,246,.04);
        }

    /* =========================================================
   CELLS
========================================================= */

    .datagrid .mud-table-body td {
        color: var(--grid-text);
        border-bottom: 1px solid var(--grid-border);
    }

    /* =========================================================
   GROUP ROW
========================================================= */

    .datagrid .mud-datagrid-group {
        background: var(--grid-group-bg);
        font-weight: 700 !important;
    }

        .datagrid .mud-datagrid-group .group-content {
            width: 100%;
        }

/* =========================================================
   STICKY GROUP ROW
========================================================= */

.sticky-group-grid .mud-datagrid-group {
    position: sticky;
    top: 32px;
    z-index: 5;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* =========================================================
    ALIGNMENT
========================================================= */

.text-end {
    text-align: right;
}


/* Align header cell text */
.align-right {
    text-align: right !important;
}


    .align-right .mud-table-sort-label {
        width: 100%;
        justify-content: flex-end;
    }


    .align-right .column-header {
        justify-content: flex-end !important;
        display: flex !important;
        width: 100%;
    }


/* =========================================================
   SCROLLBAR
========================================================= */

.datagrid .mud-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.datagrid .mud-table-container::-webkit-scrollbar-thumb {
    background: var(--grid-scrollbar);
}



.datagrid .mud-table-body tr:hover {
    background: var(--grid-hover-bg);
}


.summary-row td {
    font-weight: 800 !important;
    color: var(--mud-palette-primary) !important;
    border-top: 2px solid var(--mud-palette-primary);
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 960px) {

    .sticky-group-grid tr:has(.mud-datagrid-group) {
        position: sticky;
        top: 0;
        z-index: 20;
        background: var(--mud-palette-surface);
    }

    .sticky-group-grid .mud-datagrid-group {
        background: var(--mud-palette-surface);
    }
    /*
    .datagrid .mud-table-body td {
        padding-top: 8px;
        padding-bottom: 8px;
    }*/
}

/* =========================================================
   LAPTOP & MEDIUM SCREEN OPTIMIZATIONS (Up to 1600px wide)
========================================================= */
@media (max-width: 1600px) {
    /* 1. Reduce overall font sizing inside headers and rows */
    .datagrid .mud-table-head th,
    .datagrid .mud-table-body td,
    .datagrid .mud-datagrid-group td {
        font-size: 0.775rem !important; /* Drops from standard ~14px to a clean, crisp ~12px */
    }

    /* 2. Tighten horizontal and vertical cell spacing padding */
    .datagrid .mud-table-cell {
        padding: 4px 6px !important; /* Shaves off default loose empty spacing margins */
    }

    /* 3. Give the currency header grouping row breathing room without blowing out width */
    .datagrid .mud-datagrid-group .mud-stack {
        font-size: 0.75rem !important;
        gap: 8px !important;
    }
}

/* =========================================================
   TEXT TRUNCATION FUNCTIONALITY
========================================================= */
/* Prevents the ledger text from pushing numeric fields off the laptop screen edge */
.datagrid .truncate-cell {
    max-width: 220px; /* Adjust maximum visual allowance based on preference */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-center {
    text-align: center;
}

.text-start {
    text-align: left;
}

/* =========================================================
  Loader
========================================================= */
.overlay-container {
    position: relative;
}

/*.loading-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255,255,255,.65);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 32px;
    border-radius: 16px;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

*/

/* =========================================================
   FILTER CONTAINER
========================================================= */

.filters {
    background: var(--sb-surface);
    /* padding: 5px 12px;*/
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: background .2s ease;
    border-radius: 20px;
    margin-bottom: 5px;
}

    /* =========================================================
   FILTER INPUTS
========================================================= */

    .filters .mud-input-root {
        font-size: 13px !important;
        color: var(--sb-text) !important;
    }

    /* outlined border */
    .filters .mud-input-outlined .mud-input-outlined-border {
        border-color: var(--sb-border) !important;
        border-radius: 6px !important;
        transition: all .18s ease;
    }

    /* hover */
    .filters .mud-input-outlined:hover .mud-input-outlined-border {
        border-color: var(--sb-accent) !important;
    }

    /* focused */
    .filters .mud-input-outlined.mud-input-focused .mud-input-outlined-border {
        border-color: var(--sb-accent) !important;
        border-width: 1.5px !important;
    }

    /* actual input background */
    .filters .mud-select-input,
    .filters .mud-autocomplete .mud-input-slot,
    .filters .mud-input > input,
    .filters .mud-input-control {
        background: var(--sb-bg) !important;
        color: var(--sb-text) !important;
        border-radius: 6px !important;
    }

    /* labels */
    .filters .mud-input-label {
        color: var(--sb-text-muted) !important;
    }

    /* icons */
    .filters .mud-input-adornment,
    .filters .mud-select-icon {
        color: var(--sb-text-muted) !important;
    }



/* =========================================================
   TOOLBAR
========================================================= */

.ld-toolbar {
    background: var(--sb-bg);
    border: 1px solid var(--sb-border);
    border-radius: 7px;
    /*    padding: 6px 12px;*/
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    min-height: 40px;
    transition: background .2s ease, border-color .2s ease;
}

.ld-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* divider */
.ld-vdiv {
    width: 1px;
    height: 16px;
    background: var(--sb-border);
    margin: 0 8px;
    flex-shrink: 0;
}

/* toolbar label */
.ld-toolbar-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sb-text-muted);
    margin-right: 4px;
    white-space: nowrap;
}

/* =========================================================
   ACTION BUTTONS
========================================================= */

.ld-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* =========================================================
   CHECKBOX TEXT
========================================================= */

.filters .mud-checkbox-label {
    color: var(--sb-text) !important;
}

/* =========================================================
   LINKS
========================================================= */

.filters .mud-link {
    color: var(--sb-accent) !important;
}
/* =========================================================
   Dialog
========================================================= */

/* ─── Dialog Shell ─────────────────────────────────────────── */
.df-dialog .mud-dialog-title {
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.01em;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    margin-bottom: 0;
}

.df-dialog .mud-dialog-content {
    padding: 1.25rem 1.5rem;
}

.df-dialog .mud-dialog-actions {
    padding: 0;
}

/* ─── Inputs & Selects ──────────────────────────────────────── */
.df-dialog .mud-input-outlined .mud-input-outlined-border {
    border-radius: 8px !important;
}

.df-dialog .mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: #7F77DD !important;
    box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.10);
}

.df-toggle-row {
    height: 42px;
    padding: 0 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-grey);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--mud-palette-text-secondary);
}

    .df-toggle-row:hover {
        border-color: #7F77DD;
    }


/* ─── Dialog Footer ─────────────────────────────────────────── */
.df-footer {
    width: 100%;
    background: var(--mud-palette-background-grey);
    border-top: 1px solid var(--mud-palette-lines-default);
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}


/* =========================================================
   Context Menu
========================================================= */

.row-selected td {
    background-color: #c6c1f5 !important;
    color: var(--mud-palette-primary-text) !important;
    font-weight: 500;
}

.context-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
}

.modern-context-menu {
    position: fixed;
    z-index: 9999;
    min-width: 220px;
    padding: 2px;
    border-radius: 14px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 8px 28px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
    animation: ctxFade .12s ease-out;
}

.ctx-item {
    min-height: 38px !important;
    border-radius: 10px;
    margin: 2px 0;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all .15s ease;
}

    .ctx-item:hover {
        background: rgba(25,118,210,0.08);
    }

    .ctx-item .mud-list-item-icon {
        min-width: 34px;
        color: #6b7280;
    }

.delete-item {
    color: #e53935 !important;
}

    .delete-item .mud-list-item-icon {
        color: #e53935 !important;
    }

@keyframes ctxFade {
    from {
        opacity: 0;
        transform: scale(.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


.id-header .column-header {
    justify-content: center !important;
}


.filter-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all .18s ease;
}

.filter-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
    padding: 3px 8px;
    border-radius: 8px;
}

.filter-link:hover .filter-wrapper {
    background: rgba(0,0,0,0.04);
}

.filter-icon {
    font-size: 16px !important;
}

.filter-active {
    color: #f59e0b !important;
    font-weight: 600;
}

.filter-badge {
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-left: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}