/* DWARG — Premium app shell (header + sidebar) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --shell-font: 'Inter', system-ui, -apple-system, sans-serif;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --sidebar-bg: #0b0f19;
    --sidebar-accent: #648dcb;
    --brand-gradient: linear-gradient(90deg, #7b5cff, #a000c8);
    --topbar-height: 72px;
    --shell-transition: 0.25s ease;
    --page-bg: #f4f5f7;
    --card-bg: #ffffff;
}

body.app-shell {
    font-family: var(--shell-font);
}

body.sidebar-mobile-open {
    overflow: hidden;
}

/* ─── Sidebar backdrop (mobile) ─── */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 15, 25, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--shell-transition), visibility var(--shell-transition);
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(180deg, #0b0f19 0%, #111827 50%, #0d1321 100%);
    color: rgba(255, 255, 255, 0.92);
    position: fixed;
    top: 12px;
    left: 12px;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    overflow: hidden;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border-radius: 0 16px 16px 0;
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    transition: width var(--shell-transition), min-width var(--shell-transition), transform var(--shell-transition);
}

.sidebar__scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.sidebar__scroll::-webkit-scrollbar {
    width: 5px;
}

.sidebar__scroll::-webkit-scrollbar-thumb {
    background: rgba(100, 141, 203, 0.35);
    border-radius: 99px;
}

/* Mobile drawer header */
.sidebar-mobile-header {
    display: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-mobile-brand-wrap {
    flex: 1;
    min-width: 0;
}

.sidebar-mobile-meta {
    margin-top: 0.5rem;
    padding-left: 0.15rem;
}

.sidebar-mobile-user {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    display: block;
}

.sidebar-sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.35rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(100, 141, 203, 0.2);
    color: #a8c4e8;
}

.sidebar-sub-badge.is-expired {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background var(--shell-transition), transform var(--shell-transition);
}

.sidebar-close:hover {
    background: rgba(123, 92, 255, 0.25);
    transform: scale(1.05);
}

/* Sidebar business branding */
.sidebar-logo,
.sidebar-business-logo {
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0;
    flex-shrink: 0;
}

/* Collapse control */
.sidebar-footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--shell-transition), color var(--shell-transition);
}

.sidebar-collapse-btn:hover {
    background: rgba(100, 141, 203, 0.2);
    color: #fff;
}

.sidebar-collapse-btn i {
    transition: transform var(--shell-transition);
}

.app-layout.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

/* Menu */
.sidebar-menu {
    list-style: none;
    padding: 0.5rem 0.75rem;
    margin: 0;
}

.menu-group-header {
    padding: 1.25rem 0.75rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.25rem;
}

.menu-group-header:first-child {
    margin-top: 0;
    padding-top: 0.5rem;
}

.sidebar-menu-item {
    margin: 0 0 0.2rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 42px;
    padding: 0 0.75rem;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    border-radius: 10px;
    border-left: none;
    font-weight: 500;
    font-size: 0.84rem;
    letter-spacing: -0.01em;
    position: relative;
    transition:
        background 160ms ease,
        color 160ms ease,
        box-shadow 160ms ease;
}

.sidebar-menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    border-radius: 0 3px 3px 0;
    background: #93c5fd;
    opacity: 0;
    transition: height 160ms ease, opacity 160ms ease;
}

.sidebar-menu-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-menu-link:hover i {
    color: #e2e8f0;
}

.sidebar-menu-link:focus-visible {
    outline: 2px solid rgba(147, 197, 253, 0.65);
    outline-offset: 1px;
}

.sidebar-menu-link.active {
    background: rgba(100, 141, 203, 0.16);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(100, 141, 203, 0.22);
}

.sidebar-menu-link.active::before {
    height: 58%;
    opacity: 1;
}

.sidebar-menu-link i {
    width: 20px;
    min-width: 20px;
    margin-right: 0;
    font-size: 1.05rem;
    line-height: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    transition: color 160ms ease;
}

.sidebar-menu-link.active i {
    color: #bfdbfe;
}

.sidebar-menu-link span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Submenu (unchanged behavior) */
.sidebar-submenu {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin: 0 0.5rem 0.25rem;
}

.sidebar-submenu-link {
    padding: 0.65rem 1rem 0.65rem 2.75rem;
    border-radius: 10px;
    margin: 0 0.25rem;
}

.sidebar-submenu-link:hover {
    padding-left: 2.85rem;
}

/* Collapsed sidebar */
.app-layout.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
}

.app-layout.sidebar-collapsed .business-brand-text,
.app-layout.sidebar-collapsed .sidebar-menu-link span,
.app-layout.sidebar-collapsed .menu-group-header,
.app-layout.sidebar-collapsed .sidebar-collapse-btn span,
.app-layout.sidebar-collapsed .sidebar-brand-badge {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
}

.app-layout.sidebar-collapsed .business-brand-link--sidebar {
    justify-content: center;
}

.app-layout.sidebar-collapsed .sidebar-menu-link {
    justify-content: center;
    padding: 0;
}

.app-layout.sidebar-collapsed .sidebar-menu {
    padding: 0.5rem 0.5rem;
}

.app-layout.sidebar-collapsed .main-content {
    margin-left: calc(var(--sidebar-collapsed-width) + 24px);
    width: calc(100% - var(--sidebar-collapsed-width) - 24px);
    max-width: calc(100% - var(--sidebar-collapsed-width) - 24px);
}

/* ─── Main content ─── */
.main-content {
    margin-left: calc(var(--sidebar-width) + 24px);
    width: calc(100% - var(--sidebar-width) - 24px);
    max-width: calc(100% - var(--sidebar-width) - 24px);
    transition: margin-left var(--shell-transition), width var(--shell-transition), max-width var(--shell-transition);
}

.main-content__top {
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 12px 16px 0;
    flex-shrink: 0;
}

/* ─── Topbar (floating glass) ─── */
.app-topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(30, 58, 95, 0.08), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.topbar-end {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

/* Menu toggle */
.topbar-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    border-radius: 12px;
    background: var(--card-bg);
    color: #374151;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: box-shadow var(--shell-transition), transform var(--shell-transition), background var(--shell-transition);
    position: relative;
}

.topbar-menu-btn:hover {
    box-shadow: 0 4px 16px rgba(123, 92, 255, 0.2);
    background: linear-gradient(135deg, rgba(123, 92, 255, 0.08), rgba(160, 0, 200, 0.06));
}

.topbar-menu-btn.is-open {
    background: var(--brand-gradient);
    color: #fff;
}

.topbar-menu-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 18px;
}

.topbar-menu-icon span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--shell-transition), opacity var(--shell-transition);
}

.topbar-menu-btn.is-open .topbar-menu-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.topbar-menu-btn.is-open .topbar-menu-icon span:nth-child(2) {
    opacity: 0;
}

.topbar-menu-btn.is-open .topbar-menu-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ─── Shared business brand mark (header + sidebar) ─── */
.brand-mark {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
}

.brand-mark--header {
    width: 48px;
    height: 48px;
    min-width: 48px;
}

.brand-mark--sidebar {
    width: 48px;
    height: 48px;
    min-width: 48px;
}

.brand-mark--sidebar-mobile {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 14px;
}

.brand-mark--photo {
    background: linear-gradient(145deg, #ffffff 0%, #f4f5f7 100%);
    border: 1px solid rgba(100, 141, 203, 0.28);
    box-shadow: 0 2px 12px rgba(30, 58, 95, 0.1);
    padding: 5px;
}

.brand-mark--photo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    transform: scale(1.2);
    transform-origin: center center;
}

.sidebar .brand-mark--photo {
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    padding: 6px;
}

.sidebar .brand-mark--photo img {
    transform: scale(1.35);
}

.brand-mark--initials {
    background: var(--brand-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 14px rgba(123, 92, 255, 0.35);
}

.brand-mark--sidebar-mobile.brand-mark--initials {
    font-size: 1rem;
}

/* Business brand link blocks */
.business-brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    transition: opacity var(--shell-transition), background var(--shell-transition), box-shadow var(--shell-transition);
}

.business-brand-link:hover {
    color: inherit;
    text-decoration: none;
}

.business-brand-link--header {
    flex: 0 1 auto;
    max-width: none;
    padding: 0.3rem 0.55rem 0.3rem 0.3rem;
    margin-right: 0.25rem;
    border-radius: 14px;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.business-brand-link--header:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(100, 141, 203, 0.22);
    box-shadow: 0 4px 16px rgba(100, 141, 203, 0.12);
}

.business-brand-link--sidebar {
    color: #fff;
}

.business-brand-link--sidebar:hover {
    opacity: 0.92;
}

.business-brand-link--sidebar-mobile {
    color: #fff;
    align-items: center;
}

.business-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1 1 auto;
}

.business-brand-link--header .business-brand-text {
    min-width: max-content;
    flex: 0 1 auto;
}

.business-brand-name {
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.business-brand-link--header .business-brand-name {
    font-size: 0.95rem;
    color: #1f2937;
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
}

.business-brand-link--sidebar .business-brand-name,
.business-brand-link--sidebar-mobile .business-brand-name {
    font-size: 0.92rem;
    color: #fff;
    max-width: 170px;
}

.business-brand-link--sidebar-mobile .business-brand-name {
    font-size: 1rem;
    max-width: 200px;
}

.business-brand-subtitle {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.business-brand-link--header .business-brand-subtitle {
    color: #648dcb;
}

.business-brand-link--sidebar .business-brand-subtitle,
.business-brand-link--sidebar-mobile .business-brand-subtitle {
    color: rgba(168, 196, 232, 0.95);
}

/* Search */
.topbar-search-wrap {
    flex: 1 1 160px;
    max-width: 280px;
    min-width: 140px;
}

.topbar-search {
    position: relative;
    width: 100%;
}

.topbar-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--shell-transition);
}

.topbar-search input {
    width: 100%;
    height: 44px;
    padding: 0 1rem 0 2.75rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--shell-font);
    background: rgba(244, 245, 247, 0.9);
    color: #1f2937;
    transition: border-color var(--shell-transition), box-shadow var(--shell-transition), background var(--shell-transition);
}

.topbar-search input::placeholder {
    color: #9ca3af;
}

.topbar-search input:focus {
    outline: none;
    background: #fff;
    border-color: rgba(100, 141, 203, 0.45);
    box-shadow: 0 0 0 4px rgba(100, 141, 203, 0.12);
}

.topbar-search input:focus + i,
.topbar-search:focus-within i {
    color: var(--sidebar-accent);
}

/* Notifications */
.topbar-notify-btn.dropdown-toggle::after,
.topbar-user.dropdown-toggle::after {
    display: none;
}

.topbar-notify-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: rgba(244, 245, 247, 0.95);
    color: #4b5563;
    font-size: 1.15rem;
    cursor: pointer;
    transition: transform var(--shell-transition), background var(--shell-transition), box-shadow var(--shell-transition);
}

.topbar-notify-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(100, 141, 203, 0.15);
    color: var(--sidebar-accent);
}

.topbar-notify-count {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 999px;
    background: var(--brand-gradient);
    color: #fff;
    border: 2px solid #fff;
}

.topbar-dropdown {
    border: none;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(30, 58, 95, 0.15);
    padding: 0.5rem;
    margin-top: 0.5rem !important;
    animation: shellDropdownIn 0.2s ease;
}

@keyframes shellDropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.topbar-dropdown .dropdown-header {
    font-weight: 600;
    font-size: 0.8rem;
    color: #6b7280;
}

.topbar-dropdown .dropdown-item {
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--shell-transition);
}

.topbar-dropdown .dropdown-item:hover {
    background: rgba(100, 141, 203, 0.1);
}

.topbar-dropdown .dropdown-item i {
    color: var(--sidebar-accent);
    margin-right: 0.5rem;
}

/* User profile */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.5rem 0.35rem 0.35rem;
    border: none;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
    transition: background var(--shell-transition), box-shadow var(--shell-transition);
}

.topbar-user:hover,
.topbar-user.show {
    background: rgba(244, 245, 247, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(123, 92, 255, 0.35);
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.user-role {
    font-size: 0.7rem;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.2;
}

.topbar-user-chevron {
    color: #9ca3af;
    font-size: 0.75rem;
    transition: transform var(--shell-transition);
}

.topbar-user.show .topbar-user-chevron {
    transform: rotate(180deg);
}

/* Legacy fixed toggle — hidden */
.sidebar-toggle {
    display: none !important;
}

/* Content wrapper */
.content-wrapper {
    padding: 20px 16px 30px;
}

/* Listing sticky offset */
.listing-filter-bar {
    top: calc(var(--topbar-height) + 24px);
}

/* ─── Responsive ─── */
@media (max-width: 992px) {
    .sidebar {
        top: 0;
        left: 0;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0 20px 20px 0;
        margin: 0;
        transform: translateX(-100%);
    }

    .sidebar.show,
    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-mobile-header {
        display: flex;
    }

    .sidebar-close {
        display: flex;
    }

    .sidebar-footer .sidebar-collapse-btn {
        display: none;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .app-layout.sidebar-collapsed .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }

    .topbar-menu-btn {
        display: flex;
    }

    .sidebar-business-logo {
        display: none;
    }

    .business-brand-link--header {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
        padding: 0.2rem 0.35rem 0.2rem 0.15rem;
    }

    .business-brand-link--header .business-brand-name {
        max-width: none;
        font-size: 0.9rem;
        overflow: visible;
        text-overflow: unset;
    }

    .business-brand-link--header .business-brand-subtitle {
        display: none;
    }

    .brand-mark--header {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .brand-mark--header.brand-mark--photo {
        padding: 4px;
    }

    .brand-mark--header.brand-mark--photo img {
        transform: scale(1.25);
    }

    .topbar-search-wrap {
        display: none;
    }

    .main-content__top {
        padding: 10px 12px 0;
    }

    .app-topbar {
        height: 64px;
        min-height: 64px;
        padding: 0 0.75rem;
        border-radius: 14px;
    }

    :root {
        --topbar-height: 64px;
    }

    .topbar-user .user-info,
    .topbar-user .topbar-user-chevron {
        display: none;
    }
}

@media (min-width: 993px) {
    .sidebar-mobile-header {
        display: none !important;
    }
}

/* ─── Smart sidebar navigation ─── */
.sidebar-nav-tools {
    padding: 0.75rem 0.75rem 0.35rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, #0b0f19 0%, rgba(11, 15, 25, 0.96) 100%);
}

.sidebar-search {
    position: relative;
}

.sidebar-search i.bi-search {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    font-size: 0.95rem;
}

.sidebar-search__input {
    width: 100%;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.8125rem;
    font-family: var(--shell-font);
    padding: 0 2.25rem 0 2.5rem;
    transition: border-color var(--shell-transition), box-shadow var(--shell-transition), background var(--shell-transition);
}

.sidebar-search__input::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.sidebar-search__input:focus {
    outline: none;
    border-color: rgba(100, 141, 203, 0.55);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(100, 141, 203, 0.15);
}

.sidebar-search__clear {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar-search__clear:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-search-results {
    margin-top: 0.45rem;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
}

.sidebar-search-result {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8125rem;
}

.sidebar-search-result:last-child {
    border-bottom: none;
}

.sidebar-search-result:hover {
    background: rgba(100, 141, 203, 0.14);
    color: #fff;
}

.sidebar-search-result i {
    margin-top: 0.1rem;
    color: #a8c4e8;
}

.sidebar-search-result__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.sidebar-search-result__label {
    font-weight: 600;
    line-height: 1.25;
}

.sidebar-search-result__meta,
.sidebar-search-result__type {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: capitalize;
}

.sidebar-search-empty {
    padding: 0.75rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.sidebar-nav-meta {
    list-style: none;
    margin: 0.35rem 0 0.25rem;
    padding: 0.35rem 0.85rem 0.15rem;
}

.sidebar-nav-meta__label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.48);
}

.sidebar-nav-meta__label i {
    color: #fbbf24;
    font-size: 0.72rem;
}

/* Current page indicator */
.sidebar-location {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0.35rem 0.75rem 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: rgba(100, 141, 203, 0.12);
    border: 1px solid rgba(100, 141, 203, 0.22);
}

.sidebar-location__icon {
    color: #93c5fd;
    font-size: 0.95rem;
    line-height: 1.3;
    flex-shrink: 0;
}

.sidebar-location__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sidebar-location__label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.48);
}

.sidebar-location__path {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.35;
    word-break: break-word;
}

.sidebar-section {
    list-style: none;
    margin: 0.2rem 0;
    border-radius: 12px;
}

.sidebar-section.is-filtered-out {
    display: none;
}

.sidebar-section__toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 40px;
    padding: 0 0.7rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.sidebar-section__toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-section.is-open > .sidebar-section__toggle {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    box-shadow: inset 3px 0 0 rgba(100, 141, 203, 0.85);
}

.sidebar-section.has-active-child > .sidebar-section__toggle {
    color: #fff;
}

.sidebar-section.has-active-child:not(.is-open) > .sidebar-section__toggle {
    background: rgba(100, 141, 203, 0.14);
    box-shadow: inset 3px 0 0 rgba(100, 141, 203, 0.65);
}

.sidebar-section__icon {
    width: 20px;
    min-width: 20px;
    font-size: 1.05rem;
    color: #a8c4e8;
    text-align: center;
}

.sidebar-section.is-open .sidebar-section__icon,
.sidebar-section.has-active-child .sidebar-section__icon {
    color: #dbeafe;
}

.sidebar-section__label {
    flex: 1;
    text-align: left;
}

.sidebar-section__chevron {
    font-size: 0.75rem;
    transition: transform var(--shell-transition);
    color: rgba(255, 255, 255, 0.45);
}

.sidebar-section.is-open .sidebar-section__chevron {
    transform: rotate(180deg);
    color: rgba(255, 255, 255, 0.75);
}

.sidebar-section__items {
    list-style: none;
    margin: 0 0.3rem 0.3rem;
    padding: 0.2rem 0 0.3rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.22s ease;
    border-left: 1px solid rgba(100, 141, 203, 0.18);
    margin-left: 1.25rem;
}

.sidebar-section__items.is-expanded {
    max-height: 1600px;
    background: rgba(0, 0, 0, 0.14);
    border-radius: 0 8px 8px 0;
    border-left-color: rgba(100, 141, 203, 0.35);
}

.sidebar-section__flyout-head {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0.55rem 0.85rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-menu-item {
    position: relative;
}

.sidebar-menu-item.is-filtered-out {
    display: none;
}

.sidebar-menu-item .sidebar-menu-link {
    padding-right: 2.1rem;
    font-size: 0.84rem;
}

.sidebar-pin-btn {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    opacity: 0;
    transition: opacity var(--shell-transition), background var(--shell-transition), color var(--shell-transition);
    cursor: pointer;
    z-index: 1;
}

.sidebar-menu-item:hover .sidebar-pin-btn,
.sidebar-pin-btn.is-pinned,
.sidebar-pin-btn:focus-visible {
    opacity: 1;
}

.sidebar-pin-btn:hover,
.sidebar-pin-btn.is-pinned {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.sidebar-menu-item--favorite .sidebar-menu-link {
    padding-right: 0.85rem;
    min-height: 44px;
}

/* Collapsed sidebar — icon rail + flyout panels */
.app-layout.sidebar-collapsed .sidebar-location {
    display: none;
}

.app-layout.sidebar-collapsed .sidebar-section__label,
.app-layout.sidebar-collapsed .sidebar-section__chevron,
.app-layout.sidebar-collapsed .sidebar-nav-tools,
.app-layout.sidebar-collapsed .sidebar-menu--pinned,
.app-layout.sidebar-collapsed .sidebar-pin-btn {
    display: none;
}

.app-layout.sidebar-collapsed .sidebar {
    overflow: visible;
}

.app-layout.sidebar-collapsed .sidebar__scroll {
    overflow: visible;
}

.app-layout.sidebar-collapsed .sidebar-section {
    position: relative;
    margin: 0.15rem 0;
}

.app-layout.sidebar-collapsed .sidebar-section__toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    min-height: 48px;
    margin: 0 auto;
    padding: 0;
    border-radius: 14px;
}

.app-layout.sidebar-collapsed .sidebar-section.has-active-child > .sidebar-section__toggle,
.app-layout.sidebar-collapsed .sidebar-section.is-flyout-open > .sidebar-section__toggle {
    background: rgba(100, 141, 203, 0.28);
    box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.35);
}

.app-layout.sidebar-collapsed .sidebar-section__items {
    display: none;
    position: absolute;
    left: calc(100% + 10px);
    top: 0;
    min-width: 240px;
    max-width: 280px;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    margin: 0;
    padding: 0.35rem;
    border-left: none;
    border-radius: 14px;
    background: #111827;
    border: 1px solid rgba(100, 141, 203, 0.28);
    box-shadow: 8px 12px 40px rgba(0, 0, 0, 0.35);
    z-index: 3000;
}

.app-layout.sidebar-collapsed .sidebar-section.is-flyout-open .sidebar-section__items,
.app-layout.sidebar-collapsed .sidebar-section:hover .sidebar-section__items {
    display: block;
    max-height: min(70vh, 420px);
}

.app-layout.sidebar-collapsed .sidebar-section__flyout-head {
    display: block;
}

.app-layout.sidebar-collapsed .sidebar-section__items .sidebar-menu-link {
    justify-content: flex-start;
    padding: 0 0.85rem;
}

.app-layout.sidebar-collapsed .sidebar-section__items .sidebar-menu-link span {
    opacity: 1;
    width: auto;
    overflow: visible;
}

.app-layout.sidebar-collapsed .sidebar-menu-link:hover::after {
    display: none;
}

.app-layout.sidebar-collapsed .sidebar-menu-link.active::after {
    right: 0.5rem;
}

/* Quick actions FAB */
.quick-actions {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 1060;
}

.quick-actions__toggle {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 18px;
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 10px 30px rgba(123, 92, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    transition: transform var(--shell-transition), box-shadow var(--shell-transition);
}

.quick-actions__toggle:hover,
.quick-actions__toggle.is-open {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 14px 36px rgba(123, 92, 255, 0.42);
}

.quick-actions:has(.quick-actions__toggle.is-open) {
    z-index: 1130;
}

.quick-actions__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    min-width: 220px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 48px rgba(30, 58, 95, 0.18);
    border: 1px solid rgba(100, 141, 203, 0.12);
    overflow: hidden;
    animation: shellDropdownIn 0.18s ease;
}

.quick-actions__header {
    padding: 0.75rem 1rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.quick-actions__list {
    list-style: none;
    margin: 0;
    padding: 0.35rem;
}

.quick-actions__link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.72rem 0.85rem;
    border-radius: 12px;
    color: #1f2937;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background var(--shell-transition);
}

.quick-actions__link:hover {
    background: rgba(100, 141, 203, 0.1);
    color: #1f2937;
}

.quick-actions__link i {
    color: var(--sidebar-accent);
    font-size: 1.05rem;
}

@media (max-width: 992px) {
    .sidebar-nav-tools {
        padding-top: 0.5rem;
    }

    .sidebar-search__input {
        height: 48px;
        font-size: 0.875rem;
    }

    .sidebar-section__toggle {
        min-height: 48px;
    }

    .sidebar-menu-link,
    .sidebar-menu-item--favorite .sidebar-menu-link {
        min-height: 50px;
    }

    .sidebar-pin-btn {
        opacity: 1;
        width: 36px;
        height: 36px;
    }

    .quick-actions {
        right: 16px;
        bottom: 20px;
    }

    .quick-actions__toggle {
        width: 52px;
        height: 52px;
    }
}
/* DWARG — Ultra-premium mobile app UI (logged-in shell only, ≤992px phone + tablet) */

@media (max-width: 992px) {
    body.app-shell {
        --mobile-brand: #648dcb;
        --mobile-brand-hover: #5278b8;
        --mobile-brand-soft: rgba(100, 141, 203, 0.12);
        --mobile-brand-ring: rgba(100, 141, 203, 0.18);
        --mobile-gradient: linear-gradient(135deg, #648dcb 0%, #5278b8 100%);
        --mobile-accent-gradient: linear-gradient(90deg, #7b5cff, #a000c8);
        --mobile-surface: #ffffff;
        --mobile-page-bg: #f4f5f7;
        --mobile-text: #1f2937;
        --mobile-muted: #6b7280;
        --mobile-border: rgba(17, 24, 39, 0.08);
        --mobile-radius: 16px;
        --mobile-radius-lg: 20px;
        --mobile-shadow: 0 4px 20px rgba(30, 58, 95, 0.07);
        --mobile-shadow-lg: 0 12px 36px rgba(30, 58, 95, 0.11);
        --mobile-touch: 48px;
        --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
        --mobile-safe-top: env(safe-area-inset-top, 0px);
        --mobile-header-stack: calc(var(--topbar-height, 64px) + 12px + var(--mobile-safe-top));
        --mobile-bottom-space: calc(96px + var(--mobile-safe-bottom));
        --listing-brand: var(--mobile-brand);
        --listing-gradient: var(--mobile-gradient);
        --listing-focus-ring: 0 0 0 3px var(--mobile-brand-ring);
        --badge-info-bg: var(--mobile-brand-soft);
        --badge-info-text: #4b6f9b;
        scroll-padding-top: var(--mobile-header-stack);
        -webkit-tap-highlight-color: rgba(100, 141, 203, 0.15);
    }

    /* ─── Page shell & safe areas ─── */
    body.app-shell .app-layout {
        background: var(--mobile-page-bg);
        min-height: 100dvh;
    }

    body.app-shell .main-content {
        min-height: 100dvh;
        padding-top: var(--mobile-safe-top);
    }

    body.app-shell .main-content__top {
        position: sticky;
        top: var(--mobile-safe-top);
        z-index: 220;
        padding: 8px 10px 0;
        background: linear-gradient(180deg, var(--mobile-page-bg) 72%, rgba(244, 245, 247, 0));
    }

    body.app-shell .app-topbar {
        height: 60px;
        min-height: 60px;
        padding: 0 0.65rem;
        border-radius: var(--mobile-radius);
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.95);
        box-shadow: var(--mobile-shadow), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
    }

    body.app-shell {
        --topbar-height: 60px;
    }

    body.app-shell .content-wrapper {
        padding: 14px 12px var(--mobile-bottom-space);
        overflow-x: clip;
        max-width: 100%;
    }

    /* ─── Sidebar drawer ─── */
    body.app-shell .sidebar {
        width: min(88vw, 320px);
        min-width: min(88vw, 320px);
        max-width: 320px;
        border-radius: 0 22px 22px 0;
        box-shadow: 8px 0 48px rgba(11, 15, 25, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    }

    body.app-shell .sidebar-backdrop.is-visible {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    body.app-shell .sidebar-mobile-header {
        padding: calc(0.85rem + var(--mobile-safe-top)) 1.1rem 0.85rem;
    }

    body.app-shell .sidebar-menu-link {
        min-height: 52px;
        border-radius: 14px;
        font-size: 0.9rem;
    }

    body.app-shell .sidebar-menu-link.active {
        background: linear-gradient(90deg, rgba(100, 141, 203, 0.18), rgba(100, 141, 203, 0.28));
        box-shadow: inset 0 0 0 1px rgba(100, 141, 203, 0.22);
    }

    body.app-shell .sidebar-close {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    body.app-shell .sidebar-close:hover {
        background: rgba(100, 141, 203, 0.22);
    }

    /* ─── Legacy Bootstrap cards (settings, admin, etc.) ─── */
    body.app-shell .content-wrapper > .card,
    body.app-shell .content-wrapper .card:not(.saas-form-card):not(.listing-filter-card):not(.listing-entity-card) {
        border-radius: var(--mobile-radius-lg);
        border: 1px solid var(--mobile-border);
        box-shadow: var(--mobile-shadow);
        margin-bottom: 1rem;
        overflow: hidden;
    }

    body.app-shell .card-header {
        background: var(--mobile-brand-soft) !important;
        color: var(--mobile-brand) !important;
        border-bottom: 1px solid rgba(100, 141, 203, 0.14) !important;
        border-radius: 0 !important;
        padding: 0.95rem 1.1rem !important;
        font-weight: 700;
        font-size: 0.82rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    body.app-shell .card-body {
        padding: 1.1rem;
    }

    body.app-shell .btn-primary:not(.saas-btn):not(.btn-filter):not(.listing-fab):not(.quick-actions__toggle) {
        background: var(--mobile-gradient) !important;
        border: none !important;
        border-radius: 14px !important;
        min-height: var(--mobile-touch);
        font-weight: 700;
        box-shadow: 0 4px 16px rgba(100, 141, 203, 0.28) !important;
    }

    body.app-shell .btn-outline-primary,
    body.app-shell .btn-outline-secondary {
        min-height: var(--mobile-touch);
        border-radius: 14px;
        font-weight: 600;
        padding: 0.55rem 1rem;
    }

    body.app-shell .btn,
    body.app-shell .saas-btn {
        max-width: 100%;
    }

    body.app-shell .btn-group,
    body.app-shell .form-actions-row,
    body.app-shell .listing-page-header--with-action {
        gap: 0.55rem;
    }

    body.app-shell .listing-page-header--with-action {
        flex-direction: column;
        align-items: stretch;
    }

    body.app-shell .listing-page-header--with-action h2 {
        width: 100%;
    }

    body.app-shell .listing-page-header--with-action .btn {
        width: 100%;
        justify-content: center;
    }

    /* ─── KPI / stat cards ─── */
    body.app-shell .listing-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    body.app-shell .listing-kpi {
        padding: 1rem 0.95rem;
        border-radius: var(--mobile-radius-lg);
        box-shadow: var(--mobile-shadow);
    }

    body.app-shell .listing-kpi:hover {
        transform: none;
    }

    body.app-shell .listing-kpi--revenue .listing-kpi__icon {
        background: var(--mobile-gradient);
    }

    body.app-shell .listing-kpi--primary .listing-kpi__icon {
        background: var(--mobile-brand-soft);
        color: var(--mobile-brand);
    }

    body.app-shell .listing-page-header h2 i {
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
        color: var(--mobile-brand);
    }

    body.app-shell .dash-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    body.app-shell .dash-kpi-grid > .dash-kpi--gradient {
        grid-column: span 2;
    }

    body.app-shell .dash-kpi {
        border-radius: var(--mobile-radius-lg);
        box-shadow: var(--mobile-shadow);
        padding: 1rem;
    }

    body.app-shell .dash-kpi:hover {
        transform: none;
    }

    body.app-shell .dash-hero {
        border-radius: var(--mobile-radius-lg);
        padding: 1.15rem 1.2rem 1.15rem 1.35rem;
        margin-bottom: 1rem;
    }

    body.app-shell .dash-hero::before {
        background: var(--mobile-accent-gradient);
    }

    body.app-shell .dash-panel,
    body.app-shell .dash-card {
        border-radius: var(--mobile-radius-lg);
        box-shadow: var(--mobile-shadow);
    }

    body.app-shell .stats-card,
    body.app-shell .dashboard-card {
        border-radius: var(--mobile-radius-lg);
        box-shadow: var(--mobile-shadow);
        padding: 1.1rem;
    }

    body.app-shell .dashboard-card:hover {
        transform: none;
    }

    body.app-shell .pay-kpi {
        border-radius: var(--mobile-radius-lg);
        box-shadow: var(--mobile-shadow);
    }

    /* ─── Search & filter boxes ─── */
    body.app-shell .listing-filter-card,
    body.app-shell .listing-filter-bar,
    body.app-shell .pay-filter-bar {
        top: var(--mobile-header-stack);
        border-radius: var(--mobile-radius-lg);
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: var(--mobile-shadow);
    }

    body.app-shell .listing-filter-card .form-control,
    body.app-shell .listing-filter-card .form-select,
    body.app-shell .pay-filter-bar .form-control,
    body.app-shell .pay-filter-bar .form-select {
        min-height: var(--mobile-touch);
        border-radius: 14px;
        font-size: 16px;
        background: #fafbfc;
        border-color: var(--mobile-border);
    }

    body.app-shell .listing-filter-card .form-control:focus,
    body.app-shell .listing-filter-card .form-select:focus {
        border-color: var(--mobile-brand);
        box-shadow: 0 0 0 3px var(--mobile-brand-ring);
        background: #fff;
    }

    body.app-shell .listing-filter-card .btn-filter {
        background: var(--mobile-gradient);
        min-height: var(--mobile-touch);
        border-radius: 14px;
        width: 100%;
        box-shadow: 0 4px 16px rgba(100, 141, 203, 0.28);
    }

    body.app-shell .listing-filter-card__title i {
        color: var(--mobile-brand);
    }

    /* ─── Entity / listing cards ─── */
    body.app-shell .listing-entity-card {
        border-radius: var(--mobile-radius-lg);
        padding: 1.05rem;
        box-shadow: var(--mobile-shadow);
    }

    body.app-shell .listing-entity-card:hover {
        transform: none;
        border-color: rgba(100, 141, 203, 0.18);
    }

    body.app-shell .listing-entity-card__row {
        border-radius: 12px;
        padding: 0.6rem 0.75rem;
    }

    body.app-shell .listing-entity-card__row-value--accent {
        color: var(--mobile-brand);
    }

    body.app-shell .listing-card-action {
        width: var(--mobile-touch);
        height: var(--mobile-touch);
        border-radius: 14px;
    }

    body.app-shell .listing-card-grid {
        gap: 0.85rem;
    }

    body.app-shell .listing-empty {
        border-radius: var(--mobile-radius-lg);
        border-color: rgba(100, 141, 203, 0.22);
        padding: 2.5rem 1.25rem;
    }

    body.app-shell .listing-empty__icon-wrap {
        background: var(--mobile-brand-soft);
        border-radius: 18px;
    }

    body.app-shell .listing-empty__icon-wrap i {
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
        color: var(--mobile-brand);
    }

    /* ─── Floating + Add button ─── */
    body.app-shell .listing-fab {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--mobile-accent-gradient);
        box-shadow: 0 10px 32px rgba(123, 92, 255, 0.32), 0 4px 12px rgba(100, 141, 203, 0.2);
        bottom: calc(var(--mobile-nav-total, calc(88px + env(safe-area-inset-bottom, 0px))) + 0.65rem);
        right: 1.15rem;
        left: auto;
        transform: none;
        z-index: 1090;
    }

    body.app-shell .listing-fab:hover {
        transform: translateY(-2px) scale(1.03);
    }

    body.app-shell .listing-fab:active {
        transform: scale(0.96);
    }

    body.app-shell .quick-actions {
        right: 1rem;
        bottom: calc(5.5rem + var(--mobile-safe-bottom));
    }

    body.app-shell .quick-actions__toggle {
        width: 52px;
        height: 52px;
        border-radius: 16px;
        background: var(--mobile-gradient);
        box-shadow: 0 8px 24px rgba(100, 141, 203, 0.35);
    }

    body.app-shell .quick-actions__menu {
        border-radius: var(--mobile-radius-lg);
        min-width: 200px;
    }

    /* ─── Forms — single column, premium inputs ─── */
    body.app-shell .form-page .row > [class*="col-md"],
    body.app-shell .form-page .row > [class*="col-lg"],
    body.app-shell .form-page .row > [class*="col-xl"],
    body.app-shell .form-page .row > [class*="col-sm"],
    body.app-shell .content-wrapper .row > [class*="col-sm"],
    body.app-shell .content-wrapper .row > [class*="col-md"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    body.app-shell .form-page .form-control,
    body.app-shell .form-page .form-select,
    body.app-shell .form-page textarea.form-control,
    body.app-shell .content-wrapper .form-control,
    body.app-shell .content-wrapper .form-select {
        min-height: var(--mobile-touch);
        border-radius: 14px;
        font-size: 16px;
        background: #fafbfc;
    }

    body.app-shell .form-page .form-control:focus,
    body.app-shell .form-page .form-select:focus,
    body.app-shell .content-wrapper .form-control:focus,
    body.app-shell .content-wrapper .form-select:focus {
        border-color: var(--mobile-brand);
        box-shadow: 0 0 0 3px var(--mobile-brand-ring);
        background: #fff;
    }

    body.app-shell .saas-form-card,
    body.app-shell .form-hero {
        border-radius: var(--mobile-radius-lg);
        box-shadow: var(--mobile-shadow);
        margin-bottom: 1rem;
    }

    body.app-shell .saas-form-card__body,
    body.app-shell .form-page .card-body {
        padding: 1rem;
    }

    body.app-shell .form-hero__title {
        font-size: 1.25rem;
    }

    body.app-shell .form-page--invoice .invoice-item-row,
    body.app-shell .form-page--invoice .item-row,
    body.app-shell .form-page--purchase .invoice-item-row,
    body.app-shell .form-page--purchase .item-row {
        border-radius: var(--mobile-radius);
        padding: 0.95rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 2px 10px rgba(30, 58, 95, 0.04);
    }

    body.app-shell .form-page--invoice .invoice-item-row .row > [class*="col-"],
    body.app-shell .form-page--purchase .invoice-item-row .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    body.app-shell .form-page--invoice .form-invoice-layout {
        gap: 1rem;
    }

    body.app-shell .form-add-item-btn {
        min-height: var(--mobile-touch);
        border-radius: var(--mobile-radius);
        border-color: rgba(100, 141, 203, 0.4);
    }

    body.app-shell .form-sticky-bar {
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + var(--mobile-safe-bottom));
        z-index: 480;
        box-shadow: 0 -8px 28px rgba(30, 58, 95, 0.08);
    }

    body.app-shell .form-sticky-bar .saas-btn,
    body.app-shell .form-sticky-bar .btn {
        min-height: var(--mobile-touch);
        border-radius: 14px;
        flex: 1 1 auto;
        min-width: 0;
    }

    body.app-shell .form-sticky-bar__inner {
        flex-direction: column;
        align-items: stretch;
    }

    body.app-shell .form-sticky-bar__actions {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }

    body.app-shell .form-page .select2-container {
        width: 100% !important;
        max-width: 100%;
    }

    body.app-shell .pur-charge-tile,
    body.app-shell .pur-option-card {
        border-radius: var(--mobile-radius);
    }

    /* ─── Tables — scroll or card-style ─── */
    body.app-shell .table-responsive {
        margin-left: -2px;
        margin-right: -2px;
        padding-bottom: 2px;
        border-radius: var(--mobile-radius);
        box-shadow: var(--mobile-shadow);
        background: var(--mobile-surface);
        border: 1px solid var(--mobile-border);
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        max-width: 100%;
    }

    body.app-shell .table-responsive > .table {
        margin-bottom: 0;
        min-width: 520px;
    }

    body.app-shell .table-responsive > .table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #f8fafc;
        white-space: nowrap;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--mobile-muted);
        border-bottom: 1px solid var(--mobile-border);
        padding: 0.75rem;
    }

    body.app-shell .table-responsive > .table tbody td {
        padding: 0.75rem;
        vertical-align: middle;
        font-size: 0.88rem;
    }

    body.app-shell .table-modern {
        border-radius: var(--mobile-radius-lg);
        box-shadow: var(--mobile-shadow);
        border: 1px solid var(--mobile-border);
    }

    body.app-shell .table-modern tr {
        margin-bottom: 0.75rem;
        border-radius: var(--mobile-radius);
        border: 1px solid var(--mobile-border);
        padding: 0.65rem;
        background: var(--mobile-surface);
        box-shadow: 0 2px 8px rgba(30, 58, 95, 0.04);
    }

    body.app-shell .table-modern td {
        border-bottom: 1px solid #f1f5f9;
        padding: 0.55rem 0.35rem;
        text-align: right;
    }

    body.app-shell .table-modern td:last-child {
        border-bottom: none;
    }

    body.app-shell .table-modern td::before {
        color: var(--mobile-muted);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    /* ─── Modals ─── */
    body.app-shell .modal-dialog {
        margin: 0.65rem auto;
        max-width: calc(100vw - 1.3rem);
        max-height: calc(100dvh - 1.3rem - var(--mobile-safe-top) - var(--mobile-safe-bottom));
        display: flex;
        flex-direction: column;
    }

    body.app-shell .modal-dialog.modal-lg,
    body.app-shell .modal-dialog.modal-xl {
        max-width: calc(100vw - 1.3rem);
    }

    body.app-shell .modal-content {
        border: none;
        border-radius: var(--mobile-radius-lg);
        box-shadow: var(--mobile-shadow-lg);
        max-height: calc(100dvh - 1.3rem - var(--mobile-safe-top) - var(--mobile-safe-bottom));
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    body.app-shell .modal-header {
        padding: 1rem 1.1rem;
        border-bottom: 1px solid var(--mobile-border);
        flex-shrink: 0;
    }

    body.app-shell .modal-title {
        font-size: 1.05rem;
        font-weight: 700;
    }

    body.app-shell .modal-body {
        padding: 1rem 1.1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1 1 auto;
        min-height: 0;
    }

    body.app-shell .modal-footer {
        padding: 0.85rem 1.1rem;
        padding-bottom: calc(0.85rem + var(--mobile-safe-bottom));
        border-top: 1px solid var(--mobile-border);
        flex-shrink: 0;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    body.app-shell .modal-footer .btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-height: var(--mobile-touch);
        border-radius: 14px;
        margin: 0;
    }

    body.app-shell .modal-footer .btn:only-child {
        flex: 1 1 100%;
    }

    /* ─── Invoice / purchase line cards (view pages) ─── */
    body.app-shell .inv-line {
        border-radius: var(--mobile-radius);
        margin-bottom: 0.65rem;
        border: 1px solid var(--mobile-border);
        box-shadow: 0 2px 10px rgba(30, 58, 95, 0.04);
        padding: 0.85rem;
    }

    body.app-shell .inv-lines-wrap {
        border-radius: var(--mobile-radius-lg);
        overflow: hidden;
        box-shadow: var(--mobile-shadow);
        border: 1px solid var(--mobile-border);
    }

    /* ─── Reports & payments ─── */
    body.app-shell .reports-hero,
    body.app-shell .pay-hero,
    body.app-shell .eir-premium-card {
        border-radius: var(--mobile-radius-lg);
    }

    body.app-shell .reports-filter-card,
    body.app-shell .pay-card {
        border-radius: var(--mobile-radius-lg);
        box-shadow: var(--mobile-shadow);
    }

    body.app-shell .pay-alloc-card {
        border-radius: var(--mobile-radius);
    }

    /* ─── Pagination & breadcrumbs ─── */
    body.app-shell .listing-pagination .page-link,
    body.app-shell .pagination .page-link {
        min-width: var(--mobile-touch);
        min-height: 42px;
        border-radius: 12px;
        font-weight: 600;
    }

    body.app-shell .listing-pagination .page-item.active .page-link {
        background: var(--mobile-gradient);
        box-shadow: 0 4px 14px rgba(100, 141, 203, 0.28);
    }

    body.app-shell .breadcrumb-nav {
        margin-bottom: 1rem;
        font-size: 0.82rem;
    }

    /* ─── Badges & status colors ─── */
    body.app-shell .badge.bg-success,
    body.app-shell .dwarg-badge--success {
        background: rgba(16, 185, 129, 0.14) !important;
        color: #047857 !important;
    }

    body.app-shell .badge.bg-warning,
    body.app-shell .dwarg-badge--warning {
        background: rgba(245, 158, 11, 0.16) !important;
        color: #b45309 !important;
    }

    body.app-shell .badge.bg-danger,
    body.app-shell .dwarg-badge--danger {
        background: rgba(239, 68, 68, 0.14) !important;
        color: #b91c1c !important;
    }

    body.app-shell .badge.bg-primary,
    body.app-shell .badge.bg-info {
        background: var(--mobile-brand-soft) !important;
        color: var(--mobile-brand) !important;
    }

    /* ─── Topbar controls ─── */
    body.app-shell .topbar-menu-btn,
    body.app-shell .topbar-notify-btn {
        width: var(--mobile-touch);
        height: var(--mobile-touch);
        min-width: var(--mobile-touch);
        border-radius: 14px;
    }

    body.app-shell .topbar-menu-btn.is-open {
        background: var(--mobile-accent-gradient);
    }

    body.app-shell .user-avatar {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    body.app-shell .topbar-dropdown {
        border-radius: var(--mobile-radius);
        max-width: calc(100vw - 2rem);
    }

    /* ─── Prevent horizontal overflow ─── */
    body.app-shell .content-wrapper .row {
        --bs-gutter-x: 0.75rem;
        margin-left: 0;
        margin-right: 0;
    }

    body.app-shell .content-wrapper .row > * {
        min-width: 0;
    }

    body.app-shell .dash,
    body.app-shell .dash-main-grid,
    body.app-shell .dash-main-grid > *,
    body.app-shell .dash-actions-grid,
    body.app-shell .dash-dues-list {
        min-width: 0;
        max-width: 100%;
    }

    body.app-shell .input-group {
        flex-wrap: wrap;
    }

    body.app-shell .input-group > .form-control,
    body.app-shell .input-group > .form-select,
    body.app-shell .input-group > .btn {
        width: 100%;
        border-radius: 14px !important;
        margin-left: 0 !important;
    }

    body.app-shell .container-fluid {
        padding-left: 0;
        padding-right: 0;
    }

    /* ─── Subscription widget ─── */
    body.app-shell .subscription-widget {
        background: var(--mobile-gradient);
        border-radius: var(--mobile-radius-lg);
    }

    body.app-shell .subscription-widget.expired {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    }
}

@media (max-width: 992px) and (prefers-reduced-motion: reduce) {
    body.app-shell .listing-kpi,
    body.app-shell .listing-entity-card,
    body.app-shell .dash-kpi,
    body.app-shell .listing-fab,
    body.app-shell .quick-actions__toggle {
        transition: none;
    }
}
