/* ==========================================================================
   MultiBranch ERP — Premium theme
   Palette & typography follow the reference login design:
   Plus Jakarta Sans · royal-blue gradient · deep navy · gold accent
   ========================================================================== */

@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('../../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 800; font-display: swap; src: url('../../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-800-normal.woff2') format('woff2'); }

:root {
    --bg-page: #f0f4f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-soft: #eef2f7;

    --primary: #2563eb;
    --primary-600: #1d4ed8;
    --primary-700: #1e40af;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-gradient: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    --primary-glow: rgba(37, 99, 235, 0.25);

    --gold: #f59e0b;
    --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gold-glow: rgba(245, 158, 11, 0.35);

    --navy-950: #070d1f;
    --navy-900: #0b1329;
    --navy-800: #101b3b;
    --navy-700: #18264f;
    --navy-gradient: linear-gradient(180deg, #0b1329 0%, #0f1a3a 55%, #141c4b 100%);

    --text-title: #0f172a;
    --text-body: #475569;
    --text-muted: #94a3b8;

    --success: #16a34a; --success-50: #f0fdf4; --success-100: #dcfce7;
    --danger: #dc2626;  --danger-50: #fef2f2;  --danger-100: #fee2e2;
    --warning: #d97706; --warning-50: #fffbeb; --warning-100: #fef3c7;
    --info: #0891b2;    --info-50: #ecfeff;    --info-100: #cffafe;
    --orange: #ea580c;  --orange-50: #fff7ed;
    --violet: #7c3aed;  --violet-50: #f5f3ff;
    --pink: #db2777;    --pink-50: #fdf2f8;

    --input-bg: #f8fafc;
    --input-border: #e2e8f0;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-card: 0 12px 32px -14px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.75);
    --shadow-hover: 0 22px 44px -18px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(203, 213, 225, 0.9);
    --shadow-lg: 0 25px 60px -15px rgba(15, 23, 42, 0.18);

    --sidebar-w: 272px;
    --sidebar-mini: 84px;
    --topbar-h: 72px;
    --bottom-nav-h: 68px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --bs-body-font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bs-body-color: var(--text-body);
    --bs-body-bg: var(--bg-page);
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-link-color: #1d4ed8;
    --bs-link-hover-color: #1e40af;
    --bs-border-color: var(--border);
    --bs-border-radius: var(--radius-md);
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--bs-body-font-family);
    font-size: 0.9rem;
    color: var(--text-body);
    background-color: var(--bg-page);
    background-image:
        radial-gradient(at 0% 0%, rgba(219, 234, 254, 0.65) 0px, transparent 45%),
        radial-gradient(at 100% 100%, rgba(224, 231, 255, 0.6) 0px, transparent 45%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--text-title); font-weight: 700; letter-spacing: -0.015em; }
a { text-decoration: none; }
.text-title { color: var(--text-title) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-body-soft { color: var(--text-body) !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.fs-xs { font-size: 0.72rem !important; }
.fs-sm { font-size: 0.8rem !important; }
.small-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }
.min-w-0 { min-width: 0; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

::selection { background: var(--primary-100); color: var(--primary-700); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    width: var(--sidebar-w);
    background: var(--navy-gradient);
    color: #cbd5e1;
    display: flex; flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 40px -20px rgba(7, 13, 31, 0.55);
    overflow: hidden;
}
.sidebar::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.22) 0, transparent 40%),
        radial-gradient(circle at 100% 85%, rgba(245, 158, 11, 0.08) 0, transparent 35%);
}
.sidebar > * { position: relative; }

.sidebar-brand {
    display: flex; align-items: center; gap: 0.8rem;
    height: var(--topbar-h); padding: 0 1.35rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    flex-shrink: 0;
}
.brand-icon {
    width: 42px; height: 42px; flex-shrink: 0;
    border-radius: 12px; background: var(--gold-gradient);
    display: flex; align-items: center; justify-content: center; color: #fff;
    box-shadow: 0 8px 18px -4px var(--gold-glow);
}
.brand-icon svg { width: 22px; height: 22px; }
.brand-text { line-height: 1.15; min-width: 0; }
.brand-text strong { display: block; font-size: 1.05rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 0.72rem; font-weight: 600; color: #93c5fd; letter-spacing: 0.04em; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 1rem 0.85rem 1.5rem; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.25) transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); }

.nav-section {
    font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
    color: #64748b; padding: 1.1rem 0.85rem 0.5rem; white-space: nowrap;
}
.nav-section:first-child { padding-top: 0.25rem; }

.side-link {
    display: flex; align-items: center; gap: 0.8rem; width: 100%;
    padding: 0.62rem 0.85rem; margin-bottom: 2px;
    border-radius: 12px; border: 0; background: transparent;
    color: #cbd5e1; font-size: 0.875rem; font-weight: 500; text-align: left;
    transition: var(--transition); white-space: nowrap; position: relative;
}
.side-link i.side-icon { font-size: 1.2rem; width: 22px; text-align: center; color: #94a3b8; transition: var(--transition); flex-shrink: 0; }
.side-link .side-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.side-link .side-caret { font-size: 1.05rem; color: #64748b; transition: transform 0.25s ease; }
.side-link[aria-expanded="true"] .side-caret { transform: rotate(90deg); }
.side-link:hover { background: rgba(148, 163, 184, 0.09); color: #fff; }
.side-link:hover i.side-icon { color: #fff; }
.side-link.active {
    background: var(--primary-gradient); color: #fff; font-weight: 600;
    box-shadow: 0 10px 22px -8px rgba(37, 99, 235, 0.6);
}
.side-link.active i.side-icon { color: #fff; }
.side-link.open { color: #fff; background: rgba(148, 163, 184, 0.07); }
.side-link.open i.side-icon { color: #fbbf24; }
.side-badge { font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.45rem; border-radius: 999px; background: var(--gold); color: #1e1b0b; }

.side-sub { padding: 0.2rem 0 0.4rem 2.15rem; position: relative; }
.side-sub::before { content: ''; position: absolute; left: 1.55rem; top: 0.3rem; bottom: 0.6rem; width: 1px; background: rgba(148, 163, 184, 0.16); }
.side-sublink {
    display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.75rem; border-radius: 10px;
    color: #94a3b8; font-size: 0.83rem; font-weight: 500; transition: var(--transition); white-space: nowrap; position: relative;
}
.side-sublink::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #475569; flex-shrink: 0; transition: var(--transition); margin-left: -0.95rem; margin-right: 0.35rem; }
.side-sublink:hover { color: #fff; background: rgba(148, 163, 184, 0.07); }
.side-sublink.active { color: #fff; font-weight: 600; background: rgba(59, 130, 246, 0.16); }
.side-sublink.active::before { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2); }

.sidebar-footer { padding: 0.9rem; border-top: 1px solid rgba(148, 163, 184, 0.1); flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem; border-radius: 14px; background: rgba(148, 163, 184, 0.08); }
.sidebar-user .avatar { box-shadow: none; }
.sidebar-user .u-name { color: #fff; font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .u-role { color: #94a3b8; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-backdrop { position: fixed; inset: 0; background: rgba(7, 13, 31, 0.55); backdrop-filter: blur(3px); z-index: 1035; opacity: 0; visibility: hidden; transition: var(--transition); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* Desktop mini sidebar */
@media (min-width: 992px) {
    body.sidebar-mini .sidebar { width: var(--sidebar-mini); }
    body.sidebar-mini .main { margin-left: var(--sidebar-mini); }
    body.sidebar-mini .brand-text,
    body.sidebar-mini .nav-section,
    body.sidebar-mini .side-link .side-text,
    body.sidebar-mini .side-link .side-caret,
    body.sidebar-mini .side-link .side-badge,
    body.sidebar-mini .side-sub,
    body.sidebar-mini .sidebar-user > div:not(.avatar) { display: none !important; }
    body.sidebar-mini .sidebar-brand { padding: 0; justify-content: center; }
    body.sidebar-mini .side-link { justify-content: center; padding: 0.7rem; }
    body.sidebar-mini .nav-section { height: 0.6rem; padding: 0; }
    body.sidebar-mini .sidebar-user { justify-content: center; background: transparent; }
    body.sidebar-mini .sidebar:hover { width: var(--sidebar-w); }
    body.sidebar-mini .sidebar:hover .brand-text,
    body.sidebar-mini .sidebar:hover .side-link .side-text,
    body.sidebar-mini .sidebar:hover .side-link .side-caret,
    body.sidebar-mini .sidebar:hover .sidebar-user > div:not(.avatar) { display: block !important; }
    body.sidebar-mini .sidebar:hover .nav-section { display: block !important; height: auto; padding: 1.1rem 0.85rem 0.5rem; }
    body.sidebar-mini .sidebar:hover .side-sub.show { display: block !important; }
    body.sidebar-mini .sidebar:hover .side-link { justify-content: flex-start; padding: 0.62rem 0.85rem; }
    body.sidebar-mini .sidebar:hover .sidebar-brand { padding: 0 1.35rem; justify-content: flex-start; }
    body.sidebar-mini .sidebar:hover .sidebar-user { justify-content: flex-start; background: rgba(148, 163, 184, 0.08); }
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: min(86vw, 300px); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
    body.sidebar-open { overflow: hidden; }
    .main { margin-left: 0; }
}

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
    position: sticky; top: 0; z-index: 1020;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0 1.75rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}
.topbar-toggle, .icon-btn {
    width: 42px; height: 42px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; border: 1px solid var(--border); background: #fff;
    color: var(--text-body); font-size: 1.25rem; transition: var(--transition); position: relative;
}
.topbar-toggle:hover, .icon-btn:hover { color: var(--primary); border-color: var(--primary-200); background: var(--primary-50); }
.icon-btn .dot-badge {
    position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 1.12rem; font-weight: 800; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .crumbs { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .crumbs a { color: var(--text-muted); }
.topbar-title .crumbs a:hover { color: var(--primary); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }

.branch-switcher { width: 250px; }
.branch-switcher .select2-container--erp .select2-selection--single { height: 42px; border-radius: 12px; background: var(--primary-50); border-color: var(--primary-100); }
.branch-switcher .select2-container--erp .select2-selection--single .select2-selection__rendered { color: var(--primary-700); font-weight: 600; padding-left: 2.35rem; }
.branch-switcher { position: relative; }
.branch-switcher > i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); z-index: 2; color: var(--primary); font-size: 1.05rem; pointer-events: none; }

.user-chip { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.4rem 0.3rem 0.3rem; border-radius: 14px; border: 1px solid var(--border); background: #fff; transition: var(--transition); }
.user-chip:hover { border-color: var(--primary-200); box-shadow: var(--shadow-xs); }
.user-chip .u-name { font-size: 0.82rem; font-weight: 700; color: var(--text-title); line-height: 1.1; }
.user-chip .u-role { font-size: 0.7rem; color: var(--text-muted); }

.avatar {
    width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-gradient); color: #fff; font-weight: 700; font-size: 0.8rem;
    box-shadow: 0 6px 14px -6px var(--primary-glow);
}
.avatar.avatar-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.15rem; }
.avatar.avatar-gold { background: var(--gold-gradient); box-shadow: 0 6px 14px -6px var(--gold-glow); }

.dropdown-menu {
    border: 1px solid var(--border); border-radius: 16px; padding: 0.5rem;
    box-shadow: var(--shadow-lg); font-size: 0.86rem; min-width: 14rem;
    animation: dropIn 0.18s ease-out;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dropdown-item { border-radius: 10px; padding: 0.55rem 0.75rem; color: var(--text-body); font-weight: 500; display: flex; align-items: center; gap: 0.6rem; }
.dropdown-item i { font-size: 1.05rem; color: var(--text-muted); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--primary-50); color: var(--primary-700); }
.dropdown-item:hover i { color: var(--primary); }
.dropdown-item.text-danger:hover { background: var(--danger-50); color: var(--danger) !important; }
.dropdown-header { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.dropdown-divider { border-color: var(--border-soft); }

/* Notification centre — top-bar bell panel (pending approvals + recent requests) */
.nc { position: relative; }
.icon-btn.nc-bell[aria-expanded="true"] { color: var(--primary); border-color: var(--primary-200); background: var(--primary-50); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
.icon-btn.nc-bell:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.icon-btn.nc-bell[aria-expanded="true"]:focus-visible { outline: 0; }
.nc-bell.has-items .dot-badge { animation: ncPulse 2.6s ease-out infinite; }
@keyframes ncPulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } }
@media (prefers-reduced-motion: reduce) { .nc-bell.has-items .dot-badge { animation: none; } }
.dropdown-menu.nc-panel {
    position: absolute; top: calc(100% + 12px); right: 0; left: auto; margin: 0;
    width: 380px; max-width: calc(100vw - 1.5rem); max-height: min(640px, calc(100vh - var(--topbar-h) - 2rem));
    padding: 0; overflow: hidden; border-radius: 18px; border: 1px solid var(--border); background: #fff;
    box-shadow: 0 32px 70px -22px rgba(15, 23, 42, 0.38), 0 10px 26px -14px rgba(15, 23, 42, 0.2);
    flex-direction: column;
}
.nc-panel.show { display: flex; }
.nc-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.95rem 1rem 0.85rem; background: linear-gradient(180deg, var(--primary-50), #fff); border-bottom: 1px solid var(--border-soft); flex-shrink: 0; }
.nc-head-icon { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--primary-gradient); color: #fff; font-size: 1.15rem; box-shadow: 0 8px 18px -8px var(--primary-glow); }
.nc-title { font-weight: 800; font-size: 0.98rem; color: var(--text-title); letter-spacing: -0.01em; line-height: 1.2; }
.nc-sub { font-size: 0.74rem; color: var(--text-muted); }
.nc-total { margin-left: auto; min-width: 30px; height: 26px; padding: 0 0.55rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.78rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px -6px rgba(239, 68, 68, 0.65); }
.nc-close { display: none; margin-left: auto; width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--border); background: #fff; color: var(--text-body); font-size: 1.2rem; align-items: center; justify-content: center; flex-shrink: 0; }
.nc-total + .nc-close { margin-left: 0.15rem; }
.nc-body { overflow-y: auto; overscroll-behavior: contain; padding: 0.2rem 0.55rem 0.65rem; }
.nc-section { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 0.75rem 0.45rem 0.35rem; }
.nc-panel .nc-item, .nc-panel .nc-row { display: flex; align-items: center; gap: 0.7rem; border-radius: 14px; color: var(--text-title); transition: background 0.15s ease; }
.nc-panel .nc-item { padding: 0.6rem 0.5rem; }
.nc-panel .nc-row { padding: 0.5rem 0.5rem; border-radius: 12px; }
.nc-panel .nc-item:hover, .nc-panel .nc-row:hover, .nc-panel .nc-item:focus-visible, .nc-panel .nc-row:focus-visible { background: var(--surface-2); outline: 0; }
.nc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.nc-item-title { font-weight: 700; font-size: 0.86rem; }
.nc-item-hint, .nc-row-meta { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.1rem; }
.nc-icon, .nc-row-icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: #2563eb; }
.nc-icon { width: 38px; height: 38px; border-radius: 12px; font-size: 1.1rem; }
.nc-row-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
.nc-count { min-width: 30px; height: 24px; padding: 0 0.5rem; border-radius: 999px; font-size: 0.76rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; background: #2563eb; color: #fff; flex-shrink: 0; }
.nc-go { color: var(--text-muted); font-size: 1.15rem; margin-left: -0.2rem; transition: transform 0.15s ease, color 0.15s ease; }
.nc-item:hover .nc-go { transform: translateX(2px); color: var(--primary); }
.nc-panel .tone-red .nc-icon, .nc-panel .tone-red .nc-row-icon { background: var(--danger-50); color: #dc2626; }
.nc-panel .tone-red .nc-count { background: #dc2626; }
.nc-panel .tone-green .nc-icon, .nc-panel .tone-green .nc-row-icon { background: var(--success-50); color: #16a34a; }
.nc-panel .tone-green .nc-count { background: #16a34a; }
.nc-panel .tone-violet .nc-icon, .nc-panel .tone-violet .nc-row-icon { background: var(--violet-50); color: #7c3aed; }
.nc-panel .tone-violet .nc-count { background: #7c3aed; }
.nc-panel .tone-cyan .nc-icon, .nc-panel .tone-cyan .nc-row-icon { background: var(--info-50); color: #0891b2; }
.nc-panel .tone-cyan .nc-count { background: #0891b2; }
.nc-feed { border-top: 1px dashed var(--border); margin-top: 0.15rem; padding-top: 0.1rem; }
.nc-section + .nc-feed { border-top: 0; margin-top: 0; padding-top: 0; }
.nc-row-title { font-weight: 800; font-size: 0.8rem; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; flex-shrink: 0; }
.nc-time { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.nc-amount { font-size: 0.8rem; font-weight: 800; color: var(--text-title); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nc-empty { text-align: center; padding: 1.7rem 1.25rem 1.5rem; }
.nc-empty-icon { width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 0.75rem; display: flex; align-items: center; justify-content: center; font-size: 1.65rem; color: var(--success); background: var(--success-50); box-shadow: inset 0 0 0 1px var(--success-100); }
.nc-empty-title { font-weight: 800; color: var(--text-title); font-size: 0.95rem; }
.nc-empty-text { font-size: 0.76rem; color: var(--text-muted); max-width: 260px; margin: 0.25rem auto 0; }
.is-app .topbar .icon-btn.nc-bell[aria-expanded="true"] { background: #fff; border-color: #fff; color: var(--primary-700); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16); }
@media (max-width: 575.98px) {
    .dropdown-menu.nc-panel {
        position: fixed; top: calc(var(--topbar-h) + 0.5rem); left: 0.75rem; right: 0.75rem; width: auto; max-width: none;
        max-height: calc(100vh - var(--topbar-h) - var(--bottom-nav-h) - env(safe-area-inset-bottom, 0px) - 1.5rem);
        max-height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h) - env(safe-area-inset-bottom, 0px) - 1.5rem);
    }
    .nc-close { display: inline-flex; }
}

@media (max-width: 991.98px) {
    .topbar { padding: 0 1rem; gap: 0.6rem; }
    .branch-switcher { width: 190px; }
}
@media (max-width: 767.98px) {
    :root { --topbar-h: 64px; }
    .topbar-title h1 { font-size: 1rem; }
    .branch-switcher, .topbar .user-chip .u-meta, .topbar .hide-mobile { display: none !important; }
    .topbar-toggle, .icon-btn { width: 40px; height: 40px; }
}

/* ==========================================================================
   Content
   ========================================================================== */
.content { flex: 1; padding: 1.75rem; width: 100%; max-width: 1640px; margin: 0 auto; }
.app-footer { padding: 0.8rem 1.75rem; font-size: 0.76rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; border-top: 1px solid var(--border-soft); }
.app-footer strong { color: var(--primary-700); }
.dev-link { color: inherit; text-decoration: none; }
.dev-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 991.98px) {
    .content { padding: 1.1rem 1rem calc(var(--bottom-nav-h) + 1.25rem); }
    .app-footer { padding: 1rem 1rem calc(var(--bottom-nav-h) + 1rem); justify-content: center; text-align: center; }
}

/* Page header */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.85rem 1rem; margin-bottom: 1.1rem; }
.page-header .ph-eyebrow { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); margin-bottom: 0.2rem; }
.page-header h2 { font-size: 1.42rem; font-weight: 800; margin: 0; letter-spacing: -0.025em; }
.page-header p { margin: 0.2rem 0 0; color: var(--text-body); font-size: 0.86rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
@media (max-width: 767.98px) {
    .page-header { margin-bottom: 1.1rem; align-items: stretch; flex-direction: column; }
    .page-header h2 { font-size: 1.3rem; }
    .page-actions { width: 100%; }
    .page-actions > .btn, .page-actions > .dropdown, .page-actions > form { flex: 1 1 auto; }
    .page-actions > .dropdown > .btn { width: 100%; }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    --bs-card-border-color: transparent;
    border: 0; border-radius: var(--radius-xl); background: var(--surface);
    box-shadow: var(--shadow-card);
}
.card-header {
    background: transparent; border-bottom: 1px solid var(--border-soft);
    padding: 1.1rem 1.35rem; display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap;
}
.card-header:first-child { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.card-header .card-title { font-size: 1rem; font-weight: 700; margin: 0; color: var(--text-title); }
.card-header .card-subtitle { font-size: 0.78rem; color: var(--text-muted); margin: 0.1rem 0 0; }
.card-header .card-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.card-body { padding: 1.35rem; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--border-soft); padding: 1rem 1.35rem; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.card-icon {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-50); color: var(--primary); font-size: 1.2rem;
}
.card-icon.gold { background: var(--warning-50); color: var(--warning); }
.card-icon.green { background: var(--success-50); color: var(--success); }
.card-icon.red { background: var(--danger-50); color: var(--danger); }
.card-icon.violet { background: var(--violet-50); color: var(--violet); }
.card-icon.cyan { background: var(--info-50); color: var(--info); }
.card-hover { transition: var(--transition); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

@media (max-width: 767.98px) {
    .card { border-radius: var(--radius-lg); }
    .card-header { padding: 0.95rem 1rem; }
    .card-body { padding: 1rem; }
    .card-footer { padding: 0.85rem 1rem; }
}

/* Stat cards */
.stat-card { position: relative; overflow: hidden; padding: 1.25rem 1.3rem; height: 100%; }
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff;
    background: var(--primary-gradient); box-shadow: 0 10px 20px -8px var(--primary-glow);
}
.stat-card .stat-label { font-size: 0.78rem; font-weight: 600; color: var(--text-body); margin-top: 1rem; }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 800; color: var(--text-title); letter-spacing: -0.03em; line-height: 1.2; margin-top: 0.15rem; word-break: break-word; }
.stat-card .stat-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.stat-card::after { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: -50px; top: -50px; background: currentColor; opacity: 0.05; color: var(--primary); }
.stat-card.gold .stat-icon { background: var(--gold-gradient); box-shadow: 0 10px 20px -8px var(--gold-glow); }
.stat-card.gold::after { color: var(--gold); }
.stat-card.green .stat-icon { background: linear-gradient(135deg, #15803d, #22c55e); box-shadow: 0 10px 20px -8px rgba(34, 197, 94, 0.45); }
.stat-card.green::after { color: var(--success); }
.stat-card.red .stat-icon { background: linear-gradient(135deg, #b91c1c, #f87171); box-shadow: 0 10px 20px -8px rgba(239, 68, 68, 0.45); }
.stat-card.red::after { color: var(--danger); }
.stat-card.violet .stat-icon { background: linear-gradient(135deg, #6d28d9, #a78bfa); box-shadow: 0 10px 20px -8px rgba(124, 58, 237, 0.45); }
.stat-card.violet::after { color: var(--violet); }
.stat-card.cyan .stat-icon { background: linear-gradient(135deg, #0e7490, #22d3ee); box-shadow: 0 10px 20px -8px rgba(8, 145, 178, 0.45); }
.stat-card.cyan::after { color: var(--info); }
.stat-card.navy { background: var(--navy-gradient); color: #cbd5e1; }
.stat-card.navy .stat-label { color: #94a3b8; }
.stat-card.navy .stat-value { color: #fff; }
.stat-card.navy .stat-icon { background: var(--gold-gradient); }
.stat-card.navy::after { color: #3b82f6; opacity: 0.18; }
@media (max-width: 575.98px) {
    .stat-card { padding: 1rem; }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 12px; }
    .stat-card .stat-value { font-size: 1.15rem; }
    .stat-card .stat-label { margin-top: 0.75rem; font-size: 0.72rem; }
}

/* Hero / welcome banner */
.hero-card {
    position: relative; overflow: hidden; border-radius: var(--radius-2xl);
    background: var(--navy-gradient); color: #cbd5e1; padding: 1.75rem 1.9rem;
    box-shadow: 0 25px 50px -20px rgba(11, 19, 41, 0.6);
}
.hero-card::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.35) 0, transparent 40%),
        radial-gradient(circle at 10% 110%, rgba(245, 158, 11, 0.22) 0, transparent 35%);
}
.hero-card .hero-grid { position: absolute; inset: 0; opacity: 0.07; background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(90deg, transparent, #000 60%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); }
.hero-card > *:not(.hero-grid) { position: relative; }
.hero-card h3 { color: #fff; font-weight: 800; font-size: 1.5rem; margin-bottom: 0.35rem; }
.hero-card h3 span { color: #93c5fd; }
.hero-card .hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.hero-pill { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); color: #e2e8f0; }
.hero-pill i { color: #fbbf24; }
@media (max-width: 575.98px) { .hero-card { padding: 1.3rem; border-radius: var(--radius-xl); } .hero-card h3 { font-size: 1.2rem; } }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    --bs-btn-font-weight: 600; --bs-btn-font-size: 0.86rem;
    --bs-btn-padding-y: 0.62rem; --bs-btn-padding-x: 1.1rem;
    border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    transition: var(--transition); white-space: nowrap;
}
.btn i { font-size: 1.05rem; line-height: 1; }
.btn-sm { --bs-btn-padding-y: 0.42rem; --bs-btn-padding-x: 0.75rem; --bs-btn-font-size: 0.8rem; border-radius: 10px; }
.btn-sm i { font-size: 0.95rem; }
.btn-lg { --bs-btn-padding-y: 0.85rem; --bs-btn-padding-x: 1.5rem; --bs-btn-font-size: 0.95rem; border-radius: 14px; }
.btn-primary {
    --bs-btn-bg: #2563eb; --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent; --bs-btn-active-border-color: transparent;
    background-image: var(--primary-gradient); color: #fff; border: 0;
    box-shadow: 0 8px 20px -6px var(--primary-glow);
}
.btn-primary:hover, .btn-primary:focus-visible { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 26px -6px rgba(37, 99, 235, 0.45); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); }
.btn-gold { background-image: var(--gold-gradient); color: #1f1300; border: 0; box-shadow: 0 8px 20px -6px var(--gold-glow); }
.btn-gold:hover { color: #1f1300; transform: translateY(-1px); filter: brightness(1.04); }
.btn-success { --bs-btn-bg: #16a34a; --bs-btn-border-color: #16a34a; --bs-btn-hover-bg: #15803d; --bs-btn-hover-border-color: #15803d; box-shadow: 0 8px 18px -8px rgba(22, 163, 74, 0.5); }
.btn-danger { --bs-btn-bg: #dc2626; --bs-btn-border-color: #dc2626; --bs-btn-hover-bg: #b91c1c; --bs-btn-hover-border-color: #b91c1c; box-shadow: 0 8px 18px -8px rgba(220, 38, 38, 0.45); }
.btn-warning { --bs-btn-bg: #f59e0b; --bs-btn-border-color: #f59e0b; --bs-btn-color: #1f1300; --bs-btn-hover-bg: #d97706; --bs-btn-hover-border-color: #d97706; --bs-btn-hover-color: #fff; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--border); --bs-btn-color: var(--text-title); --bs-btn-hover-bg: var(--primary-50); --bs-btn-hover-border-color: var(--primary-200); --bs-btn-hover-color: var(--primary-700); --bs-btn-active-bg: var(--primary-50); --bs-btn-active-border-color: var(--primary-200); }
.btn-soft-primary { background: var(--primary-50); color: var(--primary-700); border: 1px solid var(--primary-100); }
.btn-soft-primary:hover { background: var(--primary-100); color: var(--primary-700); }
.btn-soft-success { background: var(--success-50); color: var(--success); border: 1px solid var(--success-100); }
.btn-soft-success:hover { background: var(--success-100); color: #15803d; }
.btn-soft-danger { background: var(--danger-50); color: var(--danger); border: 1px solid var(--danger-100); }
.btn-soft-danger:hover { background: var(--danger-100); color: #b91c1c; }
.btn-soft-warning { background: var(--warning-50); color: var(--warning); border: 1px solid var(--warning-100); }
.btn-soft-warning:hover { background: var(--warning-100); color: #b45309; }
.btn-soft-info { background: var(--info-50); color: var(--info); border: 1px solid var(--info-100); }
.btn-soft-info:hover { background: var(--info-100); color: #0e7490; }
.btn-outline-primary { --bs-btn-color: var(--primary-600); --bs-btn-border-color: var(--primary-200); --bs-btn-hover-bg: var(--primary-50); --bs-btn-hover-color: var(--primary-700); --bs-btn-hover-border-color: var(--primary); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn.loading { pointer-events: none; opacity: 0.85; }
.btn.loading::after { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Table row action buttons */
.row-actions { display: inline-flex; gap: 0.35rem; justify-content: flex-end; }
.row-actions .btn { width: 32px; height: 32px; padding: 0; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-body); }
.row-actions .btn:hover { background: var(--primary-50); border-color: var(--primary-200); color: var(--primary); }
.row-actions .btn.act-danger:hover { background: var(--danger-50); border-color: var(--danger-100); color: var(--danger); }
.row-actions .btn.act-success:hover { background: var(--success-50); border-color: var(--success-100); color: var(--success); }
.row-actions form { display: inline; }

/* "More" (⋮) action menu — always the first column of list tables */
.table > thead > tr > th.th-actions, .table > tbody > tr > td.td-actions { width: 60px; min-width: 60px; padding-left: 1rem; padding-right: 0.25rem; text-align: left; }
.btn-more {
    width: 34px; height: 34px; padding: 0; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: #fff; color: var(--text-body); font-size: 1.15rem;
    transition: var(--transition);
}
.btn-more:hover, .btn-more:focus-visible, .btn-more[aria-expanded="true"] { background: var(--primary-50); border-color: var(--primary-200); color: var(--primary); outline: 0; }
.btn-more[aria-expanded="true"] { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
.row-more-menu { min-width: 13rem; padding: 0.4rem; }
.card:has(.dropdown-menu.show), .form-sheet:has(.dropdown-menu.show) { z-index: 5; }
.table > tbody > tr > td.td-actions:has(.dropdown-menu.show) { z-index: 6; }
.row-more-menu form { margin: 0; }
.row-more-menu .dropdown-item { width: 100%; text-align: left; border: 0; background: transparent; font-size: 0.85rem; padding: 0.5rem 0.7rem; }
.row-more-menu .dropdown-item.text-danger i { color: var(--danger); }
.row-more-menu .dropdown-item.text-danger:hover { background: var(--danger-50); }
.row-more-menu .dropdown-item.text-success, .row-more-menu .dropdown-item.text-success i { color: var(--success) !important; }
.row-more-menu .dropdown-item.text-success:hover { background: var(--success-50); }
.row-more-menu .dropdown-item.text-warning, .row-more-menu .dropdown-item.text-warning i { color: #b45309 !important; }
.row-more-menu .dropdown-item.text-warning:hover { background: var(--warning-50); }
.row-more-menu .dropdown-header { padding: 0.35rem 0.7rem 0.25rem; }

/* ==========================================================================
   Form sheet — one document-style card divided into sections
   ========================================================================== */
.form-sheet { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
/* Compact density: section title + subtitle on one line, tight gaps → less scrolling */
.form-section { padding: 1rem 1.4rem 1.15rem; }
.form-section + .form-section { border-top: 1px solid var(--border-soft); }
.form-section-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.form-section-head .fs-icon {
    width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-50); color: var(--primary); font-size: 0.95rem;
}
.form-section-head > .min-w-0 { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.6rem; }
.form-section-head .fs-title { font-size: 0.92rem; font-weight: 700; color: var(--text-title); margin: 0; letter-spacing: -0.01em; }
.form-section-head .fs-sub { font-size: 0.74rem; color: var(--text-muted); margin: 0; }
.form-sheet .row.g-3 { --bs-gutter-y: 0.8rem; }
.form-sheet .form-label { margin-bottom: 0.3rem; }
.form-sheet .form-text { margin-top: 0.15rem; font-size: 0.72rem; }
.form-sheet .switch-row { padding: 0.5rem 0; }
.form-sheet .info-bar .ib-item { padding: 0.55rem 0.9rem; }
/* Wide monitors: 4 fields per row instead of 3 (fields would otherwise be ~500px wide) */
@media (min-width: 1600px) {
    .form-sheet .row > .col-xl-4 { width: 25%; }
    .form-sheet .row > .col-xl-8 { width: 50%; }
}
@media (min-width: 768px) {
    .form-sheet .form-control, .form-sheet .form-select { min-height: 40px; padding-top: 0.5rem; padding-bottom: 0.5rem; }
    .form-sheet .select2-container--erp .select2-selection--single { height: 40px; min-height: 40px; }
    .form-sheet .select2-container--erp .select2-selection--multiple { min-height: 40px; padding-top: 0.2rem; padding-bottom: 0.2rem; }
}
.form-section-head .fs-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
/* Form pages: the breadcrumb already names the module, so drop the eyebrow line to save height */
.content:has(.form-sheet) .page-header .ph-eyebrow { display: none; }
.content:has(.form-sheet) .page-header { margin-bottom: 0.9rem; }
.form-section.section-muted { background: var(--surface-2); }
.form-section:first-child { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.form-section:last-child { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.form-section .items-wrap { border-radius: 12px; }

/* Compact figures strip used inside forms (fund position, stock, totals) */
.info-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--primary-100); background: var(--primary-50); border-radius: 14px; overflow: hidden; }
.info-bar .ib-item { padding: 0.75rem 1rem; border-right: 1px solid var(--primary-100); min-width: 0; }
.info-bar .ib-item:last-child { border-right: 0; }
.info-bar .ib-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.info-bar .ib-value { font-size: 1rem; font-weight: 800; color: var(--text-title); margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-bar .ib-value.success { color: var(--success); }
.info-bar .ib-value.danger { color: var(--danger); }
.info-bar .ib-value.warning { color: #b45309; }
.info-bar.neutral { background: var(--surface-2); border-color: var(--border); }
.info-bar.neutral .ib-item { border-color: var(--border); }

/* Totals block aligned to the right inside a section */
.totals-panel { max-width: 420px; margin-left: auto; }

/* Switch rows: settings-style list instead of separate boxes */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px dashed var(--border); cursor: pointer; margin: 0; height: 100%; }
.switch-row .sr-label { display: block; font-size: 0.86rem; font-weight: 600; color: var(--text-title); }
.switch-row .sr-help { display: block; font-size: 0.74rem; color: var(--text-muted); margin-top: 0.1rem; }
.switch-row .form-switch { padding: 0; margin: 0; min-height: 0; flex-shrink: 0; }
.switch-row .form-switch .form-check-input { margin: 0; float: none; cursor: pointer; }

@media (max-width: 767.98px) {
    .form-section { padding: 1.1rem 1rem 1.2rem; }
    .form-section-head { margin-bottom: 0.9rem; }
    .info-bar { grid-template-columns: 1fr 1fr; }
    .info-bar .ib-item { border-right: 0; border-bottom: 1px solid var(--primary-100); }
    .info-bar .ib-item:nth-child(odd) { border-right: 1px solid var(--primary-100); }
    .info-bar.neutral .ib-item { border-color: var(--border); }
    .totals-panel { max-width: none; }
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-title); margin-bottom: 0.4rem; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-text { font-size: 0.74rem; color: var(--text-muted); }
.form-control, .form-select {
    font-size: 0.875rem; color: var(--text-title);
    background-color: var(--input-bg); border: 1px solid var(--input-border); border-radius: 12px;
    padding: 0.66rem 0.95rem; min-height: 44px; transition: var(--transition);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:hover, .form-select:hover { border-color: #cbd5e1; }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); color: var(--text-title); }
.form-control:disabled, .form-control[readonly] { background-color: #f1f5f9; color: var(--text-body); }
.form-control.is-invalid, .was-validated .form-control:invalid { border-color: var(--danger); background-image: none; padding-right: 0.95rem; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12); }
.invalid-feedback { font-size: 0.75rem; font-weight: 500; }
.form-control-sm { min-height: 36px; padding: 0.4rem 0.7rem; font-size: 0.82rem; border-radius: 10px; }
textarea.form-control { min-height: 66px; }
.input-group-text { background: #f1f5f9; border: 1px solid var(--input-border); color: var(--text-body); border-radius: 12px; font-size: 0.85rem; font-weight: 600; }
.input-group > .form-control:focus { z-index: 3; }
.input-icon-wrap { position: relative; }
.input-icon-wrap > i { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.05rem; pointer-events: none; z-index: 4; }
.input-icon-wrap > .form-control { padding-left: 2.6rem; }
.form-check-input { width: 1.15em; height: 1.15em; border-color: #cbd5e1; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); border-color: var(--primary); }
.form-switch .form-check-input { width: 2.5em; height: 1.35em; }
.form-check-label { font-size: 0.86rem; color: var(--text-title); }

/* Full page form layout */
.form-actions {
    position: sticky; bottom: 0; z-index: 1010;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.6rem;
    margin: 1.1rem -1.75rem -1.75rem; padding: 0.7rem 1.75rem;
    background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -12px 30px -18px rgba(15, 23, 42, 0.2);
}
.form-actions .fa-note { margin-right: auto; font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.35rem; }
@media (max-width: 991.98px) {
    .form-actions { margin: 1.25rem -1rem 0; padding: 0.8rem 1rem; bottom: var(--bottom-nav-h); }
    .form-actions .fa-note { display: none; }
    .form-actions .btn { flex: 1 1 0; }
}

/* Summary panel used beside forms */
.summary-list { list-style: none; margin: 0; padding: 0; }
.summary-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--border); font-size: 0.86rem; }
.summary-list li:last-child { border-bottom: 0; }
.summary-list li span:last-child { font-weight: 700; color: var(--text-title); text-align: right; }
.summary-total { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.1rem; margin-top: 0.75rem; border-radius: 14px; background: var(--primary-gradient); color: #fff; }
.summary-total .st-label { font-size: 0.8rem; opacity: 0.85; font-weight: 600; }
.summary-total .st-value { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }

/* Detail (show page) key-value grid */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.1rem 1.5rem; }
.detail-item .di-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.detail-item .di-value { font-size: 0.9rem; font-weight: 600; color: var(--text-title); word-break: break-word; }

/* ==========================================================================
   Select2 — "erp" theme matching form controls
   ========================================================================== */
.select2-container { max-width: 100%; }
.select2-container--erp { font-size: 0.875rem; }
.select2-container--erp .select2-selection--single,
.select2-container--erp .select2-selection--multiple {
    min-height: 44px; border: 1px solid var(--input-border); border-radius: 12px; background: var(--input-bg);
    transition: var(--transition); outline: 0;
}
.select2-container--erp .select2-selection--single { height: 44px; display: flex; align-items: center; }
.select2-container--erp .select2-selection--single .select2-selection__rendered { color: var(--text-title); padding: 0 2.6rem 0 0.95rem; line-height: 1.3; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select2-container--erp .select2-selection--single .select2-selection__placeholder { color: var(--text-muted); }
.select2-container--erp .select2-selection--single .select2-selection__arrow { position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; }
.select2-container--erp .select2-selection--single .select2-selection__arrow b { display: none; }
.select2-container--erp .select2-selection--single .select2-selection__arrow::after {
    content: ''; position: absolute; inset: 0;
    background: no-repeat center/14px url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    transition: transform 0.2s ease;
}
.select2-container--erp.select2-container--open .select2-selection--single .select2-selection__arrow::after { transform: rotate(180deg); }
.select2-container--erp .select2-selection__clear { position: absolute; right: 2.1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.1rem; font-weight: 400; cursor: pointer; z-index: 2; margin: 0; padding: 0 0.2rem; line-height: 1; }
.select2-container--erp .select2-selection__clear:hover { color: var(--danger); }
.select2-container--erp.select2-container--focus .select2-selection,
.select2-container--erp.select2-container--open .select2-selection { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
.select2-container--erp.select2-container--disabled .select2-selection { background: #f1f5f9; cursor: not-allowed; }
.select2-container--erp .select2-selection--multiple { padding: 0.3rem 0.5rem; display: flex; align-items: center; cursor: text; }
.select2-container--erp .select2-selection--multiple .select2-selection__rendered { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.select2-container--erp .select2-selection--multiple .select2-selection__choice {
    display: inline-flex; align-items: center; gap: 0.3rem; margin: 0; padding: 0.22rem 0.55rem 0.22rem 0.35rem;
    border-radius: 8px; background: var(--primary-50); border: 1px solid var(--primary-100); color: var(--primary-700); font-size: 0.78rem; font-weight: 600;
}
.select2-container--erp .select2-selection--multiple .select2-selection__choice__remove { border: 0; background: transparent; color: var(--primary); font-size: 1rem; line-height: 1; padding: 0 0.15rem; order: -1; }
.select2-container--erp .select2-selection--multiple .select2-selection__choice__remove:hover { color: var(--danger); }
.select2-container--erp .select2-search--inline { flex: 1 1 auto; min-width: 120px; }
.select2-container--erp .select2-search--inline .select2-search__field { margin: 0; height: 28px; width: 100% !important; font-family: inherit; font-size: 0.85rem; color: var(--text-title); min-width: 120px; outline: 0; border: 0; background: transparent; box-shadow: none; }
.select2-container--erp .select2-search--inline .select2-search__field::placeholder { color: var(--text-muted); }
.select2-container--erp .select2-dropdown {
    border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff;
    box-shadow: 0 22px 50px -16px rgba(15, 23, 42, 0.28); z-index: 1065;
}
.select2-container--erp.select2-container--open .select2-dropdown--below { margin-top: 6px; }
.select2-container--erp.select2-container--open .select2-dropdown--above { margin-top: -6px; }
.select2-container--erp .select2-search--dropdown { padding: 0.6rem; border-bottom: 1px solid var(--border-soft); }
.select2-container--erp .select2-search--dropdown .select2-search__field {
    width: 100%; border: 1px solid var(--input-border); border-radius: 10px; padding: 0.5rem 0.75rem 0.5rem 2.1rem; font-size: 0.85rem; outline: 0;
    background: var(--input-bg) no-repeat 0.7rem center/15px url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='m21 21-4.35-4.35M17 10.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0Z'/%3e%3c/svg%3e");
}
.select2-container--erp .select2-search--dropdown .select2-search__field:focus { border-color: var(--primary); background-color: #fff; }
.select2-container--erp .select2-results > .select2-results__options { max-height: 280px; overflow-y: auto; padding: 0.4rem; }
.select2-container--erp .select2-results__option { padding: 0.55rem 0.75rem; border-radius: 9px; font-size: 0.86rem; color: var(--text-title); margin-bottom: 1px; }
.select2-container--erp .select2-results__option--highlighted[aria-selected],
.select2-container--erp .select2-results__option--highlighted { background: var(--primary-50); color: var(--primary-700); }
.select2-container--erp .select2-results__option[aria-selected="true"],
.select2-container--erp .select2-results__option--selected { background: var(--primary); color: #fff; font-weight: 600; }
.select2-container--erp .select2-results__option[aria-disabled="true"] { color: var(--text-muted); }
.select2-container--erp .select2-results__group { display: block; padding: 0.55rem 0.75rem 0.3rem; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.select2-container--erp .select2-results__message { color: var(--text-muted); font-size: 0.82rem; }
.s2-opt { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.s2-opt .s2-main { min-width: 0; }
.s2-opt .s2-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s2-opt .s2-meta { font-size: 0.72rem; opacity: 0.75; }
.s2-opt .s2-side { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 6px; background: var(--success-50); color: var(--success); white-space: nowrap; }
.select2-results__option--highlighted .s2-opt .s2-side { background: #fff; }
.is-invalid + .select2-container--erp .select2-selection { border-color: var(--danger); }
.select2-sm + .select2-container--erp .select2-selection--single { height: 36px; min-height: 36px; border-radius: 10px; }
.select2-sm + .select2-container--erp { font-size: 0.82rem; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-card .card-body { padding: 0; }
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #f8fbff; margin: 0; font-size: 0.86rem; color: var(--text-body); vertical-align: middle; }
.table > thead > tr > th {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b;
    background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 0.85rem 1rem; white-space: nowrap;
}
.table > tbody > tr > td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border-soft); }
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table > tfoot > tr > td, .table > tfoot > tr > th { padding: 0.85rem 1rem; background: var(--primary-50); font-weight: 700; color: var(--text-title); border-top: 1px solid var(--primary-100); }
.table-hover > tbody > tr { transition: background 0.15s ease; }
.table .cell-title { font-weight: 700; color: var(--text-title); }
.table .cell-title a { color: var(--text-title); }
.table .cell-title a:hover { color: var(--primary); }
.table .cell-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }
.table .amount { font-weight: 700; color: var(--text-title); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.table th.text-end, .table td.text-end { text-align: right; }
.table-sm > tbody > tr > td, .table-sm > thead > tr > th { padding: 0.55rem 0.75rem; }
.table-responsive { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.table-bordered-soft td, .table-bordered-soft th { border: 1px solid var(--border-soft) !important; }
.table .text-in { color: var(--success); font-weight: 700; }
.table .text-out { color: var(--danger); font-weight: 700; }
.table tr.row-muted td { background: var(--surface-2); color: var(--text-muted); }
.table tr.row-highlight td { background: #fffbeb; }

/* Stacked tables on phones: each row becomes a card */
@media (max-width: 767.98px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td, .table-stack tfoot { display: block; width: 100%; }
    .table-stack tbody { padding: 0.75rem; }
    .table-stack tr { background: #fff; border: 1px solid var(--border); border-radius: 16px; margin-bottom: 0.75rem; padding: 0.5rem 0.9rem; box-shadow: var(--shadow-xs); position: relative; }
    .table-stack.table-hover > tbody > tr:hover > * { --bs-table-bg-state: transparent; }
    .table-stack > tbody > tr > td { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--border-soft); text-align: right !important; }
    .table-stack > tbody > tr > td:last-child { border-bottom: 0; }
    .table-stack > tbody > tr > td::before { content: attr(data-label); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); text-align: left; flex-shrink: 0; padding-top: 0.15rem; }
    .table-stack > tbody > tr > td[data-label=""]::before, .table-stack > tbody > tr > td.td-actions::before { display: none; }
    .table-stack > tbody > tr > td.td-primary { display: block; text-align: left !important; padding-top: 0.6rem; border-bottom: 1px solid var(--border-soft); }
    .table-stack > tbody > tr > td.td-primary::before { display: none; }
    /* Action menu (first column) floats at the top-right corner of each row card */
    .table-stack > tbody > tr > td.td-actions { position: absolute; top: 0.6rem; right: 0.7rem; width: auto; min-width: 0; padding: 0; border: 0; display: block; z-index: 2; }
    .table-stack > tbody > tr > td.td-primary { padding-right: 2.9rem; }
    .table-stack > tbody > tr > td.td-actions + td:not(.td-primary) { padding-top: 0.6rem; padding-right: 2.9rem; }
    .table-stack > tbody > tr > td.td-empty { display: block; text-align: center !important; border: 0; }
    .table-stack > tbody > tr > td.td-empty::before { display: none; }
    .table-stack tr.tr-empty { border: 0; box-shadow: none; background: transparent; }
    .table-stack .cell-sub { text-align: inherit; }
    .table-stack tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; background: var(--primary-50); padding: 0.4rem 1rem; }
    .table-stack tfoot td { width: auto; border: 0; background: transparent; padding: 0.35rem 0; }
    .table-stack tfoot td:empty { display: none; }
    .table-card .table-responsive { border-radius: 0; }
}

/* Item entry grid (purchase / sale / transfer lines) */
.items-table { min-width: 860px; }
.items-table > thead > th, .items-table > thead > tr > th { background: var(--navy-900); color: #cbd5e1; border: 0; }
.items-table > thead > tr > th:first-child { border-radius: 12px 0 0 0; }
.items-table > thead > tr > th:last-child { border-radius: 0 12px 0 0; }
.items-table > tbody > tr > td { padding: 0.55rem 0.5rem; vertical-align: top; background: #fff; }
.items-table .form-control { min-height: 40px; padding: 0.45rem 0.65rem; font-size: 0.84rem; border-radius: 10px; }
.items-table .select2-container--erp .select2-selection--single { height: 40px; min-height: 40px; border-radius: 10px; }
.items-table .line-total { font-weight: 800; color: var(--text-title); padding-top: 0.6rem; text-align: right; white-space: nowrap; }
.items-table .row-index { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-50); color: var(--primary-700); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; margin-top: 3px; }
.items-wrap { border: 1px solid var(--border); border-radius: 14px; overflow: auto; }
.add-row-btn { width: 100%; border: 2px dashed var(--primary-200); background: var(--primary-50); color: var(--primary-700); border-radius: 12px; padding: 0.7rem; font-weight: 700; font-size: 0.85rem; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.add-row-btn:hover { background: var(--primary-100); border-color: var(--primary); }

/* Mobile item cards (alternative to wide grids) */
@media (max-width: 767.98px) {
    .items-responsive .items-table { min-width: 0; }
    .items-responsive .items-table thead { display: none; }
    .items-responsive .items-table, .items-responsive .items-table tbody, .items-responsive .items-table tr { display: block; width: 100%; }
    .items-responsive .items-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 0.75rem; padding: 0.9rem; border-bottom: 1px solid var(--border); position: relative; }
    .items-responsive .items-table td { display: block; padding: 0 !important; border: 0 !important; }
    .items-responsive .items-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.25rem; }
    .items-responsive .items-table td.col-full { grid-column: 1 / -1; }
    .items-responsive .items-table td.col-index { position: absolute; top: 0.6rem; right: 3.4rem; }
    .items-responsive .items-table td.col-remove { position: absolute; top: 0.6rem; right: 0.9rem; }
    .items-responsive .items-table td.col-product { grid-column: 1 / -1; padding-right: 5.5rem !important; }
    .items-responsive .items-table .line-total { text-align: left; padding-top: 0.55rem; font-size: 1rem; }
    .items-responsive { border-radius: 14px; }
}

/* ==========================================================================
   Badges / status
   ========================================================================== */
.badge { font-weight: 600; letter-spacing: 0.01em; }
.badge-soft { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.32rem 0.65rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; line-height: 1.2; }
.badge-soft::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-soft.no-dot::before { display: none; }
.badge-soft-primary { background: var(--primary-50); color: var(--primary-600); }
.badge-soft-success { background: var(--success-50); color: #15803d; }
.badge-soft-danger { background: var(--danger-50); color: #b91c1c; }
.badge-soft-warning { background: var(--warning-50); color: #b45309; }
.badge-soft-info { background: var(--info-50); color: #0e7490; }
.badge-soft-orange { background: var(--orange-50); color: var(--orange); }
.badge-soft-secondary { background: #f1f5f9; color: #475569; }
.badge-soft-violet { background: var(--violet-50); color: var(--violet); }
.badge-soft-dark { background: var(--navy-900); color: #fff; }
.code-pill { display: inline-flex; align-items: center; padding: 0.18rem 0.5rem; border-radius: 7px; background: var(--primary-50); color: var(--primary-700); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.02em; border: 1px solid var(--primary-100); white-space: nowrap; }
.code-pill.gold { background: var(--warning-50); color: #b45309; border-color: var(--warning-100); }

/* ==========================================================================
   Alerts, empty state, misc
   ========================================================================== */
.alert { border: 1px solid transparent; border-radius: 14px; font-size: 0.86rem; display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.9rem 1.1rem; }
.alert > i { font-size: 1.2rem; line-height: 1.2; }
.alert-success { background: var(--success-50); border-color: #bbf7d0; color: #166534; }
.alert-danger { background: var(--danger-50); border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: var(--warning-50); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-700); }
.alert ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }

.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state .es-icon { width: 76px; height: 76px; margin: 0 auto 1rem; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--primary); background: var(--primary-50); box-shadow: inset 0 0 0 8px rgba(255,255,255,.6); }
.empty-state h6 { font-weight: 700; color: var(--text-title); margin-bottom: 0.3rem; }
.empty-state p { color: var(--text-muted); font-size: 0.85rem; max-width: 380px; margin: 0 auto 1rem; }

/* Filter panel (collapsed until the header "Filter" button is clicked) */
.filter-collapse > .filter-card { margin-bottom: 1.25rem; }
.filter-card .card-body { padding: 1rem 1.15rem 1.15rem; }
.filter-card .form-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.filter-head > span { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 700; color: var(--text-title); text-transform: uppercase; letter-spacing: 0.06em; }
.filter-head > span i { color: var(--primary); }
.btn-close-panel { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.btn-close-panel:hover { color: var(--danger); border-color: var(--danger-100); background: var(--danger-50); }

/* Header toggle buttons (Summary / Filter) */
.btn-panel-toggle { position: relative; }
.btn-panel-toggle[aria-expanded="true"] { background: var(--primary-50); border-color: var(--primary-200); color: var(--primary-700); }
.btn-panel-toggle .panel-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.btn-panel-toggle.has-count { border-color: var(--primary-200); color: var(--primary-700); }
@media (max-width: 575.98px) {
    .page-actions > .btn-panel-toggle { flex: 0 0 auto; width: 46px; padding-left: 0; padding-right: 0; }
    .page-actions > .btn-panel-toggle .pt-label { display: none; }
    .page-actions > .btn-panel-toggle .panel-count { position: absolute; top: -7px; right: -7px; border: 2px solid #fff; }
}

/* Tabs as pills */
.nav-pills-soft { display: flex; gap: 0.35rem; flex-wrap: nowrap; overflow-x: auto; padding: 0.3rem; background: #fff; border-radius: 14px; box-shadow: var(--shadow-card); scrollbar-width: none; }
.nav-pills-soft::-webkit-scrollbar { display: none; }
.nav-pills-soft .nav-link { border-radius: 10px; padding: 0.5rem 0.95rem; font-size: 0.82rem; font-weight: 600; color: var(--text-body); white-space: nowrap; display: flex; align-items: center; gap: 0.4rem; border: 0; background: transparent; }
.nav-pills-soft .nav-link .count { font-size: 0.68rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: #f1f5f9; color: var(--text-body); }
.nav-pills-soft .nav-link:hover { color: var(--primary); background: var(--primary-50); }
.nav-pills-soft .nav-link.active { background: var(--primary-gradient); color: #fff; box-shadow: 0 8px 18px -8px var(--primary-glow); }
.nav-pills-soft .nav-link.active .count { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* Pagination */
.pagination { gap: 0.3rem; margin: 0; flex-wrap: wrap; }
.page-link { border-radius: 10px !important; border: 1px solid var(--border); color: var(--text-body); font-weight: 600; font-size: 0.82rem; min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0 0.65rem; }
.page-link:hover { background: var(--primary-50); color: var(--primary-700); border-color: var(--primary-200); }
.page-item.active .page-link { background: var(--primary-gradient); border-color: transparent; box-shadow: 0 6px 14px -6px var(--primary-glow); }
.page-item.disabled .page-link { background: var(--surface-2); color: var(--text-muted); }
.pagination-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; padding: 0.9rem 1.15rem; border-top: 1px solid var(--border-soft); }
.pagination-bar .pg-info { font-size: 0.8rem; color: var(--text-muted); }
.pagination-bar .pg-left { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pg-size { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.pg-size label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.pg-size .select2-container { width: 84px !important; }
@media (max-width: 575.98px) {
    .pagination-bar { justify-content: center; }
    .pagination-bar .pg-left { width: 100%; justify-content: space-between; }
}

/* Attachments */
/* Compact one-row drop zone: icon · text · camera button */
.dropzone {
    position: relative; display: flex; align-items: center; gap: 0.9rem;
    border: 2px dashed #cbd5e1; border-radius: 14px; background: var(--surface-2);
    padding: 0.75rem 1rem; text-align: left; transition: var(--transition); cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-50); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone .dz-icon { width: 42px; height: 42px; border-radius: 12px; margin: 0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--primary); font-size: 1.25rem; box-shadow: var(--shadow-card); }
.dropzone .dz-text { flex: 1; min-width: 0; }
.dropzone .dz-title { font-weight: 700; color: var(--text-title); font-size: 0.86rem; }
.dropzone .dz-hint { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.1rem; }
.dz-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin: 0 0 0 auto; position: relative; z-index: 2; flex-wrap: wrap; flex-shrink: 0; }
@media (max-width: 575.98px) {
    .dropzone { flex-wrap: wrap; }
    .dz-actions { width: 100%; margin: 0.15rem 0 0; justify-content: flex-start; }
}
.file-list { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
.file-chip { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-size: 0.82rem; }
.file-chip .fc-thumb { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); font-size: 1.15rem; overflow: hidden; }
.file-chip .fc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-chip .fc-name { font-weight: 600; color: var(--text-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .fc-meta { font-size: 0.7rem; color: var(--text-muted); }
.file-chip .fc-remove { margin-left: auto; border: 0; background: transparent; color: var(--text-muted); font-size: 1.1rem; }
.file-chip .fc-remove:hover { color: var(--danger); }
.file-chip .fc-actions { margin-left: auto; display: flex; gap: 0.3rem; flex-shrink: 0; }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.doc-card { border: 1px solid var(--border); border-radius: 16px; background: #fff; overflow: hidden; transition: var(--transition); display: flex; flex-direction: column; }
.doc-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.doc-card .doc-thumb { height: 130px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 2.6rem; color: var(--primary); position: relative; overflow: hidden; }
.doc-card .doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-card .doc-thumb .ri-file-pdf-2-line { color: #dc2626; }
.doc-card .doc-thumb .ri-file-excel-2-line { color: #16a34a; }
.doc-card .doc-cat { position: absolute; top: 0.6rem; left: 0.6rem; }
.doc-card .doc-body { padding: 0.8rem 0.9rem; flex: 1; }
.doc-card .doc-name { font-weight: 700; color: var(--text-title); font-size: 0.83rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-card .doc-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }
.doc-card .doc-foot { display: flex; gap: 0.4rem; padding: 0 0.9rem 0.85rem; }
.doc-card .doc-foot .btn { flex: 1; }
@media (max-width: 575.98px) { .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; } .doc-card .doc-thumb { height: 95px; } }

/* Preview modal */
.modal-content { border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border-soft); padding: 1rem 1.25rem; }
.modal-title { font-weight: 700; font-size: 1rem; }
.modal-backdrop.show { opacity: 0.55; }
.preview-frame { width: 100%; height: 75vh; border: 0; border-radius: 0 0 20px 20px; background: #f1f5f9; }
.preview-img { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; }

/* Timeline (approval history / activity) */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 1.15rem 3rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .tl-dot { position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--border); color: var(--primary); font-size: 1rem; }
.timeline .tl-dot.success { color: var(--success); background: var(--success-50); border-color: #bbf7d0; }
.timeline .tl-dot.danger { color: var(--danger); background: var(--danger-50); border-color: #fecaca; }
.timeline .tl-dot.warning { color: var(--warning); background: var(--warning-50); border-color: #fde68a; }
.timeline .tl-title { font-weight: 700; color: var(--text-title); font-size: 0.85rem; }
.timeline .tl-meta { font-size: 0.75rem; color: var(--text-muted); }
.timeline .tl-text { font-size: 0.82rem; margin-top: 0.25rem; background: var(--surface-2); border-radius: 10px; padding: 0.5rem 0.7rem; }

/* Progress / meters */
.meter { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--primary-gradient); }
.meter.gold > span { background: var(--gold-gradient); }
.meter.red > span { background: linear-gradient(90deg, #ef4444, #f87171); }
.meter.green > span { background: linear-gradient(90deg, #16a34a, #4ade80); }

/* List rows (dashboard widgets) */
.list-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 0; border-bottom: 1px solid var(--border-soft); }
.list-row:last-child { border-bottom: 0; }
.list-row .lr-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.1rem; background: var(--primary-50); color: var(--primary); }
.list-row .lr-title { font-weight: 700; color: var(--text-title); font-size: 0.86rem; }
.list-row .lr-sub { font-size: 0.74rem; color: var(--text-muted); }
.list-row .lr-end { margin-left: auto; text-align: right; flex-shrink: 0; }

/* Quick action tiles */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.75rem; }
.quick-tile { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; padding: 1rem 0.5rem; border-radius: 16px; border: 1px solid var(--border); background: #fff; color: var(--text-title); font-size: 0.78rem; font-weight: 600; text-align: center; transition: var(--transition); }
.quick-tile i { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; background: var(--primary-50); color: var(--primary); transition: var(--transition); }
.quick-tile:hover { border-color: var(--primary-200); box-shadow: var(--shadow-card); transform: translateY(-2px); color: var(--primary-700); }
.quick-tile:hover i { background: var(--primary-gradient); color: #fff; }
@media (max-width: 575.98px) { .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; } .quick-tile { padding: 0.7rem 0.2rem; font-size: 0.68rem; border-radius: 14px; } .quick-tile i { width: 38px; height: 38px; font-size: 1.1rem; } }

/* Permission matrix */
.perm-table th, .perm-table td { text-align: center; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-module { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--text-title); }
.perm-module i { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); }

/* Report index tiles */
.report-tile { display: flex; gap: 0.9rem; padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--border); background: #fff; color: var(--text-body); transition: var(--transition); height: 100%; }
.report-tile:hover { border-color: var(--primary-200); box-shadow: var(--shadow-card); transform: translateY(-2px); }
.report-tile .rt-icon { width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); font-size: 1.25rem; }
.report-tile .rt-title { font-weight: 700; color: var(--text-title); font-size: 0.88rem; }
.report-tile .rt-desc { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ==========================================================================
   Mobile bottom navigation (app feel for PWA / Capacitor)
   ========================================================================== */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 0.5rem env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    box-shadow: 0 -10px 30px -18px rgba(15, 23, 42, 0.25);
}
.bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; font-size: 0.66rem; font-weight: 600; color: var(--text-muted); border: 0; background: transparent; height: 100%; }
.bottom-nav a i, .bottom-nav button i { font-size: 1.35rem; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav .bn-fab { position: relative; }
.bottom-nav .bn-fab span.fab { width: 54px; height: 54px; margin-top: -26px; border-radius: 18px; background: var(--primary-gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; box-shadow: 0 12px 24px -8px rgba(37, 99, 235, 0.65); border: 4px solid #fff; }
@media (min-width: 992px) { .bottom-nav { display: none; } }

.offcanvas { border: 0 !important; }
/* Bottom sheets — two classes so we beat Bootstrap's ".offcanvas.offcanvas-bottom { height: var(--bs-offcanvas-height) }" (30vh) */
.offcanvas.offcanvas-bottom { height: auto; max-height: 85vh; max-height: 85dvh; border-radius: 24px 24px 0 0; }
.offcanvas-bottom .offcanvas-header { justify-content: center; position: relative; padding-top: 1.4rem; }
.offcanvas-bottom .offcanvas-header::before { content: ''; position: absolute; top: 0.6rem; width: 44px; height: 5px; border-radius: 99px; background: #cbd5e1; }

/* "New Entry" (+ button) — a full-page screen instead of a short sheet */
.offcanvas.offcanvas-bottom.quick-sheet { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; background: var(--bg-page); }
.quick-sheet .qs-head {
    justify-content: flex-start; gap: 0.75rem; flex-shrink: 0;
    padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 1rem 0.85rem;
    background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 10px 26px -20px rgba(15, 23, 42, 0.4);
}
.quick-sheet .qs-head::before { display: none; }
.qs-head-icon { width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--primary-gradient); color: #fff; font-size: 1.45rem; box-shadow: 0 10px 20px -10px var(--primary-glow); }
.quick-sheet .offcanvas-title { margin: 0; font-size: 1.12rem; font-weight: 800; color: var(--text-title); letter-spacing: -0.01em; line-height: 1.2; }
.qs-sub { font-size: 0.76rem; color: var(--text-muted); }
.qs-close { margin-left: auto; width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; border: 1px solid var(--border); background: #fff; color: var(--text-title); font-size: 1.35rem; display: inline-flex; align-items: center; justify-content: center; }
.qs-close:active { background: var(--surface-2); transform: scale(0.95); }
.quick-sheet .offcanvas-body { padding: 1.1rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
.quick-sheet .ah-tile { min-height: 116px; }
@media (min-width: 576px) {
    .quick-sheet .offcanvas-body { padding-left: 1.5rem; padding-right: 1.5rem; }
    .quick-sheet .offcanvas-body > * { max-width: 760px; margin-left: auto; margin-right: auto; }
}

/* SweetAlert2 theme */
.swal2-popup { border-radius: 22px !important; font-family: var(--bs-body-font-family) !important; padding: 1.75rem 1.5rem !important; }
.swal2-title { font-size: 1.25rem !important; color: var(--text-title) !important; font-weight: 800 !important; }
.swal2-html-container { font-size: 0.9rem !important; color: var(--text-body) !important; }
.swal2-actions { gap: 0.5rem; }
.swal2-styled { border-radius: 12px !important; font-weight: 600 !important; font-size: 0.88rem !important; padding: 0.65rem 1.3rem !important; }
.swal2-styled.swal2-confirm { background: var(--primary-gradient) !important; box-shadow: 0 8px 20px -6px var(--primary-glow) !important; }
.swal2-styled.swal2-confirm.swal-danger { background: linear-gradient(135deg, #b91c1c, #ef4444) !important; box-shadow: 0 8px 20px -6px rgba(220, 38, 38, 0.45) !important; }
.swal2-styled.swal2-confirm.swal-success { background: linear-gradient(135deg, #15803d, #22c55e) !important; box-shadow: 0 8px 20px -6px rgba(22, 163, 74, 0.45) !important; }
.swal2-styled.swal2-cancel { background: #f1f5f9 !important; color: var(--text-body) !important; }
.swal2-textarea, .swal2-input { border-radius: 12px !important; border: 1px solid var(--border) !important; font-size: 0.9rem !important; box-shadow: none !important; font-family: inherit !important; }
.swal2-textarea:focus, .swal2-input:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important; }
.swal2-toast { border-radius: 14px !important; padding: 0.75rem 1rem !important; box-shadow: var(--shadow-lg) !important; }
.swal2-toast .swal2-title { font-size: 0.88rem !important; font-weight: 600 !important; }

/* Flatpickr touches */
.flatpickr-calendar { border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); font-family: inherit; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--primary); border-color: var(--primary); }

/* Chart containers */
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 230px; }
@media (max-width: 575.98px) { .chart-box { height: 240px; } }

/* Print */
@media print {
    .sidebar, .topbar, .bottom-nav, .app-footer, .page-actions, .form-actions, .filter-card, .no-print, .pagination-bar { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; max-width: none; }
    body { background: #fff !important; font-size: 11px; }
    .card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
    .print-header { display: block !important; }
    .table > thead > tr > th { background: #f1f5f9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit !important; }
}
.print-header { display: none; margin-bottom: 1rem; border-bottom: 2px solid #1e40af; padding-bottom: 0.6rem; }

/* Utility */
.bg-soft-primary { background: var(--primary-50) !important; }
.bg-soft-success { background: var(--success-50) !important; }
.bg-soft-danger { background: var(--danger-50) !important; }
.bg-soft-warning { background: var(--warning-50) !important; }
.bg-surface-2 { background: var(--surface-2) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.border-soft { border-color: var(--border-soft) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.gap-xs { gap: 0.35rem !important; }
.divider-text { display: flex; align-items: center; gap: 0.75rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin: 1.25rem 0 0.9rem; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }
/* "backwards" (not "both") so no transform stacking context remains after the animation — open dropdowns stay on top */
.fade-up { animation: fadeUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) backwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.install-banner { display: none; }
.install-banner.show { display: flex; }

/* ==========================================================================
   Page transitions + navigation progress (web & app)
   ========================================================================== */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }
.nav-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; pointer-events: none;
    background: linear-gradient(90deg, #f59e0b, #3b82f6, #2563eb); box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
    opacity: 0; transition: width 0.25s ease, opacity 0.25s ease;
}
.nav-progress.active { opacity: 1; width: 82%; transition: width 6s cubic-bezier(0.1, 0.7, 0.2, 1), opacity 0.2s ease; }

/* ==========================================================================
   Quick-entry tiles (app home + "New Entry" sheet)
   ========================================================================== */
.ah-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.ah-tile {
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 0.15rem;
    padding: 0.95rem 0.95rem 0.9rem; border-radius: 18px; background: #fff; color: var(--text-title);
    border: 1px solid var(--border); box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.45);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.ah-tile:active { transform: scale(0.97); }
.ah-tile::after { content: ''; position: absolute; width: 90px; height: 90px; right: -30px; top: -30px; border-radius: 50%; background: currentColor; opacity: 0.06; }
.ah-icon { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; color: #fff; margin-bottom: 0.5rem; }
.ah-label { font-weight: 800; font-size: 0.92rem; letter-spacing: -0.01em; color: var(--text-title); }
.ah-hint { font-size: 0.72rem; color: var(--text-muted); line-height: 1.3; }
.tone-blue { color: #2563eb; } .tone-blue .ah-icon { background: var(--primary-gradient); box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.6); }
.tone-red { color: #dc2626; } .tone-red .ah-icon { background: linear-gradient(135deg, #b91c1c, #f87171); box-shadow: 0 8px 18px -8px rgba(220, 38, 38, 0.55); }
.tone-gold { color: #d97706; } .tone-gold .ah-icon { background: var(--gold-gradient); box-shadow: 0 8px 18px -8px var(--gold-glow); }
.tone-green { color: #16a34a; } .tone-green .ah-icon { background: linear-gradient(135deg, #15803d, #22c55e); box-shadow: 0 8px 18px -8px rgba(22, 163, 74, 0.55); }
.tone-violet { color: #7c3aed; } .tone-violet .ah-icon { background: linear-gradient(135deg, #6d28d9, #a78bfa); box-shadow: 0 8px 18px -8px rgba(124, 58, 237, 0.55); }
.tone-cyan { color: #0891b2; } .tone-cyan .ah-icon { background: linear-gradient(135deg, #0e7490, #22d3ee); box-shadow: 0 8px 18px -8px rgba(8, 145, 178, 0.55); }
.tone-orange { color: #ea580c; } .tone-orange .ah-icon { background: linear-gradient(135deg, #c2410c, #fb923c); box-shadow: 0 8px 18px -8px rgba(234, 88, 12, 0.55); }
.ah-title { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-title); margin: 1.15rem 0 0.6rem; }
.ah-title span { font-size: 0.72rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.ah-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.ah-shortcuts a { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.65rem 0.25rem; border-radius: 14px; background: #fff; border: 1px solid var(--border); color: var(--text-title); font-size: 0.7rem; font-weight: 600; text-align: center; }
.ah-shortcuts a i { font-size: 1.25rem; color: var(--primary); }
.ah-shortcuts a:active { transform: scale(0.96); }

/* App home (only in the Android app / installed PWA) */
.app-home { display: none; }
.is-app .app-home { display: block; }
.ah-hero {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.15rem 1.15rem; border-radius: 22px; color: #cbd5e1; background: var(--navy-gradient);
    box-shadow: 0 20px 40px -22px rgba(11, 19, 41, 0.7);
}
.ah-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.4), transparent 45%), radial-gradient(circle at 0% 100%, rgba(245, 158, 11, 0.22), transparent 40%); }
.ah-hero > * { position: relative; }
.ah-hello { font-size: 0.8rem; color: #94a3b8; font-weight: 600; }
.ah-name { font-size: 1.45rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; line-height: 1.15; }
.ah-scope { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.45rem; font-size: 0.74rem; font-weight: 600; color: #e2e8f0; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); padding: 0.25rem 0.6rem; border-radius: 999px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-scope i { color: #fbbf24; }
.ah-badge { flex-shrink: 0; width: 68px; height: 68px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--gold-gradient); color: #1f1300; box-shadow: 0 10px 22px -8px var(--gold-glow); }
.ah-badge span { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.ah-badge small { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.ah-list { background: #fff; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.ah-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 0.9rem; color: var(--text-title); border-bottom: 1px solid var(--border-soft); }
.ah-row:last-child { border-bottom: 0; }
.ah-row:active { background: var(--primary-50); }
.ah-row-icon { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--warning-50); color: var(--warning); font-size: 1.05rem; flex-shrink: 0; }
.ah-row-label { flex: 1; min-width: 0; font-size: 0.85rem; font-weight: 600; }
.ah-row-count { min-width: 28px; height: 24px; padding: 0 0.5rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.75rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.ah-row-go { color: var(--text-muted); font-size: 1.2rem; }
@media (min-width: 576px) { .ah-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ==========================================================================
   App mode — Android app (Capacitor) & installed PWA feel like a native app
   ========================================================================== */
.app-brand-mark, .topbar-back { display: none; }
.is-app body { -webkit-user-select: none; user-select: none; overscroll-behavior-y: contain; }
.is-app input, .is-app textarea, .is-app [contenteditable], .is-app .table td, .is-app .detail-item, .is-app .select2-results { -webkit-user-select: text; user-select: text; }
.is-app a, .is-app button { -webkit-touch-callout: none; }
.is-app .topbar {
    height: 60px; padding: 0 0.85rem; gap: 0.6rem; border-bottom: 0;
    background: var(--navy-gradient); color: #fff;
    box-shadow: 0 10px 26px -16px rgba(7, 13, 31, 0.75);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
.is-app .topbar-toggle { display: none; }
.is-app .topbar-back, .is-app .app-brand-mark {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 12px; border: 0;
}
.is-app .topbar-back { background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 1.3rem; }
.is-app .topbar-back:active { background: rgba(255, 255, 255, 0.2); }
.is-app .app-brand-mark { background: var(--gold-gradient); color: #fff; box-shadow: 0 8px 18px -6px var(--gold-glow); }
.is-app .app-brand-mark svg { width: 20px; height: 20px; }
.is-app .topbar-title h1 { color: #fff; font-size: 1.05rem; }
.is-app .topbar-title .crumbs { display: none; }
.is-app .topbar .icon-btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); color: #fff; width: 38px; height: 38px; }
.is-app .topbar .icon-btn .dot-badge { border-color: #0f1a3a; }
.is-app .topbar .user-chip { background: transparent; border-color: rgba(255, 255, 255, 0.16); padding: 0.15rem; }
.is-app .topbar .user-chip .avatar { width: 32px; height: 32px; }
.is-app .app-footer { display: none; }
.is-app .content { padding-top: 0.9rem; }
.is-app .page-header { margin-bottom: 0.85rem; }
.is-app .page-header .ph-eyebrow, .is-app .page-header p { display: none; }
.is-app .page-header h2 { font-size: 1.2rem; }
.is-app .dash-hero { display: none; }
/* Form pages in the app: the app bar already shows the title and a back arrow */
.is-app .content:has(.form-sheet) > .page-header { display: none; }
.is-app .page-actions > a.btn:has(> .ri-arrow-left-line) { display: none; }
.is-app .btn { min-height: 44px; }
.is-app .btn-sm { min-height: 36px; }
.is-app .select2-container--erp .select2-results__option { padding: 0.75rem 0.85rem; font-size: 0.92rem; }
.is-app .bottom-nav a, .is-app .bottom-nav button { -webkit-tap-highlight-color: transparent; }
.is-app .bottom-nav a:active i, .is-app .bottom-nav button:active i { transform: scale(0.9); }

/* Pull to refresh (app mode) */
.ptr-indicator {
    position: fixed; top: 0; left: 50%; z-index: 1500; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background: #fff; color: var(--primary); font-size: 1.25rem;
    box-shadow: 0 8px 22px -6px rgba(15, 23, 42, 0.35); transform: translateY(-60px); opacity: 0; pointer-events: none;
}
.ptr-indicator.ready i { transform: rotate(180deg); }
.ptr-indicator i { transition: transform 0.2s ease; }
.ptr-indicator.refreshing i { animation: spin 0.7s linear infinite; }

/* ==========================================================================
   Product catalog + cart (phones / app) — e-commerce style item picker
   ========================================================================== */
.catalog-open-btn {
    width: 100%; display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; padding: 0.75rem 0.9rem;
    border: 0; border-radius: 16px; text-align: left; color: #fff; background: var(--navy-gradient);
    box-shadow: 0 14px 30px -18px rgba(11, 19, 41, 0.8); position: relative; overflow: hidden;
}
.catalog-open-btn::after { content: ''; position: absolute; right: -30px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 158, 11, 0.35), transparent 65%); }
.cob-icon { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: var(--gold-gradient); font-size: 1.3rem; flex-shrink: 0; box-shadow: 0 8px 16px -6px var(--gold-glow); }
.cob-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.cob-text b { display: block; font-size: 0.95rem; }
.cob-text small { display: block; font-size: 0.72rem; color: #cbd5e1; }
.cob-count { min-width: 26px; height: 26px; padding: 0 0.45rem; border-radius: 999px; background: #fff; color: var(--primary-700); font-weight: 800; font-size: 0.78rem; display: inline-flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.cob-go { font-size: 1.4rem; color: #94a3b8; position: relative; z-index: 1; }

body.catalog-open { overflow: hidden; }
.catalog { position: fixed; inset: 0; z-index: 1090; display: flex; flex-direction: column; background: var(--bg-page); animation: catIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) both; }
.catalog[hidden] { display: none; }
@keyframes catIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.cat-top { background: var(--navy-gradient); padding: 0 0.85rem 0.75rem; box-shadow: 0 12px 26px -16px rgba(7, 13, 31, 0.8); flex-shrink: 0; }
.cat-head { height: 58px; display: flex; align-items: center; gap: 0.7rem; color: #fff; }
.cat-icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 1.3rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cat-icon-btn:active { background: rgba(255, 255, 255, 0.2); }
.cat-title { flex: 1; min-width: 0; line-height: 1.2; }
.cat-title b { display: block; font-size: 1.05rem; }
.cat-title small { display: block; font-size: 0.72rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #1f1300; font-size: 0.68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #0f1a3a; }
.cat-search { position: relative; }
.cat-search i { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.1rem; }
.cat-search input { width: 100%; height: 46px; border: 0; border-radius: 14px; padding: 0 1rem 0 2.7rem; font-family: inherit; font-size: 0.95rem; color: var(--text-title); background: #fff; outline: 0; box-shadow: 0 8px 20px -14px rgba(0, 0, 0, 0.6); }
.cat-chips { display: flex; gap: 0.45rem; overflow-x: auto; scrollbar-width: none; margin-top: 0.7rem; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.08); color: #e2e8f0; border-radius: 999px; padding: 0.38rem 0.8rem; font-size: 0.78rem; font-weight: 600; }
.cat-chip small { font-size: 0.66rem; color: #94a3b8; }
.cat-chip.active { background: var(--gold-gradient); border-color: transparent; color: #1f1300; }
.cat-chip.active small { color: #5c3d00; }
.cat-body { flex: 1; overflow-y: auto; padding: 0.85rem 0.75rem calc(5.5rem + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling: touch; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
@media (min-width: 576px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .cat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.cat-card { background: #fff; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 10px 22px -18px rgba(15, 23, 42, 0.5); display: flex; flex-direction: column; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.cat-card.in-cart { border-color: var(--primary-200); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 10px 22px -18px rgba(15, 23, 42, 0.5); }
.cat-card.is-out { opacity: 0.7; }
.cc-img { position: relative; aspect-ratio: 1 / 0.82; background: var(--surface-2); overflow: hidden; }
.cc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; color: #fff; }
.cc-ph b { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; width: 58px; height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.28); }
.cc-ph small { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.9; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-ph.tone-blue { background: var(--primary-gradient); }
.cc-ph.tone-gold { background: var(--gold-gradient); }
.cc-ph.tone-green { background: linear-gradient(135deg, #15803d, #22c55e); }
.cc-ph.tone-violet { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.cc-ph.tone-cyan { background: linear-gradient(135deg, #0e7490, #22d3ee); }
.cc-ph.tone-orange { background: linear-gradient(135deg, #c2410c, #fb923c); }
.cc-ph.tone-red { background: linear-gradient(135deg, #b91c1c, #f87171); }
.cc-stock { position: absolute; left: 0.5rem; bottom: 0.5rem; font-size: 0.64rem; font-weight: 800; padding: 0.2rem 0.45rem; border-radius: 7px; background: rgba(255, 255, 255, 0.95); color: #15803d; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.3); }
.cc-stock.out { color: var(--danger); }
.cc-body { padding: 0.6rem 0.7rem 0.7rem; display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.cc-name { font-size: 0.84rem; font-weight: 700; color: var(--text-title); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.1em; }
.cc-meta { font-size: 0.68rem; color: var(--text-muted); }
.cc-foot { margin-top: auto; padding-top: 0.45rem; display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; flex-wrap: wrap; }
.cc-price { font-size: 0.98rem; font-weight: 800; color: var(--text-title); letter-spacing: -0.02em; }
.cc-price small { font-size: 0.66rem; font-weight: 600; color: var(--text-muted); }
.cc-action { margin-left: auto; }
.cc-add { height: 34px; min-width: 64px; padding: 0 0.8rem; border-radius: 10px; border: 1.5px solid var(--primary); background: #fff; color: var(--primary); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.04em; }
.cc-add:active { background: var(--primary-50); }
.cc-add:disabled { border-color: var(--border); color: var(--text-muted); }
.qty-stepper { display: inline-flex; align-items: center; height: 34px; border-radius: 10px; background: var(--primary-gradient); box-shadow: 0 6px 14px -6px var(--primary-glow); overflow: hidden; }
.qty-stepper button { width: 30px; height: 100%; border: 0; background: transparent; color: #fff; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.qty-stepper input { width: 40px; height: 100%; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; text-align: center; font-weight: 800; font-size: 0.82rem; padding: 0; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cat-state { padding: 1rem 0; }
.cat-empty { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; text-align: center; color: var(--text-muted); font-size: 0.82rem; padding: 2rem 1rem; }
.cat-empty i { font-size: 2.2rem; color: var(--primary); }
.cat-empty b { color: var(--text-title); font-size: 0.95rem; }
.cat-loading { display: flex; justify-content: center; gap: 0.35rem; }
.cat-loading span { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); animation: catDot 0.9s ease-in-out infinite; }
.cat-loading span:nth-child(2) { animation-delay: 0.15s; }
.cat-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes catDot { 0%, 100% { transform: scale(0.6); opacity: 0.4; } 50% { transform: scale(1); opacity: 1; } }
.cat-sentinel { height: 1px; }
.cat-bar {
    position: absolute; left: 0.75rem; right: 0.75rem; bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.6rem 0.6rem 1rem; border-radius: 18px;
    background: #fff; border: 1px solid var(--border); box-shadow: 0 18px 40px -16px rgba(15, 23, 42, 0.45);
}
.cat-bar.has-items { background: var(--navy-gradient); border-color: transparent; }
.cb-info { flex: 1; min-width: 0; line-height: 1.25; }
.cb-items { display: block; font-size: 0.88rem; color: var(--text-title); }
.cb-total { display: block; font-size: 0.74rem; color: var(--text-muted); }
.cat-bar.has-items .cb-items { color: #fff; }
.cat-bar.has-items .cb-total { color: #fbbf24; font-weight: 700; }
.cb-done { height: 46px; padding: 0 1.25rem; border: 0; border-radius: 14px; background: var(--primary-gradient); color: #fff; font-weight: 800; font-size: 0.92rem; display: inline-flex; align-items: center; gap: 0.4rem; box-shadow: 0 10px 22px -10px var(--primary-glow); }
.cat-bar.has-items .cb-done { background: var(--gold-gradient); color: #1f1300; box-shadow: 0 10px 22px -10px var(--gold-glow); }
body.catalog-open .swal2-container { z-index: 1200 !important; }

/* Product option in Select2: photo / initials + stock pill */
.s2-opt .s2-thumb { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary-700); font-size: 0.72rem; font-weight: 800; }
.s2-opt .s2-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s2-opt .s2-main { flex: 1; }
.s2-opt .s2-side.out { background: var(--danger-50); color: var(--danger); }
.select2-results__option--highlighted .s2-opt .s2-thumb { background: #fff; }

/* Cart lines (phones): a catalog-enabled item grid shows compact cart cards; products come from the catalog */
.cart-empty, .cl-thumb, .cl-name, .cl-code, .cl-more, .cl-step { display: none; }
.cl-qty { display: contents; }
@media (max-width: 767.98px) {
    .catalog-on [data-repeater-add] { display: none !important; }
    .catalog-on .items-wrap.items-responsive { border: 0; border-radius: 0; overflow: visible; background: transparent; }
    .catalog-on.is-empty .items-wrap { display: none; }
    .catalog-on.is-empty .cart-empty { display: flex; }
    .cart-empty { flex-direction: column; align-items: center; gap: 0.25rem; text-align: center; padding: 1.4rem 1rem; margin-bottom: 0.8rem; border: 2px dashed var(--border); border-radius: 18px; color: var(--text-muted); font-size: 0.8rem; }
    .cart-empty .ce-icon { width: 54px; height: 54px; border-radius: 17px; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); font-size: 1.6rem; margin-bottom: 0.35rem; }
    .cart-empty b { color: var(--text-title); font-size: 0.95rem; }

    .catalog-on .items-table > tbody { display: flex; flex-direction: column; gap: 0.7rem; }
    .catalog-on .items-table > tbody > tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.55rem 0.7rem; padding: 0.8rem 0.85rem 0.7rem;
        border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 12px 26px -22px rgba(15, 23, 42, 0.55);
    }
    .catalog-on .items-table > tbody > tr:not(.has-product) { display: none; }
    .catalog-on .items-table > tbody > tr > td { background: transparent; }
    .catalog-on .items-table > tbody > tr > td.col-index,
    .catalog-on .items-table > tbody > tr > td.col-unit { display: none; }
    .catalog-on .items-table > tbody > tr > td.col-product { order: 1; display: grid; grid-template-columns: 54px minmax(0, 1fr); column-gap: 0.75rem; align-items: center; padding-right: 2.7rem !important; }
    .catalog-on .items-table > tbody > tr > td.col-product::before { display: none; }
    .catalog-on .items-table > tbody > tr > td.col-product > .select2-container { display: none !important; }
    .catalog-on .cl-thumb { display: flex; grid-row: 1 / span 3; align-self: start; width: 54px; height: 54px; border-radius: 15px; overflow: hidden; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; color: #fff; background: var(--surface-2); }
    .catalog-on .cl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .cl-thumb.tone-blue { background: var(--primary-gradient); }
    .cl-thumb.tone-gold { background: var(--gold-gradient); }
    .cl-thumb.tone-green { background: linear-gradient(135deg, #15803d, #22c55e); }
    .cl-thumb.tone-violet { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
    .cl-thumb.tone-cyan { background: linear-gradient(135deg, #0e7490, #22d3ee); }
    .cl-thumb.tone-orange { background: linear-gradient(135deg, #c2410c, #fb923c); }
    .cl-thumb.tone-red { background: linear-gradient(135deg, #b91c1c, #f87171); }
    .catalog-on .cl-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; grid-column: 2; font-size: 0.9rem; font-weight: 700; color: var(--text-title); line-height: 1.25; }
    .catalog-on .cl-code { display: block; grid-column: 2; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }
    .catalog-on .col-product .item-stock { grid-column: 2; margin-top: 0.15rem !important; }
    .catalog-on .col-product .item-stock:empty { display: none; }
    .catalog-on .items-table > tbody > tr > td.col-qty { order: 2; }
    .catalog-on .items-table > tbody > tr > td.col-rate { order: 3; }
    .catalog-on .items-table > tbody > tr > td.col-total { order: 4; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; border-top: 1px dashed var(--border) !important; padding-top: 0.6rem !important; }
    .catalog-on .items-table > tbody > tr > td.col-total::before { display: none; }
    .catalog-on .items-table > tbody > tr > td.col-total .line-total { padding: 0; font-size: 1.08rem; text-align: right; }
    .catalog-on .items-table > tbody > tr > td.col-hsn,
    .catalog-on .items-table > tbody > tr > td.col-disc,
    .catalog-on .items-table > tbody > tr > td.col-gst,
    .catalog-on .items-table > tbody > tr > td.col-taxable { order: 5; display: none; }
    .catalog-on .items-table > tbody > tr.cl-open > td.col-hsn,
    .catalog-on .items-table > tbody > tr.cl-open > td.col-disc,
    .catalog-on .items-table > tbody > tr.cl-open > td.col-gst,
    .catalog-on .items-table > tbody > tr.cl-open > td.col-taxable { display: block; }
    .catalog-on .items-table > tbody > tr > td.col-remove { top: 0.75rem; right: 0.75rem; }
    .catalog-on .cl-more { display: inline-flex; align-items: center; gap: 0.25rem; min-width: 0; max-width: 62%; border: 0; border-radius: 999px; padding: 0.32rem 0.55rem 0.32rem 0.75rem; background: var(--surface-2); color: var(--text-body); font-size: 0.72rem; font-weight: 600; }
    .catalog-on .cl-more span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .catalog-on .cl-more i { font-size: 1rem; transition: transform 0.2s ease; }
    .catalog-on tr.cl-open .cl-more { background: var(--primary-50); color: var(--primary-700); }
    .catalog-on tr.cl-open .cl-more i { transform: rotate(180deg); }
    .catalog-on .cl-qty { display: flex; height: 42px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
    .catalog-on .cl-qty:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
    .catalog-on .cl-qty .item-qty { flex: 1; min-width: 0; height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; padding: 0 0.2rem; text-align: center; font-weight: 700; background: transparent; }
    .catalog-on .cl-step { display: flex; width: 38px; flex-shrink: 0; align-items: center; justify-content: center; border: 0; background: var(--primary-50); color: var(--primary-700); font-size: 1.05rem; }
    .catalog-on .cl-step:active { background: var(--primary-100); }
    .catalog-on .col-rate .form-control { min-height: 42px; }
}

/* ==========================================================================
   Step-by-step form wizard (phones): one section at a time
   ========================================================================== */
.wizard-head { margin-bottom: 0.75rem; }
.wizard-progress { height: 5px; border-radius: 9px; background: var(--border-soft); overflow: hidden; margin-bottom: 0.65rem; }
.wizard-progress > span { display: block; height: 100%; border-radius: 9px; background: var(--primary-gradient); transition: width 0.3s ease; }
.wizard-steps { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.15rem; }
.wizard-steps::-webkit-scrollbar { display: none; }
.ws-step { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.45rem; border: 1px solid var(--border); background: #fff; color: var(--text-body); border-radius: 999px; padding: 0.3rem 0.75rem 0.3rem 0.3rem; font-size: 0.76rem; font-weight: 600; }
.ws-step .ws-dot { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-muted); font-size: 0.72rem; font-weight: 800; }
.ws-step.active { border-color: var(--primary-200); background: var(--primary-50); color: var(--primary-700); }
.ws-step.active .ws-dot { background: var(--primary-gradient); color: #fff; }
.ws-step.done .ws-dot { background: var(--success); color: #fff; }
.ws-step.has-error .ws-dot { background: var(--danger); color: #fff; }
.form-sheet.is-wizard > .form-section[hidden] { display: none !important; }
.form-sheet.is-wizard > .form-section.wz-first { border-top: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.form-sheet.is-wizard > .form-section.wz-last { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.form-sheet.is-wizard > .form-section.wz-first.wz-last { border-radius: var(--radius-xl); }
.form-actions .wz-btn { display: none; }
.form-actions.wizard-on .wz-btn { display: inline-flex; }
.form-actions.wizard-on [data-wz-hide] { display: none !important; }
