/* ==========================================================================
   BeUnik Store Manager – design system
   Palette: Mango yellow (action / highlight), Brown (secondary / text accent),
            Black & dark grey (navigation, emphasis), warm greys, white.
   Works on top of Bootstrap 5.3 (light + dark colour modes via data-bs-theme).
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root,
[data-bs-theme=light] {
  --bu-mango: #F6B21B;
  --bu-mango-600: #E09A00;
  --bu-mango-700: #B87E00;
  --bu-mango-50: #FFF8E6;
  --bu-mango-100: #FFEDBF;
  --bu-brown: #6B4423;
  --bu-brown-600: #573619;
  --bu-brown-50: #F6EFE9;
  --bu-black: #111111;
  --bu-ink: #1C1917;
  --bu-nav: #161514;
  --bu-nav-2: #22201E;

  --bu-bg: #F6F5F2;
  --bu-surface: #FFFFFF;
  --bu-surface-2: #F8F7F5;
  --bu-border: #E9E6E2;
  --bu-border-strong: #D6D2CD;
  --bu-text: #1C1917;
  --bu-text-2: #44403C;
  --bu-muted: #78716C;
  --bu-accent-text: #6B4423;
  --bu-hover: #FFF8E6;
  --bu-shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 1px 3px rgba(28, 25, 23, .03);
  --bu-shadow-lg: 0 12px 32px -12px rgba(28, 25, 23, .28);
  --bu-radius: 14px;
  --bu-radius-sm: 10px;

  /* status tones: background / foreground */
  --tone-ok-bg: #E8F5EC;     --tone-ok-fg: #166534;
  --tone-bad-bg: #FDECEC;    --tone-bad-fg: #B42318;
  --tone-mango-bg: #FFF0C7;  --tone-mango-fg: #7A5000;
  --tone-brown-bg: #F3E8DF;  --tone-brown-fg: #6B4423;
  --tone-grey-bg: #F0EEEB;   --tone-grey-fg: #57534E;
  --tone-dark-bg: #1C1917;   --tone-dark-fg: #FFFFFF;

  /* Bootstrap mapping */
  --bs-body-bg: var(--bu-surface);
  --bs-body-bg-rgb: 255, 255, 255;
  --bs-body-color: var(--bu-text);
  --bs-body-color-rgb: 28, 25, 23;
  --bs-emphasis-color: #000;
  --bs-heading-color: var(--bu-text);
  --bs-secondary-color: var(--bu-muted);
  --bs-secondary-color-rgb: 120, 113, 108;
  --bs-secondary-bg: #F1EFEC;
  --bs-tertiary-bg: var(--bu-surface-2);
  --bs-border-color: var(--bu-border);
  --bs-border-color-translucent: rgba(28, 25, 23, .1);
  --bs-primary: #F6B21B;
  --bs-primary-rgb: 246, 178, 27;
  --bs-primary-bg-subtle: #FFF8E6;
  --bs-primary-border-subtle: #FFE2A0;
  --bs-primary-text-emphasis: #7A5000;
  --bs-link-color: #6B4423;
  --bs-link-color-rgb: 107, 68, 35;
  --bs-link-hover-color: #3F2814;
  --bs-link-hover-color-rgb: 63, 40, 20;
  --bs-focus-ring-color: rgba(246, 178, 27, .35);
  --bs-border-radius: .625rem;
  --bs-border-radius-sm: .5rem;
  --bs-border-radius-lg: .875rem;
  --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: .925rem;
}

[data-bs-theme=dark] {
  --bu-bg: #121110;
  --bu-surface: #1C1B1A;
  --bu-surface-2: #242220;
  --bu-border: #33302D;
  --bu-border-strong: #4A4642;
  --bu-text: #EDEBE9;
  --bu-text-2: #D6D3D1;
  --bu-muted: #A8A29E;
  --bu-accent-text: #F6B21B;
  --bu-hover: rgba(246, 178, 27, .08);
  --bu-mango-50: rgba(246, 178, 27, .08);
  --bu-mango-100: rgba(246, 178, 27, .16);
  --bu-brown-50: rgba(190, 130, 80, .14);
  --bu-nav: #0D0C0B;
  --bu-nav-2: #1D1B19;
  --bu-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --bu-shadow-lg: 0 12px 32px -12px rgba(0, 0, 0, .7);

  --tone-ok-bg: rgba(34, 197, 94, .14);    --tone-ok-fg: #86EFAC;
  --tone-bad-bg: rgba(239, 68, 68, .16);   --tone-bad-fg: #FCA5A5;
  --tone-mango-bg: rgba(246, 178, 27, .16); --tone-mango-fg: #FCD171;
  --tone-brown-bg: rgba(190, 130, 80, .2); --tone-brown-fg: #E8C3A0;
  --tone-grey-bg: #2E2C2A;                 --tone-grey-fg: #D6D3D1;
  --tone-dark-bg: #EDEBE9;                 --tone-dark-fg: #1C1917;

  --bs-body-bg: var(--bu-surface);
  --bs-body-bg-rgb: 28, 27, 26;
  --bs-body-color: var(--bu-text);
  --bs-body-color-rgb: 237, 235, 233;
  --bs-emphasis-color: #fff;
  --bs-heading-color: var(--bu-text);
  --bs-secondary-color: var(--bu-muted);
  --bs-secondary-color-rgb: 168, 162, 158;
  --bs-secondary-bg: #2A2826;
  --bs-tertiary-bg: var(--bu-surface-2);
  --bs-border-color: var(--bu-border);
  --bs-border-color-translucent: rgba(255, 255, 255, .1);
  --bs-primary-bg-subtle: rgba(246, 178, 27, .12);
  --bs-primary-border-subtle: rgba(246, 178, 27, .35);
  --bs-primary-text-emphasis: #FCD171;
  --bs-link-color: #F6B21B;
  --bs-link-color-rgb: 246, 178, 27;
  --bs-link-hover-color: #FCD171;
  --bs-link-hover-color-rgb: 252, 209, 113;
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
body.app { background: var(--bu-bg); color: var(--bu-text); font-size: .925rem; -webkit-font-smoothing: antialiased; }
a { text-underline-offset: 2px; }
a:not(.btn):not(.nav-link):not(.dropdown-item) { text-decoration: none; font-weight: 500; }
a:not(.btn):not(.nav-link):not(.dropdown-item):hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { color: var(--bu-text); letter-spacing: -.01em; }
.text-primary { color: var(--bu-accent-text) !important; }
.text-mango { color: var(--bu-mango) !important; }
.text-brown { color: var(--bu-accent-text) !important; }
.bg-primary { background-color: var(--bu-mango) !important; }
.text-muted { color: var(--bu-muted) !important; }
[data-bs-theme=dark] .bg-white, [data-bs-theme=dark] .bg-light { background-color: var(--bu-surface) !important; }
[data-bs-theme=dark] .text-dark { color: var(--bu-text) !important; }
::selection { background: rgba(246, 178, 27, .35); }
.min-w-0 { min-width: 0; }
.skip-link { position: absolute; left: -9999px; top: .5rem; z-index: 2000; background: var(--bu-mango); color: var(--bu-ink); padding: .5rem 1rem; border-radius: 8px; font-weight: 600; }
.skip-link:focus { left: .5rem; }
:focus-visible { outline: 2px solid var(--bu-mango-600); outline-offset: 2px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted-small { font-size: .8rem; color: var(--bu-muted); }

/* ---------- 3. Shell: sidebar (collapsible groups, menu search, narrow rail) ---------- */
.sidebar {
  --bs-offcanvas-width: 280px;
  --bs-offcanvas-bg: var(--bu-nav);
  --bs-offcanvas-color: #D6D3D1;
  --side-w: 264px;
  width: var(--side-w); flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--bu-nav); color: #D6D3D1; border-right: 1px solid rgba(255, 255, 255, .04);
  transition: width .2s ease;
}
.sidebar.offcanvas-lg { background-color: var(--bu-nav) !important; }
@media (min-width: 992px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1035; }
  .main { margin-left: 264px; transition: margin-left .2s ease; }
  body.nav-rail .main { margin-left: 76px; }
}
.sidebar-brand { height: 64px; flex-shrink: 0; display: flex; align-items: center; gap: .5rem; padding: 0 .9rem 0 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sidebar-brand .brand-link { display: flex; align-items: center; min-width: 0; margin-right: auto; }
.sidebar-brand img.brand-full { height: 32px; width: auto; display: block; }
.sidebar-brand img.brand-mark { display: none; width: 34px; height: 34px; }
.rail-toggle { width: 30px; height: 30px; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: #8A8580; transition: background-color .15s, color .15s, transform .2s; }
.rail-toggle:hover { background: var(--bu-nav-2); color: var(--bu-mango); }

/* quick actions */
.sidebar-quick { display: flex; gap: .4rem; padding: .85rem .9rem .35rem; flex-shrink: 0; }
.sidebar-quick .quick-main { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: .45rem; height: 38px; border-radius: 10px; background: var(--bu-mango); color: var(--bu-ink); font-weight: 700; font-size: .86rem; text-decoration: none; box-shadow: 0 4px 14px rgba(246, 178, 27, .18); transition: filter .15s, transform .1s; }
.sidebar-quick .quick-main:hover { filter: brightness(1.06); }
.sidebar-quick .quick-main:active { transform: translateY(1px); }
.sidebar-quick .quick-btn { width: 38px; height: 38px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bu-nav-2); color: #A8A29E; border: 1px solid rgba(255, 255, 255, .05); text-decoration: none; transition: color .15s, border-color .15s; }
.sidebar-quick .quick-btn:hover { color: var(--bu-mango); border-color: rgba(246, 178, 27, .35); }

/* menu search */
.sidebar-find { position: relative; padding: .45rem .9rem .35rem; flex-shrink: 0; }
.sidebar-find i { position: absolute; left: 1.6rem; top: 50%; transform: translateY(-50%); font-size: .75rem; color: #78716C; pointer-events: none; }
.sidebar-find input { width: 100%; height: 34px; padding: 0 .75rem 0 2rem; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .04); color: #E7E5E4; font-size: .82rem; outline: none; transition: border-color .15s, background-color .15s; }
.sidebar-find input::placeholder { color: #78716C; }
.sidebar-find input:focus { border-color: rgba(246, 178, 27, .55); background: rgba(255, 255, 255, .06); }

/* groups */
.sidebar-nav { flex: 1; overflow-y: auto; padding: .35rem .75rem 1rem; scrollbar-width: thin; scrollbar-color: #3A3734 transparent; }
.nav-sec { margin-top: .2rem; }
.nav-sec.is-top { padding-bottom: .35rem; margin-bottom: .2rem; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.nav-sec-head { width: 100%; display: flex; align-items: center; gap: .65rem; border: 0; background: transparent; padding: .5rem .75rem; border-radius: var(--bu-radius-sm); color: #A8A29E; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-align: left; transition: background-color .15s, color .15s; }
.nav-sec-head:hover { background: rgba(255, 255, 255, .035); color: #E7E5E4; }
.nav-sec-head .sec-icon { width: 1.1rem; text-align: center; font-size: .82rem; color: #78716C; transition: color .15s; }
.nav-sec.has-active > .nav-sec-head { color: #F5F5F4; }
.nav-sec.has-active > .nav-sec-head .sec-icon { color: var(--bu-mango); }
.nav-sec-head .sec-chev { margin-left: auto; font-size: .62rem; color: #78716C; transition: transform .2s ease; transform: rotate(-90deg); }
.nav-sec.is-open > .nav-sec-head .sec-chev { transform: rotate(0); }
.nav-sec-head .sec-badge { margin-left: auto; }
.nav-sec-head .sec-badge + .sec-chev { margin-left: .4rem; }
.nav-sec.is-open .sec-badge { display: none; }
.nav-sec.is-open .sec-badge + .sec-chev { margin-left: auto; }
.nav-sec-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.nav-sec.is-open > .nav-sec-body { grid-template-rows: 1fr; }
.nav-sec-inner { overflow: hidden; min-height: 0; position: relative; visibility: hidden; transition: visibility 0s .22s; }
.nav-sec.is-open .nav-sec-inner, .nav-sec.is-top, .sidebar.is-finding .nav-sec-inner { visibility: visible; transition-delay: 0s; }
.nav-sec:not(.is-top) .nav-sec-inner { margin-left: 1.3rem; padding-left: .45rem; border-left: 1px solid rgba(255, 255, 255, .07); }
.sidebar .nav-link { position: relative; display: flex; align-items: center; gap: .7rem; color: #D6D3D1; padding: .42rem .7rem; margin: 1px 0; border-radius: var(--bu-radius-sm); font-size: .865rem; font-weight: 500; text-decoration: none; transition: background-color .15s, color .15s; }
.sidebar .nav-link i { color: #8A8580; width: 1.1rem; text-align: center; font-size: .85rem; transition: color .15s; }
.sidebar .nav-link:hover { background: var(--bu-nav-2); color: #fff; }
.sidebar .nav-link:hover i { color: var(--bu-mango); }
.sidebar .nav-link.active { background: rgba(246, 178, 27, .13); color: var(--bu-mango); font-weight: 600; }
.sidebar .nav-link.active i { color: var(--bu-mango); }
.sidebar .nav-link.active::before { content: ""; position: absolute; left: -.5rem; top: .45rem; bottom: .45rem; width: 3px; border-radius: 3px; background: var(--bu-mango); }
.nav-sec.is-top .nav-link.active::before { left: -.75rem; border-radius: 0 3px 3px 0; }
.nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { margin-left: auto; background: var(--bu-mango); color: var(--bu-ink); font-size: .68rem; font-weight: 800; border-radius: 99px; padding: .1rem .45rem; line-height: 1.3; letter-spacing: 0; }
.nav-empty { color: #78716C; font-size: .8rem; padding: .75rem; margin: 0; }
.sidebar.is-finding .nav-sec-body { grid-template-rows: 1fr; transition: none; }
.sidebar.is-finding .sec-chev, .sidebar.is-finding .sec-badge { visibility: hidden; }
.nav-link.is-hidden, .nav-sec.is-hidden { display: none !important; }

/* footer: who is logged in */
.sidebar-foot { flex-shrink: 0; display: flex; align-items: center; gap: .65rem; padding: .7rem .9rem; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-foot .avatar-sm { width: 32px; height: 32px; font-size: .72rem; background: var(--bu-brown); }
.sidebar-foot .foot-meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-foot .foot-meta b { color: #E7E5E4; font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .foot-meta small { color: #78716C; font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .foot-out { margin-left: auto; width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: #8A8580; transition: background-color .15s, color .15s; }
.sidebar-foot .foot-out:hover { background: rgba(220, 38, 38, .15); color: #F87171; }

/* narrow rail (desktop only): icons, tooltips via title */
@media (min-width: 992px) {
  .sidebar.is-rail { --side-w: 76px; }
  .sidebar.is-rail .sidebar-brand { justify-content: center; padding: 0; flex-direction: column; gap: 0; height: 88px; }
  .sidebar.is-rail .brand-link { margin: 0; }
  .sidebar.is-rail img.brand-full { display: none; }
  .sidebar.is-rail img.brand-mark { display: block; }
  .sidebar.is-rail .rail-toggle { transform: rotate(180deg); margin-top: .25rem; }
  .sidebar.is-rail .sidebar-quick { flex-direction: column; align-items: center; padding: .7rem 0 .2rem; }
  .sidebar.is-rail .sidebar-quick .quick-main { flex: none; width: 44px; height: 40px; }
  .sidebar.is-rail .sidebar-quick .quick-main span, .sidebar.is-rail .sidebar-quick .quick-btn, .sidebar.is-rail .sidebar-find { display: none; }
  .sidebar.is-rail .sidebar-nav { padding: .35rem .6rem 1rem; }
  .sidebar.is-rail .nav-text, .sidebar.is-rail .sec-chev, .sidebar.is-rail .sec-badge { display: none; }
  .sidebar.is-rail .nav-sec-head { justify-content: center; padding: .35rem 0; pointer-events: none; }
  .sidebar.is-rail .nav-sec-head .sec-icon { display: none; }
  .sidebar.is-rail .nav-sec-head::after { content: ""; display: block; width: 26px; height: 1px; background: rgba(255, 255, 255, .1); }
  .sidebar.is-rail .nav-sec-body { grid-template-rows: 1fr; }
  .sidebar.is-rail .nav-sec-inner { margin: 0; padding: 0; border: 0; visibility: visible; }
  .sidebar.is-rail .nav-link { justify-content: center; padding: .55rem 0; }
  .sidebar.is-rail .nav-link i { font-size: .95rem; }
  .sidebar.is-rail .nav-link .nav-badge { position: absolute; top: 2px; right: 4px; padding: 0 .3rem; font-size: .6rem; }
  .sidebar.is-rail .nav-link.active::before { left: -.6rem; border-radius: 0 3px 3px 0; }
  .sidebar.is-rail .sidebar-foot { flex-direction: column; padding: .6rem 0; gap: .35rem; }
  .sidebar.is-rail .foot-meta { display: none; }
  .sidebar.is-rail .foot-out { margin: 0; }
}

/* ---------- 4. Shell: top bar ---------- */
.main { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1030; height: 64px; flex-shrink: 0;
  display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem;
  background: var(--bu-surface);
  background: color-mix(in srgb, var(--bu-surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--bu-border);
}
.btn-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--bu-radius-sm); border: 1px solid transparent; background: transparent; color: var(--bu-text-2); display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; transition: background-color .15s; }
.btn-icon:hover { background: var(--bu-surface-2); border-color: var(--bu-border); color: var(--bu-text); }
[data-bs-theme=dark] .theme-icon-light, :root:not([data-bs-theme=dark]) .theme-icon-dark { display: none; }

.store-btn { display: inline-flex; align-items: center; gap: .55rem; padding: .25rem .7rem .25rem .25rem; border-radius: 12px; border: 1px solid var(--bu-border); background: var(--bu-surface); color: var(--bu-text); font-weight: 600; font-size: .86rem; max-width: 280px; min-width: 0; line-height: 1.1; transition: border-color .15s, box-shadow .15s; }
.store-btn:hover, .store-switch.show .store-btn { border-color: var(--bu-mango); }
.store-btn.is-static { cursor: default; }
.store-btn.is-static:hover { border-color: var(--bu-border); }
.store-btn .store-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-btn.dropdown-toggle::after { margin-left: .15rem; opacity: .5; }
.store-code { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 32px; height: 32px; padding: 0 .4rem; border-radius: 8px; background: var(--bu-ink); color: var(--bu-mango); font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.store-code.is-all { background: var(--bu-mango); color: var(--bu-ink); font-size: .95rem; }
[data-bs-theme=dark] .store-code { background: #2D2A27; }
[data-bs-theme=dark] .store-code.is-all { background: var(--bu-mango); }
.store-menu { min-width: 310px; padding: .4rem; border-radius: var(--bu-radius); border-color: var(--bu-border); }
.store-menu .dropdown-header { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.store-menu .dropdown-item { display: flex; align-items: center; gap: .65rem; border-radius: var(--bu-radius-sm); padding: .5rem .6rem; white-space: normal; font-weight: 500; }

.topbar-search { position: relative; flex: 1 1 auto; max-width: 560px; min-width: 0; }
.topbar-search .form-control { height: 42px; padding-left: 2.5rem; padding-right: 2.2rem; border-radius: 12px; background: var(--bu-surface-2); border-color: var(--bu-border); }
.topbar-search .form-control:focus { background: var(--bu-surface); }
.topbar-search .form-control::-webkit-search-cancel-button { display: none; }
.search-icon { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--bu-muted); font-size: .9rem; pointer-events: none; }
.search-kbd { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font-size: .7rem; background: var(--bu-surface); border: 1px solid var(--bu-border-strong); color: var(--bu-muted); padding: .05rem .4rem; border-radius: 6px; box-shadow: none; pointer-events: none; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bu-surface); border: 1px solid var(--bu-border); border-radius: var(--bu-radius); max-height: 70vh; overflow-y: auto; padding: .4rem; z-index: 1060; }
.sr-group { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--bu-muted); padding: .55rem .6rem .25rem; font-weight: 700; }
.sr-item { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border-radius: var(--bu-radius-sm); color: var(--bu-text) !important; text-decoration: none !important; font-weight: 400 !important; }
.sr-item:hover, .sr-item.active { background: var(--bu-hover); }
.sr-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: var(--bu-surface-2); border: 1px solid var(--bu-border); color: var(--bu-accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.sr-main { min-width: 0; flex: 1; }
.sr-main b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-main small { color: var(--bu-muted); }
.sr-meta { text-align: right; font-size: .8rem; color: var(--bu-muted); white-space: nowrap; }
.sr-empty { padding: 1rem; text-align: center; color: var(--bu-muted); font-size: .875rem; }
.sr-all { display: block; text-align: center; padding: .55rem; font-size: .82rem; border-top: 1px solid var(--bu-border); margin-top: .3rem; }

.topbar-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.user-btn { display: flex; align-items: center; gap: .6rem; background: transparent; border: 1px solid transparent; padding: .25rem .5rem .25rem .25rem; border-radius: 12px; color: var(--bu-text); }
.user-btn:hover, .dropdown.show .user-btn { background: var(--bu-surface-2); border-color: var(--bu-border); }
.avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--bu-brown); color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; }
.user-meta { flex-direction: column; line-height: 1.15; text-align: left; }
.user-meta b { font-size: .84rem; font-weight: 600; }
.user-meta small { font-size: .72rem; color: var(--bu-muted); }

/* ---------- 5. Content ---------- */
.content { flex: 1; width: 100%; max-width: 1640px; padding: 1.5rem 1.75rem 3rem; }
.main-guest { margin-left: 0 !important; }
.main-guest .content { padding: 0; max-width: none; }
.page-title { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-title h1 { font-size: 1.4rem; margin: 0; font-weight: 700; color: var(--bu-text); display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .65rem; line-height: 1.25; }
.page-title h1 > i:first-child { width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; background: var(--bu-mango-100); color: var(--bu-accent-text) !important; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; margin: 0 !important; }
.page-title h1 small { font-weight: 500; }
.page-sub { color: var(--bu-muted); margin: .35rem 0 0; font-size: .9rem; max-width: 70ch; }
.page-title h1:has(> i:first-child) + .page-sub { margin-left: 52px; }

/* ---------- 6. Components ---------- */
.card { --bs-card-border-color: var(--bu-border); --bs-card-border-radius: var(--bu-radius); --bs-card-inner-border-radius: calc(var(--bu-radius) - 1px); --bs-card-cap-bg: transparent; --bs-card-cap-padding-y: .85rem; --bs-card-cap-padding-x: 1.1rem; --bs-card-spacer-x: 1.1rem; box-shadow: var(--bu-shadow); }
.card-header { font-weight: 650; font-size: .95rem; border-bottom-color: var(--bu-border); }
.card-header .fa-solid:first-child { color: var(--bu-accent-text) !important; }
.card-footer { background: var(--bu-surface-2); border-top-color: var(--bu-border); }
.card-link { color: inherit !important; text-decoration: none !important; font-weight: 400 !important; transition: border-color .15s, transform .15s, box-shadow .15s; }
.card-link:hover { border-color: var(--bu-mango); box-shadow: var(--bu-shadow-lg); transform: translateY(-1px); }
.icon-tile { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--bu-mango-100); color: var(--bu-accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }

/* buttons */
.btn { --bs-btn-font-weight: 500; --bs-btn-border-radius: var(--bu-radius-sm); --bs-btn-padding-x: 1rem; --bs-btn-padding-y: .5rem; --bs-btn-font-size: .9rem; background-image: none !important; text-shadow: none !important; box-shadow: none; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .3rem; --bs-btn-font-size: .8rem; --bs-btn-border-radius: 8px; }
.btn-lg { --bs-btn-padding-x: 1.4rem; --bs-btn-padding-y: .7rem; --bs-btn-font-size: 1rem; --bs-btn-border-radius: 12px; }
.btn-primary, .btn-mango, .btn-warning {
  --bs-btn-color: #1C1917; --bs-btn-bg: #F6B21B; --bs-btn-border-color: #F6B21B;
  --bs-btn-hover-color: #1C1917; --bs-btn-hover-bg: #E9A510; --bs-btn-hover-border-color: #E09A00;
  --bs-btn-active-color: #1C1917; --bs-btn-active-bg: #E09A00; --bs-btn-active-border-color: #CC8C00;
  --bs-btn-disabled-color: #1C1917; --bs-btn-disabled-bg: #F6B21B; --bs-btn-disabled-border-color: #F6B21B;
  --bs-btn-focus-shadow-rgb: 246, 178, 27; font-weight: 600;
}
.btn-outline-primary { --bs-btn-color: var(--bu-accent-text); --bs-btn-border-color: var(--bu-border-strong); --bs-btn-hover-color: var(--bu-text); --bs-btn-hover-bg: var(--bu-mango-50); --bs-btn-hover-border-color: var(--bu-mango); --bs-btn-active-color: var(--bu-text); --bs-btn-active-bg: var(--bu-mango-100); --bs-btn-active-border-color: var(--bu-mango); --bs-btn-focus-shadow-rgb: 246, 178, 27; }
.btn-dark { --bs-btn-color: #fff; --bs-btn-bg: #1C1917; --bs-btn-border-color: #1C1917; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000; --bs-btn-active-bg: #000; --bs-btn-active-border-color: #000; }
[data-bs-theme=dark] .btn-dark { --bs-btn-color: #1C1917; --bs-btn-bg: #EDEBE9; --bs-btn-border-color: #EDEBE9; --bs-btn-hover-color: #1C1917; --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: #fff; --bs-btn-active-color: #1C1917; --bs-btn-active-bg: #D6D3D1; }
.btn-outline-dark { --bs-btn-color: var(--bu-text); --bs-btn-border-color: var(--bu-border-strong); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1C1917; --bs-btn-hover-border-color: #1C1917; --bs-btn-active-bg: #000; }
[data-bs-theme=dark] .btn-outline-dark { --bs-btn-hover-color: #1C1917; --bs-btn-hover-bg: #EDEBE9; --bs-btn-hover-border-color: #EDEBE9; }
.btn-light { --bs-btn-color: var(--bu-text); --bs-btn-bg: var(--bu-surface-2); --bs-btn-border-color: var(--bu-border); --bs-btn-hover-color: var(--bu-text); --bs-btn-hover-bg: var(--bs-secondary-bg); --bs-btn-hover-border-color: var(--bu-border-strong); --bs-btn-active-bg: var(--bs-secondary-bg); }
.btn-outline-secondary { --bs-btn-color: var(--bu-text-2); --bs-btn-border-color: var(--bu-border-strong); --bs-btn-hover-color: var(--bu-text); --bs-btn-hover-bg: var(--bu-surface-2); --bs-btn-hover-border-color: var(--bu-border-strong); --bs-btn-active-color: var(--bu-text); --bs-btn-active-bg: var(--bs-secondary-bg); }
.btn-success { --bs-btn-bg: #1F8A4C; --bs-btn-border-color: #1F8A4C; --bs-btn-hover-bg: #187A41; --bs-btn-hover-border-color: #187A41; --bs-btn-active-bg: #146B39; }
.btn-outline-success { --bs-btn-color: #1F8A4C; --bs-btn-border-color: #9ED3B2; --bs-btn-hover-bg: #1F8A4C; --bs-btn-hover-border-color: #1F8A4C; }
[data-bs-theme=dark] .btn-outline-success { --bs-btn-color: #86EFAC; --bs-btn-border-color: #2F6B47; }
.btn-danger { --bs-btn-bg: #C7372F; --bs-btn-border-color: #C7372F; --bs-btn-hover-bg: #AE2E27; --bs-btn-hover-border-color: #AE2E27; }
.btn-outline-danger { --bs-btn-color: #C7372F; --bs-btn-border-color: #F0B5B1; --bs-btn-hover-bg: #C7372F; --bs-btn-hover-border-color: #C7372F; }
[data-bs-theme=dark] .btn-outline-danger { --bs-btn-color: #FCA5A5; --bs-btn-border-color: #6B2A27; }
.btn-link { --bs-btn-color: var(--bu-accent-text); --bs-btn-hover-color: var(--bu-text); }

/* forms */
.form-label { font-weight: 550; font-size: .82rem; color: var(--bu-text-2); margin-bottom: .3rem; }
.form-control, .form-select { border-color: var(--bu-border-strong); border-radius: var(--bu-radius-sm); font-size: .92rem; min-height: 40px; }
.form-control-sm, .form-select-sm { min-height: 32px; border-radius: 8px; font-size: .84rem; }
.form-control-lg, .form-select-lg { min-height: 50px; border-radius: 12px; font-size: 1.05rem; }
.form-control:focus, .form-select:focus { border-color: var(--bu-mango-600); box-shadow: 0 0 0 .22rem rgba(246, 178, 27, .25); }
.form-control::placeholder { color: var(--bu-muted); opacity: .75; }
.form-control:disabled, .form-control[readonly] { background-color: var(--bu-surface-2); }
.input-group-text { background: var(--bu-surface-2); border-color: var(--bu-border-strong); color: var(--bu-muted); border-radius: var(--bu-radius-sm); }
.form-check-input { border-color: var(--bu-border-strong); }
.form-check-input:checked { background-color: var(--bu-mango); border-color: var(--bu-mango-600); }
.form-check-input:focus { border-color: var(--bu-mango-600); box-shadow: 0 0 0 .22rem rgba(246, 178, 27, .25); }
.form-check-input[type=checkbox]:checked { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%231C1917' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:checked { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%231C1917'/%3e%3c/svg%3e"); }
.form-text { color: var(--bu-muted); font-size: .78rem; }
.required::after { content: " *"; color: #DC2626; }

/* tables */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--bu-hover); --bs-table-striped-bg: var(--bu-surface-2); --bs-table-border-color: var(--bu-border); font-size: .875rem; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table-sm > :not(caption) > * > * { padding: .42rem .6rem; }
.table thead th { background: var(--bu-surface-2); color: var(--bu-muted); font-weight: 650; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; border-bottom-color: var(--bu-border); }
.table td { vertical-align: middle; }
.table tfoot td, .table tfoot th { background: var(--bu-surface-2); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--bu-hover); }
.table-sticky thead th { position: sticky; top: 0; z-index: 1; }
/* v59: sortable column headers (assets/js/app.js) */
.table thead th.th-sort { cursor: pointer; user-select: none; }
.table thead th.th-sort:hover { color: var(--bu-text); }
.table thead th.th-sort:focus-visible { outline: none; box-shadow: inset 0 -2px 0 var(--bu-mango); }
.th-sort-ic { margin-left: .25rem; font-size: .8em; opacity: .28; transition: opacity .15s; }
.th-sort:hover .th-sort-ic { opacity: .6; }
.table thead th[aria-sort=ascending], .table thead th[aria-sort=descending] { color: var(--bu-accent-text); }
.th-sort[aria-sort=ascending] .th-sort-ic, .th-sort[aria-sort=descending] .th-sort-ic { opacity: 1; color: var(--bu-mango-600); }
@media print { .th-sort-ic { display: none; } }
.card > .table-responsive:first-child .table thead th:first-child, .card > .table-responsive:first-child .table thead tr:first-child th:first-child { border-top-left-radius: calc(var(--bu-radius) - 1px); }
.card > .table-responsive:first-child .table thead tr:first-child th:last-child { border-top-right-radius: calc(var(--bu-radius) - 1px); }
.table-light { --bs-table-bg: var(--bu-surface-2); --bs-table-color: var(--bu-text); --bs-table-border-color: var(--bu-border); }
.table-warning { --bs-table-bg: var(--tone-mango-bg); --bs-table-color: var(--bu-text); }
.table-primary { --bs-table-bg: var(--bu-mango-50); --bs-table-color: var(--bu-text); }
.table-danger { --bs-table-bg: var(--tone-bad-bg); --bs-table-color: var(--bu-text); }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-group td { background: var(--bu-surface-2) !important; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bu-muted); font-weight: 700; }

/* v66: role permission matrix – readable with a sticky role row + sticky permission column */
.perm-scroll { max-height: 74vh; overflow: auto; border: 1px solid var(--bu-border); border-radius: 10px; }
.perm-scroll .perm-table { margin: 0; }
.perm-table thead th { position: -webkit-sticky; position: sticky; top: 0; z-index: 3; background: var(--bu-surface); box-shadow: inset 0 -2px 0 var(--bu-border); vertical-align: bottom; }
.perm-table td:first-child, .perm-table th:first-child { position: -webkit-sticky; position: sticky; left: 0; z-index: 2; background: var(--bu-surface); box-shadow: inset -1px 0 0 var(--bu-border); min-width: 15rem; }
.perm-table thead th:first-child { z-index: 4; }
.perm-table tbody tr:hover td { background: var(--bu-surface-2); }
.perm-table tbody tr:hover td:first-child { background: var(--bu-surface-2); }
.perm-group td { position: -webkit-sticky; position: sticky; left: 0; } /* group label follows horizontal scroll */
.perm-rolehead { cursor: pointer; user-select: none; white-space: nowrap; padding: .45rem .5rem !important; border-radius: 6px 6px 0 0; }
.perm-rolehead:hover { background: var(--bu-surface-2); }
.perm-rolehead .rtone { display: inline-block; width: .62rem; height: .62rem; border-radius: 3px; margin-right: .3rem; vertical-align: middle; }
.perm-rolehead .rname { font-weight: 700; font-size: .82rem; }
.perm-rolehead .cnt { display: block; font-weight: 500; font-size: .68rem; opacity: .7; margin-top: 1px; }
.perm-rolehead .cnt b { font-weight: 700; opacity: 1; }
.perm-table col.perm-col-hi { background: var(--bu-mango-50); }
.perm-table .perm-chk { width: 1.1rem; height: 1.1rem; cursor: pointer; }
.perm-table .perm-chk:disabled { opacity: .3; cursor: not-allowed; }
.perm-hint { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

/* badges & tones */
.badge { font-weight: 600; letter-spacing: .01em; border-radius: 6px; padding: .32em .6em; }
.badge-tone-ok { background: var(--tone-ok-bg); color: var(--tone-ok-fg); }
.badge-tone-bad { background: var(--tone-bad-bg); color: var(--tone-bad-fg); }
.badge-tone-mango { background: var(--tone-mango-bg); color: var(--tone-mango-fg); }
.badge-tone-brown { background: var(--tone-brown-bg); color: var(--tone-brown-fg); }
.badge-tone-grey { background: var(--tone-grey-bg); color: var(--tone-grey-fg); }
.badge-tone-dark { background: var(--tone-dark-bg); color: var(--tone-dark-fg); }
.badge-tone-info { background: transparent; color: var(--bu-text-2); box-shadow: inset 0 0 0 1px var(--bu-border-strong); }
.status-badge { font-weight: 600; }
.badge-store { background: var(--bu-ink); color: var(--bu-mango); font-weight: 700; }
[data-bs-theme=dark] .badge-store { background: #2D2A27; }
.text-bg-info { background-color: var(--tone-brown-bg) !important; color: var(--tone-brown-fg) !important; }
.text-bg-warning { background-color: var(--tone-mango-bg) !important; color: var(--tone-mango-fg) !important; }
.text-bg-success { background-color: var(--tone-ok-bg) !important; color: var(--tone-ok-fg) !important; }
.text-bg-secondary { background-color: var(--tone-grey-bg) !important; color: var(--tone-grey-fg) !important; }
.text-bg-light { background-color: var(--tone-grey-bg) !important; color: var(--tone-grey-fg) !important; }
.text-bg-primary { background-color: var(--bu-mango) !important; color: var(--bu-ink) !important; }
.text-bg-danger { background-color: #D92D20 !important; color: #fff !important; }
.bg-success-subtle { background-color: var(--tone-ok-bg) !important; } .text-success { color: var(--tone-ok-fg) !important; }
.bg-warning-subtle { background-color: var(--tone-mango-bg) !important; } .text-warning { color: var(--tone-mango-fg) !important; }
.bg-primary-subtle { background-color: var(--bu-mango-100) !important; }
.bg-info-subtle { background-color: var(--tone-brown-bg) !important; } .text-info { color: var(--tone-brown-fg) !important; }
.text-danger { color: var(--tone-bad-fg) !important; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bu-border-strong); margin-right: .45rem; vertical-align: middle; }
.dot-ok { background: #22C55E; }

/* alerts / flashes */
.alert { --bs-alert-border-radius: 12px; border-width: 1px; }
.alert-success { --bs-alert-bg: #ECFDF3; --bs-alert-border-color: #ABEFC6; --bs-alert-color: #085D3A; --bs-alert-link-color: #085D3A; }
.alert-danger { --bs-alert-bg: #FEF3F2; --bs-alert-border-color: #FECDCA; --bs-alert-color: #912018; --bs-alert-link-color: #912018; }
.alert-warning { --bs-alert-bg: #FFF8E6; --bs-alert-border-color: #FFDF8F; --bs-alert-color: #6B4600; --bs-alert-link-color: #6B4600; }
.alert-info { --bs-alert-bg: #F6EFE9; --bs-alert-border-color: #E5D3C3; --bs-alert-color: #4E3018; --bs-alert-link-color: #4E3018; }
[data-bs-theme=dark] .alert-success { --bs-alert-bg: rgba(34, 197, 94, .1); --bs-alert-border-color: rgba(34, 197, 94, .3); --bs-alert-color: #A7F3C4; --bs-alert-link-color: #A7F3C4; }
[data-bs-theme=dark] .alert-danger { --bs-alert-bg: rgba(239, 68, 68, .1); --bs-alert-border-color: rgba(239, 68, 68, .32); --bs-alert-color: #FECACA; --bs-alert-link-color: #FECACA; }
[data-bs-theme=dark] .alert-warning { --bs-alert-bg: rgba(246, 178, 27, .1); --bs-alert-border-color: rgba(246, 178, 27, .32); --bs-alert-color: #FDE3A7; --bs-alert-link-color: #FDE3A7; }
[data-bs-theme=dark] .alert-info { --bs-alert-bg: rgba(190, 130, 80, .12); --bs-alert-border-color: rgba(190, 130, 80, .35); --bs-alert-color: #EBD3BE; --bs-alert-link-color: #EBD3BE; }
.flash { display: flex; align-items: flex-start; gap: .75rem; box-shadow: var(--bu-shadow); }
.flash-icon { font-size: 1.1rem; margin-top: .12rem; flex-shrink: 0; }
.flash-body { flex: 1; min-width: 0; }
.flash-body .btn { margin-top: .15rem; margin-bottom: .15rem; }
.toast { --bs-toast-bg: var(--bu-ink); --bs-toast-color: #fff; --bs-toast-border-radius: 12px; --bs-toast-max-width: 380px; box-shadow: var(--bu-shadow-lg); }
.toast .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
[data-bs-theme=dark] .toast { --bs-toast-bg: #2A2826; }
.toast-container { z-index: 1090; }

/* dropdowns, pagination, nav pills, list groups */
.dropdown-menu { --bs-dropdown-border-color: var(--bu-border); --bs-dropdown-border-radius: 12px; --bs-dropdown-link-active-bg: var(--bu-mango-100); --bs-dropdown-link-active-color: var(--bu-text); --bs-dropdown-link-hover-bg: var(--bu-surface-2); --bs-dropdown-font-size: .9rem; padding: .35rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; }
.pagination { --bs-pagination-color: var(--bu-text-2); --bs-pagination-hover-color: var(--bu-text); --bs-pagination-hover-bg: var(--bu-surface-2); --bs-pagination-active-bg: var(--bu-ink); --bs-pagination-active-border-color: var(--bu-ink); --bs-pagination-active-color: #fff; --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(246, 178, 27, .3); --bs-pagination-border-color: var(--bu-border); margin-bottom: 0; flex-wrap: wrap; }
[data-bs-theme=dark] .pagination { --bs-pagination-active-bg: var(--bu-mango); --bs-pagination-active-border-color: var(--bu-mango); --bs-pagination-active-color: #1C1917; }
.nav-pills-soft { gap: .35rem; flex-wrap: wrap; }
.nav-pills-soft .nav-link, .nav-pills .nav-link { color: var(--bu-text-2); font-weight: 550; border-radius: var(--bu-radius-sm); padding: .5rem .9rem; border: 1px solid var(--bu-border); background: var(--bu-surface); }
.nav-pills-soft .nav-link:hover, .nav-pills .nav-link:hover { border-color: var(--bu-border-strong); color: var(--bu-text); }
.nav-pills-soft .nav-link.active, .nav-pills .nav-link.active { background: var(--bu-ink); border-color: var(--bu-ink); color: #fff; }
[data-bs-theme=dark] .nav-pills-soft .nav-link.active, [data-bs-theme=dark] .nav-pills .nav-link.active { background: var(--bu-mango); border-color: var(--bu-mango); color: #1C1917; }
.nav-tabs { --bs-nav-tabs-link-active-color: var(--bu-text); --bs-nav-tabs-link-active-border-color: var(--bu-border) var(--bu-border) var(--bs-body-bg); --bs-nav-link-color: var(--bu-muted); --bs-nav-link-hover-color: var(--bu-text); }
.nav-tabs .nav-link.active { box-shadow: inset 0 3px 0 var(--bu-mango); font-weight: 600; }
.list-group { --bs-list-group-border-color: var(--bu-border); --bs-list-group-active-bg: var(--bu-mango); --bs-list-group-active-border-color: var(--bu-mango); --bs-list-group-active-color: #1C1917; }
.progress { --bs-progress-bg: var(--bu-surface-2); --bs-progress-bar-bg: var(--bu-mango); --bs-progress-border-radius: 99px; }
.modal { --bs-modal-border-radius: var(--bu-radius); --bs-modal-border-color: var(--bu-border); }
kbd { background: var(--bu-ink); }

/* ---------- 7. App widgets ---------- */
/* KPI tiles */
.kpi { position: relative; height: 100%; padding: 1.1rem 1.2rem; background: var(--bu-surface); border: 1px solid var(--bu-border); border-radius: var(--bu-radius); box-shadow: var(--bu-shadow); overflow: hidden; }
.kpi-label { display: flex; align-items: center; gap: .55rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bu-muted); font-weight: 700; }
.kpi-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--bu-mango-100); color: var(--bu-accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.kpi-value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; margin-top: .55rem; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--bu-text); }
.kpi-sub { font-size: .8rem; color: var(--bu-muted); margin-top: .3rem; }
.kpi-hero { background: var(--bu-ink); border-color: var(--bu-ink); color: #fff; }
.kpi-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(246, 178, 27, .35), transparent 70%); }
.kpi-hero .kpi-label, .kpi-hero .kpi-sub { color: #BDB7B1; }
.kpi-hero .kpi-value { color: var(--bu-mango); }
.kpi-hero .kpi-icon { background: rgba(246, 178, 27, .18); color: var(--bu-mango); }
[data-bs-theme=dark] .kpi-hero { background: #0D0C0B; border-color: #2A2826; }
a.kpi { color: inherit; text-decoration: none !important; font-weight: 400 !important; display: block; transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--bu-mango); transform: translateY(-1px); }

/* legacy stat-card (reports / daybook / ledger) */
.stat-card { border-radius: var(--bu-radius); padding: 1rem 1.1rem; background: var(--bu-surface); border: 1px solid var(--bu-border); box-shadow: var(--bu-shadow); height: 100%; }
.stat-card .label { color: var(--bu-muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.stat-card .value { font-size: 1.45rem; font-weight: 750; color: var(--bu-text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-card .sub { font-size: .8rem; color: var(--bu-muted); }
.stat-card .icon { width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }

/* quick actions */
.quick-action { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; height: 100%; background: var(--bu-surface); border: 1px solid var(--bu-border); border-radius: 12px; color: var(--bu-text) !important; text-decoration: none !important; font-size: .86rem; font-weight: 600 !important; box-shadow: var(--bu-shadow); transition: border-color .15s, transform .15s, box-shadow .15s; }
.quick-action i { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: var(--bu-mango-100); color: var(--bu-accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; transition: background-color .15s, color .15s; }
.quick-action:hover { border-color: var(--bu-mango); transform: translateY(-1px); box-shadow: var(--bu-shadow-lg); }
.quick-action:hover i { background: var(--bu-mango); color: var(--bu-ink); }
.quick-action.is-primary { background: var(--bu-mango); border-color: var(--bu-mango); color: var(--bu-ink) !important; }
.quick-action.is-primary i { background: rgba(28, 25, 23, .1); color: var(--bu-ink); }

/* charts */
.chart-wrap { position: relative; overflow-x: auto; overflow-y: hidden; padding-top: 4px; }
.chart-wrap svg { display: block; width: 100%; min-width: 560px; height: auto; overflow: visible; }
.chart-bar { fill: var(--bu-mango); transition: fill .15s; }
.chart-bar.is-today { fill: var(--bu-brown); }
[data-bs-theme=dark] .chart-bar.is-today { fill: #EDEBE9; }
.chart-bar-group:hover .chart-bar { fill: var(--bu-mango-600); }
.chart-grid { stroke: var(--bu-border); stroke-width: 1; }
.chart-axis { fill: var(--bu-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; pointer-events: none; background: var(--bu-ink); color: #fff; font-size: .78rem; padding: .35rem .55rem; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: var(--bu-shadow-lg); z-index: 5; }
[data-bs-theme=dark] .chart-tip { background: #EDEBE9; color: #1C1917; }
.meter { height: 6px; border-radius: 99px; background: var(--bu-surface-2); overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--bu-mango); }
.meter.is-brown > span { background: var(--bu-brown); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

/* item / billing */
.item-card { border: 1px dashed var(--bu-border-strong); background: var(--bu-mango-50); border-radius: 12px; padding: .85rem 1rem; }
.item-card .model { font-weight: 650; font-size: 1rem; }
.item-card dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .15rem .75rem; font-size: .85rem; }
.item-card dt { color: var(--bu-muted); font-weight: 500; }
.item-card dd { margin: 0; }
.pay-row .form-select { min-width: 0; }
.balance-box { font-size: 1.15rem; font-weight: 750; padding: .5rem .8rem; border-radius: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.balance-ok { background: var(--tone-ok-bg); color: var(--tone-ok-fg); }
.balance-bad { background: var(--tone-bad-bg); color: var(--tone-bad-fg); }
.autocomplete-list { position: absolute; z-index: 1050; background: var(--bu-surface); border: 1px solid var(--bu-border); border-radius: 10px; max-height: 260px; overflow-y: auto; width: 100%; box-shadow: var(--bu-shadow-lg); padding: .25rem; }
.autocomplete-list div { padding: .4rem .6rem; cursor: pointer; font-size: .875rem; border-radius: 7px; }
.autocomplete-list div:hover, .autocomplete-list div.active { background: var(--bu-hover); }
.chip-check { display: inline-block; margin: 0 .35rem .4rem 0; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: .3rem .75rem; border: 1px solid var(--bu-border-strong); border-radius: 99px; cursor: pointer; font-size: .82rem; background: var(--bu-surface); transition: background-color .15s, border-color .15s; }
.chip-check span:hover { border-color: var(--bu-mango); }
.chip-check input:checked + span { background: var(--bu-mango); color: var(--bu-ink); border-color: var(--bu-mango-600); font-weight: 600; }
.chip-check input:focus-visible + span { outline: 2px solid var(--bu-mango-600); outline-offset: 2px; }
.chip-check input:disabled + span { opacity: .45; cursor: not-allowed; }

/* empty states */
.empty-state { text-align: center; padding: 2.5rem 1.25rem; border: 1px dashed var(--bu-border-strong); border-radius: var(--bu-radius); background: var(--bu-surface); }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--bu-mango-100); color: var(--bu-accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; margin-bottom: .8rem; }
.empty-state-sm { padding: 1.25rem; border: 0; background: transparent; }
.empty-state-sm .empty-icon { width: 40px; height: 40px; font-size: 1rem; border-radius: 12px; display: flex; margin: 0 auto .5rem; }

/* stores & transfer */
.store-tile { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; background: var(--bu-surface); border: 1px solid var(--bu-border); border-radius: var(--bu-radius); color: var(--bu-text) !important; text-decoration: none !important; font-weight: 400 !important; box-shadow: var(--bu-shadow); transition: border-color .15s, box-shadow .15s; }
.store-tile:hover { border-color: var(--bu-mango); }
.store-tile.active { border-color: var(--bu-mango); box-shadow: 0 0 0 3px rgba(246, 178, 27, .2); }
.store-tile.inactive { opacity: .62; }
.store-tile .store-code { min-width: 46px; height: 46px; font-size: .85rem; border-radius: 12px; }
.store-pill { display: inline-flex; align-items: center; padding: .4rem .8rem; border-radius: 99px; background: var(--bu-ink); color: var(--bu-mango); font-weight: 600; font-size: .86rem; }
[data-bs-theme=dark] .store-pill { background: #2D2A27; }
.transfer-route { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; padding: .9rem 1.1rem; background: var(--bu-surface-2); border: 1px solid var(--bu-border); border-radius: 12px; }
.transfer-route > i { color: var(--bu-mango); font-size: 1.4rem; }
.store-compare .meter { width: 100%; }

.sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: .5rem; padding: 1rem 0 .25rem; background: linear-gradient(to bottom, transparent, var(--bu-bg) 40%); }

/* bottom navigation (phones) */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: var(--bu-nav); border-top: 1px solid #2A2826; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: .5rem 0 .45rem; color: #A8A29E !important; font-size: .66rem; font-weight: 600 !important; background: none; border: 0; text-decoration: none !important; }
.bottom-nav i { font-size: 1.1rem; }
.bottom-nav .active { color: var(--bu-mango) !important; }

/* ---------- 8. Login ---------- */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bu-surface); }
.login-art { position: relative; overflow: hidden; background: var(--bu-nav); color: #EDEBE9; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(246, 178, 27, .32), transparent 65%); }
.login-art::after { content: ""; position: absolute; width: 380px; height: 380px; left: -140px; bottom: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(107, 68, 35, .55), transparent 70%); }
.login-art > * { position: relative; z-index: 1; }
.login-art img { height: 44px; width: auto; align-self: flex-start; }
.login-art h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; max-width: 14ch; }
.login-art h2 span { color: var(--bu-mango); }
.login-art .lead { color: #BDB7B1; font-size: 1rem; max-width: 42ch; }
.login-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .85rem; }
.login-points li { display: flex; gap: .75rem; align-items: center; color: #D6D3D1; font-size: .92rem; }
.login-points i { width: 34px; height: 34px; border-radius: 10px; background: rgba(246, 178, 27, .14); color: var(--bu-mango); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.login-card .form-control { min-height: 48px; }
.login-card .input-group-text { min-width: 46px; justify-content: center; }
.login-mobile-logo { display: none; height: 40px; margin-bottom: 1.5rem; }
[data-bs-theme=dark] .login-mobile-logo.for-light, :root:not([data-bs-theme=dark]) .login-mobile-logo.for-dark { display: none !important; }
@media (max-width: 991.98px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-mobile-logo { display: block; }
}

/* ---------- 9. Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar { width: auto; transition: none; }
  .content { padding: 1.1rem 1rem calc(84px + env(safe-area-inset-bottom)); }
  .sticky-actions { bottom: calc(60px + env(safe-area-inset-bottom)); }
  .toast-container { bottom: calc(60px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 767.98px) {
  .topbar { padding: 0 .75rem; gap: .4rem; }
  .topbar-search { display: none; }
  .topbar.search-open .topbar-search { display: block; position: absolute; left: .6rem; right: .6rem; top: 11px; max-width: none; z-index: 3; }
  .topbar.search-open .topbar-search .form-control { background: var(--bu-surface); box-shadow: var(--bu-shadow-lg); }
  .store-btn { max-width: 52vw; }
  .page-title h1 { font-size: 1.2rem; }
  .page-title h1 > i:first-child { width: 34px; height: 34px; font-size: .9rem; }
  .page-title h1:has(> i:first-child) + .page-sub { margin-left: 0; }
  .kpi-value { font-size: 1.35rem; }
}
@media (max-width: 575.98px) {
  .store-btn .store-name { max-width: 34vw; }
  .content { padding-left: .75rem; padding-right: .75rem; }
  .topbar-actions { gap: .15rem; }
}
@media (max-width: 430px) { /* small phones: store code chip only, so bell / theme / profile fit without a sideways scroll */
  .store-btn .store-name { display: none; }
  .store-btn { padding-right: .45rem; }
}

/* ---------- 10. Print ---------- */
@media print {
  .no-print, .topbar, .sidebar, .bottom-nav, .skip-link, .alert-dismissible .btn-close, .toast-container, .sticky-actions { display: none !important; }
  body.app { background: #fff; font-size: 11px; }
  .main { margin-left: 0 !important; }
  .content { padding: 0; max-width: none; }
  .card, .kpi, .stat-card { box-shadow: none; }
  .card { border: 0; }
  .table-responsive { overflow: visible !important; max-height: none !important; }
  .stat-card, .kpi { border: 1px solid #ccc; }
  a { color: inherit !important; text-decoration: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Phase A widgets ---------- */
.step-no { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; background: var(--bu-ink); color: var(--bu-mango); font-size: .75rem; font-weight: 800; margin-right: .6rem; vertical-align: 1px; }
[data-bs-theme=dark] .step-no { background: var(--bu-mango); color: var(--bu-ink); }
.req-badge { font-size: .7rem; }

/* segmented radio control */
.seg-control { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .9rem; border: 1px solid var(--bu-border-strong); border-radius: var(--bu-radius-sm); background: var(--bu-surface); color: var(--bu-text-2); font-weight: 550; font-size: .875rem; cursor: pointer; transition: all .15s; user-select: none; }
.seg-btn i { color: var(--bu-muted); }
.seg-btn:hover { border-color: var(--bu-mango); }
.btn-check:checked + .seg-btn { background: var(--bu-mango-50); border-color: var(--bu-mango-600); color: var(--bu-text); box-shadow: inset 0 0 0 1px var(--bu-mango-600); }
.btn-check:checked + .seg-btn i { color: var(--bu-accent-text); }
.btn-check:focus-visible + .seg-btn { outline: 2px solid var(--bu-mango-600); outline-offset: 2px; }
.seg-sm .seg-btn { padding: .3rem .65rem; font-size: .8rem; }
.seg-fill { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.seg-fill .seg-btn { justify-content: center; }
.media-picker[data-kind^=kyc] .mp-slot { aspect-ratio: 1.58; }

/* upload tiles */
.media-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .6rem; }
.mp-slot { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--bu-border-strong); background: var(--bu-surface-2); overflow: hidden; transition: border-color .15s, background-color .15s; }
.mp-slot:hover { border-color: var(--bu-mango); background: var(--bu-mango-50); }
.mp-add { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; color: var(--bu-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; font-size: .75rem; font-weight: 600; padding: .25rem; text-align: center; }
.mp-add i { font-size: 1.25rem; color: var(--bu-accent-text); }
.mp-slot.is-filled, .mp-slot.is-busy, .mp-slot.is-error { border-style: solid; }
.mp-slot.is-filled { border-color: var(--bu-border); }
.mp-slot.is-filled .mp-add, .mp-slot.is-busy .mp-add { display: none; }
.mp-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mp-video { display: flex; align-items: center; justify-content: center; background: var(--bu-ink); color: var(--bu-mango); font-size: 1.6rem; }
.mp-name { position: absolute; left: 0; right: 0; bottom: 0; padding: .15rem .4rem; font-size: .66rem; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-slot.is-filled .mp-name { display: block; }
.mp-remove { position: absolute; top: 4px; right: 4px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.mp-remove:hover { background: #C7372F; }
.mp-progress { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; font-size: .75rem; color: var(--bu-text-2); }
.mp-error { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: .4rem; font-size: .7rem; font-weight: 600; color: var(--tone-bad-fg); background: var(--tone-bad-bg); pointer-events: none; }
.mp-slot.is-error .mp-add { opacity: 0; }
.media-picker.is-live .mp-slot { border-radius: 50%; }
.media-picker.is-live { grid-template-columns: 1fr; }
.mp-bulk { margin-top: .6rem; }
.seller-status .badge { font-size: .78rem; }
#kycFields.is-collapsed { display: none; }

/* gallery (item / seller pages) */
.media-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.mg-item { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bu-surface-2); border: 1px solid var(--bu-border); text-decoration: none !important; }
.mg-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.mg-item:hover img { transform: scale(1.04); }
.mg-label { position: absolute; left: 0; right: 0; bottom: 0; padding: .15rem .4rem; font-size: .65rem; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-item.is-video { background: var(--bu-ink); }
.mg-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--bu-mango); font-size: 2rem; }
.grade-badge { font-size: .78rem; }
.grade-hero { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 120px; padding: .8rem 1rem; border-radius: 14px; background: var(--bu-ink); color: var(--bu-mango); }
.grade-hero b { font-size: 1.5rem; letter-spacing: -.02em; line-height: 1.1; }
.grade-hero small { color: #BDB7B1; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
[data-bs-theme=dark] .grade-hero { background: #0D0C0B; border: 1px solid #2A2826; }
.spec-list { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; font-size: .875rem; }
.spec-list dt { color: var(--bu-muted); font-weight: 500; }
.spec-list dd { margin: 0; font-weight: 550; }

/* QC checklist */
.qc-list { display: flex; flex-direction: column; }
.qc-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem 1.1rem; border-bottom: 1px solid var(--bu-border); transition: background-color .15s; }
.qc-row:last-child { border-bottom: 0; }
.qc-row.is-failed { background: var(--tone-bad-bg); }
.qc-label { font-weight: 550; font-size: .9rem; display: flex; align-items: center; gap: .45rem; min-width: 0; }
.qc-crit { font-size: .45rem; color: #DC2626; }
.qc-opts { display: flex; gap: .3rem; flex-shrink: 0; }
.qc-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .32rem .7rem; border-radius: 8px; border: 1px solid var(--bu-border-strong); background: var(--bu-surface); color: var(--bu-muted); font-size: .8rem; font-weight: 600; cursor: pointer; user-select: none; transition: all .12s; }
.qc-btn:hover { border-color: var(--bu-text-2); color: var(--bu-text); }
.btn-check:checked + .qc-btn.is-pass { background: #1F8A4C; border-color: #1F8A4C; color: #fff; }
.btn-check:checked + .qc-btn.is-fail { background: #C7372F; border-color: #C7372F; color: #fff; }
.btn-check:checked + .qc-btn.is-na { background: var(--tone-grey-bg); border-color: var(--bu-border-strong); color: var(--bu-text); }
.btn-check:focus-visible + .qc-btn { outline: 2px solid var(--bu-mango-600); outline-offset: 2px; }
@media (max-width: 575.98px) {
  .qc-row { flex-direction: column; align-items: stretch; gap: .4rem; }
  .qc-opts .qc-btn { flex: 1; justify-content: center; padding: .5rem; }
}

/* live status chips + bulk bar */
.status-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.status-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .8rem; border-radius: 99px; border: 1px solid var(--bu-border); background: var(--bu-surface); color: var(--bu-text-2) !important; font-size: .84rem; font-weight: 550 !important; text-decoration: none !important; box-shadow: var(--bu-shadow); transition: border-color .15s; }
.status-chip i { color: var(--bu-muted); }
.status-chip b { background: var(--bu-surface-2); border-radius: 99px; padding: 0 .5rem; font-size: .78rem; color: var(--bu-text); }
.status-chip:hover { border-color: var(--bu-mango); }
.status-chip.active { background: var(--bu-ink); border-color: var(--bu-ink); color: #fff !important; }
.status-chip.active i { color: var(--bu-mango); }
.status-chip.active b { background: var(--bu-mango); color: var(--bu-ink); }
[data-bs-theme=dark] .status-chip.active { background: var(--bu-mango); border-color: var(--bu-mango); color: var(--bu-ink) !important; }
[data-bs-theme=dark] .status-chip.active i { color: var(--bu-ink); }
[data-bs-theme=dark] .status-chip.active b { background: var(--bu-ink); color: var(--bu-mango); }
.bulk-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 1.25rem; z-index: 1040; display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem .6rem 1rem; border-radius: 14px; background: var(--bu-ink); color: #fff; box-shadow: var(--bu-shadow-lg); }
@media (min-width: 992px) { .bulk-bar { left: calc(50% + 128px); } }
@media (max-width: 991.98px) { .bulk-bar { bottom: calc(72px + env(safe-area-inset-bottom)); } }

/* workshop kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-col { background: var(--bu-surface-2); border: 1px solid var(--bu-border); border-radius: var(--bu-radius); padding: .6rem; display: flex; flex-direction: column; gap: .55rem; min-height: 200px; }
.kanban-head { display: flex; justify-content: space-between; align-items: center; padding: .2rem .3rem .4rem; font-weight: 650; font-size: .88rem; }
.kanban-head i { color: var(--bu-accent-text); }
.kanban-empty { text-align: center; color: var(--bu-muted); padding: 1.5rem 0; }
.job-card { display: block; background: var(--bu-surface); border: 1px solid var(--bu-border); border-left: 3px solid var(--bu-border-strong); border-radius: 10px; padding: .65rem .75rem; color: var(--bu-text) !important; text-decoration: none !important; font-weight: 400 !important; box-shadow: var(--bu-shadow); transition: border-color .15s, transform .15s; }
.job-card:hover { border-color: var(--bu-mango); transform: translateY(-1px); }
.job-card.is-urgent { border-left-color: #DC2626; }
.avatar-xs { width: 22px; height: 22px; font-size: .6rem; }
@media (max-width: 991.98px) { .kanban { grid-template-columns: repeat(4, 260px); } }

/* exchange card */
.exchange-card .exchange-body { display: none; }
.exchange-card.is-on { border-color: var(--bu-mango); box-shadow: 0 0 0 3px rgba(246, 178, 27, .15); }
.exchange-card.is-on .exchange-body { display: block; }
.exchange-kyc { border-top: 1px dashed var(--bu-border-strong); padding-top: .9rem; }

/* passbook covers + ticket timeline */
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.cover { border: 1px solid var(--bu-border); border-left: 4px solid var(--bu-border-strong); border-radius: 10px; padding: .6rem .75rem; background: var(--bu-surface); }
.cover.tone-ok { border-left-color: #22C55E; }
.cover.tone-mango { border-left-color: var(--bu-mango); background: var(--bu-mango-50); }
.cover.tone-grey { opacity: .75; }
.cover.tone-brown { border-left-color: var(--bu-brown); }
.cover-title { font-weight: 650; font-size: .88rem; }
.cover-title i { color: var(--bu-accent-text); }
.cover-value { font-weight: 750; font-size: 1.05rem; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.timeline { padding: .9rem 1.1rem .4rem 1.9rem; position: relative; }
.timeline li { position: relative; padding-bottom: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -1.05rem; top: .6rem; bottom: -.3rem; width: 2px; background: var(--bu-border); }
.timeline li:last-child::before { display: none; }
.tl-dot { position: absolute; left: -1.35rem; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bu-mango); box-shadow: 0 0 0 3px var(--bu-surface); }

/* ---------- Phase C: cash milan, party ledger, settlement ---------- */
.den-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem 1.25rem; }
.den-row { display: grid; grid-template-columns: 58px 10px minmax(44px, 1fr) 72px; align-items: center; gap: .4rem; margin: 0; cursor: text; }
.den-note { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bu-text); background: var(--bu-mango-50); border: 1px solid var(--bu-mango-100); border-radius: 8px; padding: .2rem .45rem; text-align: center; font-size: .82rem; }
.den-coins .den-note { background: var(--bu-surface-2); border-color: var(--bu-border); }
.den-amt { text-align: right; font-variant-numeric: tabular-nums; color: var(--bu-muted); font-size: .84rem; }
[data-bs-theme=dark] .den-note { background: rgba(246, 178, 27, .12); border-color: rgba(246, 178, 27, .25); }
.kpi-hero .kpi-value .text-body-secondary, .kpi-hero .kpi-sub { color: rgba(255, 255, 255, .7) !important; }

/* ---------- Phase D1: executive dashboard ---------- */
:root, [data-bs-theme=light] {
  --st-good: #0ca30c; --st-warning: #fab219; --st-serious: #ec835a; --st-critical: #d03b3b;
  --st-good-t: #166534; --st-warning-t: #7A5000; --st-serious-t: #9A3412; --st-critical-t: #B42318;
}
[data-bs-theme=dark] { --st-good-t: #4ADE80; --st-warning-t: #FCD34D; --st-serious-t: #FDBA74; --st-critical-t: #F87171; }
.st-good { background: var(--st-good); color: #fff; } .st-warning { background: var(--st-warning); color: #0b0b0b; }
.st-serious { background: var(--st-serious); color: #fff; } .st-critical { background: var(--st-critical); color: #fff; }
.st-good-i { color: var(--st-good); } .st-warning-i { color: var(--st-warning); } .st-serious-i { color: var(--st-serious); } .st-critical-i { color: var(--st-critical); }
.st-good-t { color: var(--st-good-t) !important; } .st-warning-t { color: var(--st-warning-t) !important; } .st-serious-t { color: var(--st-serious-t) !important; } .st-critical-t { color: var(--st-critical-t) !important; }
.exec-hero { font-size: 3rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.05; margin: .55rem 0 .35rem; color: var(--bu-mango); }
.kpi-hero .kpi-sub { color: rgba(255, 255, 255, .72); }
.kpi-hero .delta-good { color: #6EE7A0; } .kpi-hero .delta-bad { color: #FCA5A5; } .kpi-hero .delta-vs { color: rgba(255, 255, 255, .55); }
.delta { font-weight: 650; font-size: .8rem; white-space: nowrap; }
.delta-good { color: var(--st-good-t); } .delta-bad { color: var(--st-critical-t); } .delta-flat { color: var(--bu-muted); }
.delta-vs { font-size: .74rem; color: var(--bu-muted); }
.exec-note { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .82rem; padding: .7rem 1rem; border: 1px dashed var(--bu-border-strong); border-radius: var(--bu-radius-sm); background: var(--bu-surface); }
.exec-nav { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--bu-border); padding-bottom: .5rem; position: sticky; top: 64px; z-index: 5; background: var(--bu-bg); }
.exec-nav a { font-size: .82rem; font-weight: 600; color: var(--bu-text-2); text-decoration: none; padding: .3rem .65rem; border-radius: 99px; }
.exec-nav a:hover { background: var(--bu-hover); color: var(--bu-text); }
.exec-h { font-size: 1.05rem; font-weight: 700; margin: .25rem 0 .75rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; scroll-margin-top: 120px; }
.exec-h i { color: var(--bu-accent-text); }
.exec-h small { font-size: .78rem; font-weight: 500; color: var(--bu-muted); }
.risk-list .list-group-item { padding: 0; }
.risk-list a { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .62rem 1rem; color: var(--bu-text); text-decoration: none; font-size: .86rem; }
.risk-list a:hover { background: var(--bu-hover); }
.risk-list a > span i { width: 22px; color: var(--bu-muted); }
.risk-list small { color: var(--bu-muted); margin-left: .25rem; }
.risk-list b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-thin { height: 8px; border-radius: 99px; background: var(--bu-mango-100); overflow: hidden; }
.meter-thin span { display: block; height: 100%; border-radius: 99px; background: var(--bu-mango); }
[data-bs-theme=dark] .meter-thin { background: rgba(246, 178, 27, .16); }
.hbars { display: flex; flex-direction: column; gap: .55rem; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: .6rem; font-size: .84rem; border-radius: 6px; }
.hbar:hover .hbar-fill, .hbar:focus .hbar-fill { background: var(--bu-mango-600); }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-label small, .hbar-val small { color: var(--bu-muted); }
.hbar-track { height: 14px; background: transparent; position: relative; }
.hbar-fill { display: block; height: 100%; min-width: 2px; background: var(--bu-mango); border-radius: 0 4px 4px 0; transition: background-color .15s; }
.hbar-fill.is-neg { background: var(--st-critical); }
.hbar-val { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; min-width: 92px; }
.segbar { display: flex; gap: 2px; height: 28px; border-radius: 4px; overflow: hidden; }
.seg { display: flex; align-items: center; padding-left: .5rem; font-size: .78rem; font-weight: 700; border-radius: 4px; min-width: 2px; outline-offset: 2px; }
.seg-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: .55rem; font-size: .8rem; color: var(--bu-text-2); }
.seg-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.aging-tile { border: 1px solid var(--bu-border); border-left-width: 4px; border-radius: var(--bu-radius-sm); padding: .7rem .85rem; height: 100%; background: var(--bu-surface); }
.st-good-b { border-left-color: var(--st-good); } .st-warning-b { border-left-color: var(--st-warning); } .st-serious-b { border-left-color: var(--st-serious); } .st-critical-b { border-left-color: var(--st-critical); }
.aging-head { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--bu-text-2); display: flex; gap: .4rem; align-items: center; }
.aging-val { font-size: 1.45rem; font-weight: 750; margin-top: .2rem; }
.aging-val small { font-size: .78rem; font-weight: 500; color: var(--bu-muted); }
.aging-sub { font-size: .8rem; color: var(--bu-text-2); }
.chart-bar.is-neg { fill: var(--st-critical); }
.chart-base { stroke: var(--bu-border-strong); }
.chart-val { font-weight: 600; fill: var(--bu-text-2); }
@media print { .exec-nav { display: none; } .exec-hero { color: #000; } }

/* Online enquiries – unread rows */
.table-warning-soft > td { background: var(--bu-hover) !important; }

/* Split payments (payment_split) */
.pay-split .card-body { display: flex; flex-direction: column; gap: .5rem; }
.pay-rows { display: flex; flex-direction: column; gap: .5rem; }
.pay-rows:empty { display: none; }
.pay-row { display: grid; grid-template-columns: 1.6rem minmax(0, 1.15fr) minmax(0, 1fr) 2.25rem 2.25rem; gap: .4rem; align-items: center; }
.pay-row .pay-no { font-size: .75rem; font-weight: 700; color: var(--bu-muted); text-align: center; font-variant-numeric: tabular-nums; }
.pay-row .pay-amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.pay-btn { width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--bu-border); background: var(--bu-surface); color: var(--bu-text-2); border-radius: var(--bu-radius-sm); padding: 0; }
.pay-btn:hover { background: var(--bu-hover); color: var(--bu-text); }
.pay-btn.pay-remove:hover { background: var(--tone-bad-bg); color: var(--tone-bad-fg); border-color: transparent; }
span.pay-btn { border: 0; background: none; }
.pay-err { grid-column: 2 / -1; font-size: .75rem; color: var(--tone-bad-fg); display: none; }
.pay-row.is-invalid .pay-err { display: block; }
.pay-row.is-invalid .form-select, .pay-row.is-invalid .form-control { border-color: var(--tone-bad-fg); }
.pay-row.is-system { background: var(--bu-surface-2); border: 1px dashed var(--bu-border-strong); border-radius: var(--bu-radius-sm); padding: .35rem 0; grid-template-columns: 1.6rem minmax(0, 1fr) auto 2.25rem; }
.pay-sys-label { display: flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 600; min-width: 0; }
.pay-sys-label i { color: var(--bu-accent-text); }
.pay-sys-label small { display: block; font-weight: 500; color: var(--bu-muted); font-size: .72rem; }
.pay-sys-amt { font-weight: 700; font-variant-numeric: tabular-nums; padding-right: .25rem; }
.pay-add-line { align-self: flex-start; border: 1px dashed var(--bu-border-strong); background: none; color: var(--bu-accent-text); font-size: .82rem; font-weight: 600; border-radius: 99px; padding: .3rem .8rem; }
.pay-add-line:hover { background: var(--bu-hover); }
.pay-advance { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: var(--tone-mango-bg); color: var(--tone-mango-fg); border: 1px solid transparent; border-radius: var(--bu-radius-sm); padding: .5rem .7rem; font-size: .85rem; }
.pay-advance span { flex: 1 1 180px; }
.pay-summary { margin: .25rem 0 0; border-top: 1px solid var(--bu-border); padding-top: .5rem; display: grid; gap: .2rem; }
.pay-summary > div { display: flex; justify-content: space-between; align-items: baseline; font-size: .9rem; }
.pay-summary dt { font-weight: 500; color: var(--bu-text-2); }
.pay-summary dt small { color: var(--bu-muted); font-weight: 500; }
.pay-summary dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-summary .is-remaining.is-due dd { color: var(--tone-mango-fg); }
.pay-summary .is-excess dd, .pay-summary .is-excess dt { color: var(--tone-bad-fg); }
.pay-status { font-size: .95rem; font-weight: 700; padding: .5rem .75rem; border-radius: var(--bu-radius-sm); text-align: right; }
.pay-status.tone-ok { background: var(--tone-ok-bg); color: var(--tone-ok-fg); }
.pay-status.tone-bad { background: var(--tone-bad-bg); color: var(--tone-bad-fg); }
.pay-status.tone-warn { background: var(--tone-mango-bg); color: var(--tone-mango-fg); }
.pay-status.tone-muted { background: var(--bu-surface-2); color: var(--bu-muted); font-weight: 600; }
.pay-status.shake { animation: pay-shake .3s; }
@keyframes pay-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .pay-status.shake { animation: none; } }
.pay-split.is-flat { border: 0; box-shadow: none; background: transparent; }
.pay-split.is-flat > .card-header { padding: 0 0 .6rem; background: none; border: 0; font-weight: 600; }
.pay-split.is-flat > .card-body { padding: 0; }
/* narrow boxes (purchase side column, settlement footer, phones): method + buttons on one line, amount full width below */
.pay-split { container-type: inline-size; container-name: paysplit; }
.pay-row:not(.is-system) { grid-template-areas: "no mode amt fill rm"; }
.pay-row:not(.is-system) > .pay-no { grid-area: no; } .pay-row:not(.is-system) > .pay-mode { grid-area: mode; } .pay-row:not(.is-system) > .pay-amt { grid-area: amt; }
.pay-row:not(.is-system) > .pay-fill { grid-area: fill; } .pay-row:not(.is-system) > .pay-remove { grid-area: rm; }
@container paysplit (max-width: 365px) {
  .pay-row:not(.is-system) { grid-template-columns: 1.3rem minmax(0, 1fr) 2.25rem 2.25rem; grid-template-areas: "no mode fill rm" ". amt amt amt"; row-gap: .35rem; }
  .pay-row:not(.is-system) + .pay-row { border-top: 1px dashed var(--bu-border); padding-top: .5rem; }
  .pay-row .pay-amount { font-size: 1.05rem; }
}
.pay-split > .card-header { gap: .5rem; } .pay-split > .card-header .btn { white-space: nowrap; flex-shrink: 0; }

/* QC edit / history */
.qc-was { display: inline-block; font-size: .85rem; color: var(--bu-muted); border: 1px dashed var(--bu-border-strong); border-radius: 99px; padding: .2rem .7rem; }
.qc-was.is-changed { color: var(--tone-mango-fg); background: var(--tone-mango-bg); border-color: transparent; }
.qc-edit { padding: .75rem 1rem; border-top: 1px solid var(--bu-border); }
.qc-edit:first-child { border-top: 0; }
.qc-edit-head { font-size: .85rem; margin-bottom: .2rem; }
.qc-edit-reason { font-size: .85rem; margin-bottom: .4rem; }
.qc-diff th { font-size: .72rem; }
.qc-diff td { font-size: .82rem; }
.qc-diff .qc-old { color: var(--bu-muted); text-decoration: line-through; }
.qc-diff .qc-new { font-weight: 650; }

/* Product photo manager (item page) */
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.pm-tile { position: relative; border: 1px solid var(--bu-border); border-radius: var(--bu-radius-sm); background: var(--bu-surface); overflow: hidden; cursor: grab; transition: box-shadow .15s, opacity .15s; }
.pm-tile.is-drag { opacity: .45; }
.pm-tile.is-cover { border-color: var(--bu-mango); box-shadow: 0 0 0 2px var(--bu-mango); }
.pm-tile.is-del { opacity: .55; }
.pm-tile.is-del .pm-img img { filter: grayscale(1); }
.pm-tile.is-busy { pointer-events: none; opacity: .6; }
.pm-img { position: relative; display: block; aspect-ratio: 1; background: var(--bu-surface-2); }
.pm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-video { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--bu-muted); }
.pm-pos { position: absolute; top: .35rem; left: .35rem; min-width: 1.5rem; height: 1.5rem; border-radius: 99px; background: rgba(0,0,0,.65); color: #fff; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 .35rem; }
.pm-flags { position: absolute; left: .35rem; right: .35rem; bottom: .35rem; display: flex; flex-wrap: wrap; gap: .25rem; }
.pm-flag { display: none; align-items: center; gap: .25rem; font-size: .68rem; font-weight: 700; border-radius: 6px; padding: .1rem .4rem; background: rgba(0,0,0,.7); color: #fff; }
.pm-tile.is-cover .f-cover { display: inline-flex; background: var(--bu-mango); color: #1C1917; }
.pm-tile.is-hidden .f-hidden { display: inline-flex; }
.pm-tile.is-new .f-new { display: inline-flex; background: #166534; }
.pm-tile.is-del .f-del { display: inline-flex; background: #B42318; }
.pm-actions { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--bu-border); }
.pm-btn { display: flex; align-items: center; justify-content: center; height: 2.1rem; border: 0; background: none; color: var(--bu-text-2); cursor: pointer; margin: 0; font-size: .85rem; }
.pm-btn:hover { background: var(--bu-hover); color: var(--bu-text); }
.pm-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pm-btn.is-off { opacity: .25; cursor: not-allowed; }
.pm-star:has(input:checked) { color: var(--bu-mango-600); background: var(--tone-mango-bg); }
.pm-eye:has(input:not(:checked)) { color: var(--tone-bad-fg); }
.pm-eye:has(input:not(:checked)) i::before { content: "\f070"; }
.pm-btn:focus-within, .pm-btn:focus-visible { outline: 2px solid var(--bu-mango); outline-offset: -2px; }
.pm-del:hover { color: var(--tone-bad-fg); }
.pm-err { font-size: .72rem; color: var(--tone-bad-fg); padding: 0 .4rem; }
.pm-err:empty { display: none; }
.pm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--bu-border); }
[data-pm-status].is-dirty { color: var(--tone-mango-fg) !important; font-weight: 600; }

/* Billing cart (multi-product invoices) */
.cart-table th { font-size: .72rem; }
.cart-table td { vertical-align: middle; }
.cart-table .cart-no { color: var(--bu-muted); font-weight: 700; font-size: .8rem; }
.cart-table .cart-price { max-width: 9rem; margin-left: auto; }
.cart-line-disc { color: var(--tone-mango-fg); font-weight: 600; }
.cart-empty { text-align: center; color: var(--bu-muted); padding: 1.25rem .5rem; border: 1px dashed var(--bu-border-strong); border-radius: var(--bu-radius-sm); margin-top: .5rem; font-size: .9rem; }
.cart-msg { font-size: .85rem; min-height: 1.4rem; margin: .4rem 0; }
.cart-msg.tone-ok { color: var(--tone-ok-fg); } .cart-msg.tone-bad { color: var(--tone-bad-fg); font-weight: 600; } .cart-msg.tone-warn { color: var(--tone-mango-fg); font-weight: 600; }
.cart-sum { margin: .75rem 0 0; border-top: 1px solid var(--bu-border); padding-top: .5rem; display: grid; gap: .2rem; }
.cart-sum > div { display: flex; justify-content: space-between; align-items: baseline; font-size: .9rem; }
.cart-sum dt { font-weight: 500; color: var(--bu-text-2); } .cart-sum dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-sum .is-disc dd { color: var(--tone-mango-fg); }
.cart-sum .is-total { font-size: 1.15rem; } .cart-sum .is-total dt { color: var(--bu-text); font-weight: 700; }
.cart .card-body { container-type: inline-size; }
/* narrow card (phones): each product line becomes a two-row block – name on top, price / sale price / remove below */
@container (max-width: 520px) {
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody { display: block; }
  .cart-table tr { display: grid; grid-template-columns: 1.4rem 1fr auto 2.3rem; grid-template-areas: "no prod prod rm" "no list sale rm"; gap: .35rem .5rem; padding: .65rem 0; border-bottom: 1px solid var(--bu-border); align-items: center; }
  .cart-table td { display: block; border: 0; padding: 0; box-shadow: none; background: transparent; }
  .cart-table td:nth-child(1) { grid-area: no; align-self: start; padding-top: .1rem; }
  .cart-table td:nth-child(2) { grid-area: prod; min-width: 0; }
  .cart-table td:nth-child(3) { grid-area: list; text-align: left; font-size: .85rem; color: var(--bu-text-2); }
  .cart-table td:nth-child(3)::before { content: 'Price '; color: var(--bu-muted); font-size: .75rem; }
  .cart-table td:nth-child(4) { grid-area: sale; }
  .cart-table td:nth-child(5) { grid-area: rm; align-self: start; }
  .cart-table .cart-price { max-width: 8.5rem; }
}

/* ---------- E2: protection plan + accessories card (sale forms) ---------- */
.xsell .xs-title { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bu-text-2); margin-bottom: .45rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.xsell .xs-title i { color: var(--bu-mango-600, #d89400); }
.xsell .xs-dev { border: 1px solid var(--bu-border); border-radius: var(--bu-radius-sm); padding: .55rem .65rem; margin-bottom: .5rem; }
.xsell .xs-dev-h { font-size: .86rem; margin-bottom: .4rem; }
.xsell .xs-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .4rem; }
.xsell .xs-opt { display: flex; gap: .5rem; align-items: flex-start; border: 1px solid var(--bu-border); border-radius: 8px; padding: .45rem .55rem; cursor: pointer; margin: 0; background: var(--bu-surface); transition: border-color .15s, background-color .15s; }
.xsell .xs-opt:hover { border-color: var(--bu-border-strong); }
.xsell .xs-opt input { margin-top: .2rem; accent-color: var(--bu-mango); }
.xsell .xs-opt span { display: flex; flex-direction: column; font-size: .84rem; line-height: 1.3; }
.xsell .xs-opt small { color: var(--bu-muted); font-size: .74rem; }
.xsell .xs-opt:has(input:checked) { border-color: var(--bu-mango); background: rgba(246, 178, 27, .09); }
.xsell .xs-acc { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem; }
.xsell .xs-acc-item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border: 1px dashed var(--bu-border); border-radius: 8px; padding: .4rem .55rem; }
.xsell .min-w-0 { min-width: 0; }
.cart-sum .is-plan dd { color: var(--bu-mango-600, #b77c00); font-weight: 600; }
.pay-repeat { background: rgba(246, 178, 27, .10); }
/* exchange approval (salesman request): details locked while waiting / after approval */
.exchange-card .ex-locked { opacity: .78; }
.exchange-card .ex-locked .form-control, .exchange-card .ex-locked .form-select { background-color: var(--bs-tertiary-bg); }
.exreq-box { border-top: 1px dashed var(--bu-border-strong); padding-top: .9rem; }
.exchange-card .ex-locked .catalog-manual-link { display: none; }
.qc-group { padding: .45rem 1.1rem; background: var(--bs-tertiary-bg); font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--bu-text-2); border-bottom: 1px solid var(--bu-border); }
.qc-row[data-optional="1"] .qc-label::after { content: "(sirf kuch phones me)"; font-weight: 400; font-size: .74rem; color: var(--bu-muted); margin-left: .35rem; }

/* v27: store business model picker (COCO / COFO / FOCO / FOFO) */
.model-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 1400px) { .model-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.model-card { display: block; height: 100%; padding: 10px 12px; border: 1px solid var(--bu-border); border-radius: var(--bu-radius-sm); background: var(--bu-surface); cursor: pointer; transition: border-color .15s, background .15s; }
.model-card b { font-size: 1rem; letter-spacing: .04em; }
.model-card:hover { border-color: var(--bu-border-strong); }
.btn-check:checked + .model-card { border-color: var(--bu-mango); background: var(--bu-mango-50); box-shadow: 0 0 0 2px rgba(246, 178, 27, .35); }
.btn-check:focus-visible + .model-card { outline: 2px solid var(--bu-mango); outline-offset: 2px; }

/* v28 – business growth card on the dashboard */
.growth-tile { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border: 1px solid var(--bs-border-color); border-radius: 12px; color: inherit; text-decoration: none; background: var(--bs-body-bg); transition: border-color .15s, box-shadow .15s; }
.growth-tile:hover, .growth-tile:focus-visible { border-color: var(--bs-primary); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.growth-tile b { line-height: 1.2; overflow-wrap: anywhere; }
.growth-list { list-style: none; padding: 0; }
ol.growth-list { counter-reset: g; }
.growth-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--bs-border-color); }
.growth-list li:last-child { border-bottom: 0; }
ol.growth-list li span::before { counter-increment: g; content: counter(g) ". "; color: var(--bs-secondary-color); }
.growth-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.growth-list li > :last-child { white-space: nowrap; }

/* v29 – security / notifications / approvals */
.totp-qr { width: 176px; height: 176px; margin: 0 auto; padding: 6px; background: #fff; border-radius: 10px; }
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.backup-grid code { font-size: .95rem; letter-spacing: .04em; text-align: center; padding: 4px; background: rgba(0,0,0,.05); border-radius: 6px; }
.bell-btn { position: relative; }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; line-height: 18px; text-align: center; background: #DC2626; color: #fff; font-weight: 700; }
.bell-menu { width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; padding: 0; }
.bell-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--bs-border-color); color: inherit; text-decoration: none; }
.bell-item:hover { background: var(--bs-tertiary-bg); }
.bell-item.is-unread { background: rgba(246, 178, 27, .10); }
.bell-item small { display: block; color: var(--bs-secondary-color); }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .82rem; }
.chain .step { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--bs-border-color); white-space: nowrap; }
.chain .step.is-done { background: #DCFCE7; border-color: #86EFAC; color: #166534; }
.chain .step.is-now { background: #FEF3C7; border-color: #FCD34D; color: #7A5000; font-weight: 600; }
.chain .step.is-skip { opacity: .55; text-decoration: line-through; }
.chain .step.is-bad { background: #FEE2E2; border-color: #FCA5A5; color: #B42318; }
[data-bs-theme=dark] .chain .step.is-done { background: #14532D; color: #BBF7D0; border-color: #166534; }
[data-bs-theme=dark] .chain .step.is-now { background: #422006; color: #FDE68A; border-color: #854D0E; }
[data-bs-theme=dark] .chain .step.is-bad { background: #450A0A; color: #FECACA; border-color: #7F1D1D; }

/* v35: forecast bars + KPI scorecard */
.chart-bar.is-fc { fill: var(--bu-mango); opacity: .38; stroke: var(--bu-mango-600); stroke-width: 1; stroke-dasharray: 3 2; }
.kpi-table td.kpi-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-table .kpi-t { font-size: .7rem; color: var(--bu-muted); font-weight: 400; }
.kpi-ok { background: color-mix(in srgb, var(--st-good, #16a34a) 14%, transparent) !important; }
.kpi-near { background: color-mix(in srgb, var(--bu-mango) 22%, transparent) !important; }
.kpi-bad { background: color-mix(in srgb, var(--st-critical, #dc2626) 14%, transparent) !important; }
.kpi-legend { display: inline-block; padding: 0 .4rem; border-radius: 6px; font-size: .8rem; }

/* v36: attendance codes, calendar, register */
.att-c { display: inline-block; min-width: 1.6rem; padding: 0 .2rem; border-radius: 5px; font-size: .72rem; font-weight: 600; text-align: center; line-height: 1.35rem; }
.att-present { background: var(--tone-ok-bg); color: var(--tone-ok-fg); }
.att-half { background: var(--tone-mango-bg); color: var(--tone-mango-fg); }
.att-absent, .att-unpaid { background: var(--tone-bad-bg); color: var(--tone-bad-fg); }
.att-leave { background: var(--tone-brown-bg); color: var(--tone-brown-fg); }
.att-holiday, .att-week_off { background: var(--tone-grey-bg); color: var(--tone-grey-fg); }
.att-none { color: var(--bu-muted); }
.att-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.att-day { position: relative; border: 1px solid var(--bu-border); border-radius: 8px; padding: 2px 4px 4px; text-align: center; }
.att-day small { display: block; font-size: .65rem; color: var(--bu-muted); text-align: left; }
.att-day.today { border-color: var(--bu-mango-600); box-shadow: 0 0 0 1px var(--bu-mango-600); }
.att-late { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--bu-mango-600); }
.att-reg td, .att-reg th { padding: .2rem .25rem; }
.att-reg .sticky-col { position: sticky; left: 0; background: var(--bs-body-bg); z-index: 1; }
.att-wd { font-size: .65rem; font-weight: 600; text-align: center; color: var(--bu-muted); text-transform: uppercase; }
/* v37: circulars */
.circ-stores { max-height: 220px; overflow: auto; }
.circ-body { white-space: normal; line-height: 1.6; }
/* v38: budget */
.bud-ok { background: var(--st-good, #16a34a); }
.bud-near { background: var(--bu-mango-600, #E09A00); }
.bud-bad { background: var(--st-critical, #dc2626); }
.bud-grid input.form-control-sm { min-width: 5.5rem; }
.bud-grid .sticky-col { position: sticky; left: 0; background: var(--bs-body-bg); z-index: 1; }

/* v141: the phone's country flag + product condition */
.cflag { display: inline-block; height: 14px; width: auto; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.14); }
.cflag-txt { height: auto; padding: 0 3px; font-size: 10px; font-weight: 700; line-height: 14px; background: var(--bs-tertiary-bg, #eee); color: var(--bs-body-color); }
.cflag-badge { white-space: nowrap; }
.cflag-group .input-group-text { min-width: 2.4rem; justify-content: center; }
.cond-badge { font-weight: 600; }
