:root {
    --bg: #eeece8;
    --surface: #f8f7f5;
    --card: #ffffff;
    --card-soft: #f3f2ef;
    --text: #171714;
    --muted: #7b7770;
    --line: #e6e1da;
    --accent: #ff5a35;
    --accent-2: #ff7b4f;
    --accent-soft: #fff0ea;
    --success: #2fb875;
    --warning: #f5bd3f;
    --danger: #e14d42;
    --radius-xl: 28px;
    --radius-lg: 22px;
    --shadow: 0 18px 50px rgba(20, 18, 16, .08);
    --shadow-soft: 0 10px 26px rgba(20, 18, 16, .06);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 15px;
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 17% 10%, rgba(255, 255, 255, .7), transparent 24%),
        radial-gradient(circle at 82% 5%, rgba(255, 255, 255, .45), transparent 28%);
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    width: min(1500px, calc(100vw - 56px));
    min-height: calc(100vh - 56px);
    margin: 28px auto;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 20px;
}

.app-sidebar {
    position: sticky;
    top: 28px;
    align-self: start;
    min-height: calc(100vh - 56px);
    padding: 18px 12px;
    border-radius: 32px;
    background: rgba(255, 255, 255, .76);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-main {
    min-width: 0;
    border-radius: 34px;
    background: rgba(248, 247, 245, .92);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.app-content {
    padding: 22px 24px 28px;
}

.brand-card {
    display: grid;
    place-items: center;
    gap: 8px;
    margin-bottom: 22px;
    text-align: center;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    letter-spacing: -.05em;
    background: linear-gradient(135deg, var(--accent), #f44722);
    box-shadow: 0 10px 26px rgba(255, 90, 53, .34);
}

.brand-name,
.brand-subtitle,
.sidebar-link span:last-child {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-link {
    width: 46px;
    height: 46px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #5e5a53;
    transition: .18s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: #191815;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .14);
}

.sidebar-link.small {
    width: 42px;
    height: 42px;
    border-radius: 16px;
}

.sidebar-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px 8px;
}

.top-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.top-tab {
    padding: 11px 18px;
    border-radius: 999px;
    color: #57524b;
    font-size: .94rem;
    transition: .16s ease;
}

.top-tab:hover,
.top-tab.active {
    color: #fff;
    background: #171714;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 8px 20px rgba(0, 0, 0, .12);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-search,
.table-search {
    min-width: 250px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.top-search input,
.table-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.round-btn,
.soft-btn {
    border: 0;
    background: #fff;
    color: #292723;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .04);
    transition: .16s ease;
}

.round-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.soft-btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
}

.round-btn:hover,
.soft-btn:hover,
.pill-btn:hover {
    transform: translateY(-1px);
}

.user-chip {
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 7px;
    border-radius: 999px;
    background: #fff;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: #201f1b;
    font-weight: 800;
}

.user-meta {
    display: grid;
    line-height: 1.1;
}

.user-meta strong {
    font-size: .9rem;
}

.user-meta span {
    color: var(--muted);
    font-size: .74rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-section {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 8px 0 22px;
}

.hero-section h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.hero-text {
    max-width: 720px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--accent);
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .78rem;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pill-btn {
    min-height: 44px;
    border-radius: 999px;
    padding-inline: 20px;
    border: 0;
}

.btn-dark {
    background: #171714;
}

.btn-light {
    color: #272420;
    background: #fff;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr 1.05fr;
    gap: 18px;
}

.lower-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.app-card {
    border: 0;
    border-radius: var(--radius-xl);
    background: var(--card);
    box-shadow: var(--shadow-soft);
    padding: 20px;
}

.card-soft-header,
.card-title-row,
.activity-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.card-label {
    display: block;
    color: var(--muted);
    font-size: .88rem;
    margin-bottom: 8px;
}

.balance-card h2 {
    margin: 0;
    font-size: 2.4rem;
    letter-spacing: -.05em;
}

.balance-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 24px 0 18px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
}

.status-chip.success {
    color: #168f57;
    background: #eaf9f1;
}

.status-chip.warning {
    color: #9a6a02;
    background: #fff4d2;
}

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

.mini-wallets > div {
    min-height: 98px;
    padding: 14px;
    border-radius: 20px;
    background: var(--card-soft);
    display: grid;
    align-content: space-between;
}

.mini-wallets span,
.mini-wallets small {
    color: var(--muted);
    font-size: .8rem;
}

.mini-wallets strong {
    font-size: 1rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    min-height: 165px;
    border-radius: var(--radius-lg);
    background: var(--card);
    padding: 18px;
    box-shadow: var(--shadow-soft);
    display: grid;
    align-content: space-between;
    position: relative;
    overflow: hidden;
}

.stat-card strong {
    display: block;
    margin-top: 2px;
    font-size: 2rem;
    letter-spacing: -.05em;
}

.stat-card small {
    color: var(--success);
}

.stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, .18);
}

.stat-icon.muted {
    background: var(--card-soft);
    color: #5f5b54;
}

.gradient-card {
    color: #fff;
    background: linear-gradient(160deg, var(--accent-2), #ff4823);
    box-shadow: 0 22px 45px rgba(255, 90, 53, .32);
}

.gradient-card .card-label,
.gradient-card small {
    color: rgba(255, 255, 255, .8);
}

.danger-text {
    color: var(--danger) !important;
}

.chart-card h3,
.limit-card h3,
.cards-preview h3,
.activity-card h3,
.note-card h3 {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: -.03em;
}

.legend {
    display: flex;
    gap: 12px;
    color: var(--muted);
    font-size: .8rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 2px;
    margin-right: 5px;
}

.legend-dot.profit {
    background: var(--accent);
}

.legend-dot.cost {
    background: #1d1c19;
}

.bar-chart {
    height: 245px;
    margin-top: 20px;
    padding: 18px 8px 0;
    border-radius: 22px;
    background: linear-gradient(180deg, #faf9f7, #f3f1ee);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    align-items: end;
    gap: 12px;
}

.bar-chart > div {
    height: 100%;
    position: relative;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 4px;
}

.bar-chart > div::before,
.bar-chart > div::after {
    content: "";
    width: 15px;
    min-height: 18px;
    border-radius: 10px 10px 4px 4px;
    display: block;
}

.bar-chart > div::before {
    height: var(--profit);
    background: repeating-linear-gradient(135deg, #ff6b40 0, #ff6b40 4px, #ff8b68 4px, #ff8b68 8px);
}

.bar-chart > div::after {
    height: var(--cost);
    background: #201f1b;
}

.bar-chart span {
    position: absolute;
    bottom: -24px;
    color: var(--muted);
    font-size: .78rem;
}

.limit-card,
.cards-preview {
    min-height: 220px;
}

.progress-soft {
    height: 14px;
    border-radius: 999px;
    margin: 34px 0 12px;
    background: repeating-linear-gradient(-45deg, #ece8e2 0, #ece8e2 6px, #f5f2ee 6px, #f5f2ee 12px);
    overflow: hidden;
}

.progress-soft span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #ff3f1d);
}

.limit-meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: .88rem;
}

.limit-meta strong {
    color: var(--text);
}

.module-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.module-card {
    min-height: 130px;
    border-radius: 24px;
    padding: 18px;
    display: grid;
    align-content: space-between;
    color: #fff;
    overflow: hidden;
    position: relative;
}

.module-card::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    right: -35px;
    top: -35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.module-card.dark {
    background: #171714;
}

.module-card.orange {
    background: linear-gradient(160deg, var(--accent-2), #ff4823);
}

.module-card span,
.module-card small {
    color: rgba(255, 255, 255, .72);
}

.module-card strong {
    font-size: 1.3rem;
    letter-spacing: -.03em;
}

.activity-card {
    grid-row: span 2;
}

.activity-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-search {
    min-width: 220px;
    height: 40px;
}

.activity-table {
    margin: 18px 0 0;
    --bs-table-bg: transparent;
    --bs-table-border-color: #efebe5;
}

.activity-table thead th {
    color: var(--muted);
    font-weight: 650;
    font-size: .82rem;
    border-bottom: 1px solid #ebe6df;
    padding-block: 13px;
}

.activity-table tbody td {
    padding-block: 15px;
    color: #302e2a;
    font-size: .9rem;
}

.row-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    margin-right: 8px;
    font-weight: 800;
}

.row-icon.blue {
    color: #0c73d9;
    background: #eaf4ff;
}

.row-icon.orange-dot {
    color: var(--accent);
    background: var(--accent-soft);
}

.row-icon.purple {
    color: #7b49d6;
    background: #f2eaff;
}

.row-icon.yellow {
    color: #a47000;
    background: #fff4d2;
}

.dot-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4a4741;
}

.dot-text::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: block;
}

.dot-text.completed::before {
    background: var(--success);
}

.dot-text.pending::before {
    background: var(--danger);
}

.dot-text.progressing::before {
    background: var(--warning);
}

.form-check-input:checked {
    background-color: #171714;
    border-color: #171714;
}

.app-toast,
.app-modal {
    border: 0;
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.toast-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

.simple-page {
    align-items: flex-start;
}

.note-card ol {
    margin-bottom: 0;
    color: #55504a;
}

.note-card code {
    color: #c23c1f;
    background: var(--accent-soft);
    border-radius: 8px;
    padding: 2px 6px;
}

@media (max-width: 1180px) {
    .dashboard-grid,
    .lower-grid {
        grid-template-columns: 1fr;
    }

    .activity-card {
        grid-row: auto;
    }
}

@media (max-width: 940px) {
    .app-shell {
        width: min(100vw - 24px, 760px);
        grid-template-columns: 1fr;
        margin: 12px auto;
    }

    .app-sidebar {
        position: static;
        min-height: auto;
        flex-direction: row;
        justify-content: space-between;
        overflow-x: auto;
        border-radius: 24px;
    }

    .brand-card,
    .sidebar-nav,
    .sidebar-footer {
        display: flex;
        flex-direction: row;
        margin: 0;
    }

    .app-topbar,
    .hero-section {
        flex-direction: column;
        align-items: stretch;
    }

    .top-actions {
        flex-wrap: wrap;
    }

    .top-search {
        flex: 1 1 100%;
    }

    .app-content {
        padding: 18px;
    }
}

@media (max-width: 650px) {
    .stat-grid,
    .mini-wallets,
    .module-cards,
    .balance-actions {
        grid-template-columns: 1fr;
    }

    .hero-section h1 {
        font-size: 2.1rem;
    }

    .user-meta,
    .top-tabs {
        display: none;
    }
}

/* Hover flyout menu - trực quan hơn cho màn hình rộng */
.app-sidebar {
    z-index: 30;
}

.menu-group {
    position: relative;
    width: 100%;
    display: grid;
    place-items: center;
}

.sidebar-flyout {
    position: absolute;
    top: -4px;
    left: calc(100% + 14px);
    width: 292px;
    padding: 14px;
    border: 1px solid rgba(230, 225, 218, .88);
    border-radius: 26px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 22px 60px rgba(20, 18, 16, .16);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-8px) scale(.98);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    z-index: 80;
}

.sidebar-flyout::before {
    content: "";
    position: absolute;
    top: 22px;
    left: -8px;
    width: 16px;
    height: 16px;
    border-left: 1px solid rgba(230, 225, 218, .88);
    border-bottom: 1px solid rgba(230, 225, 218, .88);
    border-radius: 0 0 0 5px;
    background: rgba(255, 255, 255, .94);
    transform: rotate(45deg);
}

.sidebar-flyout.mega {
    width: min(760px, calc(100vw - 170px));
}

.sidebar-flyout.compact {
    width: 260px;
}

.flyout-up {
    top: auto;
    bottom: -4px;
}

.flyout-up::before {
    top: auto;
    bottom: 22px;
}

.menu-group:hover > .sidebar-flyout,
.menu-group:focus-within > .sidebar-flyout,
.menu-group.is-open > .sidebar-flyout {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.menu-group:hover > .sidebar-link,
.menu-group:focus-within > .sidebar-link,
.menu-group.is-open > .sidebar-link {
    color: #fff;
    background: #191815;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .14);
}

.flyout-head {
    padding: 6px 8px 12px;
    display: grid;
    gap: 3px;
}

.flyout-head span {
    color: var(--accent);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.flyout-head strong {
    font-size: 1.08rem;
    letter-spacing: -.025em;
}

.flyout-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.flyout-item,
.flyout-row {
    border-radius: 18px;
    background: #f7f5f2;
    color: #302d28;
    transition: .15s ease;
}

.flyout-item {
    min-height: 82px;
    padding: 12px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.flyout-row {
    min-height: 42px;
    margin-top: 8px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
}

.flyout-row::after {
    content: "›";
    color: #a49e96;
    font-size: 1.2rem;
    line-height: 1;
}

.flyout-item:hover,
.flyout-row:hover {
    color: #fff;
    background: #171714;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .12);
}

.flyout-badge {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #f44722);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: -.03em;
}

.flyout-item strong {
    display: block;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .94rem;
}

.flyout-item small {
    display: -webkit-box;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flyout-item:hover small {
    color: rgba(255, 255, 255, .68);
}

@media (max-width: 940px) {
    .menu-group {
        width: auto;
    }

    .sidebar-flyout,
    .sidebar-flyout.compact,
    .sidebar-flyout.mega {
        position: fixed;
        top: 90px;
        left: 16px;
        right: 16px;
        bottom: auto;
        width: auto;
        max-height: calc(100vh - 116px);
        overflow: auto;
        transform: translateY(-6px) scale(.98);
    }

    .sidebar-flyout::before {
        display: none;
    }

    .menu-group:hover > .sidebar-flyout,
    .menu-group:focus-within > .sidebar-flyout,
    .menu-group.is-open > .sidebar-flyout {
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 650px) {
    .flyout-grid {
        grid-template-columns: 1fr;
    }

    .flyout-item {
        min-height: 72px;
    }
}

/* Topic 01-03: danh mục nền */
.page-head-section {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 8px 0 18px;
}

.page-head-section h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.catalog-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px;
}

.catalog-tabs.compact-tabs {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

.catalog-tab {
    min-height: 86px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: center;
    background: var(--card-soft);
    transition: .16s ease;
}

.catalog-tabs.compact-tabs .catalog-tab {
    min-height: 60px;
}

.catalog-tab:hover,
.catalog-tab.active {
    color: #fff;
    background: #171714;
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.catalog-tab span {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #ff4422);
}

.catalog-tab strong,
.catalog-tab small {
    display: block;
}

.catalog-tab small {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.25;
}

.catalog-tab:hover small,
.catalog-tab.active small {
    color: rgba(255, 255, 255, .72);
}

.data-card,
.form-card {
    margin-bottom: 22px;
}

.data-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.table-search.wide {
    min-width: min(560px, 100%);
}

.toolbar-meta {
    display: flex;
    gap: 12px;
    color: var(--muted);
    font-size: .88rem;
}

.toolbar-meta a {
    color: var(--accent);
    font-weight: 700;
}

.data-table th {
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 750;
}

.status-pill.on {
    color: #168f57;
    background: #eaf9f1;
}

.status-pill.off {
    color: #8e5d00;
    background: #fff2d1;
}

.soft-btn.mini {
    height: 34px;
    padding-inline: 12px;
    font-size: .84rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
}

.soft-btn.disabled {
    pointer-events: none;
    opacity: .45;
}

.action-cell {
    white-space: nowrap;
}

.empty-state {
    min-height: 150px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    color: var(--muted);
}

.empty-state strong {
    color: var(--text);
    font-size: 1.1rem;
}

.pager-row,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.form-card {
    padding: 22px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field,
.check-card {
    display: grid;
    gap: 7px;
}

.field label,
.check-card span {
    color: #4a4640;
    font-size: .88rem;
    font-weight: 750;
}

.field .form-control,
.field .form-select {
    min-height: 44px;
    border-radius: 15px;
    border-color: var(--line);
    background-color: #fff;
}

.field textarea.form-control {
    min-height: 104px;
}

.span-2 {
    grid-column: span 2;
}

.span-all {
    grid-column: 1 / -1;
}

.check-card {
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--card-soft);
    grid-template-columns: 18px 1fr;
    align-items: center;
    cursor: pointer;
}

.check-card input {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
}

.text-danger {
    font-size: .82rem;
}

@media (max-width: 1180px) {
    .catalog-tabs,
    .catalog-tabs.compact-tabs,
    .field-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page-head-section,
    .data-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .catalog-tabs,
    .catalog-tabs.compact-tabs,
    .field-grid,
    .field-grid.three {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }
}

/* Topic 04-08: forms, autocomplete, stock tables */
.autocomplete-field { position: relative; }
.autocomplete-menu {
    position: absolute;
    z-index: 1070;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    display: none;
    max-height: 320px;
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(20, 20, 20, .08);
    border-radius: 16px;
    padding: 8px;
}
.autocomplete-menu.show { display: block; }
.autocomplete-item {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 12px;
    padding: 10px 12px;
    text-align: left;
    color: #202020;
}
.autocomplete-item:hover { background: #f6f1ec; }
.autocomplete-item strong { display: block; font-size: 14px; }
.autocomplete-item small { display: block; color: #7b756e; margin-top: 2px; }
.hint { display: block; margin-top: 4px; color: #8a827a; font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; background: #eee; color: #444; }
.status-draft { background: #fff3cd; color: #8a5a00; }
.status-posted { background: #d8f3dc; color: #1b6b35; }
.status-cancelled { background: #f8d7da; color: #842029; }
.badge-soft { display: inline-flex; border-radius: 999px; background: #f6f1ec; color: #624631; padding: 4px 9px; font-size: 12px; font-weight: 700; }
.card-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid rgba(20,20,20,.06); }
.card-toolbar small { color: #8a827a; margin-left: 8px; }
.section-title { font-size: 18px; margin-bottom: 16px; }
.line-editor .form-label { font-size: 12px; font-weight: 700; color: #70675f; }
.app-table td, .app-table th { padding: 14px 16px; }
.toast-error .toast-dot { background: #dc3545 !important; }
.toast-error .toast-body { color: #842029; }

/* Topic 08.5: Import phiếu nhập thực tế */
.import-note-card {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #5c5046;
}
.import-note-card strong {
    color: #241f1b;
}
.import-raw-text {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
}
.import-lines-wrap {
    max-height: 620px;
}
.import-lines-table th,
.import-lines-table td {
    min-width: 120px;
    vertical-align: top;
}
.import-lines-table .line-no-cell {
    min-width: 64px;
    width: 64px;
}
.import-lines-table .import-product-cell {
    min-width: 340px;
}
.import-lines-table input.form-control-sm {
    min-height: 32px;
    border-radius: 10px;
    font-size: 12px;
}
.tiny-check {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #72675d;
    font-size: 12px;
    white-space: nowrap;
}
.tiny-check input {
    accent-color: var(--accent);
}
@media (max-width: 980px) {
    .import-note-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

.import-file-preview {
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: 18px;
    background: #f8fafc;
    overflow: hidden;
}

.import-file-preview.image-preview {
    max-height: 420px;
    overflow: auto;
}

.import-file-preview.image-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.import-file-preview.pdf-preview iframe {
    display: block;
    width: 100%;
    height: 420px;
    border: 0;
}

/* Topic 08.6-13 completion */
.action-stack {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 180px;
}
.action-stack form { display: inline-flex; }
.table-warning-soft { background: #fff8e6 !important; }
.map-warning { display: inline-block; color: #a36200; font-weight: 700; margin-top: 3px; }
.badge-ok { background: #dff5e6; color: #1f7a3a; }
.badge-warn { background: #fff3cd; color: #8a5a00; }
.report-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.metric-card {
    background: #fff;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 14px 40px rgba(20,20,20,.06);
    border: 1px solid rgba(20,20,20,.05);
}
.metric-card span { display:block; color:#786f66; font-size:13px; font-weight:700; }
.metric-card strong { display:block; margin-top:8px; font-size:26px; color:#201b18; }
.metric-card small { color:#8a827a; }
.metric-card.warning { background:#fff7ed; border-color:#fed7aa; }
.info-tile {
    border: 1px solid rgba(20,20,20,.07);
    border-radius: 18px;
    padding: 16px;
    background: #faf7f2;
    min-height: 130px;
}
.info-tile strong { display:block; margin-bottom:8px; }
.info-tile span { color:#70675f; }
@media (max-width: 1100px) {
    .report-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .report-dashboard-grid { grid-template-columns: 1fr; }
}

/* Topic 08.6 - 13 helpers */
.table-warning-soft,
.app-table .table-warning-soft > td {
    background: rgba(255, 193, 7, .12) !important;
}
.badge-soft.success {
    background: rgba(25, 135, 84, .12);
    color: #146c43;
}
.badge-soft.warn {
    background: rgba(255, 193, 7, .18);
    color: #8a5a00;
}
.map-helper-row > td {
    background: rgba(248, 249, 250, .8);
    border-top: 0;
}
.map-helper-grid {
    display: grid;
    gap: .75rem;
}
.map-box {
    border: 1px solid rgba(16, 24, 40, .08);
    background: #fff;
    border-radius: 16px;
    padding: .75rem;
}
.summary-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .75rem;
}
.summary-strip > div {
    background: #fff;
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .06);
}
.summary-strip span {
    display: block;
    color: #777;
    font-size: .8rem;
}
.summary-strip strong {
    font-size: 1.15rem;
}
.file-list .list-group-item {
    border-color: rgba(16, 24, 40, .08);
}
@media (max-width: 991.98px) {
    .summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Topic 08.6-13: mapping, VAT, return, reports */
.table-warning-soft > td {
    background: #fff8e6 !important;
}
.badge-soft.badge-warning {
    color: #8a5a00;
    background: #fff0c2;
}
.metric-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.metric-strip > div {
    padding: 14px;
    border-radius: 18px;
    background: var(--card-soft);
}
.metric-strip span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}
.metric-strip strong {
    display: block;
    margin-top: 4px;
    font-size: 1.2rem;
    letter-spacing: -.03em;
}
.alert-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}
.alert-row {
    padding: 14px;
    border-radius: 18px;
    background: #f7f4ef;
    display: grid;
    gap: 4px;
}
.alert-row:hover {
    color: #fff;
    background: #171714;
}
.alert-row span {
    color: var(--muted);
    font-size: .86rem;
}
.alert-row:hover span {
    color: rgba(255,255,255,.72);
}
.action-cell form {
    margin: 0;
}
@media (max-width: 980px) {
    .metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .metric-strip {
        grid-template-columns: 1fr;
    }
}

/* Auth + quick-add UX */
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top left, #fff5e8, #f6f5f0 48%, #eceae3);
}
.auth-shell { width: min(460px, calc(100% - 32px)); }
.auth-card {
    background: #fff;
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 24px 80px rgba(16, 24, 40, .12);
}
.auth-brand { margin-bottom: 24px; }
.narrow-form { max-width: 920px; }
.quick-add-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: #dd5c1d;
    font-weight: 700;
    font-size: .82rem;
    padding: 0;
    text-decoration: none;
}
.quick-add-link:hover { color: #111; text-decoration: underline; }
.input-with-add {
    display: flex;
    gap: 8px;
    align-items: center;
}
.input-with-add .autocomplete-field,
.input-with-add input.form-control { flex: 1 1 auto; }
.autocomplete-empty {
    padding: 10px 12px;
    display: grid;
    gap: 2px;
    color: #6b6258;
    background: #fff8ef;
    border-radius: 12px;
    margin: 6px;
}
.autocomplete-empty strong { color: #1f1f1b; font-size: .86rem; }
.autocomplete-empty small { font-size: .78rem; }
.role-muted { filter: grayscale(.3); opacity: .76; }
.sensitive-hidden {
    border-radius: 999px;
    background: #f2f0eb;
    color: #7c7469;
    font-size: .78rem;
    padding: 4px 8px;
}
.form-help-line {
    display: block;
    margin-top: 4px;
    color: #7c7469;
    font-size: .78rem;
}
.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 992px) {
    .report-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .report-filter-grid { grid-template-columns: 1fr; }
}

/* Auth + quick-add UX */
.auth-body {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #fff5ed, #f4f4f2 45%, #ece8e2);
}
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.auth-card {
    width: min(460px, 100%);
    background: #fff;
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 24px 70px rgba(43, 37, 32, .12);
}
.auth-brand { margin-bottom: 24px; }
.input-with-add { position: relative; }
.input-with-add .quick-add-link {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 12px;
    font-weight: 700;
    color: #b35a1e;
    text-decoration: none;
}
.quick-add-hint, .hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #8a8178;
}
.autocomplete-empty {
    padding: 10px 12px;
    color: #7b756e;
}
.autocomplete-empty strong { display: block; font-size: 13px; color: #3d3731; }
.autocomplete-empty small { display: block; font-size: 12px; margin-top: 2px; }
.quick-add-modal .modal-content,
.quick-add-modal { border-radius: 22px; }
.table-warning-soft { background: #fff8e8; }
.badge-soft {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f1eee9;
    color: #514941;
    font-size: 12px;
    font-weight: 700;
}
.badge-soft.success { background: #e9f7ee; color: #227344; }
.badge-soft.warn { background: #fff0cf; color: #8a5700; }
.badge-soft.danger { background: #ffe2dc; color: #a2341e; }

/* Auth + quick-add UX */
.auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(255, 139, 82, .18), transparent 34%), #f5f2ee;
}
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}
.auth-card {
    width: min(480px, 100%);
    background: #fff;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 24px 70px rgba(18, 18, 18, .08);
}
.auth-card h1 { margin: 18px 0 8px; font-weight: 800; }
.auth-brand { box-shadow: none; padding: 0; background: transparent; }
.quick-add-link {
    border: 0;
    background: transparent;
    color: #c75a22;
    font-size: .82rem;
    font-weight: 700;
    padding: 0;
    margin-left: 8px;
    text-decoration: none;
}
.quick-add-link:hover { color: #111; text-decoration: underline; }
.input-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.autocomplete-empty {
    padding: 10px 12px;
    font-size: .84rem;
    color: #777;
    background: #fff8f4;
}
.quick-add-modal .modal-content { border-radius: 24px; }
.permission-muted { filter: grayscale(1); opacity: .55; pointer-events: none; }
.sensitive-hidden { color: #999; font-style: italic; }
.menu-section-title {
    margin: 18px 12px 6px;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.56);
}
.line-mini-actions{display:flex;justify-content:flex-end;margin-bottom:2px;font-size:.72rem}.line-mini-actions .quick-add-link{font-weight:700;color:#d35b24;text-decoration:none}.line-mini-actions .quick-add-link:hover{text-decoration:underline}.label-row.compact{justify-content:flex-end;margin-bottom:2px;font-size:.72rem}
.sidebar-note{margin:12px 10px;padding:12px;border-radius:16px;background:rgba(255,255,255,.72);color:#7a736d;font-size:.86rem;line-height:1.35}
.mini-add-link{display:inline-block;margin-top:4px;font-size:.78rem;font-weight:700;color:#d35b24;text-decoration:none}.mini-add-link:hover{text-decoration:underline;color:#111}

/* ============================================================
   Sidebar tree menu - thay flyout hover bang menu cay ro rang
   ============================================================ */
.app-shell {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
}

.app-sidebar {
    align-items: stretch;
    padding: 18px 14px;
    overflow-y: auto;
    overflow-x: hidden;
}

.brand-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    text-align: left;
    gap: 10px;
    margin: 0 4px 18px;
}

.brand-name,
.brand-subtitle,
.sidebar-link span:last-child {
    display: block;
}

.brand-name {
    font-weight: 900;
    letter-spacing: -.02em;
}

.brand-subtitle {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.2;
}

.sidebar-tree {
    align-items: stretch;
    gap: 8px;
}

.tree-group,
.tree-subgroup {
    width: 100%;
}

.tree-group {
    border-radius: 20px;
    background: rgba(255,255,255,.50);
    border: 1px solid rgba(230,225,218,.72);
    overflow: hidden;
}

.tree-subgroup {
    margin-top: 4px;
    border-radius: 16px;
    background: rgba(246,244,240,.75);
}

.tree-summary,
.tree-link {
    min-height: 42px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border-radius: 16px;
    color: #4c4740;
    font-weight: 760;
    cursor: pointer;
    transition: .16s ease;
}

.tree-summary {
    padding: 10px 12px;
    list-style: none;
}

.tree-summary::-webkit-details-marker {
    display: none;
}

.tree-summary::after {
    content: "⌄";
    color: #a29a90;
    font-size: 1rem;
    transform: rotate(-90deg);
    transition: transform .16s ease;
}

.tree-group[open] > .tree-summary::after,
.tree-subgroup[open] > .tree-summary::after {
    transform: rotate(0deg);
}

.tree-summary:hover,
.tree-link:hover,
.tree-link.active {
    color: #fff;
    background: #171714;
    box-shadow: 0 10px 22px rgba(0,0,0,.10);
}

.tree-link {
    padding: 9px 12px;
    text-decoration: none;
}

.tree-link.child {
    min-height: 38px;
    grid-template-columns: 28px minmax(0, 1fr);
    font-size: .9rem;
    font-weight: 700;
    color: #5e584f;
}

.tree-link.child.active,
.tree-link.child:hover {
    color: #fff;
}

.tree-children {
    display: grid;
    gap: 4px;
    padding: 0 8px 9px;
}

.tree-children.inner {
    padding-left: 10px;
}

.tree-ico {
    width: 28px;
    height: 28px;
    border-radius: 11px;
    display: inline-grid;
    place-items: center;
    background: #f2eee8;
    font-size: .94rem;
    line-height: 1;
}

.tree-summary:hover .tree-ico,
.tree-link:hover .tree-ico,
.tree-link.active .tree-ico {
    background: rgba(255,255,255,.16);
}

.small-summary {
    min-height: 38px;
    padding: 8px 10px;
    font-size: .9rem;
}

/* Tat han popup hover cu */
.sidebar-flyout,
.sidebar-flyout.compact,
.sidebar-flyout.mega {
    display: none !important;
}

.menu-has-flyout .sidebar-link,
.menu-trigger {
    pointer-events: auto;
}

/* ============================================================
   Form nhap lieu - nhom truong ro rang, tieng Viet co dau
   ============================================================ */
.business-form {
    padding: 22px;
}

.form-section {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid rgba(230,225,218,.78);
    border-radius: 24px;
    background: rgba(255,255,255,.72);
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.form-section-title h2,
.form-section-title h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 850;
    letter-spacing: -.02em;
}

.form-section-title small {
    color: var(--muted);
    font-size: .8rem;
}

.form-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: .72rem;
}

.line-editor .form-section {
    background: rgba(248,247,245,.78);
}

.form-control::placeholder,
.form-select::placeholder {
    color: #a29b92;
}

@media (max-width: 1100px) {
    .app-shell {
        width: min(100% - 24px, 1500px);
        grid-template-columns: 1fr;
        margin: 12px auto;
    }
    .app-sidebar {
        position: relative;
        top: 0;
        min-height: auto;
        max-height: none;
    }
    .sidebar-tree {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    }
}

/* ============================================================
   Patch v6.1 - Sidebar thu gon mac dinh, hover moi mo menu cay
   ============================================================ */
@media (min-width: 1101px) {
    .app-shell {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 20px;
    }

    .app-sidebar {
        width: 92px;
        min-width: 92px;
        max-width: 92px;
        transition: width .18s ease, max-width .18s ease, box-shadow .18s ease;
        z-index: 50;
        overflow-x: hidden;
    }

    .app-sidebar:hover,
    .app-sidebar:focus-within {
        width: 300px;
        max-width: 300px;
        box-shadow: 16px 0 38px rgba(0,0,0,.08);
    }

    .brand-card {
        grid-template-columns: 46px 190px;
        width: 252px;
    }

    .brand-name,
    .brand-subtitle,
    .tree-summary span:not(.tree-ico),
    .tree-link span:not(.tree-ico),
    .tree-summary::after,
    .sidebar-note {
        opacity: 0;
        visibility: hidden;
        transition: opacity .12s ease;
        white-space: nowrap;
    }

    .app-sidebar:hover .brand-name,
    .app-sidebar:hover .brand-subtitle,
    .app-sidebar:hover .tree-summary span:not(.tree-ico),
    .app-sidebar:hover .tree-link span:not(.tree-ico),
    .app-sidebar:hover .tree-summary::after,
    .app-sidebar:hover .sidebar-note,
    .app-sidebar:focus-within .brand-name,
    .app-sidebar:focus-within .brand-subtitle,
    .app-sidebar:focus-within .tree-summary span:not(.tree-ico),
    .app-sidebar:focus-within .tree-link span:not(.tree-ico),
    .app-sidebar:focus-within .tree-summary::after,
    .app-sidebar:focus-within .sidebar-note {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-tree {
        width: 266px;
    }

    .tree-summary,
    .tree-link {
        width: 266px;
    }

    .tree-group,
    .tree-subgroup {
        background: transparent;
        border-color: transparent;
    }

    .tree-children {
        display: none;
    }

    .app-sidebar:hover .tree-group[open] > .tree-children,
    .app-sidebar:hover .tree-subgroup[open] > .tree-children,
    .app-sidebar:focus-within .tree-group[open] > .tree-children,
    .app-sidebar:focus-within .tree-subgroup[open] > .tree-children {
        display: grid;
    }

    .tree-summary,
    .tree-link {
        grid-template-columns: 30px minmax(0, 1fr) auto;
    }

    .tree-link.child {
        grid-template-columns: 28px minmax(0, 1fr);
    }
}

/* ============================================================
   Patch v6.2 - Menu tinh te hon + badge thong bao Import
   ============================================================ */
.tree-summary,
.tree-link {
    position: relative;
}

.tree-summary::after {
    content: "";
    width: 7px;
    height: 7px;
    border: solid #aaa197;
    border-width: 0 1.8px 1.8px 0;
    transform: rotate(-45deg);
    transition: transform .16s ease, border-color .16s ease;
    margin-right: 4px;
}

.tree-group[open] > .tree-summary::after,
.tree-subgroup[open] > .tree-summary::after {
    transform: rotate(45deg);
}

.tree-summary:hover,
.tree-link:hover {
    color: #171714;
    background: rgba(23, 23, 20, .055);
    box-shadow: none;
}

.tree-link.active,
.tree-link.child.active {
    color: #171714;
    background: rgba(255, 90, 53, .12);
    box-shadow: inset 3px 0 0 rgba(255, 90, 53, .72);
}

.tree-summary:hover .tree-ico,
.tree-link:hover .tree-ico,
.tree-link.active .tree-ico {
    background: rgba(255,255,255,.72);
}

.tree-link.active .tree-ico,
.tree-link.child.active .tree-ico {
    background: rgba(255, 90, 53, .16);
}

.menu-badge {
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: #ff5a35;
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(255,90,53,.24);
}

.child-badge {
    justify-self: end;
}

.notification-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    text-decoration: none;
}

.notification-btn em {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff5a35;
    color: #fff;
    border: 2px solid #fff;
    font-size: .68rem;
    font-style: normal;
    font-weight: 900;
    display: inline-grid;
    place-items: center;
}

.import-alert {
    color: #171714;
    background: #fff7f3;
}

@media (min-width: 1101px) {
    .tree-summary .menu-badge,
    .tree-link .menu-badge {
        opacity: 1 !important;
        visibility: visible !important;
        white-space: nowrap;
    }

    .app-sidebar:not(:hover):not(:focus-within) .menu-badge {
        position: absolute;
        left: 38px;
        top: 4px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        font-size: .62rem;
    }

    .app-sidebar:hover .menu-badge,
    .app-sidebar:focus-within .menu-badge {
        position: static;
    }
}
.tree-link.child {
    grid-template-columns: 28px minmax(0, 1fr) auto;
}
.import-flow-help span {
    display: inline-block;
    margin-left: 10px;
}

/* PM Sale v6.5 - streamlined stock document flow */
.completion-card {
    border-left: 4px solid rgba(24, 24, 21, .16);
}
.completion-card.success,
.badge-soft.success {
    background: rgba(24, 166, 101, .10);
    color: #0b7a45;
}
.completion-card.ready,
.badge-soft.ready {
    background: rgba(24, 166, 101, .08);
    color: #0b7a45;
}
.completion-card.warn,
.badge-soft.warn {
    background: rgba(255, 193, 7, .14);
    color: #8a5a00;
}
.completion-card.danger,
.badge-soft.danger {
    background: rgba(220, 53, 69, .09);
    color: #b42335;
}
.completion-card.muted,
.badge-soft.muted {
    background: rgba(108, 117, 125, .10);
    color: #5f6469;
}
.soft-alert {
    border-radius: 18px;
    border: 0;
}
.form-actions.sticky-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 14px;
}
.import-line-prefill {
    border: 1px solid rgba(255, 90, 53, .18);
    background: rgba(255, 90, 53, .035);
}
.line-edit-row > td {
    background: rgba(23, 23, 20, .035) !important;
    border-top: 0 !important;
}
.line-inline-editor {
    background: #fff;
    border: 1px solid rgba(23, 23, 20, .08);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(23, 23, 20, .04);
}
.field-validation-error,
.input-validation-error + .text-danger,
.text-danger.small {
    font-size: .78rem;
    margin-top: 4px;
    display: block;
}
.input-validation-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 .18rem rgba(220, 53, 69, .12) !important;
}

/* PM Sale v6.8 - sidebar con nhẹ hơn + danh sách phiếu đang xử lý rõ hơn */
.tree-link.child,
.tree-subgroup > .small-summary {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding-left: 44px !important;
    font-weight: 500 !important;
    color: #625c53 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 14px;
}
.tree-children.inner .tree-link.child {
    padding-left: 58px !important;
}
.tree-link.child .tree-ico,
.tree-subgroup > .small-summary .tree-ico {
    display: none !important;
}
.tree-link.child:hover,
.tree-link.child.active {
    color: #171714 !important;
    background: rgba(23,23,20,.065) !important;
    box-shadow: none !important;
}
.tree-link.child .menu-badge {
    margin-left: auto;
}
.tree-subgroup {
    background: rgba(23,23,20,.025);
}
.tree-summary::after {
    content: "›";
    font-size: .95rem;
    color: #b2aaa0;
}
.tree-group[open] > .tree-summary::after,
.tree-subgroup[open] > .tree-summary::after {
    transform: rotate(90deg);
}

.stock-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.stock-tab {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid rgba(23,23,20,.16);
    border-radius: 999px;
    color: #4d4741;
    text-decoration: none;
    background: rgba(255,255,255,.66);
    font-weight: 650;
}
.stock-tab:hover,
.stock-tab.active {
    color: #171714;
    background: rgba(23,23,20,.08);
    border-color: rgba(23,23,20,.22);
}
.stock-doc-table th {
    white-space: nowrap;
}
.stock-doc-table .stock-doc-main strong {
    letter-spacing: -.01em;
}
.stock-doc-table tr.row-processing {
    background: rgba(255, 246, 224, .20);
}
.stock-doc-table tr.row-processing:hover {
    background: rgba(255, 246, 224, .35);
}
@media (max-width: 900px) {
    .stock-doc-table {
        min-width: 980px;
    }
}

/* Danh mục nền - tab + table layout */
.catalog-head-section {
    align-items: center;
    margin-bottom: 16px;
}

.catalog-workspace {
    padding: 18px;
}

.catalog-tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px;
    margin-bottom: 18px;
    border: 1px solid rgba(22, 22, 18, .07);
    border-radius: 24px;
    background: rgba(245, 243, 239, .9);
}

.catalog-tab-item {
    min-height: 58px;
    flex: 1 1 180px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
    color: var(--text);
    background: transparent;
    text-decoration: none;
    transition: .16s ease;
}

.catalog-tab-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .78);
    transform: translateY(-1px);
}

.catalog-tab-item.active {
    color: #fff;
    background: #171714;
    box-shadow: var(--shadow-soft);
}

.catalog-tab-badge {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    font-size: .72rem;
    font-weight: 850;
    background: linear-gradient(135deg, var(--accent), #ff4422);
}

.catalog-tab-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.catalog-tab-copy strong {
    font-size: .95rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-tab-copy small {
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-tab-item.active .catalog-tab-copy small {
    color: rgba(255, 255, 255, .72);
}

.catalog-panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 4px 14px;
    border-bottom: 1px solid rgba(22, 22, 18, .08);
}

.catalog-panel-head h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2.3vw, 2rem);
    letter-spacing: -.035em;
}

.catalog-panel-head p:not(.eyebrow) {
    max-width: 780px;
    margin: 6px 0 0;
    color: var(--muted);
}

.catalog-data-toolbar {
    margin-top: 16px;
}

.catalog-data-table {
    margin-bottom: 0;
}

@media (max-width: 1180px) {
    .catalog-tabbar {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .catalog-tab-item {
        flex: 0 0 210px;
    }
}

@media (max-width: 760px) {
    .catalog-workspace {
        padding: 12px;
    }

    .catalog-panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .catalog-panel-head .pill-btn,
    .catalog-head-section .pill-btn {
        width: 100%;
    }
}

/* PM Sale v6.11 - Xoa mui ten o cuoi cac muc menu sidebar */
.tree-summary::after,
.tree-group[open] > .tree-summary::after,
.tree-subgroup[open] > .tree-summary::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    transform: none !important;
}

.tree-summary::-webkit-details-marker {
    display: none !important;
}

.tree-summary::marker {
    content: "" !important;
}

/* PM Sale v6.28 - trạng thái đơn hàng nhẹ nhàng */
.badge-soft.status-moi { background: #f3f4f6; color: #374151; }
.badge-soft.status-da_yeu_cau_xuat { background: #fff7dd; color: #8a5a00; }
.badge-soft.status-da_xuat_kho { background: #e8f1ff; color: #2454a6; }
.badge-soft.status-hoan_thanh { background: #e9f7ee; color: #227344; }
.badge-soft.status-huy { background: #ffe6e0; color: #a2341e; }

/* ============================================================
   PM Sale v6.37 - Mobile app mode
   Chi thay doi giao dien tren man hinh nho, khong doi nghiep vu.
   Desktop giu nguyen layout sidebar + table hien tai.
   ============================================================ */
.mobile-app-header,
.mobile-app-drawer,
.mobile-drawer-backdrop,
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 760px) {
    :root {
        --mobile-bottom-nav-height: 74px;
        --mobile-sticky-action-height: 72px;
    }

    html {
        font-size: 14px;
    }

    body {
        background: #f3f0eb;
        padding-top: calc(64px + env(safe-area-inset-top));
        padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom) + 18px);
    }

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

    body::before {
        display: none;
    }

    .mobile-app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1040;
        min-height: calc(64px + env(safe-area-inset-top));
        padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 10px;
        background: rgba(255, 255, 255, .94);
        border-bottom: 1px solid rgba(23, 23, 20, .08);
        box-shadow: 0 12px 30px rgba(23, 23, 20, .08);
        backdrop-filter: blur(16px);
    }

    .mobile-icon-btn {
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 16px;
        display: inline-grid;
        place-items: center;
        color: #181612;
        background: #f3f0eb;
        font-size: 1.28rem;
        font-weight: 850;
        line-height: 1;
    }

    .mobile-icon-btn:active,
    .mobile-nav-item:active,
    .mobile-drawer-link:active {
        transform: scale(.98);
    }

    .mobile-app-title {
        min-width: 0;
        display: grid;
        justify-items: center;
        text-align: center;
        line-height: 1.15;
    }

    .mobile-app-title strong {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 1rem;
        font-weight: 900;
        letter-spacing: -.02em;
    }

    .mobile-app-title span {
        max-width: 100%;
        margin-top: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #80786f;
        font-size: .72rem;
    }

    .mobile-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1050;
        display: block;
        background: rgba(17, 17, 15, .36);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .18s ease, visibility .18s ease;
    }

    .mobile-app-drawer {
        position: fixed;
        z-index: 1060;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(92vw, 390px);
        display: flex;
        flex-direction: column;
        padding: calc(14px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
        background: #fff;
        box-shadow: -22px 0 60px rgba(0, 0, 0, .18);
        transform: translateX(104%);
        transition: transform .22s ease;
    }

    body.mobile-drawer-open .mobile-drawer-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.mobile-drawer-open .mobile-app-drawer {
        transform: translateX(0);
    }

    .mobile-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(23, 23, 20, .08);
    }

    .mobile-brand-card {
        margin: 0;
        min-width: 0;
    }

    .mobile-drawer-menu {
        margin-top: 14px;
        padding-right: 2px;
        display: grid;
        gap: 10px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-drawer-link {
        min-height: 62px;
        padding: 12px;
        border-radius: 20px;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        color: #221f1b;
        background: #f6f3ee;
        text-decoration: none;
    }

    .mobile-drawer-link > span {
        width: 42px;
        height: 42px;
        border-radius: 15px;
        display: inline-grid;
        place-items: center;
        background: #fff;
        box-shadow: 0 8px 18px rgba(23, 23, 20, .05);
    }

    .mobile-drawer-link strong,
    .mobile-drawer-link small {
        display: block;
        min-width: 0;
    }

    .mobile-drawer-link strong {
        font-size: .96rem;
        font-weight: 850;
    }

    .mobile-drawer-link small {
        margin-top: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #756d64;
        font-size: .76rem;
    }

    .mobile-drawer-link.active {
        color: #fff;
        background: #171714;
    }

    .mobile-drawer-link.active small {
        color: rgba(255, 255, 255, .68);
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 1035;
        min-height: var(--mobile-bottom-nav-height);
        padding: 8px;
        border: 1px solid rgba(23, 23, 20, .08);
        border-radius: 28px;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 18px 45px rgba(23, 23, 20, .16);
        backdrop-filter: blur(16px);
    }

    .mobile-nav-item {
        min-width: 0;
        min-height: 56px;
        border: 0;
        border-radius: 20px;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 3px;
        color: #686057;
        background: transparent;
        text-decoration: none;
        font-weight: 800;
    }

    .mobile-nav-item span {
        font-size: 1.12rem;
        line-height: 1;
    }

    .mobile-nav-item small {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .68rem;
        line-height: 1;
    }

    .mobile-nav-item.active {
        color: #fff;
        background: #171714;
    }

    .mobile-nav-button {
        cursor: pointer;
    }

    .app-shell {
        width: 100%;
        min-height: auto;
        display: block;
        margin: 0;
    }

    .app-sidebar,
    .app-topbar {
        display: none !important;
    }

    .app-main {
        min-height: calc(100vh - 64px - var(--mobile-bottom-nav-height));
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .app-content {
        padding: 12px 10px 20px;
    }

    .page-hero,
    .hero-section,
    .page-head-section,
    .catalog-head-section,
    .catalog-panel-head,
    .card-toolbar,
    .data-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .page-hero,
    .hero-section,
    .page-head-section {
        margin: 6px 0 12px;
    }

    .page-hero h1,
    .hero-section h1,
    .page-head-section h1 {
        font-size: clamp(1.5rem, 8vw, 2.1rem);
        line-height: 1.05;
    }

    .page-hero p,
    .hero-text,
    .catalog-panel-head p:not(.eyebrow) {
        font-size: .92rem;
    }

    .soft-card,
    .app-card,
    .metric-card,
    .data-card,
    .form-card {
        border-radius: 24px !important;
        box-shadow: 0 10px 28px rgba(23, 23, 20, .07) !important;
    }

    .business-form,
    .form-card,
    .catalog-workspace {
        padding: 12px;
    }

    .form-section {
        margin-bottom: 14px;
        padding: 14px;
        border-radius: 22px;
    }

    .form-section-title {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 12px;
        gap: 4px;
    }

    .form-section-title h2,
    .form-section-title h3 {
        font-size: 1rem;
    }

    .business-form .row.g-3,
    .business-form .row.g-2,
    .line-editor .row.g-3,
    .report-filter-grid,
    .field-grid,
    .field-grid.three {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px !important;
    }

    .business-form .row.g-3 > [class*="col-"],
    .business-form .row.g-2 > [class*="col-"],
    .line-editor .row.g-3 > [class*="col-"],
    .field-grid > *,
    .field-grid.three > *,
    .report-filter-grid > * {
        width: auto;
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }

    .business-form .row.g-3 > .col-12,
    .business-form .row.g-2 > .col-12,
    .business-form .row.g-3 > .col-md-4.autocomplete-field,
    .business-form .row.g-3 > .col-md-5.autocomplete-field,
    .business-form .row.g-3 > .col-md-6.autocomplete-field,
    .business-form .row.g-3 > .col-md-7,
    .business-form .row.g-3 > .col-md-8,
    .business-form .row.g-3 > .col-md-9,
    .business-form .row.g-3 > .col-md-10,
    .business-form .row.g-3 > .col-md-11,
    .business-form .row.g-3 > .col-md-12,
    .business-form textarea,
    .span-2,
    .span-all {
        grid-column: 1 / -1;
    }

    .form-control,
    .form-select,
    .btn,
    .pill-btn,
    .soft-btn {
        min-height: 44px;
        border-radius: 16px;
    }

    textarea.form-control {
        min-height: 94px;
    }

    .input-with-add {
        display: block;
    }

    .input-with-add .quick-add-link,
    .quick-add-link {
        position: static;
        display: inline-flex;
        margin: 4px 0 0;
    }

    .summary-strip,
    .metric-strip,
    .report-dashboard-grid,
    .stat-grid,
    .mini-wallets,
    .module-cards,
    .balance-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    .summary-strip > div,
    .metric-strip > div {
        min-height: 82px;
        border-radius: 20px;
        padding: 13px;
    }

    .summary-strip span,
    .metric-strip span {
        font-size: .72rem;
        line-height: 1.2;
    }

    .summary-strip strong,
    .metric-strip strong {
        font-size: 1.05rem;
        line-height: 1.18;
        word-break: break-word;
    }

    .table-responsive {
        overflow: visible;
    }

    table.mobile-card-table,
    table.mobile-card-table thead,
    table.mobile-card-table tbody,
    table.mobile-card-table tfoot {
        display: block;
        width: 100%;
    }

    table.mobile-card-table thead {
        height: 0;
        overflow: hidden;
        visibility: hidden;
    }

    table.mobile-card-table tbody {
        display: grid;
        gap: 12px;
    }

    table.mobile-card-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 13px;
        border: 1px solid rgba(23, 23, 20, .08);
        border-radius: 22px;
        background: #fff;
        box-shadow: 0 10px 24px rgba(23, 23, 20, .06);
    }

    table.mobile-card-table td,
    table.mobile-card-table th {
        display: grid;
        gap: 3px;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        text-align: left !important;
        white-space: normal !important;
        word-break: break-word;
    }

    table.mobile-card-table td::before {
        content: attr(data-label);
        color: #82786e;
        font-size: .7rem;
        font-weight: 850;
        letter-spacing: .02em;
    }

    table.mobile-card-table td[data-label=""],
    table.mobile-card-table td[data-label="#"],
    table.mobile-card-table td[data-label*="Hàng"],
    table.mobile-card-table td[data-label*="Tên"],
    table.mobile-card-table td[data-label*="Khách"],
    table.mobile-card-table td[data-label*="Đối tác"],
    table.mobile-card-table td[data-label*="Ghi chú"],
    table.mobile-card-table td[data-label*="Thao tác"],
    table.mobile-card-table td[data-label*="Số phiếu"],
    table.mobile-card-table td[data-label*="Mã"],
    table.mobile-card-table td.action-cell {
        grid-column: 1 / -1;
    }

    table.mobile-card-table td[data-label=""]::before,
    table.mobile-card-table td.action-cell::before {
        display: none;
    }

    table.mobile-card-table .text-end,
    table.mobile-card-table .text-center {
        text-align: left !important;
    }

    table.mobile-card-table .action-cell,
    table.mobile-card-table td:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start !important;
        align-items: center;
    }

    table.mobile-card-table .btn,
    .action-stack .btn,
    .action-cell .btn {
        min-height: 40px;
        border-radius: 999px;
    }

    .stock-doc-table,
    .import-lines-table {
        min-width: 0 !important;
    }

    .form-actions.sticky-actions {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(var(--mobile-bottom-nav-height) + 14px + env(safe-area-inset-bottom));
        z-index: 1034;
        margin: 0;
        padding: 10px;
        border: 1px solid rgba(23, 23, 20, .08);
        border-radius: 24px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 18px 45px rgba(23, 23, 20, .16);
        backdrop-filter: blur(16px);
    }

    .form-actions.sticky-actions .btn,
    .form-actions.sticky-actions button {
        width: 100%;
        min-height: 48px;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    body:has(.form-actions.sticky-actions) {
        padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--mobile-sticky-action-height) + env(safe-area-inset-bottom) + 28px);
    }

    .autocomplete-menu.show {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: calc(var(--mobile-bottom-nav-height) + 12px + env(safe-area-inset-bottom));
        z-index: 1075;
        max-height: min(52vh, 420px);
        border-radius: 24px 24px 18px 18px;
        box-shadow: 0 -18px 55px rgba(23, 23, 20, .20);
    }

    body:has(.form-actions.sticky-actions) .autocomplete-menu.show {
        bottom: calc(var(--mobile-bottom-nav-height) + var(--mobile-sticky-action-height) + 22px + env(safe-area-inset-bottom));
    }

    .autocomplete-item {
        min-height: 48px;
        padding: 12px;
        border-radius: 16px;
    }

    .modal-dialog {
        margin: 10px;
    }

    .quick-add-modal .modal-dialog,
    .modal-dialog-centered {
        align-items: flex-end;
        min-height: calc(100% - 20px);
    }

    .quick-add-modal .modal-content,
    .modal-content {
        border-radius: 26px;
    }

    .toast-container {
        left: 10px !important;
        right: 10px !important;
        bottom: calc(var(--mobile-bottom-nav-height) + 16px + env(safe-area-inset-bottom)) !important;
    }

    .app-toast {
        width: 100%;
    }

    .catalog-tabbar,
    .stock-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }

    .catalog-tab-item,
    .stock-tab {
        flex: 0 0 auto;
    }

    .hero-actions,
    .top-actions,
    .activity-tools,
    .action-stack {
        justify-content: stretch;
    }

    .hero-actions .btn,
    .activity-tools .btn,
    .action-stack .btn,
    .pager-row .btn,
    .card-toolbar .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 359px) {
    .business-form .row.g-3,
    .business-form .row.g-2,
    .line-editor .row.g-3,
    .field-grid,
    .field-grid.three,
    .summary-strip,
    .metric-strip,
    .report-dashboard-grid,
    .stat-grid,
    .mini-wallets,
    .module-cards,
    .balance-actions,
    table.mobile-card-table tr {
        grid-template-columns: 1fr !important;
    }

    .mobile-bottom-nav {
        left: 6px;
        right: 6px;
        padding: 6px;
        border-radius: 22px;
    }

    .mobile-nav-item small {
        font-size: .62rem;
    }
}
