/* ============================================================
   app.css — Fluent UI Blazor Shell
   ============================================================ */

/* ── Inter variable font (self-hosted, works offline) ────────
   Weights 100–900 from a single variable font file.
   Fallback: Segoe UI (Windows) → system-ui → sans-serif.      */
@font-face {
    font-family: 'Inter';
    src: url('/_content/Basis.Shared/fonts/InterVariable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/_content/Basis.Shared/fonts/InterVariable-Italic.woff2') format('woff2');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* Box-sizing reset — tanpa ini FluentDataGrid mengkalkulasi
   lebar/tinggi cell dengan salah (padding dihitung di luar width).
   Ini juga kenapa header checkbox SelectColumn bisa tampil tidak sejajar. */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --body-font: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
    --type-ramp-base-font-size: 14px;

    /* ── LIGHT MODE: Surface hierarchy ──────────────────────────
       Canvas (body)  < Chrome (header/sidebar/footer) = Cards
       Cards appear elevated because they are white on a grey canvas. */
    --neutral-layer-1:          #f4f5f8;  /* body canvas — slightly blue-grey */
    --neutral-layer-2:          #ffffff;  /* chrome — header, sidebar, footer */
    --neutral-fill-layer-rest:  #ffffff;  /* card surfaces — fluent-card, filter */
    --neutral-layer-floating:   #ffffff;  /* stat-card, dropdowns, popovers */
    --neutral-layer-card-container: #ffffff; /* sticky table cells inside cards */

    /* ── LIGHT MODE: Input fills ── */
    --neutral-fill-input-rest:   #ffffff;
    --neutral-fill-input-hover:  #f9f9fb;
    --neutral-fill-input-active: #f3f4f8;
    --neutral-fill-input-focus:  #ffffff;

    /* ── LIGHT MODE: Control fills (buttons, rows, stealth) ── */
    --neutral-fill-rest:          #f3f4f8;
    --neutral-fill-hover:         #eaecf2;
    --neutral-fill-active:        #e2e4ec;
    --neutral-fill-focus:         #f3f4f8;
    --neutral-fill-stealth-hover: #eaecf2;

    /* ── LIGHT MODE: Strokes ── */
    --neutral-stroke-rest:          #d2d3dc;
    --neutral-stroke-divider-rest:  #e6e7ef;

    /* ── LIGHT MODE: Foreground ── */
    --neutral-foreground-rest: #1a1a28;
    --neutral-foreground-hint: #66667a;
}

/* ============================================================
   DARK MODE — CSS variable overrides
   Surface hierarchy: Canvas < Chrome < Cards < Stat-card/Float
   Higher elevation = slightly lighter background.
   ============================================================ */
[data-theme="dark"] {
    /* ── Surfaces — pure neutral grey, no colour tint ── */
    --neutral-layer-1: #141414; /* body canvas — near-black */
    --neutral-layer-2: #1c1c1c; /* chrome — header, sidebar, footer */
    --neutral-fill-layer-rest: #212121; /* card surfaces */
    --neutral-layer-floating: #292929; /* stat-card, dropdowns, popovers */
    --neutral-layer-card-container: #212121; /* sticky cells match card bg */
    /* ── Input fills ── */
    --neutral-fill-input-rest: #1e1e1e;
    --neutral-fill-input-hover: #232323;
    --neutral-fill-input-active: #282828;
    --neutral-fill-input-focus: #1e1e1e;
    /* ── Control fills ── */
    --neutral-fill-rest: #212121;
    --neutral-fill-hover: #272727;
    --neutral-fill-active: #2e2e2e;
    --neutral-fill-focus: #212121;
    --neutral-fill-stealth-hover: #272727;
    --neutral-fill-stealth-rest: transparent;
    /* ── Strokes ── */
    --neutral-stroke-rest: #333333;
    --neutral-stroke-input-rest: #333333;
    --neutral-stroke-divider-rest: #2a2a2a;
    --rpt-row-rule: #363636;
    /* ── Foreground ── */
    --neutral-foreground-rest: #e0e0e0;
    --neutral-foreground-hint: #888888;
}

/* ::part() fallback — override shadow DOM inputs to match token */
[data-theme="dark"] fluent-text-field::part(control),
[data-theme="dark"] fluent-number-field::part(control),
[data-theme="dark"] fluent-text-area::part(control),
[data-theme="dark"] fluent-combobox::part(control),
[data-theme="dark"] fluent-autocomplete::part(control),
[data-theme="dark"] fluent-select::part(control),
[data-theme="dark"] fluent-date-picker::part(control),
[data-theme="dark"] fluent-time-picker::part(control),
[data-theme="dark"] fluent-search::part(control) {
    background-color: var(--neutral-fill-input-rest) !important;
}

fluent-text-field::part(control)::placeholder,
fluent-number-field::part(control)::placeholder,
fluent-text-area::part(control)::placeholder,
fluent-combobox::part(control)::placeholder,
fluent-autocomplete::part(control)::placeholder,
fluent-search::part(control)::placeholder {
    color: rgba(0, 0, 0, 0.32);
    opacity: 1;
}

[data-theme="dark"] fluent-text-field::part(control)::placeholder,
[data-theme="dark"] fluent-number-field::part(control)::placeholder,
[data-theme="dark"] fluent-text-area::part(control)::placeholder,
[data-theme="dark"] fluent-combobox::part(control)::placeholder,
[data-theme="dark"] fluent-autocomplete::part(control)::placeholder,
[data-theme="dark"] fluent-search::part(control)::placeholder {
    color: rgba(255, 255, 255, 0.28);
    opacity: 1;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: var(--body-font);
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    color: var(--neutral-foreground-rest);
    background: var(--neutral-layer-1);
    /* Font rendering — match tabler.io softness */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-optical-sizing: auto;
    /* Inter OpenType features: humanist letterforms (cv01=I, cv03=6/9, cv04=a) */
    font-feature-settings: "cv01","cv03","cv04";
}


/* ----------------------------------------------------------
   SHELL — overflow:hidden di sini tidak masalah karena
   FluentProfileMenu me-render popover via portal ke <body>,
   bukan di dalam .app-shell.
   ---------------------------------------------------------- */
.app-shell {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
}

/* ----------------------------------------------------------
   HEADER
   ---------------------------------------------------------- */
.app-header {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0 12px !important;
    height: 48px !important;
    background-color: var(--neutral-layer-2) !important;
    border-bottom: 1px solid var(--neutral-stroke-rest) !important;
    overflow: visible !important;
    z-index: 200;
}

.header-gutters {
    margin: 0px !important;
}

.hdr-left {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.hdr-center {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.hdr-right {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
    overflow: visible;
}

/* Brand */
.app-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    color: var(--neutral-foreground-rest) !important;
    border-radius: var(--corner-radius-medium, 4px);
    transition: background 120ms ease;
    white-space: nowrap;
}

    .app-brand:hover {
        background: var(--neutral-fill-stealth-hover);
        text-decoration: none !important;
    }

.brand-icon {
    color: var(--accent-fill-rest) !important;
    flex-shrink: 0;
}

/* Buttons di header dan sidebar-header: transparent saat normal,
   background hanya muncul saat hover — override FAST stealth token */
.app-header,
.bsp-header,
.sidebar-header {
    --neutral-fill-stealth-rest: transparent;
    --neutral-fill-stealth-active: var(--neutral-fill-stealth-hover);
}

.brand-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--neutral-foreground-rest);
}

.brand-sub {
    font-size: 10px;
    font-weight: 400;
    color: var(--neutral-foreground-hint);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hdr-search {
    border-radius: 999px !important;
    /* Override Fluent fill tokens so the search box inherits header color */
    --neutral-fill-rest:        var(--neutral-layer-2) !important;
    --neutral-fill-hover:       var(--neutral-layer-2) !important;
    --neutral-fill-active:      var(--neutral-layer-2) !important;
    --neutral-fill-focus:       var(--neutral-layer-2) !important;
    --neutral-fill-input-rest:  var(--neutral-layer-2) !important;
    --neutral-fill-input-hover: var(--neutral-layer-2) !important;
    --neutral-fill-input-active:var(--neutral-layer-2) !important;
    --neutral-fill-input-focus: var(--neutral-layer-2) !important;
}

    .hdr-search::part(root) {
        background-color: var(--neutral-layer-2) !important;
    }

.hdr-search::part(control),
.hdr-search::part(start),
.hdr-search::part(end) {
    background-color: var(--neutral-layer-2) !important;
}

.hdr-divider {
    height: 22px !important;
    margin: 0 2px !important;
}


/* ----------------------------------------------------------
   BODY ROW
   ---------------------------------------------------------- */
.app-body-row {
    display: flex;
    flex-direction: row;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* ----------------------------------------------------------
   SIDEBAR & NAV MENU
   ---------------------------------------------------------- */
.app-sidebar {
    flex-shrink: 0;
    border-right: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest) !important;
    background: var(--neutral-layer-2);
    overflow: hidden;
    z-index: 50;
    display: flex;
    flex-direction: column;
    will-change: width;
    transition: width 200ms cubic-bezier(.4, 0, .2, 1);
}

.sidebar-title-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1; /* Mengisi ruang yang tersisa */
    min-width: 0; /* Mencegah overflow */
    padding-left: inherit;
}

.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--accent-fill-rest); /* Warna ikon senada dengan teks */
    flex-shrink: 0; /* Ikon tidak mengecil */
    margin-left: 4px;
}

.sidebar-title {
    margin: 0px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-fill-rest);
    white-space: nowrap; /* Mencegah teks turun ke bawah */
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-navmenu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--neutral-stroke-rest) transparent;
    overscroll-behavior: none;
    
}

fluent-nav-group::part(heading) {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .65px !important;
    color: var(--neutral-foreground-hint) !important;
    padding: 10px 10px 2px !important;
}

fluent-nav-link::part(content) {
    padding: 4px 10px !important;
    margin: 1px 4px !important;
    min-height: 30px !important;
    border-radius: var(--corner-radius-medium, 4px) !important;
    font-size: 14px !important;
    gap: 8px !important;
    transition: background 120ms ease, color 120ms ease !important;
    color: var(--neutral-foreground-rest) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

fluent-nav-link:hover::part(content) {
    background: var(--neutral-fill-stealth-hover) !important;
}

fluent-nav-link[aria-current="page"]::part(content) {
    background: var(--accent-fill-rest) !important;
    color: var(--foreground-on-accent-rest) !important;
    font-weight: 600 !important;
}

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */
@media (min-width: 768px) {
    .app-sidebar {
        position: static;
    }

    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: flex !important;
    }
}

@media (max-width: 767px) {
    .app-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 0 !important;
        border-right: none;
        box-shadow: none;
        transition: width 260ms cubic-bezier(.4, 0, .2, 1), box-shadow 260ms ease;
    }

        .app-sidebar.mobile-open {
            width: 280px !important;
            box-shadow: 4px 0 20px rgba(0, 0, 0, .28);
        }

    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    .hdr-search {
        width: 140px !important;
    }

    .brand-sub {
        display: none !important;
    }

}

.mobile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 49;
    animation: fadeOverlay 200ms ease forwards;
}

@keyframes fadeOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ----------------------------------------------------------
   MAIN CONTENT
   ---------------------------------------------------------- */
fluent-body-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.app-content {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: auto !important;
    padding: 0 !important; /* remove padding from scroll container */
    overscroll-behavior: none;
}

/* Preview pages (doc-preview-wrap present): suppress outer scroll so only
   doc-preview-wrap scrolls — prevents double scrollbar on document previews */
.app-content:has(.doc-preview-wrap) {
    overflow: hidden !important;
}

.app-content-inner {
    display: flex !important;
    flex-direction: column !important;
    /* Normal pages: grow with content so app-content can scroll */
    min-height: 100% !important;
    padding: 24px;
}

/* Preview pages: fixed height so doc-preview-wrap fills remaining space.
   No overflow:hidden here — that would clip inv-bar's negative margin
   and break position:sticky. app-content handles outer clipping. */
.app-content-inner:has(.doc-preview-wrap) {
    height: 100% !important;
    min-height: 0 !important;
}


/* ==========================================================
   CONSISTENT SCROLLBAR
   ========================================================== */

.app-navmenu,
.app-content,
.body-content {
    scrollbar-width: thin;
    scrollbar-color: var(--neutral-stroke-rest) transparent;
    scroll-behavior: smooth;
    will-change: scroll-position;
}

    .app-navmenu::-webkit-scrollbar,
    .app-content::-webkit-scrollbar,
    .body-content::-webkit-scrollbar {
        width: 4px;
    }

    .app-navmenu::-webkit-scrollbar-thumb,
    .app-content::-webkit-scrollbar-thumb,
    .body-content::-webkit-scrollbar-thumb {
        background: var(--neutral-stroke-rest);
        border-radius: 999px;
    }

        .app-navmenu::-webkit-scrollbar-thumb:hover,
        .app-content::-webkit-scrollbar-thumb:hover,
        .body-content::-webkit-scrollbar-thumb:hover {
            background: var(--neutral-foreground-hint);
        }

/* ----------------------------------------------------------
   FOOTER
   ---------------------------------------------------------- */
.app-footer {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    color: var(--neutral-foreground-hint) !important;
    border-top: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest) !important;
    background: var(--neutral-layer-2) !important;
}

.footer-version {
    font-size: 0.75rem;
    opacity: 0.55;
    letter-spacing: 0.02em;
}

.footer-licensee {
    font-size: 0.75rem;
    opacity: 0.7;
    font-style: italic;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* ----------------------------------------------------------
   PAGE HELPERS
   ---------------------------------------------------------- */
.page-header {
    margin-bottom: 20px;
}

/* Mobile: hide label text and collapse button to icon-only size */
@media (max-width: 640px) {
    .hdr-btn .btn-label {
        display: none;
    }
    .hdr-btn::part(content) {
        display: none;
    }
    .hdr-btn::part(control) {
        padding-inline: 0;
        min-width: 32px;
        justify-content: center;
    }
    .hdr-btn::part(start) {
        margin-inline-end: 0;
    }
}

/* Mobile: wrap page-header title + action button to avoid overflow */
@media (max-width: 480px) {
    .page-header .d-flex {
        flex-wrap: wrap;
        gap: 8px;
    }
    /* Push button (single) or button-group wrapper (multi) to the right */
    .page-header .d-flex > :last-child {
        margin-left: auto;
    }
    /* When last child is a div wrapper containing multiple buttons, right-align them */
    .page-header .d-flex > div:last-child {
        justify-content: flex-end;
    }
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 3px;
    line-height: 1.2;
    color: var(--neutral-foreground-rest);
}

.page-subtitle {
    font-size: 14px;
    margin: 0;
    color: var(--neutral-foreground-hint);
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--neutral-foreground-hint);
    margin-bottom: 6px;
}

    .page-breadcrumb a {
        color: var(--accent-foreground-rest);
    }

/* Inline CSS spinner — used where FluentProgressRing is unreliable (MAUI WebView) */
@keyframes spin { to { transform: rotate(360deg); } }
.spin-ring {
    display: inline-block;
    width: 13px; height: 13px;
    border: 2px solid var(--accent-fill-rest);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

.bc-link {
    color: var(--accent-foreground-rest);
    text-decoration: none;
    font-weight: 500;
}

.bc-link:hover {
    text-decoration: underline;
    color: var(--accent-foreground-hover);
}

/* ----------------------------------------------------------
   CARDS
 * fluent-card (FAST web component) has overflow:hidden in its shadow :host
 * which clips absolutely-positioned overlays (FluentSelect listbox, etc.).
 * External CSS overrides shadow :host styles per CSS cascade spec, so this
 * restores overflow:visible so dropdowns can escape the card boundary.
 */
fluent-card {
    overflow: visible;
}

.fluent-card {
    background-color: var(--neutral-fill-layer-rest);
    border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
    border-radius: var(--corner-radius-large, 8px);
    padding: 12px 20px;
    /*box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);*/
    /*transition: box-shadow 180ms ease;*/
}

    .fluent-card:hover {
        box-shadow: var(--elevation-shadow-card-hover);
    }

.fluent-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
}

.fluent-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--neutral-foreground-rest);
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--neutral-layer-floating);
    border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
    border-radius: var(--corner-radius-large, 8px);
    padding: 16px 20px;
    /*box-shadow: var(--elevation-shadow-card-rest);*/
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    overflow: hidden;
    /*transition: box-shadow 180ms ease, transform 120ms ease;*/
}

    .stat-card:hover {
        box-shadow: var(--elevation-shadow-card-hover);
        transform: translateY(-1px);
    }

    .stat-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--accent-fill-rest);
        border-radius: var(--corner-radius-large, 8px) var(--corner-radius-large, 8px) 0 0;
    }

.stat-card-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--neutral-foreground-hint);
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-card-value {
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: var(--neutral-foreground-rest);
    margin-left: 20px;
}
    .stat-card-value.text-amount {
        font-size: 15px;
        letter-spacing: -0.03em;
    }


.stat-card-sub {
    font-size: 11px;
    color: var(--neutral-foreground-hint);
}

.stat-card-trend {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: 20px;
}

    .stat-card-trend.positive {
        color: var(--colorPaletteGreenForeground1, #54a854);
    }

    .stat-card-trend.negative {
        color: var(--colorPaletteRedForeground1, #e5524a);
    }

/* ----------------------------------------------------------
   GRID
   ---------------------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.grid-2 > *, .grid-3 > *, .grid-4 > *, .grid-5 > *, .grid-auto > * {
    min-width: 0;
}

/* ── Bootstrap-style grid (12 columns) ────────────────────────────── */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -6px;
    margin-right: -6px;
    align-items: flex-end;
}

.row > [class^="col"] {
    padding-left: 6px;
    padding-right: 6px;
    min-width: 0;
    box-sizing: border-box;
}

.col-1  { flex: 0 0 8.333%;  max-width: 8.333%;  }
.col-2  { flex: 0 0 16.667%; max-width: 16.667%; }
.col-3  { flex: 0 0 25%;     max-width: 25%;     }
.col-4  { flex: 0 0 33.333%; max-width: 33.333%; }
.col-5  { flex: 0 0 41.667%; max-width: 41.667%; }
.col-6  { flex: 0 0 50%;     max-width: 50%;     }
.col-7  { flex: 0 0 58.333%; max-width: 58.333%; }
.col-8  { flex: 0 0 66.667%; max-width: 66.667%; }
.col-9  { flex: 0 0 75%;     max-width: 75%;     }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-11 { flex: 0 0 91.667%; max-width: 91.667%; }
.col-12 { flex: 0 0 100%;    max-width: 100%;    }

/* md breakpoint ≥ 768px */
@media (min-width: 768px) {
    .col-md-1  { flex: 0 0 8.333%;  max-width: 8.333%;  }
    .col-md-2  { flex: 0 0 16.667%; max-width: 16.667%; }
    .col-md-3  { flex: 0 0 25%;     max-width: 25%;     }
    .col-md-4  { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-5  { flex: 0 0 41.667%; max-width: 41.667%; }
    .col-md-6  { flex: 0 0 50%;     max-width: 50%;     }
    .col-md-8  { flex: 0 0 66.667%; max-width: 66.667%; }
    .col-md-9  { flex: 0 0 75%;     max-width: 75%;     }
    .col-md-10 { flex: 0 0 83.333%; max-width: 83.333%; }
    .col-md-12 { flex: 0 0 100%;    max-width: 100%;    }
}

/* lg breakpoint ≥ 1024px */
@media (min-width: 1024px) {
    .col-lg-1  { flex: 0 0 8.333%;  max-width: 8.333%;  }
    .col-lg-2  { flex: 0 0 16.667%; max-width: 16.667%; }
    .col-lg-3  { flex: 0 0 25%;     max-width: 25%;     }
    .col-lg-4  { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-lg-5  { flex: 0 0 41.667%; max-width: 41.667%; }
    .col-lg-6  { flex: 0 0 50%;     max-width: 50%;     }
    .col-lg-8  { flex: 0 0 66.667%; max-width: 66.667%; }
    .col-lg-9  { flex: 0 0 75%;     max-width: 75%;     }
    .col-lg-10 { flex: 0 0 83.333%; max-width: 83.333%; }
    .col-lg-12 { flex: 0 0 100%;    max-width: 100%;    }
}

/* ── Report filter bar — 12-col grid, setiap input=span 2, setiap tombol=span 1 ── */
.report-filters {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: end;
    gap: 8px;
}

/* Setiap input control menggunakan 2 kolom */
.report-filters > *:not(.filter-actions) {
    grid-column: span 2;
}

/* filter-actions: 2 tombol × 1 kolom = 2 kolom, tombol tidak stretch */
.report-filters > .filter-actions {
    grid-column: span 2;
    display: flex;
    gap: 6px;
    align-items: flex-end;
}

@media (max-width: 900px) {
    .report-filters > *:not(.filter-actions) {
        grid-column: span 4;
    }
    .report-filters > .filter-actions {
        grid-column: span 4;
    }
}

@media (max-width: 540px) {
    .report-filters > *:not(.filter-actions) {
        grid-column: span 12;
    }
    .report-filters > .filter-actions {
        grid-column: span 12;
    }
}

@media (max-width: 1200px) {
    .grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-4, .grid-3, .grid-2, .grid-5 {
        grid-template-columns: 1fr;
    }

    .hdr-center {
        display: none;
    }
}

/* ----------------------------------------------------------
   QUICK ACTIONS
   ---------------------------------------------------------- */
.qa-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 640px) {
    .qa-actions {
        grid-template-columns: 1fr;
    }
}

.qa-actions fluent-button {
    width: 100%;
}

/* ----------------------------------------------------------
   UTILITIES
   ---------------------------------------------------------- */
.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mt-5 {
    margin-top: 24px;
}

.mt-6 {
    margin-top: 32px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-5 {
    margin-bottom: 24px;
}

.mb-6 {
    margin-bottom: 32px;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.text-muted {
    color: var(--neutral-foreground-hint);
}

.text-accent {
    color: var(--accent-foreground-rest);
}

.text-success {
    color: var(--colorPaletteGreenForeground1, #107c10);
}

.text-warning {
    color: var(--colorPaletteYellowForeground1, #c57a00);
}

.text-warn {
    color: var(--colorPaletteYellowForeground1, #c57a00);
}

.text-error {
    color: var(--colorPaletteRedForeground1, #d13438);
}

.dt .dt-subtotal-row td,
.dt-sm .dt-subtotal-row td {
    border-top: 2px solid var(--neutral-stroke-rest);
    background: var(--neutral-fill-subtle);
    font-weight: 600;
    padding: 8px 10px;
}

.stat-card-danger { border-color: var(--colorPaletteRedBorder1, #d13438); }

/* Stock movement card header */
.rpt-card-meta  { font-size: 13px; color: var(--neutral-foreground-hint); }


/* ----------------------------------------------------------
   ERROR UI
   ---------------------------------------------------------- */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--colorPaletteRedBackground1, #fde7e9);
    border: 1px solid var(--colorPaletteRedBorder1, #fca5a5);
    color: var(--colorPaletteRedForeground1, #991b1b);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
    z-index: 9999;
    max-width: 480px;
    width: 90%;
    text-align: center;
}

/* ----------------------------------------------------------
   PATCH Fluent Ui Component
   ---------------------------------------------------------- */
.fluent-messagebar {
    width: unset !important;
}

fluent-message-bar {
    width: unset !important;
}

.fluent-popover-content {
    width: unset !important;
}

.stack-horizontal {
    width: unset !important;
}

.fluent-card-minimal-style {
    width: unset !important;
    box-shadow: unset !important;
}

fluent-select {
    min-width: 160px !important;
}

/* ----------------------------------------------------------
   MAUI SAFE AREA
   ---------------------------------------------------------- */
@supports (padding: env(safe-area-inset-top)) {
    .app-header {
        padding-top: env(safe-area-inset-top) !important;
        height: calc(48px + env(safe-area-inset-top)) !important;
    }
}
/* ==========================================================
   NOT FOUND PAGE
   ========================================================== */

.notfound-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.notfound-card {
    text-align: center;
    padding: 40px 50px;
    max-width: 420px;
    background: var(--neutral-layer-floating);
    border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
    border-radius: var(--corner-radius-large, 8px);
    box-shadow: var(--elevation-shadow-card-rest);
}

.notfound-icon {
    color: var(--accent-fill-rest);
    margin-bottom: 12px;
}

.notfound-title {
    font-size: 56px;
    margin: 0;
}

.notfound-text {
    margin-top: 24px;
    color: var(--neutral-foreground-hint);
}


/* ==========================================================
   DATA ENTRY TABLE — inline form tables (GL, Inventory, etc.)
   ========================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    /* no font-size here — inherit 14px from html/body */
}

    .data-table th {
        padding: 6px 8px;
        font-size: 13px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: var(--neutral-foreground-hint);
        border-bottom: 2px solid var(--neutral-stroke-rest);
        text-align: start;
        white-space: nowrap;
    }

        .data-table th.text-right {
            text-align: end;
        }

        .data-table th.text-center {
            text-align: center;
        }

    .data-table td {
        padding: 4px 8px;
        border-bottom: 1px solid var(--neutral-stroke-rest);
        vertical-align: middle;
    }

        .data-table td.code-col {
            font-size: 13px;
            font-weight: 500;
            color: var(--neutral-foreground-rest);
        }

        .data-table td.text-right {
            text-align: end;
        }

        .data-table td.text-center {
            text-align: center;
        }

        .data-table td.fw-600 {
            font-weight: 600;
        }

        .data-table td.muted {
            color: var(--neutral-foreground-hint);
        }

    .data-table tfoot td {
        border-top: 2px solid var(--neutral-stroke-rest);
        border-bottom: none;
        font-weight: 600;
        padding: 5px 8px;
    }

    /* Sticky first two columns for wide tables */
    .data-table td.sticky-0,
    .data-table th.sticky-0 {
        position: sticky;
        left: 0;
        z-index: 1;
        background: var(--neutral-layer-card-container);
    }

    .data-table td.sticky-1,
    .data-table th.sticky-1 {
        position: sticky;
        left: 88px;
        z-index: 1;
        background: var(--neutral-layer-card-container);
    }

    /* Stock highlight */
    .data-table td.cell-has-value {
        background: rgba(0, 128, 0, 0.05);
    }

    .data-table tr.row-has-stock {
        background: rgba(0, 128, 0, 0.03);
    }

/* ==========================================================
   FORM INPUT LABEL — softer color untuk dark mode
   ==========================================================
   Masalah: label bawaan Fluent UI pakai --neutral-foreground-rest
   yang di dark mode = putih penuh (#fff), terlalu kontras.

   Solusi: override via ::part(label) — ini cara resmi Fluent UI
   untuk styling internal shadow DOM element.

   Token yang dipakai: --neutral-foreground-hint
   - Light mode: abu gelap (~#605e5c) — cukup terbaca, tidak dominan
   - Dark mode : abu terang (~#a19f9d) — soft, tidak silau

   Komponen yang di-cover:
   fluent-text-field, fluent-text-area, fluent-number-field,
   fluent-select, fluent-combobox, fluent-date-picker,
   fluent-time-picker, fluent-autocomplete
   ========================================================== */
fluent-text-field::part(label),
fluent-text-area::part(label),
fluent-number-field::part(label),
fluent-select::part(label),
fluent-combobox::part(label),
fluent-date-picker::part(label),
fluent-time-picker::part(label),
fluent-autocomplete::part(label) {
    color: var(--neutral-foreground-hint) !important;
    font-size: 13px;
    font-weight: 500;
}

/* Hide profile name/role text on mobile, show only avatar */

.user-profile-menu {
    background: transparent;
    --fluent-profile-menu-hover: var(--neutral-fill-stealth-hover);
    padding: 2px 6px;
}

@media (max-width: 600px) {
    .profile-text {
        display: none !important;
    }
}

/* ----------------------------------------------------------
   SELECT-BUSINESS / OWNER PORTAL PAGE
   ---------------------------------------------------------- */
.bsp-header {
    height: 48px;
    background: var(--neutral-layer-2);
    border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
    padding: 0 clamp(12px, 4vw, 28px);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    z-index: 10;
}

.bsp-owner-badge {
    background: var(--accent-fill-rest);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.bsp-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding: clamp(12px, 4vw, 28px);
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.bsp-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.bsp-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.bsp-grant-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

    .bsp-grant-row > div {
        flex: 1;
        min-width: 150px;
    }

.bsp-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bsp-user-info {
    flex: 1;
    min-width: 120px;
}

.bsp-user-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}


/* ================================================================
   SIDEBAR HEADER
   ================================================================ */
.sidebar-header {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    padding: 0 6px;
    box-sizing: border-box;
    gap: 6px;
    flex-shrink: 0;
    overflow: hidden;
    border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

/* ── Nav menu — collapsed state ──────────────────────────────────
   Component sets width:40px inline; sidebar is 56px → stretch it.
   Then centre each icon row.
   ---------------------------------------------------------------- */
.sidebar-collapsed .app-navmenu {
    width: 100% !important;
    min-width: 0 !important;
}

/* The anchor / div wrapping each row */
.sidebar-collapsed .fluent-nav-link {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
}

/* The inner layout containers */
.sidebar-collapsed .positioning-region,
.sidebar-collapsed .content-region {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    gap: 0 !important;
    width: 100% !important;
    margin-inline-start: unset !important;
}

    .sidebar-collapsed .positioning-region::before {
        content: unset !important;
    }

.fluent-nav-item .positioning-region:not(:hover) {
    background: unset !important;
}

/* Hide text labels and expand arrows when collapsed */
.sidebar-collapsed .fluent-nav-text,
.sidebar-collapsed .expand-collapse-button,
.sidebar-collapsed .rotate {
    display: none !important;
}

/* Give the icon a comfortable tap target */
.sidebar-collapsed .fluent-nav-icon {
    margin: 0 !important;
}


/* ================================================================
   SIDEBAR PROFILE FOOTER (bottom of sidebar, Claude-style)
   ================================================================ */

.sidebar-profile-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Trigger button — collapsed: avatar centred */
.sidebar-profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
    cursor: pointer;
    min-height: 52px;
    transition: background 140ms ease;
    -webkit-user-select: none;
    user-select: none;
    outline: none;
}

    .sidebar-profile-btn:hover {
        background: var(--neutral-fill-stealth-hover);
    }

    .sidebar-profile-btn:focus-visible {
        outline: 2px solid var(--accent-fill-rest);
        outline-offset: -2px;
        border-radius: 4px;
    }

    /* Expanded state */
    .sidebar-profile-btn.is-expanded {
        justify-content: flex-start;
        padding-left: 12px;
        padding-right: 12px;
    }

/* Avatar circle */
.sidebar-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--accent-fill-rest);
    color: var(--foreground-on-accent-rest);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.sidebar-avatar-lg {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 16px;
}

.sidebar-profile-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-profile-email {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Popover */

fluent-anchored-region {
    border-radius: calc(var(--control-corner-radius) * 1px);
    /* Tanpa overflow:hidden di sini — supaya shadow tidak terpotong */
    /*margin-left: 10px;*/
    /* Shadow agar popup terlihat di atas content, pakai token Fluent */
    box-shadow: var(--elevation-shadow-flyout);
    /* Fallback manual kalau token belum terdefinisi oleh FluentDesignTheme */
    /*filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.14)) drop-shadow(0 1px 4px rgba(0, 0, 0, 0.08));*/
}

    fluent-anchored-region > div {
        border-radius: calc(var(--control-corner-radius) * 1px);
        overflow: hidden;
        box-shadow: var(--elevation-shadow-flyout);
        margin: 0px !important;
        padding: 4px;
    }

fluent-option {
    border: none !important;
}

.fluent-autocomplete-multiselect {
    --neutral-fill-div-hover: transparent;
}


/* Popover items */
.spop-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.spop-info {
    flex: 1;
    min-width: 0;
    line-height: normal;
}

.spop-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
}

.spop-email {
    display: block;
    font-size: 13px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spop-biz {
    display: block;
    font-size: 13px;
    color: var(--neutral-foreground-rest);
    margin-top: 2px;
}

.spop-item {
    width: 100% !important;
    margin-bottom: 6px;
}

    .spop-item::part(control) {
        justify-content: flex-start !important;
        width: 100% !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        min-height: 34px !important;
    }

.spop-danger::part(control) {
    color: var(--error-foreground, #d13438) !important;
}

/*========================================*/
.fo-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--neutral-foreground-hint);
    margin-bottom: 4px;
}

/* ============================================================
   ELEVATION FIX — popup, dialog, tooltip
   Menggunakan token --elevation-shadow-* bawaan Fluent UI.
   Token ini sudah di-set dengan benar oleh FluentDesignTheme
   untuk light maupun dark mode, tanpa perlu override warna.
   ============================================================ */

/* Dialog */
fluent-dialog::part(control) {
    box-shadow: var(--elevation-shadow-dialog) !important;
    max-width: calc(100vw - 32px) !important;
    max-height: 90vh !important;
    overflow: visible !important;
}

/* Dialog body scroll — tambahkan class ini ke wrapper konten panjang di dalam dialog */
.dialog-scrollable-body {
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

fluent-dialog::part(positioning-region) {
    padding: 0 16px;
    box-sizing: border-box;
}

/* Batasi tinggi dropdown FluentSelect — tampilkan 6-8 item, sisanya scroll */
fluent-select::part(listbox) {
    max-height: 224px;
    overflow-y: auto;
    padding: calc((var(--design-unit) - var(--stroke-width)) * 2px);
}

/* Browser autofill — override warna kuning/biru bawaan browser.
   Input Fluent UI ada di shadow DOM, jadi harus pakai ::part(control). */
fluent-text-field::part(control):-webkit-autofill,
fluent-text-field::part(control):-webkit-autofill:hover,
fluent-text-field::part(control):-webkit-autofill:focus,
fluent-text-field::part(control):-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--neutral-fill-input-rest) inset !important;
    -webkit-text-fill-color: var(--neutral-foreground-rest) !important;
    caret-color: var(--neutral-foreground-rest);
    transition: background-color 9999s ease-in-out 0s;
}

/* Popover (FluentPopover, FluentProfileMenu, dsb) */
fluent-popover::part(popup) {
    box-shadow: var(--elevation-shadow-flyout) !important;
    border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest) !important;
}

/* Tooltip */
fluent-tooltip::part(tooltip) {
    box-shadow: var(--elevation-shadow-tooltip) !important;
}



fluent-number-field::part(control) {
    text-align: end; /* angka jadi rata kanan */
}

.tx-lines-wrap {
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--neutral-stroke-rest) transparent;
    scroll-behavior: smooth;
}

.tx-lines-wrap::-webkit-scrollbar { width: 4px; }
.tx-lines-wrap::-webkit-scrollbar-thumb { background: var(--neutral-stroke-rest); border-radius: 999px; }

/* ── Form line table column widths (used with dt-line) ───── */
.col-drag {
    width: 20px;
    padding: 0 4px !important;
    cursor: grab;
}

.drag-handle {
    display: inline-block;
    font-size: 1rem;
    color: var(--neutral-foreground-hint);
    cursor: grab;
    line-height: 1;
    opacity: 0.4;
    transition: opacity 120ms ease;
    -webkit-user-select: none;
    user-select: none;
}

.dt-line-row:hover .drag-handle {
    opacity: 1;
}

.dt-line-row.drag-over {
    outline: 2px solid var(--accent-fill-rest);
    outline-offset: -2px;
    background: var(--accent-fill-rest);
    opacity: 0.08;
}

.col-num {
    width: 28px;
    color: var(--neutral-foreground-hint);
    font-size: 0.75rem;
}

.col-code {
    width: 72px;
}

.col-item {
    min-width: 200px;
}

.col-loc {
    min-width: 90px;
}

.col-num-r {
    min-width: 80px;
    text-align: end;
}

.col-tax {
    min-width: 110px;
}

.col-wht {
    min-width: 110px;
    color: var(--neutral-foreground-hint);
}

.col-total {
    min-width: 90px;
    text-align: end;
}

/* ──────────────────────────────────────────────────────────
   PDF VIEWER TOOLBAR - Mobile responsive zoom controls
   ────────────────────────────────────────────────────────── */
.inv-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 640px) {
    .inv-zoom-controls {
        gap: 4px !important;
    }
    .inv-zoom-controls input[type="range"] {
        width: 60px !important;
        min-width: 50px !important;
    }
    .inv-zoom-controls label {
        display: none;
    }
}

.col-actions {
    width: 100px;
    white-space: nowrap;
}


.col-title-text {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    font-weight: 500;
    /*font-size: var(--type-ramp-minus-1-font-size) !important;*/
    color: var(--neutral-foreground-hint);
}


/* Danger item in FluentMenu */
.menu-item-danger::part(content) {
    color: var(--colorPaletteRedForeground1);
}


/* ── Sticky save footer ─────────────────────────────────────── */
.save-footer {
    position: sticky;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 8px;
    background: var(--neutral-layer-floating);
    border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
    border-radius: var(--layer-corner-radius-large, 6px);
    box-shadow: 0 -4px 8px rgba(0,0,0,.08);
}

.save-footer-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    min-width: 0;
    flex: 1;
}

.save-footer-divider {
    color: var(--neutral-foreground-hint);
}

.save-footer-total {
    text-align: end;
    font-size: 1.25rem;
    color: var(--accent-fill-rest);
}

@media (max-width: 479px) {
    .save-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

        .save-footer > div:last-child {
            display: flex;
            gap: 8px;
        }

            .save-footer > div:last-child fluent-button {
                flex: 1;
            }
}

/* ── Receipt Note — progress row (mobile card) ──────────── */
.rn-progress-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 8px;
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--neutral-fill-stealth-rest);
    border-radius: var(--corner-radius-medium, 4px);
    border: 1px solid var(--neutral-stroke-rest);
    font-size: 0.875rem;
}

.rn-progress-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .rn-progress-cell .lc-label {
        font-size: 0.75rem;
    }

/* ── Payment / Receipt — grand total + summary strip ────── */

/* Grand total */
.pv-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 2px solid var(--neutral-stroke-rest);
    font-size: 1rem;
}

/* Summary strip */
.pv-summary-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.pv-summary-amount {
    margin-inline-start: auto;
    font-weight: 700;
    font-size: 1rem;
    text-align: end;
}

/* ── Journal Entry — totals row ──────────────────────────── */
.je-totals-row {
    display: flex;
    justify-content: flex-end;
    gap: 32px;
    padding: 10px 0 0;
    margin-top: 4px;
    border-top: 2px solid var(--neutral-stroke-rest);
    font-size: 0.875rem;
    font-weight: 700;
}

.je-total-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

/* ── Journal Entry — balance indicator strip ─────────────── */
.je-balance-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: var(--layer-corner-radius, 6px);
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.je-balanced {
    background: color-mix(in srgb, var(--colorPaletteGreenBackground2) 30%, transparent);
    border-color: var(--colorPaletteGreenBorder2);
    color: var(--colorPaletteGreenForeground1);
}

.je-unbalanced {
    background: color-mix(in srgb, var(--colorPaletteYellowBackground2) 30%, transparent);
    border-color: var(--colorPaletteYellowBorder2);
    color: var(--colorPaletteYellowForeground1);
}

/* ── Dialog footer — separator + full-width equal buttons ── */
.dialog-footer {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    margin-top: 20px;
    border-top: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
}

    .dialog-footer > * {
        flex: 1;
    }

/* ── List filters bar ──────────────────────────────────── */
.list-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: end;
    gap: 8px;
    margin-bottom: 4px;
}

.filter-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

    .filter-actions fluent-button[appearance="stealth"] {
        border: 1px solid var(--neutral-stroke-rest);
        border-radius: calc(var(--control-corner-radius) * 1px);
    }

/* ── Transaction list — native table ────────────────────── */
.list-table-wrap {
    overflow-x: auto;
}

.list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

    .list-table thead tr {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--neutral-foreground-hint);
        border-bottom: 2px solid var(--neutral-stroke-rest);
    }

    .list-table th,
    .list-table td {
        padding: 8px 10px;
        vertical-align: middle;
    }

    .list-table tbody tr {
        border-bottom: 1px solid var(--neutral-stroke-rest);
    }

        .list-table tbody tr:last-child {
            border-bottom: none;
        }

        .list-table tbody tr:hover {
            background: var(--neutral-fill-stealth-hover);
        }

/* ── Master data list — desktop table / mobile card ─────── */
.md-list-table {
    display: block;
    overflow-x: auto;
}

/* Match dt-* font sizes: 13px cells, 11px uppercase headers */
.md-list-table fluent-data-grid-cell {
    font-size: 14px;
}

.md-list-table fluent-data-grid-cell[role="columnheader"] {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.45px;
    color: var(--neutral-foreground-hint);
}

.md-list-cards {
    display: none;
}

@media (max-width: 959px) {
    .md-list-table {
        display: none;
    }

    .md-list-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-top: 4px;
    }
}

.md-list-card {
    border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
    border-radius: var(--corner-radius-large, 8px);
    padding: 14px 16px;
}

/* ----------------------------------------------------------
   REPORT HUB PAGE  (.rpt-hub-*)
   ---------------------------------------------------------- */
.rpt-hub-group .fluent-card-header {
    gap: 8px;
}

.rpt-hub-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rpt-hub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
    transition: background 0.12s ease;
}

.rpt-hub-item:last-child {
    border-bottom: none;
}

.rpt-hub-item:hover {
    background: var(--neutral-fill-stealth-hover);
    text-decoration: none;
}

.rpt-hub-item-icon {
    flex-shrink: 0;
    color: var(--accent-fill-rest);
    display: flex;
    align-items: center;
}

.rpt-hub-item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.rpt-hub-item-title {
    font-size: 14px;
    /*font-weight: 500;*/
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rpt-hub-item-desc {
    font-size: 11px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rpt-hub-item-arrow {
    flex-shrink: 0;
    color: var(--neutral-foreground-hint);
    display: flex;
    align-items: center;
    opacity: 0.5;
}

/* ----------------------------------------------------------
   ADMINISTRATION HUB PAGE  (.admin-hub-*)
   ---------------------------------------------------------- */
.admin-hub-section {
    margin-bottom: 32px;
}

.admin-hub-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
}

.admin-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
}

.admin-hub-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 12px 16px;
    border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
    border-radius: var(--corner-radius-large, 8px);
    background: var(--neutral-layer-floating);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    gap: 8px;
    transition: background 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.admin-hub-tile:hover {
    background: var(--neutral-fill-stealth-hover);
    border-color: var(--accent-fill-rest);
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
    text-decoration: none;
}

/* Icon container — no background, colored icon */
.admin-hub-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    position: relative;
    flex-shrink: 0;
}

/* Scale SVG up from Size20 → ~32 px */
.admin-hub-tile-icon svg {
    width: 32px !important;
    height: 32px !important;
}

/* Section color variants — applied directly to the icon */
.admin-hub-tile-icon--md  { color: var(--accent-fill-rest); }
.admin-hub-tile-icon--cfg { color: #0ca678; }
.admin-hub-tile-icon--sys { color: #7c3aed; }

.admin-hub-tile-title {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--neutral-foreground-rest);
    line-height: 1.3;
}

.admin-hub-tile-desc {
    font-size: 11px;
    color: var(--neutral-foreground-hint);
    line-height: 1.35;
}

/* Unread badge on tile icon */
.admin-hub-tile-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--colorPaletteRedBackground3, #c50f1f);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@media (max-width: 600px) {
    .admin-hub-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .admin-hub-tile {
        padding: 16px 8px 12px;
    }

    .admin-hub-tile-icon svg {
        width: 26px !important;
        height: 26px !important;
    }
}

fluent-checkbox {
    margin-bottom: 6px;
}


