:root {
    --crm-font-sans: "Roboto", "Segoe UI", Arial, sans-serif;
    --crm-bg: #f7f9fc;
    --crm-surface: #ffffff;
    --crm-text: #0f172a;
    --crm-muted: #64748b;
    --crm-primary: #2563eb;
    --crm-primary-dark: #1d4ed8;
    --crm-primary-soft: #dbeafe;
    --crm-cyan-soft: #ecfeff;
    --crm-indigo-soft: #eef2ff;
    --crm-red-soft: #fee2e2;
    --crm-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
    font-family: "Roboto", "Segoe UI", Arial, sans-serif;
}

input,
textarea,
select,
button {
    font-family: "Roboto", "Segoe UI", Arial, sans-serif;
}

table {
    font-family: "Roboto", "Segoe UI", Arial, sans-serif;
}

.product-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    background: #f3f4f6;
    flex: 0 0 56px;
}

.product-thumb-placeholder,
.product-card-img-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.product-card-img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
    background: #f3f4f6;
}

body {
    font-family: var(--crm-font-sans);
    font-size: 15px;
    line-height: 1.65;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--crm-text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 36%),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.06), transparent 22%),
        linear-gradient(180deg, #fbfcfe 0%, #f7f9fc 50%, #f3f6fb 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

html {
    overflow-x: clip;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--crm-font-sans);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

p,
li,
td,
th,
label,
.form-control,
.form-select,
.btn,
.badge,
.status-pill,
.nav-link,
.navbar-brand,
.modal-title,
.text-muted,
.crm-chip {
    font-family: var(--crm-font-sans);
}

.nav-link,
.navbar-brand {
    line-height: 1.4;
}

.nav-link {
    font-weight: 500;
}

.navbar-brand {
    font-weight: 700;
}

.crm-shell {
    padding-bottom: 48px;
}

.fab-primary {
    display: none;
}

.fab-primary.is-hidden {
    display: none !important;
}

.main-wrapper {
    flex: 1;
    min-width: 0;
}

.app {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.app-shell-container {
    width: min(1400px, calc(100vw - 32px));
    max-width: none;
    margin-inline: auto;
    padding-inline: 0;
}

.app-main-shell {
    min-width: 0;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar,
.crm-topbar {
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.97), rgba(22, 119, 255, 0.94));
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 36px rgba(13, 71, 161, 0.2);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crm-topbar-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-inline: 24px;
}

.crm-topbar-layout {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
}

.topbar-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.crm-topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.crm-topbar-brand img {
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15, 76, 219, 0.22);
}

.crm-header-menu,
.topbar-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow-x: visible;
    overflow-y: visible;
    scrollbar-width: none;
}

.crm-header-menu::-webkit-scrollbar {
    display: none;
}

.topbar-nav {
    display: flex !important;
    align-items: center !important;
    gap: 18px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap;
}

.topbar-nav a,
.topbar-nav .crm-top-link,
.topbar-nav .crm-header-dropdown-wrap {
    color: #fff;
    text-decoration: none;
}

.topbar-nav a,
.topbar-nav .crm-top-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    flex: 0 0 auto;
}

.topbar-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.crm-top-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.crm-top-link:hover,
.crm-top-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.crm-top-link.is-active {
    color: #fff;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.12)),
        rgba(7, 43, 112, 0.28);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.16),
        0 12px 24px rgba(6, 39, 102, 0.18);
}

.crm-top-dropdown-toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: 0.55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.8;
}

.nav-item {
    position: relative;
}

.crm-header-dropdown-wrap {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.crm-header-dropdown-wrap .crm-top-dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu,
.crm-header-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    min-width: 180px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    height: auto;
    max-height: none;
    overflow: visible;
    z-index: 1000;
}

.crm-header-dropdown {
    min-width: 180px;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.topbar-nav .dropdown-menu a,
.topbar-nav .crm-header-dropdown a,
.topbar-nav .crm-header-dropdown .crm-top-link,
.dropdown-menu a,
.crm-header-dropdown a,
.crm-header-dropdown .crm-top-link {
    display: block;
    width: 100%;
    padding: 10px 14px;
    color: #1f2937;
    text-decoration: none;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1.45;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border-radius: 0;
}

.topbar-nav .dropdown-menu a:hover,
.topbar-nav .dropdown-menu a:focus-visible,
.dropdown-menu a:hover,
.dropdown-menu a:focus-visible,
.crm-header-dropdown .crm-top-link:hover,
.crm-header-dropdown .crm-top-link:focus-visible {
    color: #1f2937;
    background: #f3f4f6;
    box-shadow: none;
    transform: none;
}

.crm-header-dropdown .crm-top-link.is-active {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.12);
    box-shadow: none;
}

.crm-staff-dropdown {
    min-width: 220px;
    padding: 8px;
}

.topbar-nav .crm-staff-dropdown .crm-staff-dropdown-item {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    text-align: left;
    line-height: 1.45;
}

.topbar-nav .crm-staff-dropdown .crm-staff-dropdown-item:hover,
.topbar-nav .crm-staff-dropdown .crm-staff-dropdown-item:focus-visible {
    background: #f3f4f6;
    color: #111827;
}

.topbar-nav .crm-staff-dropdown .crm-staff-dropdown-item.is-active {
    background: #eef2ff;
    color: #1d4ed8;
    font-weight: 700;
}

.crm-header-dropdown-wrap.is-open .dropdown-menu,
.crm-header-dropdown-wrap.is-open .crm-header-dropdown {
    display: block;
}

.crm-content-area {
    min-width: 0;
    flex: 1;
    padding: 24px 24px 40px;
}

.crm-navbar {
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.97), rgba(22, 119, 255, 0.94));
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 36px rgba(13, 71, 161, 0.2);
    margin-bottom: 28px;
}

.crm-sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.crm-navbar .navbar-nav {
    gap: 6px;
    align-items: center;
}

.crm-navbar-menu-wrap {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.crm-navbar-menu-wrap::-webkit-scrollbar {
    display: none;
}

.crm-navbar-section {
    flex: 0 0 auto;
}

.crm-navbar-menu {
    flex-wrap: nowrap;
    gap: 8px;
}

@media (min-width: 992px) {
    .crm-navbar .navbar-collapse {
        display: flex !important;
        align-items: center;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .crm-navbar .navbar-nav {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .crm-navbar-menu-wrap {
        flex: 1 1 auto;
    }
}

@media (max-width: 991.98px) {
    .crm-topbar-inner {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .crm-topbar-layout {
        align-items: flex-start;
    }

    .crm-header-menu,
    .topbar-nav {
        order: 3;
        justify-content: flex-start;
        width: 100%;
        padding-bottom: 4px;
    }
}

.navbar-brand,
.nav-link {
    letter-spacing: 0;
}

.crm-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px !important;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.84) !important;
    font-weight: 600;
    white-space: nowrap;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.crm-nav-link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 6px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(191, 230, 255, 0.96));
    opacity: 0;
    transform: scaleX(0.6);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.crm-nav-link:hover,
.crm-nav-link:focus-visible {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.crm-nav-link:hover::after,
.crm-nav-link:focus-visible::after {
    opacity: 0.55;
    transform: scaleX(1);
}

.crm-nav-link.is-active {
    color: #ffffff !important;
    font-weight: 700;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.12)),
        rgba(7, 43, 112, 0.26);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        0 12px 24px rgba(6, 39, 102, 0.2);
}

.crm-nav-link.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

.crm-nav-link.is-active:hover,
.crm-nav-link.is-active:focus-visible {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.14)),
        rgba(7, 43, 112, 0.32);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.22),
        0 14px 28px rgba(6, 39, 102, 0.22);
}

.navbar-brand img {
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15, 76, 219, 0.22);
}

.crm-card,
.hero-panel {
    background: var(--crm-surface);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    box-shadow: var(--crm-shadow);
    backdrop-filter: blur(18px);
}

.hero-panel {
    padding: 28px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    position: relative;
    overflow: hidden;
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto -80px -80px auto;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(22, 119, 255, 0.18), transparent 65%);
    pointer-events: none;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.order-detail-mobile-only {
    display: none;
}

.order-detail-mobile-card,
.order-detail-product-card,
.order-detail-payment-item {
    border-radius: 14px;
}

.order-detail-mobile-header-top,
.order-detail-payment-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.order-detail-mobile-order-id {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.order-detail-mobile-customer {
    margin-top: 12px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.order-detail-mobile-meta {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    color: #64748b;
    font-size: 0.92rem;
}

.order-detail-mobile-summary-label {
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 700;
}

.order-detail-mobile-debt {
    margin-top: 8px;
    font-size: 28px;
    line-height: 1.1;
    font-weight: 800;
    color: #b91c1c;
}

.order-detail-mobile-summary-grid {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.order-detail-mobile-summary-row,
.order-detail-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #475569;
}

.order-detail-mobile-summary-row strong,
.order-detail-product-row strong {
    color: #0f172a;
    text-align: right;
}

.order-detail-mobile-summary-row .is-paid,
.order-detail-payment-item strong {
    color: #15803d;
}

.order-detail-product-list,
.order-detail-payment-list {
    display: grid;
    gap: 14px;
}

.order-detail-product-card,
.order-detail-payment-item {
    padding: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.order-detail-product-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
}

.order-detail-product-grid {
    display: grid;
    gap: 10px;
}

.order-detail-product-row .is-returned {
    color: #b91c1c;
}

.order-detail-product-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.order-detail-product-actions .btn {
    min-height: 42px;
    border-radius: 12px;
    font-weight: 700;
}

.order-detail-payment-item-top strong {
    font-size: 1rem;
    font-weight: 800;
}

.order-detail-payment-item-meta {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    color: #64748b;
    font-size: 0.9rem;
}

.order-detail-action-bar {
    display: none;
}

.order-detail-action-spacer {
    display: none;
}

.page-heading,
.toolbar-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.crm-chip {
    background: rgba(22, 119, 255, 0.1);
    color: var(--crm-primary-dark);
    border: 1px solid rgba(22, 119, 255, 0.16);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.metric-card {
    padding: 24px;
    min-width: 0;
    overflow: hidden;
}

.metric-label {
    color: var(--crm-muted);
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    margin-bottom: 12px;
}

.metric-value {
    font-size: clamp(2.2rem, 4vw, 3.15rem);
    line-height: 0.96;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: clip;
}

.dashboard-kpi-value {
    display: block;
    max-inline-size: 100%;
    font-size: clamp(1.9rem, 3.2vw, 3rem);
    line-height: 1;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: balance;
}

.dashboard-kpi-value[data-size="medium"] {
    font-size: clamp(1.72rem, 2.8vw, 2.52rem);
}

.dashboard-kpi-value[data-size="small"] {
    font-size: clamp(1.5rem, 2.4vw, 2.16rem);
    letter-spacing: -0.03em;
}

.dashboard-kpi-value[data-size="xsmall"] {
    font-size: clamp(1.28rem, 2vw, 1.84rem);
    letter-spacing: -0.02em;
}

.dashboard-kpi-value[data-wrap="true"] {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.08;
}

.metric-foot {
    color: var(--crm-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.metric-green { background: linear-gradient(135deg, rgba(217, 236, 255, 0.96), rgba(255, 255, 255, 0.96)); }
.metric-sand { background: linear-gradient(135deg, rgba(223, 247, 255, 0.96), rgba(255, 255, 255, 0.96)); }
.metric-blue { background: linear-gradient(135deg, rgba(229, 235, 255, 0.96), rgba(255, 255, 255, 0.96)); }
.metric-red { background: linear-gradient(135deg, rgba(255, 225, 232, 0.96), rgba(255, 255, 255, 0.96)); }

.dashboard-chart-card {
    padding: 24px;
}

.dashboard-attention-card {
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.94)),
        radial-gradient(circle at top right, rgba(22, 119, 255, 0.08), transparent 28%);
}

.dashboard-attention-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-attention-summary {
    color: var(--crm-text);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
}

.dashboard-attention-badge {
    display: inline-grid;
    justify-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(22, 119, 255, 0.12);
    background: rgba(255, 255, 255, 0.92);
    color: var(--crm-text);
    line-height: 1.1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.dashboard-attention-badge strong {
    font-size: 1.28rem;
    font-weight: 800;
}

.dashboard-attention-badge-label {
    margin-bottom: 4px;
    color: var(--crm-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-attention-badge.is-empty {
    opacity: 0.62;
}

.dashboard-attention-list {
    display: grid;
    gap: 10px;
}

.dashboard-attention-row {
    display: grid;
    grid-template-columns: minmax(114px, 132px) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    text-decoration: none;
    border: 1px solid rgba(14, 30, 37, 0.08);
    background: rgba(255, 255, 255, 0.84);
    color: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.dashboard-attention-row:hover,
.dashboard-attention-row:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(21, 55, 77, 0.09);
    border-color: rgba(22, 119, 255, 0.18);
    background: rgba(255, 255, 255, 0.96);
}

.dashboard-attention-label-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dashboard-attention-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 800;
    flex: 0 0 auto;
}

.dashboard-attention-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-attention-body {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dashboard-attention-title {
    color: var(--crm-text);
    font-size: 0.98rem;
    line-height: 1.45;
    font-weight: 700;
}

.dashboard-attention-meta {
    color: var(--crm-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.dashboard-attention-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dashboard-attention-row.urgency-urgent {
    border-color: rgba(217, 45, 32, 0.22);
    background: linear-gradient(135deg, rgba(255, 239, 236, 0.98), rgba(255, 248, 247, 0.94));
}

.dashboard-attention-row.urgency-urgent .dashboard-attention-label {
    color: #b42318;
}

.dashboard-attention-row.urgency-urgent .dashboard-attention-icon,
.dashboard-attention-row.urgency-urgent .dashboard-attention-cta {
    color: #b42318;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(217, 45, 32, 0.18);
}

.dashboard-attention-row.urgency-soon {
    border-color: rgba(217, 119, 6, 0.18);
    background: linear-gradient(135deg, rgba(255, 248, 235, 0.98), rgba(255, 252, 245, 0.94));
}

.dashboard-attention-row.urgency-soon .dashboard-attention-label {
    color: #b54708;
}

.dashboard-attention-row.urgency-soon .dashboard-attention-icon,
.dashboard-attention-row.urgency-soon .dashboard-attention-cta {
    color: #b54708;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(217, 119, 6, 0.18);
}

.dashboard-attention-row.urgency-follow {
    border-color: rgba(22, 119, 255, 0.16);
    background: linear-gradient(135deg, rgba(239, 247, 255, 0.98), rgba(248, 251, 255, 0.94));
}

.dashboard-attention-row.urgency-follow .dashboard-attention-label {
    color: #175cd3;
}

.dashboard-attention-row.urgency-follow .dashboard-attention-icon,
.dashboard-attention-row.urgency-follow .dashboard-attention-cta {
    color: #175cd3;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(22, 119, 255, 0.18);
}

.dashboard-attention-empty {
    display: grid;
    gap: 4px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px dashed rgba(22, 119, 255, 0.16);
    background: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.dashboard-attention-empty-title {
    color: var(--crm-text);
    font-size: 0.98rem;
    font-weight: 700;
}

.dashboard-attention-empty-copy {
    color: var(--crm-muted);
    font-size: 0.9rem;
}

.dashboard-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.hero-panel .text-muted,
.dashboard-chart-head .text-muted,
.superadmin-header .text-muted,
.superadmin-form-heading .text-muted,
.superadmin-table-head .text-muted {
    color: var(--crm-muted) !important;
    font-size: 0.94rem;
    line-height: 1.6;
}

.dashboard-chart-filter {
    display: grid;
    grid-template-columns: minmax(120px, 160px) minmax(120px, 160px) auto;
    gap: 12px;
    align-items: end;
}

.dashboard-chart-filter-action {
    display: flex;
    align-items: end;
}

.dashboard-chart-shell {
    position: relative;
    min-height: 360px;
}

.dashboard-chart-empty {
    border-radius: 16px;
    background: rgba(22, 119, 255, 0.06);
    border-color: rgba(22, 119, 255, 0.1);
    color: var(--crm-primary-dark);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.dashboard-main-column,
.dashboard-sidebar-column {
    min-width: 0;
}

.dashboard-main-section + .dashboard-main-section {
    margin-top: 20px;
}

.dashboard-sidebar-column {
    position: sticky;
    top: 96px;
}

.dashboard-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-sidebar-link {
    color: var(--crm-primary);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-sidebar-link:hover,
.dashboard-sidebar-link:focus-visible {
    color: var(--crm-primary-dark);
    text-decoration: underline;
}

.staff-page-heading {
    margin-bottom: 10px;
}

.staff-page-heading-compact {
    align-items: center;
}

.staff-page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.staff-owner-card {
    border-radius: 18px;
}

.staff-owner-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.staff-owner-main {
    display: grid;
    gap: 2px;
}

.staff-owner-title {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--crm-muted);
}

.staff-owner-identity {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--crm-text);
}

.staff-owner-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.staff-list-card,
.staff-modal-card {
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--crm-shadow);
}

.staff-list-card-full .card-body {
    padding: 18px 20px !important;
}

.staff-summary-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.staff-summary-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(22, 119, 255, 0.08);
    border: 1px solid rgba(22, 119, 255, 0.12);
    color: var(--crm-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.staff-summary-chip strong {
    margin-right: 4px;
    color: var(--crm-primary-dark);
    font-weight: 800;
}

.staff-list-shell {
    display: grid;
    gap: 6px;
}

.staff-list-shell-rows {
    width: 100%;
}

.staff-member-item {
    display: grid;
    align-items: center;
}

.staff-member-row {
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) auto;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
    align-items: start;
}

.staff-member-row.is-expiring {
    border-color: rgba(217, 119, 6, 0.18);
    background: linear-gradient(180deg, rgba(255, 250, 241, 0.98), rgba(255, 255, 255, 0.94));
}

.staff-member-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: nowrap;
    min-height: 36px;
}

.staff-member-name-inline {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    color: var(--crm-text);
    white-space: nowrap;
}

.staff-member-type {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.staff-member-type.is-manager {
    background: rgba(22, 119, 255, 0.12);
    color: var(--crm-primary-dark);
}

.staff-member-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    align-content: center;
    min-width: 0;
}

.staff-permission-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(22, 119, 255, 0.12);
    border: 1px solid rgba(22, 119, 255, 0.2);
    color: var(--crm-primary-dark);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.staff-permission-badge.is-muted {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.14);
    color: #64748b;
}

.staff-member-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    color: var(--crm-muted);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.staff-member-meta.is-expiring {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.staff-member-side {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: end;
    gap: 8px;
    min-width: max-content;
}

.staff-member-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
    min-height: 36px;
}

.staff-member-actions form {
    margin: 0;
}

.staff-icon-button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--crm-primary-dark);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.staff-icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 78, 201, 0.1);
    border-color: rgba(22, 119, 255, 0.18);
}

.staff-icon-button.is-danger {
    color: #b42318;
}

.staff-form-grid {
    display: grid;
    gap: 10px;
}

.staff-form-grid .form-label {
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.staff-form-grid .form-control,
.staff-form-grid .form-select {
    min-height: 40px;
    border-radius: 12px;
}

.staff-permissions-card {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(22, 119, 255, 0.12);
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.95), rgba(255, 255, 255, 0.9));
}

.staff-permissions-head {
    margin-bottom: 8px;
}

.staff-permissions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.staff-permissions-grid-inline {
    gap: 6px;
}

.staff-permission-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.staff-permission-option:hover {
    border-color: rgba(22, 119, 255, 0.18);
    box-shadow: 0 10px 22px rgba(15, 78, 201, 0.06);
}

.staff-permission-option .form-check-input {
    margin: 0;
}

.staff-permission-option span {
    display: inline-flex;
    align-items: center;
}

.staff-permission-option strong {
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 700;
}

.staff-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 2px;
    flex-wrap: wrap;
}

.staff-empty-state {
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 28px 20px;
    border-radius: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.74);
    text-align: center;
}

.staff-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--crm-text);
}

.staff-empty-copy {
    color: var(--crm-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.hero-panel-system {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(229, 241, 255, 0.92)),
        radial-gradient(circle at top right, rgba(22, 119, 255, 0.18), transparent 32%);
}

.hero-panel-copy {
    max-width: 720px;
}

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

.admin-kpi-card {
    grid-column: span 4;
}

.admin-section {
    display: grid;
    gap: 16px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
}

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

.admin-action-card {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 16px;
    align-items: start;
    padding: 22px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.admin-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(22, 119, 255, 0.14);
    border-color: rgba(22, 119, 255, 0.18);
}

.admin-action-card h3 {
    margin: 0 0 6px;
    font-size: 1.02rem;
    font-weight: 700;
}

.admin-action-card p {
    margin: 0;
    color: var(--crm-muted);
    line-height: 1.55;
}

.admin-action-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 119, 255, 0.12);
    color: var(--crm-primary-dark);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 16px;
}

.admin-table-card {
    padding: 24px;
}

.admin-table-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-success {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.16);
}

.status-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.16);
}

.status-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.16);
}

.status-muted {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    border-color: rgba(100, 116, 139, 0.16);
}

.superadmin-page {
    padding: 28px;
}

.superadmin-header,
.superadmin-table-head,
.superadmin-form-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.superadmin-inline-form {
    padding: 20px;
    border-radius: 18px;
    background: rgba(22, 119, 255, 0.04);
    border: 1px solid rgba(22, 119, 255, 0.1);
}

.superadmin-form-heading {
    align-items: end;
    margin-bottom: 14px;
}

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

.superadmin-kpi-card {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--crm-shadow);
}

.superadmin-kpi-card .metric-value,
.customer-metric-number,
.sales-payment-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
}

.superadmin-table-shell {
    border-top: 1px solid rgba(16, 42, 67, 0.08);
    padding-top: 22px;
}

.superadmin-table-head {
    margin-bottom: 16px;
}

.superadmin-expire-note {
    margin-top: 4px;
    font-size: 0.84rem;
    color: var(--crm-muted);
}

.superadmin-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.superadmin-actions form {
    margin: 0;
}

.superadmin-expand-row td {
    background: transparent;
}

.superadmin-detail-panel,
.superadmin-extend-panel {
    padding: 0 20px 16px;
}

.superadmin-detail-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.superadmin-detail-item {
    display: grid;
    gap: 4px;
}

.superadmin-detail-item span {
    font-size: 0.8rem;
    color: var(--crm-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.superadmin-detail-item strong {
    font-size: 0.95rem;
    color: var(--crm-text);
}

.superadmin-extend-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 280px) auto;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.superadmin-empty-state {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.crm-table thead th {
    color: var(--crm-muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.35;
    border-bottom-width: 1px;
}

.crm-table tbody tr {
    border-color: rgba(16, 42, 67, 0.06);
}

.crm-table tbody td {
    font-size: 0.95rem;
    line-height: 1.5;
}

.toolbar-search {
    min-width: min(300px, 70vw);
}

.customer-page {
    width: 100%;
    min-width: 0;
    margin: 0;
    display: grid;
    gap: 22px;
}

.customer-simple-card {
    border-radius: 20px;
}

.customer-simple-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.customer-simple-search {
    display: grid;
    grid-template-columns: minmax(280px, 420px) auto auto;
    gap: 12px;
}

.customer-search-input {
    min-height: 46px;
    border-radius: 14px;
    border-color: rgba(22, 119, 255, 0.16);
    background: rgba(255, 255, 255, 0.96);
    padding-inline: 15px;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.customer-search-input:hover {
    border-color: rgba(22, 119, 255, 0.26);
}

.customer-search-input:focus {
    border-color: rgba(22, 119, 255, 0.38);
    background: #ffffff;
    box-shadow: 0 0 0 0.24rem rgba(22, 119, 255, 0.12);
}

.customer-simple-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.customer-stat-box {
    min-width: 150px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(22, 119, 255, 0.08);
    border: 1px solid rgba(22, 119, 255, 0.1);
}

.customer-stat-box span {
    display: block;
    font-size: 0.82rem;
    color: var(--crm-muted);
    margin-bottom: 4px;
}

.customer-stat-box strong {
    font-size: 1.05rem;
}

.customer-debt-chip {
    display: inline-flex;
    align-items: center;
    min-width: 96px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    font-weight: 700;
    justify-content: center;
}

.customer-debt-chip.is-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #b42318;
}

.customer-debt-chip.is-success {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.customers-table {
    margin-bottom: 0;
}

.customers-table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.7);
}

.customers-row {
    transition: background-color 0.22s ease, box-shadow 0.22s ease;
}

.customers-row td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    transition: background-color 0.22s ease, border-color 0.22s ease;
}

.customers-row:hover td {
    background: rgba(22, 119, 255, 0.04);
}

.customers-row.has-debt td:first-child {
    box-shadow: inset 3px 0 0 rgba(220, 53, 69, 0.34);
}

.customers-debt-cell {
    white-space: nowrap;
}

.customers-debt-chip {
    min-width: 110px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.customers-cash-cell {
    white-space: nowrap;
}

.customers-cash-chip.is-success {
    border: 1px solid rgba(34, 197, 94, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.customers-action-button {
    border-radius: 12px;
    font-weight: 700;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        background-color 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease;
}

.customers-action-button:hover {
    transform: translateY(-1px);
}

.customers-action-collect.is-active {
    box-shadow: 0 10px 18px rgba(245, 158, 11, 0.18);
}

.customers-action-collect.is-active:not(:disabled):hover {
    box-shadow: 0 14px 22px rgba(245, 158, 11, 0.24);
}

.customers-action-collect.is-inactive,
.customers-action-collect:disabled {
    background: rgba(248, 250, 252, 0.94);
    border-color: rgba(203, 213, 225, 0.9);
    color: #94a3b8 !important;
    box-shadow: none;
    opacity: 1;
}

.customers-table .crm-action-row {
    gap: 10px;
}

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

.orders-table {
    margin-bottom: 0;
}

.orders-card-body {
    padding: 24px !important;
}

.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.orders-toolbar-head {
    min-width: 0;
    flex: 1 1 auto;
}

.orders-card-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
}

.orders-total-badge {
    background: #f1f5f9;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
    color: #334155;
}

.orders-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.orders-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
    margin-left: auto;
}

.orders-page-heading {
    align-items: flex-start;
    flex-wrap: nowrap;
}

.orders-page-heading-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.orders-page-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.orders-page-heading-actions .btn,
.orders-page-heading-actions .dropdown {
    flex: 0 0 auto;
}

.orders-export-toggle {
    min-width: 136px;
    justify-content: center;
}

.orders-export-menu {
    min-width: 220px;
    padding: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.orders-export-menu .dropdown-item {
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
}

.orders-export-menu .dropdown-item:hover,
.orders-export-menu .dropdown-item:focus {
    background: rgba(22, 119, 255, 0.08);
    color: var(--crm-primary-dark);
}

.orders-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    width: 100%;
}

.orders-filter-select {
    width: 220px;
    min-width: 220px;
    flex: 0 0 220px;
}

.orders-date-input {
    width: 160px;
    min-width: 160px;
    flex: 0 0 160px;
}

.orders-search-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 44px;
    border-radius: 14px;
    border-color: rgba(22, 119, 255, 0.16);
    background: rgba(255, 255, 255, 0.96);
    padding-inline: 15px;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.orders-toolbar-button,
.orders-search-form .form-select,
.orders-search-form .form-control,
.orders-bulk-delete-button {
    min-height: 44px;
}

.orders-reset-button {
    flex: 0 0 auto;
}

.orders-search-form .btn {
    flex: 0 0 auto;
}

.orders-search-input:hover {
    border-color: rgba(22, 119, 255, 0.26);
}

.orders-search-input:focus {
    border-color: rgba(22, 119, 255, 0.38);
    background: #ffffff;
    box-shadow: 0 0 0 0.24rem rgba(22, 119, 255, 0.12);
}

.orders-filter-shell {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.orders-filter-panel {
    flex: 1 1 auto;
    min-width: 0;
}

.orders-mobile-filter-toggle,
.orders-mobile-list {
    display: none;
}

.orders-bulk-form {
    display: flex;
    align-items: stretch;
}

.orders-bulk-delete-button {
    min-width: 132px;
    border-radius: 12px;
    font-weight: 700;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        background-color 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease;
}

.orders-bulk-delete-button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(220, 53, 69, 0.12);
}

.orders-bulk-delete-button:disabled {
    opacity: 0.58;
    box-shadow: none;
}

.pagination-mobile-wrapper {
    padding: 0 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.pagination-mobile-wrapper::-webkit-scrollbar {
    display: none;
}

.orders-mobile-pagination-wrap {
    display: none;
}

.orders-desktop-pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.orders-mobile-pagination,
.pagination-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: nowrap;
    min-width: max-content;
}

.orders-mobile-pagination::-webkit-scrollbar,
.pagination-mobile::-webkit-scrollbar {
    display: none;
}

.orders-mobile-pagination-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.orders-mobile-pagination-pages::-webkit-scrollbar {
    display: none;
}

.orders-mobile-pagination-button,
.orders-mobile-pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    font-weight: 500;
    flex: 0 0 auto;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
    white-space: nowrap;
}

.orders-mobile-pagination-button:hover,
.orders-mobile-pagination-page:hover,
.orders-mobile-pagination-button:active,
.orders-mobile-pagination-page:active {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #0f172a;
}

.orders-mobile-pagination-arrow {
    font-size: 1.05rem;
    line-height: 1;
    flex: 0 0 auto;
}

.orders-mobile-pagination-page.is-current {
    border-color: var(--crm-primary);
    background: var(--crm-primary);
    color: #ffffff;
}

.orders-mobile-pagination-page.is-current:hover,
.orders-mobile-pagination-page.is-current:active {
    background: var(--crm-primary-dark);
    border-color: var(--crm-primary-dark);
    color: #ffffff;
}

.orders-mobile-pagination-button.is-disabled {
    opacity: 0.4;
    color: #94a3b8;
    background: #f8fafc;
    box-shadow: none;
    pointer-events: none;
}

.orders-mobile-pagination-ellipsis {
    color: #64748b;
    font-weight: 700;
    padding-inline: 0;
    flex: 0 0 auto;
}

@media (max-width: 1180px) {
    .orders-header {
        width: 100%;
        flex-wrap: wrap;
    }

    .orders-toolbar {
        flex-wrap: wrap;
    }

    .orders-search-form {
        flex-wrap: wrap;
    }

    .orders-filter-shell,
    .orders-toolbar-actions,
    .orders-bulk-form {
        width: 100%;
    }

    .orders-toolbar-actions {
        justify-content: flex-start;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .orders-filter-select,
    .orders-date-input {
        flex: 1 1 220px;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .order-detail-mobile-only {
        display: block;
    }

    .order-detail-desktop-only {
        display: none;
    }

    .order-detail-mobile-card .card-body,
    .order-detail-product-card,
    .order-detail-payment-item {
        padding: 16px;
    }

    .order-detail-product-list + .table-responsive,
    .order-detail-payment-list + .table-responsive {
        display: none;
    }

    .hero-actions {
        display: none;
    }

    .order-detail-action-bar {
        position: fixed;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        z-index: 1080;
        width: min(100%, var(--crm-mobile-nav-shell-width, 100vw));
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(12px);
    }

    .order-detail-action-bar .btn {
        min-height: 46px;
        border-radius: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
    }

    .order-detail-action-spacer {
        display: block;
        height: calc(var(--crm-mobile-nav-offset, 98px) + 96px);
    }

    .orders-mobile-pagination-wrap {
        display: block;
    }

    .orders-desktop-pagination-wrap {
        display: none;
    }

    .orders-page-heading {
        flex-wrap: wrap;
    }

    .orders-page-heading-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .orders-header {
        margin-bottom: 12px;
    }

    .orders-filter-shell {
        width: 100%;
        display: grid;
        gap: 10px;
    }

    .orders-mobile-filter-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 44px;
        padding-inline: 14px;
        border-radius: 14px;
        font-weight: 700;
    }

    .orders-mobile-filter-toggle::after {
        content: "+";
        font-size: 1rem;
        line-height: 1;
    }

    .orders-mobile-filter-toggle.is-open::after {
        content: "-";
    }

    .orders-filter-panel {
        width: 100%;
        padding: 12px;
        border: 1px solid rgba(226, 232, 240, 0.92);
        border-radius: 14px;
        background: rgba(248, 250, 252, 0.9);
    }

    .orders-search-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .orders-filter-select,
    .orders-date-input,
    .orders-search-input {
        width: 100%;
        min-width: 0;
        flex: 1 1 auto;
    }

    .orders-toolbar {
        display: grid;
        gap: 10px;
        margin-bottom: 16px;
    }

    .orders-toolbar-actions,
    .orders-bulk-form {
        width: 100%;
        margin-left: 0;
    }

    .orders-card-count {
        min-height: 44px;
    }

    .orders-toolbar-button,
    .orders-bulk-delete-button {
        width: 100%;
    }

    .orders-mobile-list {
        display: grid;
        gap: 12px;
        margin-bottom: 12px;
    }

    .orders-mobile-card {
        padding: 12px;
        border: 1px solid rgba(226, 232, 240, 0.9);
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    }

    .orders-mobile-card.has-debt {
        border-color: rgba(248, 113, 113, 0.28);
    }

    .orders-mobile-card-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 10px;
    }

    .orders-mobile-card-head-main {
        min-width: 0;
        flex: 1 1 auto;
        display: flex;
        align-items: baseline;
        gap: 8px;
        flex-wrap: wrap;
    }

    .orders-mobile-card-code {
        font-size: 1rem;
        line-height: 1.25;
    }

    .orders-mobile-card-date {
        color: var(--crm-muted);
        font-size: 0.84rem;
    }

    .orders-mobile-card-badges {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
    }

    .orders-mobile-card-customer {
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 10px;
    }

    .orders-mobile-card-amounts {
        display: grid;
        gap: 8px;
        padding: 10px 0 0;
        border-top: 1px solid rgba(226, 232, 240, 0.7);
    }

    .orders-mobile-card-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        color: #475569;
        font-variant-numeric: tabular-nums;
    }

    .orders-mobile-card-row span {
        font-size: 0.92rem;
    }

    .orders-mobile-card-row strong {
        text-align: right;
        color: #0f172a;
        flex: 0 0 auto;
    }

    .orders-mobile-card-row.is-paid strong {
        color: #15803d;
    }

    .orders-mobile-card-row.is-debt strong {
        color: #b91c1c;
    }

    .orders-mobile-card-actions {
        display: flex;
        justify-content: flex-end;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(226, 232, 240, 0.7);
    }

    .orders-mobile-detail-button {
        min-width: 92px;
        border-radius: 12px;
        font-weight: 700;
    }

    .orders-mobile-empty,
    .orders-mobile-note {
        padding: 12px;
        border-radius: 14px;
        background: rgba(248, 250, 252, 0.96);
        color: var(--crm-muted);
    }

    .orders-mobile-pagination {
        margin-top: 12px;
        padding-bottom: 2px;
    }

    .orders-mobile-pagination-button,
    .orders-mobile-pagination-page {
        min-width: 36px;
        width: 36px;
        height: 36px;
    }

    .orders-table-wrap {
        display: none;
    }

    .orders-table-wrap table,
    .orders-table-wrap thead,
    .orders-table-wrap tbody,
    .orders-table-wrap tr,
    .orders-table-wrap th,
    .orders-table-wrap td {
        display: none;
    }

    .orders-toolbar-actions .orders-bulk-form {
        display: none;
    }
}

.orders-check-col {
    width: 44px;
    min-width: 44px;
    white-space: nowrap;
}

.orders-table .orders-check-col {
    text-align: center;
}

.orders-check-input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    border-radius: 0.35rem;
    border-color: rgba(148, 163, 184, 0.9);
    cursor: pointer;
}

.orders-check-input:focus {
    border-color: rgba(22, 119, 255, 0.42);
    box-shadow: 0 0 0 0.18rem rgba(22, 119, 255, 0.12);
}

.orders-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(248, 251, 255, 0.96);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 -1px 0 rgba(16, 42, 67, 0.08);
}

.orders-row {
    transition: background-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.orders-table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.72);
}

.orders-row td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    transition: background-color 0.22s ease, border-color 0.22s ease;
}

.orders-row:hover td {
    background: rgba(22, 119, 255, 0.04);
}

.orders-row.has-debt td:first-child {
    box-shadow: inset 3px 0 0 rgba(220, 53, 69, 0.38);
}

.orders-debt-cell.has-debt {
    white-space: nowrap;
    background: transparent !important;
}

.orders-row:hover .orders-debt-cell.has-debt {
    background: transparent !important;
}

.orders-debt-chip {
    min-width: 110px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.orders-debt-chip.is-danger {
    background: linear-gradient(135deg, rgba(255, 234, 238, 0.98), rgba(255, 244, 246, 0.98));
    color: #b42318;
    border: 1px solid rgba(220, 53, 69, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.orders-debt-chip.is-high-debt {
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.98), rgba(255, 238, 242, 0.98));
    color: #991b1b;
    border-color: rgba(220, 53, 69, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.orders-date-cell {
    white-space: nowrap;
    width: 1%;
}

.orders-date-cell .fw-semibold {
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.orders-amount-cell {
    font-weight: 800;
    color: var(--crm-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.orders-paid-cell {
    color: #64748b;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.orders-action-button {
    min-width: 62px;
    border-radius: 12px;
    font-weight: 700;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        background-color 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease;
}

.orders-action-button:hover {
    transform: translateY(-1px);
}

.orders-action-collect {
    min-width: 76px;
}

.orders-action-collect.is-active {
    box-shadow: 0 10px 18px rgba(245, 158, 11, 0.18);
}

.orders-action-collect.is-active:not(:disabled):hover {
    box-shadow: 0 14px 22px rgba(245, 158, 11, 0.24);
}

.orders-action-collect.is-inactive,
.orders-action-collect:disabled {
    background: rgba(248, 250, 252, 0.94);
    border-color: rgba(203, 213, 225, 0.9);
    color: #94a3b8 !important;
    box-shadow: none;
    opacity: 1;
}

.orders-action-view {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.28);
    color: #475569;
}

.orders-action-view:hover {
    background: rgba(248, 250, 252, 0.98);
    border-color: rgba(100, 116, 139, 0.3);
    color: #334155;
}

.orders-action-edit {
    border-color: rgba(22, 119, 255, 0.24);
    color: var(--crm-primary-dark);
    background: rgba(22, 119, 255, 0.05);
}

.orders-action-edit:hover {
    background: rgba(22, 119, 255, 0.1);
    border-color: rgba(22, 119, 255, 0.34);
    color: #0a4db8;
}

.orders-action-delete {
    border-color: rgba(220, 53, 69, 0.22);
    color: #c62828;
    background: rgba(255, 244, 246, 0.74);
}

.orders-action-delete:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.34);
    color: #a61b1b;
}

.orders-table .crm-action-row {
    gap: 10px;
}

.collection-modal-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.collection-modal-summary > div {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(22, 119, 255, 0.08);
    border: 1px solid rgba(22, 119, 255, 0.1);
}

.collection-modal-summary span,
.customer-detail-item span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: var(--crm-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.collection-modal-summary strong,
.customer-detail-item strong {
    display: block;
    font-size: 1rem;
}

.customer-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 18px;
}

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

.customer-detail-item {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(22, 119, 255, 0.12);
    background: rgba(255, 255, 255, 0.72);
}

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

.products-toolbar {
    display: grid;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef2f7;
}

.products-toolbar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 20px;
    flex-wrap: wrap;
}

.products-toolbar-main {
    display: grid;
    gap: 10px;
    flex: 1 1 460px;
}

.products-toolbar-copy {
    display: grid;
    gap: 4px;
}

.products-toolbar-title {
    font-size: 1rem;
    font-weight: 700;
    color: #16253d;
}

.products-toolbar-note {
    color: #6b7280;
    font-size: 0.9rem;
}

.products-search {
    width: min(420px, 100%);
}

.products-search-wrap {
    min-width: min(420px, 100%);
}

.products-toolbar-search {
    flex: 1 1 56%;
    min-width: min(100%, 32rem);
}

.products-toolbar-cta {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
}

.products-toolbar-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.products-import-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.products-import-input {
    min-width: 14rem;
}

.products-modal {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
}

.products-page {
    display: grid;
    gap: 16px;
}

.products-page-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: end;
}

.products-page-title {
    font-size: 1.9rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0;
    color: #0f172a;
}

.products-page-subtitle {
    margin: 8px 0 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #64748b;
}

.products-panel {
    border-radius: 14px;
    background: #fff;
    border-color: #e6ebf2;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.products-panel-body {
    padding: 22px 24px !important;
}

.products-segmented {
    display: inline-flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    padding: 3px;
}

.products-segment {
    padding: 8px 14px;
    border-radius: 7px;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.products-segment:hover {
    color: #0f4ec9;
    background: rgba(255, 255, 255, 0.7);
}

.products-segment.is-active {
    background: #fff;
    color: #0f4ec9;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.products-primary-button {
    min-height: 40px;
    border-radius: 9px;
    padding-inline: 15px;
    font-size: 0.92rem;
    font-weight: 700;
}

.products-secondary-button {
    min-height: 40px;
    border-radius: 9px;
    padding-inline: 14px;
}

.products-table-shell {
    border: 1px solid #e4eaf3;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.products-form-grid {
    display: grid;
    gap: 16px;
}

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

.products-form-head {
    display: grid;
    gap: 8px;
    padding-right: 20px;
}

.products-form-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e9f1ff;
    color: var(--crm-primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.products-form-status {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.products-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.products-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.products-field-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: #475569;
}

.products-table thead th {
    background: #f8fafc;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    padding: 13px 16px;
    font-size: 0.78rem;
}

.products-table tbody td {
    padding: 15px 16px;
    vertical-align: middle;
    border-bottom-color: #eef2f7;
}

.products-table tbody tr {
    transition: background 0.16s ease, box-shadow 0.16s ease;
}

.products-table tbody tr:hover {
    background: #f8fbff;
}

.products-name-cell {
    font-weight: 700;
    color: #16253d;
}

.products-table-meta {
    color: #475569;
    font-weight: 500;
}

.products-price-cell {
    font-weight: 700;
    color: #0f4ec9;
    white-space: nowrap;
}

.products-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    border: 1px solid transparent;
    letter-spacing: 0.01em;
}

.products-status-badge.is-active {
    color: #166534;
    background: #ecfdf3;
    border-color: #bbf7d0;
}

.products-status-badge.is-inactive {
    color: #475569;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.products-action-button {
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 8px;
    border: 1px solid #d6deea;
    background: #f8fafc;
    color: #334155;
    font-size: 0.84rem;
    font-weight: 700;
}

.products-action-button:hover {
    background: #f1f5f9;
    border-color: #b8c5d6;
}

.products-action-button.is-danger {
    color: #b42318;
    border-color: #f0c3be;
    background: #fff7f6;
}

.products-action-button.is-danger:hover {
    background: #ffeceb;
}

.products-action-button.is-secondary {
    color: #475569;
    border-color: #d6deea;
    background: #f8fafc;
}

.products-action-button.is-danger-outline {
    color: #b42318;
    border-color: #f0c3be;
    background: #fff;
}

.products-action-button.is-danger-outline:hover {
    background: #fff5f4;
}

.products-search-input {
    min-height: 42px;
    border-radius: 10px;
    border-color: #d7e0eb;
    background: #fff;
}

.products-search-input:hover {
    border-color: #bfd0e6;
}

.products-search-input:focus {
    border-color: rgba(22, 119, 255, 0.42);
    box-shadow: 0 0 0 0.2rem rgba(22, 119, 255, 0.11);
}

.customer-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 42, 67, 0.42);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 1050;
}

.customer-modal-card {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(16, 42, 67, 0.24);
}

.customer-modal-form {
    display: grid;
    gap: 14px;
}

[data-return-modal].customer-modal-backdrop {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.order-return-modal > .d-flex.justify-content-between.align-items-start.gap-3.mb-3 {
    display: none;
}

.order-return-modal {
    display: flex;
    flex-direction: column;
    width: min(760px, 92vw);
    max-height: 90vh;
    padding: 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 28px 72px rgba(16, 42, 67, 0.3);
}

.order-return-modal__form {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-height: 90vh;
}

.order-return-modal__header,
.order-return-modal__footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: #fff;
}

.order-return-modal__header {
    border-bottom: 1px solid rgba(16, 42, 67, 0.08);
}

.order-return-modal__footer {
    justify-content: flex-end;
    margin-top: auto;
    border-top: 1px solid rgba(16, 42, 67, 0.08);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.order-return-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px 24px;
}

.order-return-modal__footer .btn-outline-secondary {
    border-color: rgba(16, 42, 67, 0.14);
    color: #475569;
}

.order-return-modal__footer .btn-danger {
    font-weight: 700;
    padding-left: 18px;
    padding-right: 18px;
}

.order-return-readonly-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.order-return-readonly-card {
    padding: 12px 14px;
    border: 1px solid rgba(16, 42, 67, 0.08);
    border-radius: 16px;
    background: #f8fafc;
}

.order-return-readonly-card__label {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 0.82rem;
}

.order-return-readonly-card__value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.order-return-modal__body > .row.g-3.mb-3 > .col-md-4:nth-child(-n+2) {
    display: none;
}

.order-return-modal__body input[readonly] {
    background: #f8fafc;
    border-color: rgba(16, 42, 67, 0.08);
    color: #334155;
    box-shadow: none;
}

@media (max-height: 820px) {
    [data-return-modal].customer-modal-backdrop {
        padding: 16px;
        align-items: stretch;
    }

    .order-return-modal,
    .order-return-modal__form {
        max-height: calc(100vh - 32px);
    }
}

@media (max-width: 767.98px) {
    [data-return-modal].customer-modal-backdrop {
        padding: 16px;
    }

    .order-return-modal__header,
    .order-return-modal__body,
    .order-return-modal__footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .order-return-readonly-grid {
        grid-template-columns: 1fr;
    }
}

body.modal-open {
    overflow: hidden;
}

.staff-hr-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.staff-hr-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.staff-hr-header h1 {
    margin: 0 0 4px;
    color: #111827;
    font-size: 1.8rem;
    font-weight: 800;
}

.staff-hr-header p,
.staff-hr-panel-head p {
    margin: 0;
    color: #667085;
}

.staff-hr-actions,
.staff-hr-panel-actions,
.staff-hr-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.staff-hr-row-actions form {
    margin: 0;
}

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

.staff-hr-metric,
.staff-hr-panel,
.staff-hr-shifts article,
.staff-hr-permission-grid article {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.staff-hr-metric {
    padding: 18px;
}

.staff-hr-metric strong {
    display: block;
    color: #111827;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
}

.staff-hr-metric span {
    display: block;
    margin-top: 6px;
    color: #667085;
    font-size: 0.86rem;
}

.staff-hr-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-bottom: 1px solid #e5e7eb;
}

.staff-hr-tabs a {
    padding: 11px 14px;
    border-radius: 10px 10px 0 0;
    color: #667085;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.staff-hr-tabs a.is-active {
    background: #eaf3ff;
    color: #1d4ed8;
    box-shadow: inset 0 -2px 0 #2c7be5;
}

.staff-hr-advanced-nav {
    width: fit-content;
    margin-top: -4px;
    color: #667085;
    font-size: 0.88rem;
}

.staff-hr-advanced-nav summary {
    cursor: pointer;
    padding: 8px 0;
    font-weight: 700;
}

.staff-hr-advanced-nav a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: #475467;
    text-decoration: none;
    font-weight: 700;
}

.staff-hr-advanced-nav a:hover,
.staff-hr-advanced-nav a:focus {
    background: #f3f4f6;
    color: #111827;
}

.staff-hr-advanced-nav a.is-active {
    background: #eef2ff;
    color: #1d4ed8;
}

.staff-hr-panel {
    padding: 20px;
}

.staff-hr-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.staff-hr-panel-head h2 {
    margin: 0 0 4px;
    color: #111827;
    font-size: 1.15rem;
    font-weight: 800;
}

.staff-hr-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.staff-hr-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) 0.75fr 0.85fr 0.45fr 0.85fr 0.75fr minmax(260px, 1.25fr);
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #ffffff;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.staff-hr-row > div,
.staff-hr-person {
    min-width: 0;
}

.staff-hr-row:not(.staff-hr-row-head):hover {
    background: #f8fbff;
    border-color: #dbeafe;
}

.staff-hr-row-head {
    padding: 9px 14px;
    border: 0;
    background: #f8fafc;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.staff-hr-person strong,
.staff-hr-row strong {
    display: block;
    color: #111827;
    font-weight: 800;
}

.staff-hr-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.staff-hr-person small,
.staff-hr-row small,
.staff-hr-sub {
    display: block;
    color: #667085;
    font-size: 0.78rem;
}

.staff-hr-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.staff-hr-permissions span,
.staff-hr-role,
.staff-hr-status,
.staff-hr-permission-presets span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.74rem;
    font-weight: 800;
}

.staff-hr-role {
    background: #f0fdf4;
    color: #15803d;
}

.staff-hr-status.is-active,
.staff-hr-status.is-present,
.staff-hr-status.is-working {
    background: #ecfdf3;
    color: #027a48;
}

.staff-hr-status.is-completed {
    background: #f2f4f7;
    color: #475467;
}

.staff-hr-status.is-expiring,
.staff-hr-status.is-late,
.staff-hr-status.is-early_leave {
    background: #fffaeb;
    color: #b54708;
}

.staff-hr-status.is-locked,
.staff-hr-status.is-absent {
    background: #fff1f3;
    color: #c01048;
}

.staff-hr-status.is-off {
    background: #f2f4f7;
    color: #475467;
}

.staff-hr-filter,
.staff-hr-quick,
.staff-hr-inline-form,
.staff-hr-month-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.staff-hr-quick {
    align-items: center;
}

.staff-hr-form-block {
    padding: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    background: #ffffff;
}

.staff-hr-form-block-head {
    margin-bottom: 14px;
}

.staff-hr-form-block-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #111827;
}

.staff-hr-form-block-head p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 0.88rem;
}

.staff-hr-payroll-tabs-block {
    margin-bottom: 18px;
}

.staff-hr-inline-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: #f8fafc;
}

.staff-hr-inline-tab {
    border: 0;
    background: transparent;
    color: #667085;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

.staff-hr-inline-tab.is-active {
    background: #eef2ff;
    color: #1d4ed8;
}

.staff-hr-tab-panel[hidden] {
    display: none !important;
}

.staff-hr-labeled-form {
    align-items: flex-end;
}

.staff-hr-labeled-form .staff-hr-field {
    flex: 1 1 180px;
    max-width: 240px;
    margin: 0;
}

.staff-hr-labeled-form .staff-hr-field-wide {
    flex: 1.4 1 240px;
    max-width: 320px;
}

.staff-hr-labeled-form .staff-hr-preview-field {
    max-width: 170px;
}

.staff-hr-labeled-form .staff-hr-field label {
    display: block;
    margin-bottom: 6px;
    color: #344054;
    font-size: 0.85rem;
    font-weight: 700;
}

.staff-hr-form-submit {
    display: flex;
    align-items: flex-end;
    min-height: 100%;
}

.staff-hr-quick-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #475467;
    font-size: 0.82rem;
    font-weight: 800;
}

.staff-hr-quick-status[data-status="working"] {
    background: #ecfdf3;
    color: #027a48;
}

.staff-hr-quick-status[data-status="completed"] {
    background: #f2f4f7;
    color: #475467;
}

.staff-hr-filter .form-select,
.staff-hr-filter .form-control,
.staff-hr-quick .form-select,
.staff-hr-inline-form .form-control,
.staff-hr-inline-form .form-select,
.staff-hr-month-filter .form-control {
    max-width: 220px;
}

.staff-hr-labeled-form .form-control,
.staff-hr-labeled-form .form-select {
    max-width: none;
}

.staff-hr-money-input {
    text-align: right;
}

.staff-hr-adjustment-preview {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    color: #027a48;
    font-weight: 800;
    white-space: nowrap;
}

.staff-hr-adjustment-preview.is-negative {
    color: #b42318;
}

.staff-hr-adjustment-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.staff-hr-adjustment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 10px;
    background: #fcfcfd;
}

.staff-hr-adjustment-item strong,
.staff-hr-adjustment-item small {
    display: block;
}

.staff-hr-adjustment-item small {
    margin-top: 4px;
    color: #667085;
}

.staff-hr-adjustment-item form {
    margin: 0;
}

.staff-hr-attendance-table .staff-hr-row {
    grid-template-columns: minmax(170px, 1.2fr) 0.8fr 1fr 0.65fr 0.65fr 0.65fr 0.8fr 1fr 0.65fr;
}

.staff-hr-payroll-table .staff-hr-row {
    grid-template-columns: minmax(180px, 1.25fr) 0.8fr 0.6fr 0.6fr 0.8fr 0.9fr 0.9fr minmax(220px, 1.1fr);
}

.staff-hr-payroll-table.has-hourly .staff-hr-row {
    grid-template-columns: minmax(180px, 1.25fr) 0.8fr 0.6fr 0.6fr 0.65fr 0.8fr 0.9fr 0.9fr minmax(220px, 1.1fr);
}

.staff-hr-month-label {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    background: #f8fafc;
    color: #344054;
    font-size: 0.88rem;
    font-weight: 800;
}

.staff-hr-money {
    color: #111827;
    font-weight: 800;
}

.staff-hr-payroll-actions {
    align-items: center;
}

.staff-hr-action-menu {
    padding: 6px;
    border-radius: 10px;
}

.staff-hr-action-menu form {
    margin: 0;
}

.staff-hr-action-menu .dropdown-item {
    border-radius: 8px;
    padding: 8px 10px;
    color: #344054;
    font-size: 0.86rem;
    font-weight: 700;
}

.staff-hr-action-menu .dropdown-item:hover,
.staff-hr-action-menu .dropdown-item:focus {
    background: #f3f4f6;
    color: #111827;
}

.staff-hr-action-menu .dropdown-item.is-danger {
    color: #b42318;
}

.staff-hr-action-menu .dropdown-item.is-danger:hover,
.staff-hr-action-menu .dropdown-item.is-danger:focus {
    background: #fef3f2;
    color: #912018;
}

.staff-hr-shifts,
.staff-hr-permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.staff-hr-shifts article,
.staff-hr-permission-grid article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
}

.staff-hr-shifts article strong,
.staff-hr-shifts article span,
.staff-hr-shifts article small {
    display: block;
}

.staff-hr-shifts article span,
.staff-hr-shifts article small {
    color: #667085;
}

.staff-hr-permission-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.staff-hr-permissions.expanded {
    margin: 8px 0 0;
}

.staff-hr-empty {
    padding: 28px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #667085;
    text-align: center;
}

.staff-hr-modal {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.staff-hr-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.staff-hr-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.staff-hr-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.staff-hr-field label {
    color: #344054;
    font-size: 0.82rem;
    font-weight: 800;
}

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

.staff-hr-salary-group[hidden] {
    display: none;
}

.staff-hr-advanced {
    grid-column: 1 / -1;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #ffffff;
}

.staff-hr-advanced summary {
    cursor: pointer;
    padding: 10px 12px;
    color: #475467;
    font-size: 0.86rem;
    font-weight: 800;
}

.staff-hr-advanced-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 12px 12px;
}

.staff-hr-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.staff-hr-permission-editor {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
}

.staff-hr-permission-editor label,
.staff-hr-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    font-size: 0.86rem;
    font-weight: 700;
    min-height: 34px;
}

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

.staff-hr-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.staff-hr-detail-grid section {
    padding: 14px;
    border-radius: 12px;
    background: #f8fafc;
}

.staff-hr-detail-grid h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 800;
}

.staff-hr-detail-grid p {
    margin: 0 0 6px;
    color: #475467;
}

@media (max-width: 1100px) {
    .staff-hr-metrics,
    .staff-hr-shifts,
    .staff-hr-permission-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .staff-hr-row,
    .staff-hr-attendance-table .staff-hr-row,
    .staff-hr-payroll-table .staff-hr-row {
        grid-template-columns: 1fr;
    }

    .staff-hr-row-head {
        display: none;
    }
}

@media (max-width: 700px) {
    .staff-hr-header,
    .staff-hr-panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .staff-hr-metrics,
    .staff-hr-shifts,
    .staff-hr-permission-grid,
    .staff-hr-form-grid,
    .staff-hr-salary-group,
    .staff-hr-advanced-grid,
    .staff-hr-permission-editor,
    .staff-hr-detail-grid {
        grid-template-columns: 1fr;
    }
}

.customer-page-heading {
    margin-bottom: 0;
}

.customer-page-alert {
    margin-bottom: 0;
}

.customer-page-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    min-width: 0;
}

.customer-page-sidebar {
    min-width: 0;
}

.customer-page-main {
    min-width: 0;
    display: grid;
    gap: 22px;
}

.customer-summary-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.customer-form-card,
.customer-table-card {
    border-radius: 24px;
}

.customer-toolbar-row {
    margin-bottom: 18px;
}

.customer-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)) auto auto;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.customer-filter-form > * {
    min-width: 0;
    width: 100%;
}

.customer-filter-form .btn {
    width: auto;
    white-space: nowrap;
}

.customer-filter-form .toolbar-search {
    min-width: 0;
}

.customer-table-wrap {
    margin-top: 6px;
    overflow-x: auto;
}

.customer-metric-value {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.45;
}

.customer-metric-number {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(22, 119, 255, 0.1);
    color: var(--crm-primary-dark);
    font-weight: 700;
}

.login-page {
    background: linear-gradient(135deg, #0b4bb3 0%, #1677ff 46%, #37b7ff 100%);
    overflow: hidden;
}

.login-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.18), transparent 24%),
        radial-gradient(circle at 78% 22%, rgba(131, 229, 255, 0.22), transparent 22%),
        radial-gradient(circle at 58% 86%, rgba(255, 255, 255, 0.1), transparent 20%);
}

.login-card {
    overflow: hidden;
}

.login-password-group .form-control {
    border-right: 0;
}

.login-password-toggle {
    min-width: 72px;
    font-weight: 600;
    border-color: var(--crm-border);
    color: #475569;
    background: #fff;
}

.login-password-toggle:hover,
.login-password-toggle:focus {
    color: var(--crm-primary-dark);
    background: #f8fbff;
    border-color: rgba(22, 119, 255, 0.35);
    box-shadow: none;
}

.brand-wordmark {
    width: min(220px, 60vw);
    height: auto;
    display: block;
}

.login-card::before {
    content: "";
    display: block;
    height: 6px;
    background: linear-gradient(90deg, #0e5eff, #38bdf8, #7dd3fc);
}

.crm-note {
    background: rgba(22, 119, 255, 0.08);
    border: 1px solid rgba(22, 119, 255, 0.12);
    border-radius: 16px;
    padding: 14px 16px;
    color: var(--crm-primary-dark);
}

.form-control,
.form-select {
    border-radius: 14px;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    border-color: rgba(22, 119, 255, 0.14);
    font-size: 0.95rem;
    line-height: 1.5;
    letter-spacing: 0;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(22, 119, 255, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(22, 119, 255, 0.14);
}

.btn {
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.005em;
}

.btn-sm {
    font-size: 0.88rem;
}

.btn-lg {
    font-size: 1rem;
}

.badge,
.status-pill,
.products-status-badge,
.products-form-badge {
    line-height: 1.25;
    letter-spacing: 0.02em;
    font-weight: 700;
}

.customer-modal-card,
.products-modal {
    line-height: 1.55;
}

.inventory-adjust-card {
    position: relative;
    height: 100%;
    overflow: visible;
}

.inventory-adjust-header {
    margin-bottom: 18px;
}

.inventory-adjust-form {
    display: grid;
    gap: 16px;
    overflow: visible;
}

.inventory-list-toolbar {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.inventory-search-box {
    min-width: 0;
}

.inventory-search-hint {
    line-height: 1.5;
}

.inventory-row {
    cursor: pointer;
    transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.inventory-row:hover {
    background: rgba(22, 119, 255, 0.05);
    transform: translateX(1px);
}

.inventory-row:focus-visible {
    outline: 2px solid rgba(22, 119, 255, 0.35);
    outline-offset: -2px;
}

.inventory-row.is-selected {
    background: linear-gradient(90deg, rgba(22, 119, 255, 0.12), rgba(22, 119, 255, 0.05));
    box-shadow: inset 4px 0 0 #1677ff;
}

.inventory-row.is-selected td {
    background: transparent;
}

.inventory-stock-cell {
    white-space: nowrap;
}

.inventory-stock-value {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.inventory-stock-cell.is-empty .inventory-stock-value {
    color: #b42318;
    background: rgba(239, 68, 68, 0.08);
}

.inventory-stock-cell.is-negative .inventory-stock-value {
    color: #991b1b;
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.96), rgba(255, 241, 242, 0.98));
    border: 1px solid rgba(239, 68, 68, 0.22);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.08);
    font-size: 1rem;
    font-weight: 800;
}

.inventory-product-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.inventory-meta-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(22, 119, 255, 0.1);
}

.inventory-meta-item span,
.inventory-preview-item span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: var(--crm-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.inventory-meta-item strong,
.inventory-preview-item strong {
    display: block;
    font-size: 1rem;
}

.inventory-meta-status .badge {
    margin-top: 8px;
}

.inventory-adjust-type-grid {
    display: grid;
    gap: 12px;
}

.inventory-adjust-type-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.inventory-adjust-type-option:hover {
    border-color: rgba(22, 119, 255, 0.35);
}

.inventory-adjust-type-option input {
    margin-top: 3px;
    accent-color: #1677ff;
}

.inventory-adjust-type-option strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.98rem;
}

.inventory-adjust-type-option small {
    display: block;
    color: var(--crm-muted);
    line-height: 1.45;
}

.inventory-adjust-type-option:has(input:checked) {
    border-color: rgba(22, 119, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.10);
    background: rgba(22, 119, 255, 0.04);
}

.inventory-adjust-type-option:has(input[value="decrease"]:checked) {
    border-color: rgba(239, 68, 68, 0.42);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    background: rgba(239, 68, 68, 0.04);
}

.inventory-reason-combobox {
    position: relative;
    overflow: visible;
    isolation: isolate;
    z-index: 5;
}

.inventory-reason-input {
    border-color: rgba(148, 163, 184, 0.32);
    box-shadow: none;
}

.inventory-reason-input:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.inventory-reason-input::placeholder {
    color: #94a3b8;
}

.inventory-reason-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1080;
    display: grid;
    gap: 6px;
    padding: 8px;
    min-height: 56px;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(22, 119, 255, 0.14);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(12px);
}

.inventory-reason-empty {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.92);
    color: var(--crm-muted);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
}

.inventory-reason-suggestion {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
    white-space: normal;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.inventory-reason-suggestion:hover,
.inventory-reason-suggestion:focus-visible {
    background: rgba(22, 119, 255, 0.05);
    border-color: rgba(22, 119, 255, 0.16);
    transform: translateY(-1px);
    outline: none;
}

.inventory-preview-box {
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(22, 119, 255, 0.08), rgba(22, 119, 255, 0.03));
    border: 1px solid rgba(22, 119, 255, 0.12);
}

.inventory-preview-box.is-empty {
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.10), rgba(148, 163, 184, 0.04));
    border-color: rgba(148, 163, 184, 0.18);
}

.inventory-preview-box.is-negative {
    border-color: rgba(239, 68, 68, 0.25);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.10), rgba(239, 68, 68, 0.03));
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10);
}

.inventory-preview-box.is-decrease:not(.is-negative) {
    border-color: rgba(245, 158, 11, 0.24);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.09), rgba(245, 158, 11, 0.03));
}

.inventory-preview-head {
    margin-bottom: 14px;
}

.inventory-preview-empty {
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px dashed rgba(148, 163, 184, 0.35);
    color: var(--crm-muted);
    font-weight: 600;
    text-align: center;
}

.inventory-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.inventory-preview-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.inventory-preview-item-result {
    background: rgba(22, 119, 255, 0.12);
    border-color: rgba(22, 119, 255, 0.18);
}

.inventory-preview-box.is-negative .inventory-preview-item-result {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.2);
}

.inventory-preview-alert {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #b42318;
    font-size: 0.92rem;
    line-height: 1.5;
}

.inventory-quick-adjust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.inventory-quantity-input {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.inventory-quick-adjust .btn {
    min-width: 68px;
}

.inventory-history-card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.inventory-history-header {
    margin-bottom: 14px;
}

.inventory-history-list {
    display: grid;
    gap: 12px;
}

.inventory-history-empty {
    padding: 16px;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px dashed rgba(148, 163, 184, 0.28);
    color: var(--crm-muted);
    font-weight: 600;
    text-align: center;
}

.inventory-history-item {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.inventory-history-item--increase {
    border-color: rgba(34, 197, 94, 0.18);
    background: linear-gradient(180deg, rgba(236, 253, 243, 0.92), rgba(248, 250, 252, 0.95));
}

.inventory-history-item--decrease {
    border-color: rgba(245, 158, 11, 0.2);
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.94), rgba(248, 250, 252, 0.95));
}

.inventory-history-item-top,
.inventory-history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.inventory-history-type {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
}

.inventory-history-item--decrease .inventory-history-type {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.inventory-history-time,
.inventory-history-meta,
.inventory-history-note,
.inventory-history-user {
    color: var(--crm-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.inventory-history-quantity {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
}

.inventory-list-card {
    overflow: hidden;
}

.inventory-list-card-body {
    display: grid;
    gap: 18px;
}

.inventory-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.inventory-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inventory-filter-pills > a,
.inventory-filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #dbe3ee;
    background: #fff;
    color: #475569;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.inventory-filter-pills > a:hover,
.inventory-filter-pills > a:focus-visible,
.inventory-filter-pill:hover,
.inventory-filter-pill:focus-visible {
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.2);
    background: #f8fbff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.inventory-filter-pills > a:is(.btn-success, .btn-danger, .btn-warning),
.inventory-filter-pills > a.is-active,
.inventory-filter-pill.is-active {
    color: #fff;
    border-color: #2563eb;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.inventory-search-input,
.inventory-search-box .form-control {
    min-height: 46px;
    border-radius: 12px;
    border-color: #dbe3ee;
    box-shadow: none;
}

.inventory-mobile-list {
    display: none;
}

.inventory-mobile-list-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 0 2px 10px;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.inventory-mobile-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.inventory-mobile-item:last-child {
    border-bottom: 0;
}

.inventory-mobile-item:hover,
.inventory-mobile-item:focus-visible {
    background: rgba(37, 99, 235, 0.04);
    outline: none;
}

.inventory-mobile-item.is-selected {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
}

.inventory-mobile-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.inventory-mobile-thumb {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex: 0 0 42px;
}

.inventory-mobile-item-copy {
    min-width: 0;
}

.inventory-mobile-item-title {
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.inventory-mobile-item-meta {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.4;
}

.inventory-mobile-item-side {
    display: flex;
    justify-content: flex-end;
}

.inventory-stock-badge {
    display: grid;
    justify-items: end;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 14px;
    font-variant-numeric: tabular-nums;
}

.inventory-stock-badge strong {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.2;
}

.inventory-stock-badge span {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

.inventory-stock-badge.is-ok {
    background: #ecfdf3;
}

.inventory-stock-badge.is-ok strong,
.inventory-stock-badge.is-ok span {
    color: #15803d;
}

.inventory-stock-badge.is-low {
    background: #fff7ed;
}

.inventory-stock-badge.is-low strong,
.inventory-stock-badge.is-low span {
    color: #b45309;
}

.inventory-stock-badge.is-out {
    background: #fef2f2;
}

.inventory-stock-badge.is-out strong,
.inventory-stock-badge.is-out span {
    color: #dc2626;
}

.inventory-stock-badge.is-negative {
    background: #fee2e2;
}

.inventory-stock-badge.is-negative strong,
.inventory-stock-badge.is-negative span {
    color: #b91c1c;
}

.inventory-mobile-empty {
    padding: 18px 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    color: #64748b;
    text-align: center;
    font-weight: 600;
}

.inventory-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 14px;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.4;
}

.inventory-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inventory-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 10px;
}

.inventory-legend-dot.is-negative {
    background: #fca5a5;
}

.inventory-legend-dot.is-out {
    background: #dc2626;
}

.inventory-legend-dot.is-low {
    background: #f59e0b;
}

.inventory-legend-dot.is-ok {
    background: #16a34a;
}

.inventory-adjust-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-right: 56px;
}

.inventory-mobile-fab {
    display: none;
}

.pagination-container,
.inventory-pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
    flex-wrap: nowrap;
}

.pagination-btn,
.inventory-pagination-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0f172a;
    flex: 0 0 auto;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pagination-btn:hover,
.inventory-pagination-btn:hover {
    background: #f1f5f9;
}

.pagination-btn.disabled,
.inventory-pagination-btn.disabled,
.pagination-btn:disabled,
.inventory-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info,
.inventory-pagination-info {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    flex: 0 0 auto;
}

.app-modal-close,
.inventory-adjust-close,
.inventory-sheet-close {
  position: absolute;
  top: 16px;
  right: 16px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    display: inline-flex;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 100000 !important;
  }

.inventory-mobile-sheet-overlay {
    display: none;
}

.app-modal-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 99998 !important;
    background: rgba(15, 23, 42, 0.45);
}

.app-modal-panel,
.app-bottom-sheet {
    position: fixed;
    z-index: 99999 !important;
    background: #fff;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
}

.app-bottom-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.inventory-adjust-column .inventory-adjust-card.app-bottom-sheet {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    max-height: none;
    overflow: visible;
    border-radius: 18px;
    padding-bottom: 0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.app-modal-panel {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 560px;
    width: min(560px, calc(100vw - 32px));
    border-radius: 18px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
}

body.app-modal-open {
    overflow: hidden;
    overflow-x: hidden;
}

body.app-modal-open .app-header,
body.app-modal-open .top-nav,
body.app-modal-open .mobile-header,
body.app-modal-open .bottom-nav,
body.app-modal-open .topbar,
body.app-modal-open .crm-topbar,
body.app-modal-open .crm-navbar,
body.app-modal-open .crm-sticky-header,
body.app-modal-open .crm-mobile-nav {
    z-index: 1000 !important;
}

@media (min-width: 769px) {
    .inventory-page-layout {
      display: grid;
      grid-template-columns: minmax(720px, 1fr) 520px;
      gap: 20px;
      align-items: start;
      max-width: 1480px;
      margin: 0 auto;
      padding: 0 24px;
    }

    .inventory-page-layout.row {
      --bs-gutter-x: 0;
      --bs-gutter-y: 0;
    }

    .inventory-page-layout > [class*="col-"] {
      width: auto;
      max-width: none;
      flex: none;
      padding: 0;
    }

    .inventory-page-layout > .inventory-list-section,
    .inventory-list-section {
      min-width: 0;
    }

    .inventory-page-layout > .inventory-adjust-column,
    .inventory-adjust-column {
      width: auto;
      max-width: none;
    }

    .inventory-adjust-panel,
    .inventory-bottom-sheet,
    .app-modal-panel,
    .inventory-adjust-card.app-bottom-sheet,
    body.app-modal-open .inventory-adjust-card.app-bottom-sheet {
      position: sticky !important;
      top: 96px !important;
      right: auto !important;
      bottom: auto !important;
      left: auto !important;
      transform: none !important;
      width: 100% !important;
      max-width: none !important;
      max-height: none !important;
      overflow: visible !important;
      z-index: 1 !important;
      border-radius: 18px !important;
      margin: 0 !important;
      box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
      padding-bottom: 0 !important;
    }

    .inventory-adjust-card.app-bottom-sheet .card-body {
      overflow: visible !important;
      max-height: none !important;
    }

    .inventory-adjust-panel {
      width: 100%;
      position: sticky !important;
      top: 96px !important;
    }

    .app-modal-overlay,
    .inventory-modal-overlay {
      display: none !important;
    }

    .inventory-adjust-close,
    .app-modal-close,
    .inventory-sheet-close {
      display: none !important;
    }

    body.inventory-page .ai-chatbot-button,
    body.inventory-page .chatbot-toggle,
    body.inventory-page .ai-assistant-fab {
      display: none !important;
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .inventory-page-layout {
      grid-template-columns: minmax(0, 1fr);
    }

    .inventory-adjust-panel,
    .inventory-bottom-sheet,
    .app-modal-panel,
    .inventory-adjust-card.app-bottom-sheet,
    body.app-modal-open .inventory-adjust-card.app-bottom-sheet {
      position: static !important;
      margin-top: 20px !important;
      top: auto !important;
    }
}

body.app-modal-open .mobile-fab,
body.app-modal-open .fab-primary,
body.app-modal-open .inventory-fab,
body.app-modal-open .chatbot-toggle,
body.app-modal-open .ai-chatbot-button,
body.app-modal-open .ai-assistant-fab {
    display: none !important;
}

@media (max-width: 768px) {
    .fab-primary,
    .purchase-fab,
    .purchase-return-mobile-fab,
    .products-mobile-fab {
        position: fixed !important;
        right: 18px !important;
        bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        min-height: 46px !important;
        border-radius: 999px !important;
        border: none !important;
        outline: none !important;
        background: #2563eb !important;
        color: #ffffff !important;
        font-size: 26px !important;
        font-weight: 500 !important;
        line-height: 1 !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22) !important;
        z-index: 90 !important;
    }

    .fab-primary svg,
    .purchase-fab svg,
    .products-mobile-fab svg,
    .purchase-return-mobile-fab svg {
        width: 22px !important;
        height: 22px !important;
        font-size: 22px !important;
    }

    .fab-primary:active,
    .purchase-fab:active,
    .purchase-return-mobile-fab:active,
    .products-mobile-fab:active {
        transform: scale(0.96);
    }

    .app-bottom-sheet,
    .inventory-bottom-sheet,
    .inventory-adjust-card.app-bottom-sheet {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        transform: translateY(calc(100% + 32px)) !important;
        border-radius: 20px 20px 0 0;
        max-height: 88dvh;
        overflow-y: auto;
        box-sizing: border-box;
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        z-index: 9999;
    }

    .app-bottom-sheet *,
    .inventory-bottom-sheet * {
        box-sizing: border-box;
    }

    .inventory-adjust-form,
    .inventory-adjust-form input,
    .inventory-adjust-form textarea,
    .inventory-adjust-form select {
        max-width: 100%;
    }

    .inventory-list-card {
        border-radius: 16px;
    }

    .inventory-list-card-body {
        padding: 16px !important;
        gap: 14px;
    }

    .inventory-list-header {
        gap: 12px;
    }

    .inventory-list-header h4 {
        font-size: 1rem;
        margin-bottom: 4px !important;
    }

    .inventory-list-header p,
    .inventory-search-hint {
        font-size: 0.8rem;
        line-height: 1.45;
    }

    .inventory-search-box .form-label {
        display: none;
    }

    .inventory-search-input,
    .inventory-search-box .form-control {
        min-height: 44px;
        font-size: 0.94rem;
    }

    .inventory-mobile-list {
        display: grid;
    }

    .inventory-table-wrap {
        display: none;
    }

    .inventory-mobile-fab {
        position: fixed;
        right: 16px;
        bottom: calc(92px + env(safe-area-inset-bottom, 0px));
        z-index: 1100;
        width: 56px;
        height: 56px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 999px;
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        color: #fff;
        box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
        font-size: 1.8rem;
        line-height: 1;
    }

    .app-modal-overlay[data-inventory-sheet-overlay] {
        display: block;
        backdrop-filter: blur(2px);
    }

    .inventory-adjust-column {
        position: static;
    }

    .inventory-adjust-card.app-bottom-sheet {
        transition: transform 0.24s ease;
        overflow-x: hidden;
        box-shadow: 0 -24px 48px rgba(15, 23, 42, 0.24);
    }

    .inventory-adjust-card.app-bottom-sheet .card-body {
        max-height: none;
        overflow-y: auto;
        padding: 14px 0 0 !important;
        width: 100%;
    }

    .inventory-sheet-close {
        display: inline-flex;
        flex: 0 0 auto;
    }

    body.app-modal-open .inventory-adjust-card.app-bottom-sheet {
        transform: none !important;
    }

    .inventory-adjust-header {
        position: sticky;
        top: 0;
        z-index: 4;
        margin: -14px -16px 16px;
        padding: 14px 16px 12px;
        background: rgba(255, 255, 255, 0.96);
        border-bottom: 1px solid rgba(226, 232, 240, 0.92);
        backdrop-filter: blur(14px);
    }

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

    .inventory-adjust-type-option {
        min-height: 100%;
        padding: 12px;
        border-radius: 14px;
    }

    .inventory-adjust-type-option small {
        font-size: 0.74rem;
    }

    .inventory-product-meta,
    .inventory-preview-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .inventory-quick-adjust {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .inventory-quick-adjust .btn {
        min-width: 0;
        min-height: 40px;
        border-radius: 12px;
        padding-inline: 8px;
        font-size: 0.82rem;
        font-weight: 700;
    }

    .inventory-preview-box,
    .inventory-history-card {
        border-radius: 16px;
    }

    .inventory-history-card {
        margin-bottom: 72px;
    }

    .inventory-adjust-form [data-inventory-submit] {
        position: sticky;
        bottom: 0;
        min-height: 48px;
        border-radius: 14px;
        margin-top: 4px;
        box-shadow: 0 -8px 20px rgba(255, 255, 255, 0.96);
    }

    .inventory-legend {
        margin-bottom: 110px;
    }
}

.btn-success {
    --bs-btn-bg: #2563eb;
    --bs-btn-border-color: #2563eb;
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
    --bs-btn-disabled-bg: #2563eb;
    --bs-btn-disabled-border-color: #2563eb;
}

.btn-outline-success {
    --bs-btn-color: #2563eb;
    --bs-btn-border-color: rgba(148, 163, 184, 0.38);
    --bs-btn-hover-bg: #2563eb;
    --bs-btn-hover-border-color: #2563eb;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #1d4ed8;
    --bs-btn-active-border-color: #1d4ed8;
    --bs-btn-active-color: #fff;
}

.alert-success {
    background: rgba(22, 119, 255, 0.1);
    border-color: rgba(22, 119, 255, 0.16);
    color: var(--crm-primary-dark);
}

.order-item-row {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(22, 119, 255, 0.12) !important;
}

.order-item-summary {
    display: grid;
    gap: 6px;
    color: var(--crm-muted);
    font-size: 0.95rem;
}

.app-footer {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.footer-text {
    width: 100%;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
}

.footer-form {
    max-width: 720px;
}

.sales-page {
    display: grid;
    gap: 20px;
}

.sales-customer-card {
    min-width: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 247, 255, 0.92));
    border: 1px solid rgba(22, 119, 255, 0.14);
    box-shadow: 0 16px 34px rgba(15, 78, 201, 0.08);
}

.sales-customer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 20px;
    align-items: start;
}

.sales-customer-picker {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(170px, 190px) minmax(180px, 220px);
    gap: 16px;
    align-items: start;
}

.sales-customer-control {
    position: relative;
}

.sales-customer-input-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid #d7e0eb;
    border-radius: 14px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sales-customer-input-shell:focus-within {
    border-color: rgba(22, 119, 255, 0.42);
    box-shadow: 0 0 0 0.2rem rgba(22, 119, 255, 0.11);
}

.sales-customer-search-input {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: 0 !important;
    background: transparent !important;
}

.sales-customer-search-input::placeholder {
    color: #64748b;
}

.sales-customer-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #e8f1ff, #f8fbff);
    color: #0f172a;
    font-weight: 700;
    white-space: nowrap;
}

.sales-customer-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-customer-chip-clear {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.sales-customer-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    display: grid;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid rgba(16, 42, 67, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(10px);
}

.sales-customer-option {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    text-align: left;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sales-customer-option:hover,
.sales-customer-option.is-active {
    background: #f4f8ff;
    border-color: rgba(22, 119, 255, 0.18);
    transform: translateY(-1px);
}

.sales-customer-option-name {
    display: block;
    font-weight: 700;
    color: #102a43;
}

.sales-customer-option-meta {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 0.84rem;
}

.sales-customer-actions {
    display: grid;
}

.sales-customer-summary {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(22, 119, 255, 0.12);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(217, 236, 255, 0.5), rgba(255, 255, 255, 0.9));
    transition: background 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease;
}

.sales-customer-summary-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--crm-muted);
}

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

.sales-customer-summary-grid span {
    display: block;
    color: var(--crm-muted);
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.sales-customer-summary-grid strong {
    display: block;
    line-height: 1.4;
    color: var(--crm-text);
    font-weight: 700;
}

.sales-customer-summary-empty {
    color: var(--crm-muted);
}

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

.sales-container,
.sales-pos-layout {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 16px;
    align-items: start;
}

.cart-section,
.product-section,
.sales-cart-card,
.sales-products-card {
    min-width: 0;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.24s ease, box-shadow 0.24s ease, background-color 0.24s ease, transform 0.24s ease;
}

.sales-cart-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(234, 244, 255, 0.94));
    border: 1px solid rgba(22, 119, 255, 0.18);
    box-shadow:
        0 18px 36px rgba(10, 64, 166, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.sales-products-card {
    border: 1px solid rgba(22, 119, 255, 0.12);
    box-shadow: 0 14px 28px rgba(15, 78, 201, 0.08);
}

.sales-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.sales-panel-head h4 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.sales-search {
    width: min(320px, 100%);
}

.sales-search-input {
    min-height: 48px;
    border-radius: 14px;
    border-color: rgba(22, 119, 255, 0.18);
    font-weight: 600;
}

.sales-search-empty {
    margin-top: 14px;
    padding: 16px;
    border: 1px dashed rgba(22, 119, 255, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
}

.product-grid,
.sales-product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 4px;
}

.product-card,
.sales-product-item {
    border: 1px solid rgba(22, 119, 255, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 255, 0.96));
    border-radius: 18px;
    padding: 12px;
    text-align: left;
    display: grid;
    gap: 8px;
    color: var(--crm-text);
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(15, 78, 201, 0.06);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease,
        background-color 0.22s ease;
}

.product-card:hover,
.sales-product-item:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(232, 243, 255, 0.98));
    border-color: rgba(22, 119, 255, 0.35);
    box-shadow: 0 18px 34px rgba(22, 119, 255, 0.14);
    transform: translateY(-3px);
}

.sales-product-item:active {
    transform: translateY(0);
    box-shadow: 0 10px 18px rgba(22, 119, 255, 0.12);
}

.sales-product-item.is-added {
    border-color: rgba(22, 119, 255, 0.55);
    background: linear-gradient(180deg, rgba(224, 239, 255, 0.98), rgba(211, 232, 255, 0.96));
    box-shadow: 0 16px 30px rgba(15, 78, 201, 0.12);
}

.sales-product-add {
    display: none;
}

.sales-product-name {
    font-weight: 700;
}

.sales-product-price {
    display: grid;
    gap: 2px;
    color: var(--crm-primary-dark);
    font-weight: 600;
}

.sales-product-price-line {
    display: block;
}

.sales-product-meta {
    color: var(--crm-muted);
    font-size: 0.88rem;
}

.sales-cart-list {
    display: grid;
    gap: 9px;
    min-height: 160px;
    margin-bottom: 16px;
}

.sales-cart-item {
    border: 1px solid rgba(22, 119, 255, 0.12);
    border-radius: 18px;
    padding: 11px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 247, 255, 0.84));
    display: grid;
    gap: 8px;
    box-shadow: 0 10px 24px rgba(15, 78, 201, 0.06);
    transition: border-color 0.24s ease, box-shadow 0.24s ease, background-color 0.24s ease;
}

.sales-cart-item.is-invalid {
    border-color: rgba(220, 53, 69, 0.25);
}

.sales-cart-main,
.sales-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.sales-cart-meta {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    align-items: center;
}

.sales-summary {
    display: grid;
    gap: 12px;
}

.sales-payment-bar {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(22, 119, 255, 0.1);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.88), rgba(255, 255, 255, 0.78));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.sales-payment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
        "customer paid debt"
        "total total total";
    gap: 10px;
    align-items: stretch;
}

.sales-payment-box {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    padding: 10px 12px;
    min-height: 76px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow:
        0 4px 12px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.78);
    transition: border-color 0.24s ease, box-shadow 0.24s ease, background-color 0.24s ease;
}

.sales-payment-box-customer {
    grid-area: customer;
    min-height: 72px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94));
    padding: 7px 10px;
}

.sales-payment-box-total {
    grid-area: total;
    background:
        linear-gradient(180deg, rgba(241, 247, 255, 0.98), rgba(229, 240, 255, 0.96));
    border-color: rgba(22, 119, 255, 0.28);
    box-shadow:
        0 12px 24px rgba(15, 102, 232, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
    min-height: 94px;
    padding: 13px 15px;
    justify-content: center;
    gap: 5px;
}

.sales-payment-box-total .sales-payment-label {
    color: var(--crm-primary-dark);
}

.sales-payment-box-total .sales-payment-value {
    font-size: clamp(1.95rem, 1.78rem + 0.62vw, 2.2rem);
    color: #0a4db8;
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.sales-payment-box-paid {
    grid-area: paid;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 252, 255, 0.96));
    border-color: rgba(148, 163, 184, 0.18);
    min-height: 72px;
    padding: 10px 12px;
}

.sales-payment-box-debt {
    grid-area: debt;
    background:
        linear-gradient(180deg, rgba(255, 249, 250, 0.98), rgba(255, 243, 244, 0.96));
    border-color: rgba(220, 53, 69, 0.14);
    min-height: 72px;
    padding-top: 9px;
    padding-bottom: 9px;
    box-shadow:
        0 6px 14px rgba(220, 53, 69, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.sales-payment-box-debt .sales-payment-label {
    color: #b42318;
}

.sales-payment-box-debt .sales-payment-value {
    color: #c62828 !important;
    font-size: clamp(1.18rem, 1.06rem + 0.4vw, 1.38rem);
    font-weight: 700;
    line-height: 1.1;
}

.sales-payment-label {
    display: block;
    color: var(--crm-muted);
    font-size: 0.72rem;
    line-height: 1.3;
    margin-bottom: 3px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.sales-payment-value {
    font-size: clamp(0.95rem, 0.9rem + 0.18vw, 1.03rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.sales-paid-input {
    min-height: 42px;
    border-radius: 10px;
    border-color: rgba(22, 119, 255, 0.18);
    background: rgba(255, 255, 255, 0.98);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--crm-text);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sales-paid-input:hover {
    border-color: rgba(22, 119, 255, 0.28);
}

.sales-paid-input:focus {
    border-color: rgba(22, 119, 255, 0.34);
    background: #ffffff;
    box-shadow:
        0 0 0 0.22rem rgba(22, 119, 255, 0.14),
        0 10px 22px rgba(15, 102, 232, 0.08);
}

.sales-payment-box [data-set-paid] {
    min-width: 68px;
    border-radius: 999px;
    font-weight: 700;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.84rem;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        background-color 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease;
}

.sales-payment-shortcuts {
    margin-top: 10px;
}

.sales-payment-box [data-set-paid="full"] {
    color: var(--crm-primary-dark);
    border-color: rgba(22, 119, 255, 0.24);
    background: rgba(22, 119, 255, 0.1);
    box-shadow: 0 8px 18px rgba(15, 102, 232, 0.08);
}

.sales-payment-box [data-set-paid="full"]:hover {
    color: #ffffff;
    background: #1677ff;
    border-color: #1677ff;
    box-shadow: 0 12px 22px rgba(15, 102, 232, 0.16);
    transform: translateY(-1px);
}

.sales-payment-box [data-set-paid="zero"] {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.86);
}

.sales-payment-box [data-set-paid="zero"]:hover {
    border-color: rgba(100, 116, 139, 0.34);
    background: rgba(241, 245, 249, 0.96);
}

.sales-submit-button {
    min-height: 56px;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 16px;
    box-shadow: 0 12px 22px rgba(15, 102, 232, 0.16);
    transition: transform 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease;
}

.sales-submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(15, 102, 232, 0.2);
    filter: saturate(1.04);
}

.sales-submit-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 10px 18px rgba(15, 102, 232, 0.16);
}

.sales-submit-button:disabled {
    box-shadow: none;
}

.sales-summary-input {
    align-items: start;
}

.sales-summary-input .form-control {
    width: 180px;
}

.sales-customer-summary {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid rgba(22, 119, 255, 0.16);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(244, 249, 255, 0.96), rgba(255, 255, 255, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sales-customer-summary.is-selected {
    background:
        linear-gradient(180deg, rgba(232, 244, 255, 0.98), rgba(248, 251, 255, 0.96));
    border-style: solid;
    border-color: rgba(22, 119, 255, 0.28);
    box-shadow: 0 14px 28px rgba(15, 78, 201, 0.1);
}

.sales-customer-summary.is-selected .sales-customer-summary-title {
    color: var(--crm-primary-dark);
}

.sales-paid-controls {
    width: 220px;
    display: grid;
    gap: 8px;
}

.sales-cart-controls {
    display: grid;
    grid-template-columns: minmax(220px, 240px) minmax(150px, 170px) minmax(180px, 200px) minmax(200px, 220px);
    gap: 14px;
    align-items: start;
    min-width: 0;
    overflow: hidden;
}

.sales-qty-control {
    min-width: 0;
}

.sales-cart-controls .input-group,
.sales-qty-group {
    flex-wrap: nowrap;
}

.sales-cart-controls .input-group .form-control,
.sales-qty-input {
    min-width: 96px;
    min-height: 38px;
    padding-inline: 10px;
    text-align: center;
    font-weight: 700;
}

.sales-cart-controls .input-group .btn,
.sales-qty-group .btn {
    flex: 0 0 38px;
    min-height: 38px;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.sales-qty-group {
    width: 100%;
}

.sales-qty-input {
    flex: 1 1 auto;
}

.sales-pricing-switcher {
    min-width: 0;
}

.sales-price-control,
.sales-line-total-wrap,
.sales-line-total-box {
    min-width: 0;
    justify-self: start;
}

.sales-price-control,
.sales-line-total-wrap {
    width: min(100%, 200px);
    max-width: 200px;
}

.sales-price-field {
    min-width: 0;
    width: 100%;
    min-height: 38px;
    height: 38px;
    padding-inline: 10px;
    padding-block: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.98);
    box-sizing: border-box;
    box-shadow: none;
}

.sales-pricing-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.sales-pricing-pill {
    min-height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #ffffff;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.sales-pricing-pill:hover:not(:disabled),
.sales-pricing-pill:focus-visible:not(:disabled) {
    border-color: rgba(22, 119, 255, 0.28);
    color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.sales-pricing-pill.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.sales-pricing-pill:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.sales-empty {
    display: grid;
    place-items: center;
    border: 1px dashed rgba(22, 119, 255, 0.18);
    border-radius: 18px;
    min-height: 160px;
    background: rgba(255, 255, 255, 0.55);
}

.sales-inline-error {
    color: #dc3545;
    font-size: 0.8rem;
    line-height: 1.35;
    margin-top: 4px;
}

.sales-mini-label {
    display: block;
    color: var(--crm-muted);
    font-size: 0.72rem;
    margin-bottom: 4px;
    line-height: 1.2;
}

.sales-line-total-box {
    display: grid;
    align-items: center;
    overflow: hidden;
}

.sales-line-total-box strong {
    display: block;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: var(--crm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-cart-main [data-remove-index] {
    min-height: 32px;
    padding: 0.24rem 0.6rem;
    border-radius: 10px;
    font-size: 0.78rem;
    line-height: 1.1;
}

.sales-search .form-control,
.sales-customer-card .form-control,
.sales-customer-card .form-select,
.sales-payment-box .form-control,
.sales-cart-controls .form-control {
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.sales-search .form-control:focus,
.sales-customer-card .form-control:focus,
.sales-customer-card .form-select:focus,
.sales-payment-box .form-control:focus,
.sales-cart-controls .form-control:focus {
    border-color: rgba(22, 119, 255, 0.32);
    box-shadow: 0 0 0 0.22rem rgba(22, 119, 255, 0.12);
}

@media (max-width: 991px) {
    .admin-kpi-card {
        grid-column: span 6;
    }

    .admin-action-grid,
    .admin-summary-grid {
        grid-template-columns: 1fr;
    }

    .superadmin-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .superadmin-extend-form {
        grid-template-columns: 1fr;
    }

    .superadmin-detail-card {
        grid-template-columns: 1fr 1fr;
    }

    .app-shell-container {
        width: min(100%, calc(100vw - 22px));
    }

    .customer-page {
        gap: 18px;
    }

    .customer-page-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .inventory-product-meta,
    .inventory-preview-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .inventory-quick-adjust {
        gap: 6px;
    }

    .customer-summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-simple-search {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .customer-detail-grid,
    .customer-detail-info,
    .customer-detail-metrics,
    .collection-modal-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-panel {
        align-items: start;
        flex-direction: column;
    }

    .dashboard-chart-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .dashboard-chart-filter-action {
        grid-column: 1 / -1;
    }

    .dashboard-attention-row {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .dashboard-attention-cta {
        min-width: 0;
        width: fit-content;
    }

    .staff-member-item {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .staff-member-main,
    .staff-member-permissions {
        justify-content: flex-start;
    }

    .staff-member-side {
        justify-content: start;
        min-width: 0;
    }

    .staff-member-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .customer-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .products-toolbar {
        align-items: stretch;
    }

    .products-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .products-toolbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .products-form-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .sales-customer-top,
    .sales-customer-picker,
    .sales-container,
    .sales-pos-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-grid,
    .sales-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
    }

    .sales-payment-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "customer"
            "paid"
            "debt"
            "total";
    }
}

@media (max-width: 1280px) {
    .customer-filter-form {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .app-shell-container {
        width: min(100%, calc(100vw - 16px));
    }

    .admin-kpi-grid {
        grid-template-columns: 1fr;
    }

    .admin-kpi-card {
        grid-column: auto;
    }

    .dashboard-chart-card {
        padding: 18px;
    }

    .dashboard-attention-card {
        padding: 18px;
    }

    .dashboard-attention-head {
        align-items: stretch;
    }

    .dashboard-attention-badge {
        justify-self: start;
    }

    .staff-page-heading-compact,
    .staff-member-main,
    .staff-form-actions {
        align-items: start;
        flex-direction: column;
    }

    .staff-owner-row,
    .staff-owner-side,
    .staff-page-actions,
    .staff-summary-bar {
        width: 100%;
    }

    .staff-form-actions > * {
        width: 100%;
    }

    .dashboard-chart-shell {
        min-height: 300px;
    }

    .admin-action-card {
        grid-template-columns: 44px 1fr;
        padding: 18px;
    }

    .admin-action-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .superadmin-page {
        padding: 20px;
    }

    .superadmin-kpi-grid {
        grid-template-columns: 1fr;
    }

    .superadmin-actions {
        justify-content: flex-start;
    }

    .superadmin-detail-card {
        grid-template-columns: 1fr;
    }

    .customer-page {
    }

    .customer-summary-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .customer-filter-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .sales-product-grid {
        grid-template-columns: minmax(0, 1fr);
    }

.products-toolbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .products-import-form {
        width: 100%;
    }

    .products-import-input {
        width: 100%;
        min-width: 0;
    }

    .products-panel-body {
        padding: 18px !important;
    }

    .products-segmented {
        width: 100%;
        justify-content: stretch;
    }

    .products-segment {
        flex: 1 1 0;
        text-align: center;
    }

    .products-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .sales-cart-meta {
        grid-template-columns: minmax(0, 1fr);
    }

    .sales-cart-controls,
    .sales-customer-summary-grid,
    .product-grid,
    .sales-product-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sales-summary-row,
    .sales-cart-main {
        align-items: start;
        flex-direction: column;
    }

    .sales-summary-input .form-control {
        width: 100%;
    }

    .sales-paid-controls {
        width: 100%;
    }
}

@media (max-width: 991.98px) {
    .crm-navbar .navbar-nav {
        gap: 8px;
        align-items: stretch;
        margin-top: 16px;
    }

    .crm-nav-link {
        justify-content: flex-start;
        width: 100%;
    }
}

html, body, button, input, select, textarea, table, th, td, a, span, div, small, strong, label {
  font-family: "Roboto", "Segoe UI", Arial, sans-serif !important;
}

.btn,
.badge,
.nav,
.modal,
.card,
.page,
.content {
  font-family: "Roboto", "Segoe UI", Arial, sans-serif !important;
}

.assistant-page-card {
    display: grid;
    gap: 24px;
}

.assistant-page-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.crm-ai-widget {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 1085;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.crm-ai-widget.is-open .crm-ai-icon-image {
    display: none;
}

.crm-ai-icon-image {
    width: 80px;
    height: 80px;
    display: block;
    border-radius: 50%;
    background: #fff;
    padding: 0;
    object-fit: contain;
    box-shadow: 0 16px 30px rgba(16, 42, 67, 0.18);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    animation: crmAiIconFloat 3s ease-in-out infinite, crmAiIconGlow 3s ease-in-out infinite;
}

.crm-ai-icon-image:hover {
    transform: scale(1.04);
    box-shadow: 0 18px 34px rgba(16, 42, 67, 0.22);
}

@keyframes crmAiIconFloat {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes crmAiIconGlow {
    0% {
        box-shadow: 0 14px 28px rgba(16, 42, 67, 0.16);
    }
    50% {
        box-shadow: 0 24px 40px rgba(16, 42, 67, 0.28);
    }
    100% {
        box-shadow: 0 14px 28px rgba(16, 42, 67, 0.16);
    }
}

.crm-ai-suggestions {
    display: grid;
    gap: 5px;
}

.crm-ai-suggestion {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgba(22, 119, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--crm-primary-dark);
    font-weight: 600;
    font-size: 0.8rem;
    text-align: left;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.crm-ai-suggestion:disabled {
    opacity: 0.6;
    cursor: default;
}

.crm-ai-suggestion:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(22, 119, 255, 0.12);
    border-color: rgba(22, 119, 255, 0.28);
}

.crm-ai-panel {
    width: min(320px, calc(100vw - 24px));
    height: min(460px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(16, 42, 67, 0.08);
    box-shadow: 0 22px 56px rgba(16, 42, 67, 0.22);
    transform-origin: bottom right;
    animation: crmAiPanelIn 0.18s ease-out;
}

.crm-ai-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px 9px;
    background: linear-gradient(135deg, #0f4ec9, #1677ff);
    color: #fff;
}

.crm-ai-panel-heading {
    min-width: 0;
}

.crm-ai-panel-title {
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.1;
}

.crm-ai-panel-meta {
    margin-top: 2px;
    font-size: 0.72rem;
    opacity: 0.82;
}

.crm-ai-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-ai-head-link,
.crm-ai-head-button {
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    text-decoration: none;
    min-width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-weight: 700;
    font-size: 0.76rem;
}

.crm-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px 10px;
    background:
        radial-gradient(circle at top left, rgba(76, 195, 255, 0.08), transparent 35%),
        linear-gradient(180deg, #f7fbff 0%, #edf5ff 100%);
}

.crm-ai-messages::-webkit-scrollbar {
    width: 6px;
}

.crm-ai-messages::-webkit-scrollbar-thumb {
    background: rgba(16, 42, 67, 0.16);
    border-radius: 999px;
}

.crm-ai-messages::-webkit-scrollbar-track {
    background: transparent;
}

.crm-ai-panel-suggestions {
    padding: 6px 10px 0;
}

.crm-ai-message {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.crm-ai-message-user {
    align-items: flex-end;
}

.crm-ai-message-bot {
    align-items: flex-start;
}

.crm-ai-message-bubble {
    max-width: 88%;
    padding: 8px 10px;
    border-radius: 14px;
    white-space: pre-wrap;
    line-height: 1.38;
    font-size: 0.84rem;
    box-shadow: 0 8px 20px rgba(16, 42, 67, 0.06);
}

.crm-ai-message-user .crm-ai-message-bubble {
    background: linear-gradient(135deg, #1677ff, #0f4ec9);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.crm-ai-message-bot .crm-ai-message-bubble {
    background: #fff;
    color: var(--crm-text);
    border: 1px solid rgba(16, 42, 67, 0.08);
    border-bottom-left-radius: 6px;
}

.crm-ai-message-meta {
    margin-top: 3px;
    font-size: 0.72rem;
    color: var(--crm-muted);
}

.crm-ai-message-loading .crm-ai-message-bubble {
    color: var(--crm-muted);
    font-style: italic;
}

.crm-ai-form {
    display: flex;
    gap: 8px;
    padding: 9px 10px 10px;
    background: #fff;
    border-top: 1px solid rgba(16, 42, 67, 0.08);
}

.crm-ai-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(16, 42, 67, 0.12);
    border-radius: 12px;
    padding: 9px 11px;
    outline: none;
    font-size: 0.85rem;
}

.crm-ai-input:focus {
    border-color: rgba(22, 119, 255, 0.48);
    box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.12);
}

.crm-ai-submit {
    border: 0;
    min-width: 56px;
    border-radius: 12px;
    padding: 0 12px;
    background: #1f8b4c;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
}

.crm-ai-submit:disabled {
    opacity: 0.7;
}

/* Haravan-inspired visual refinement: keep layout, polish surface, type and controls */
body {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.98), transparent 38%),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 20%),
        linear-gradient(180deg, #fbfcfe 0%, #f7f9fc 52%, #f4f7fb 100%);
    color: #0f172a;
}

.crm-navbar {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.98), rgba(37, 99, 235, 0.94));
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.14);
}

.crm-card,
.hero-panel,
.customer-modal-card,
.products-modal,
.staff-list-card,
.staff-modal-card,
.admin-table-card,
.customer-table-card,
.superadmin-page,
.dashboard-chart-card,
.dashboard-attention-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    backdrop-filter: none;
}

.hero-panel,
.dashboard-attention-card,
.sales-customer-card,
.sales-summary-card,
.sales-cart-card {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.text-muted,
.metric-label,
.products-page-subtitle,
.products-table-meta,
.products-name-meta,
.metric-foot,
.sales-mini-label,
.sales-payment-label {
    color: #64748b !important;
}

.page-title,
.products-page-title,
.modal-title,
.metric-value,
.customer-summary-name,
.dashboard-attention-title,
.sales-payment-box-total .sales-payment-value {
    color: #0f172a;
    font-weight: 800;
}

.products-name-cell,
.products-price-value,
.inventory-stock-value,
.staff-member-name-inline,
.customer-card-title {
    color: #0f172a;
    font-weight: 800;
}

.products-price-value,
.sales-payment-value,
.metric-value {
    letter-spacing: -0.03em;
}

.crm-table,
.products-table,
.customers-table,
.orders-table {
    background: #ffffff;
}

.crm-table thead th,
.products-table thead th,
.customers-table thead th,
.orders-table thead th {
    color: #64748b;
    font-weight: 800;
    background: #f8fafc;
    border-bottom-color: rgba(203, 213, 225, 0.9);
}

.crm-table tbody tr,
.products-table tbody tr,
.customers-table tbody tr,
.orders-table tbody tr {
    border-color: rgba(226, 232, 240, 0.9);
    transition: background-color 0.16s ease;
}

.crm-table tbody tr:hover td,
.products-table tbody tr:hover td,
.customers-table tbody tr:hover td,
.orders-table tbody tr:hover td {
    background: rgba(37, 99, 235, 0.035);
}

.form-control,
.form-select,
.sales-paid-input {
    background: #ffffff;
    border-color: #dbe3ef;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
    color: #0f172a;
}

.form-control:focus,
.form-select:focus,
.sales-paid-input:focus {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 0.24rem rgba(37, 99, 235, 0.12);
    background: #ffffff;
}

.btn {
    font-weight: 700;
    letter-spacing: 0;
}

.btn-success,
.products-primary-button,
.sales-submit-button {
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
}

.btn-outline-secondary,
.products-secondary-button,
.products-action-button {
    background: #ffffff;
    border-color: rgba(203, 213, 225, 0.95);
    color: #334155;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.btn-outline-secondary:hover,
.products-secondary-button:hover,
.products-action-button:hover {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.55);
    color: #0f172a;
}

.btn-warning,
.products-action-button.is-secondary {
    --bs-btn-bg: #fef3c7;
    --bs-btn-border-color: #fde68a;
    --bs-btn-color: #92400e;
    --bs-btn-hover-bg: #fde68a;
    --bs-btn-hover-border-color: #fcd34d;
    --bs-btn-hover-color: #78350f;
}

.btn-danger,
.products-action-button.is-danger,
.products-action-button.is-subtle-danger {
    --bs-btn-bg: #fee2e2;
    --bs-btn-border-color: #fecaca;
    --bs-btn-color: #b91c1c;
    --bs-btn-hover-bg: #fecaca;
    --bs-btn-hover-border-color: #fca5a5;
    --bs-btn-hover-color: #991b1b;
}

@keyframes crmAiPanelIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .crm-ai-widget {
        left: 16px;
        right: auto;
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
        z-index: 1100;
        align-items: flex-start;
    }

    .crm-ai-panel {
        transform-origin: bottom left;
    }

    .chatbot-toggle,
    .ai-chatbot-button,
    .ai-assistant-fab,
    .crm-ai-icon-image {
        position: fixed !important;
        left: 14px !important;
        right: auto !important;
        bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
        width: 36px !important;
        height: 36px !important;
        border-radius: 50% !important;
        z-index: 85 !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12) !important;
    }

    .crm-ai-panel {
        width: min(320px, calc(100vw - 20px));
        height: min(460px, calc(100vh - 40px));
    }
}

/* Bright SaaS refinement: CSS-only polish, keep layout unchanged */
:root {
    --crm-bg: #f8fbff;
    --crm-surface: #ffffff;
    --crm-text: #0f172a;
    --crm-muted: #66758a;
    --crm-primary: #2563eb;
    --crm-primary-dark: #1d4ed8;
    --crm-primary-soft: #dbeafe;
    --crm-red-soft: #fee2e2;
    --crm-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

body {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.98), transparent 38%),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 22%),
        linear-gradient(180deg, #fbfdff 0%, #f8fbff 56%, #f4f8fd 100%);
    color: var(--crm-text);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.products-page-title,
.modal-title,
.page-title {
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.text-muted,
.metric-label,
.metric-foot,
.products-page-subtitle,
.products-table-meta,
.products-name-meta,
.sales-mini-label,
.sales-payment-label {
    color: var(--crm-muted) !important;
}

.crm-card,
.hero-panel,
.customer-modal-card,
.products-modal,
.staff-list-card,
.staff-modal-card,
.dashboard-chart-card,
.dashboard-attention-card,
.customer-table-card,
.admin-table-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    backdrop-filter: none;
}

.products-name-cell,
.staff-member-name-inline,
.customer-card-title,
.dashboard-attention-title {
    color: #0f172a;
    font-weight: 800;
}

.products-price-value,
.metric-value,
.sales-payment-value,
.sales-payment-box-total .sales-payment-value {
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.crm-table,
.products-table,
.customers-table,
.orders-table {
    background: #ffffff;
}

.crm-table thead th,
.products-table thead th,
.customers-table thead th,
.orders-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 800;
    border-bottom-color: rgba(203, 213, 225, 0.9);
}

.crm-table tbody tr,
.products-table tbody tr,
.customers-table tbody tr,
.orders-table tbody tr {
    border-color: rgba(226, 232, 240, 0.88);
    transition: background-color 0.16s ease;
}

.crm-table tbody tr:hover td,
.products-table tbody tr:hover td,
.customers-table tbody tr:hover td,
.orders-table tbody tr:hover td {
    background: rgba(37, 99, 235, 0.04);
}

.form-control,
.form-select,
.sales-paid-input {
    background: #ffffff;
    border-color: #dbe4f0;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
    color: #0f172a;
}

.form-control:focus,
.form-select:focus,
.sales-paid-input:focus {
    background: #ffffff;
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 0.24rem rgba(37, 99, 235, 0.12);
}

.btn {
    font-weight: 700;
    letter-spacing: 0;
}

.btn-success,
.products-primary-button,
.sales-submit-button {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

.btn-success:hover,
.products-primary-button:hover,
.sales-submit-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    border-color: #1d4ed8;
    color: #ffffff;
}

.btn-outline-secondary,
.products-secondary-button,
.products-action-button {
    background: #ffffff;
    border-color: rgba(203, 213, 225, 0.95);
    color: #334155;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.btn-outline-secondary:hover,
.products-secondary-button:hover,
.products-action-button:hover {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.55);
    color: #0f172a;
}

.btn-warning,
.products-action-button.is-secondary {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
    box-shadow: none;
}

.btn-warning:hover,
.products-action-button.is-secondary:hover {
    background: #fde68a;
    border-color: #fcd34d;
    color: #78350f;
}

.btn-danger,
.btn-outline-danger,
.products-action-button.is-danger,
.products-action-button.is-subtle-danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
    box-shadow: none;
}

.btn-danger:hover,
.btn-outline-danger:hover,
.products-action-button.is-danger:hover,
.products-action-button.is-subtle-danger:hover {
    background: #fecaca;
    border-color: #fca5a5;
    color: #991b1b;
}

.badge,
.status-pill,
.products-status-badge,
.products-form-badge {
    border: 1px solid transparent;
    box-shadow: none;
}

.products-status-badge.is-active,
.status-pill.is-success,
.badge.bg-success {
    background: #e8f7ee !important;
    color: #15803d !important;
    border-color: #bbf7d0 !important;
}

.products-status-badge.is-inactive,
.status-pill.is-danger,
.badge.bg-danger {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #fecaca !important;
}

.crm-activity-dropdown {
    position: relative;
    flex: 0 0 auto;
}

.crm-activity-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 700;
}

.crm-activity-bell:hover,
.crm-activity-bell:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.36);
}

.crm-activity-bell-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.crm-activity-bell-text {
    display: none;
}

.crm-activity-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    padding: 1px 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.35;
}

.crm-activity-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(340px, calc(100vw - 24px));
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
    color: #0f172a;
    z-index: 1055;
    overflow: hidden;
}

.crm-activity-menu-head,
.crm-activity-menu-foot {
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid rgba(226, 232, 240, 0.96);
}

.crm-activity-menu-foot {
    border-top: 1px solid rgba(226, 232, 240, 0.96);
    border-bottom: 0;
    display: flex;
    justify-content: center;
}

.crm-activity-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.crm-activity-menu-title,
.activity-log-title,
.dashboard-recent-activity-title {
    font-weight: 800;
    color: #0f172a;
}

.crm-activity-menu-subtitle,
.crm-activity-item-meta,
.activity-log-message,
.dashboard-recent-activity-message {
    color: #64748b;
    font-size: 0.92rem;
}

.crm-activity-list,
.dashboard-recent-activity-list {
    display: flex;
    flex-direction: column;
}

.crm-activity-item-link {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-decoration: none;
    text-align: left;
}

.crm-activity-item,
.dashboard-recent-activity-item {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: background-color 0.16s ease;
}

.crm-activity-item:last-child,
.dashboard-recent-activity-item:last-child {
    border-bottom: 0;
}

.crm-activity-item.is-unread {
    background: #f8fbff;
}

.crm-activity-item-link:hover .crm-activity-item,
.crm-activity-item-link:focus-visible .crm-activity-item {
    background: #f8fafc;
    cursor: pointer;
}

.crm-activity-item-link:focus-visible {
    outline: none;
}

.crm-activity-item-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.crm-activity-item-icon {
    flex: 0 0 18px;
    width: 18px;
    margin-top: 1px;
    color: #94a3b8;
    font-size: 0.82rem;
    line-height: 1.1;
    text-align: center;
}

.crm-activity-item-content {
    min-width: 0;
    flex: 1 1 auto;
}

.crm-activity-item-title {
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.28;
}

.crm-activity-item-message {
    margin-top: 1px;
    color: #475569;
    font-size: 0.84rem;
    line-height: 1.3;
}

.crm-activity-item-meta {
    margin-top: 3px;
    color: #a0aec0;
    font-size: 0.74rem;
    line-height: 1.2;
}

.crm-activity-empty {
    padding: 16px 12px;
    color: #64748b;
    text-align: center;
    font-size: 0.86rem;
}

.crm-activity-menu-title-compact {
    font-size: 0.95rem;
}

.crm-activity-menu-head > div:not(.crm-activity-menu-title-compact),
.crm-activity-menu-head > .btn {
    display: none;
}

.crm-activity-menu-action,
.crm-activity-menu-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.crm-activity-menu-action:hover,
.crm-activity-menu-action:focus-visible,
.crm-activity-menu-link:hover,
.crm-activity-menu-link:focus-visible {
    color: #1d4ed8;
    text-decoration: underline;
}

.crm-activity-menu-link + .btn {
    display: none;
}

.activity-log-filter {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-log-time-cell {
    min-width: 120px;
    white-space: nowrap;
}

.dashboard-recent-activity-card {
    padding: 12px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    border-radius: 20px;
    max-height: 75vh;
    overflow: hidden;
}

.dashboard-recent-activity-list {
    gap: 14px;
    max-height: calc(75vh - 48px);
    overflow-y: auto;
    padding-right: 6px;
}

.dashboard-recent-activity-list::-webkit-scrollbar {
    width: 6px;
}

.dashboard-recent-activity-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
}

.dashboard-recent-activity-list::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-recent-activity-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.035);
}

.dashboard-recent-activity-item:hover {
    border-color: rgba(37, 99, 235, 0.18);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05);
    transform: translateY(-1px);
}

.dashboard-recent-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: var(--crm-primary);
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 1px;
}

.dashboard-recent-activity-content {
    min-width: 0;
}

.dashboard-recent-activity-title {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.dashboard-recent-activity-message {
    margin-top: 5px;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.45;
}

.dashboard-recent-activity-time {
    color: #94a3b8;
    display: block;
    margin-top: 7px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

.dashboard-recent-activity-empty {
    min-height: 132px;
    place-content: center;
}

.crm-navbar-end {
    flex: 0 0 auto;
    white-space: nowrap;
}

.crm-navbar-user {
    line-height: 1.2;
}

@media (min-width: 992px) {
    .crm-navbar-end {
        gap: 10px !important;
        margin-left: auto;
    }
}

@media (max-width: 1023.98px) {
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-sidebar-column {
        position: static;
    }

    .dashboard-recent-activity-card,
    .dashboard-recent-activity-list {
        max-height: none;
    }

    .dashboard-recent-activity-list {
        overflow-y: visible;
        padding-right: 0;
    }

    .crm-navbar-end {
        align-items: stretch !important;
    }

    .crm-activity-menu {
        right: -70px;
    }
}

@media (max-width: 576px) {
    .dashboard-layout {
        gap: 16px;
    }

    .dashboard-recent-activity-item {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 10px;
    }

    .dashboard-recent-activity-icon {
        width: 28px;
        height: 28px;
        border-radius: 10px;
        font-size: 0.88rem;
    }

    .crm-activity-menu {
        position: fixed;
        top: 78px;
        left: 12px;
        right: 12px;
        width: auto;
    }
}

/* Dashboard layout refinement: preserve existing CRM feel, improve structure and alignment */
.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.dashboard-main,
.dashboard-sidebar {
    min-width: 0;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.dashboard-section {
    margin: 0;
}

.dashboard-attention-card {
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96)),
        radial-gradient(circle at top right, rgba(22, 119, 255, 0.06), transparent 30%);
}

.dashboard-attention-badge {
    min-width: 84px;
    padding: 9px 12px;
    border-radius: 16px;
}

.dashboard-attention-list {
    gap: 12px;
}

.dashboard-attention-row {
    grid-template-columns: minmax(106px, 124px) minmax(0, 1fr) auto;
    gap: 14px;
    min-height: 84px;
    padding: 14px 16px;
    border-radius: 18px;
}

.dashboard-attention-title {
    font-size: 0.96rem;
}

.dashboard-attention-meta {
    font-size: 0.86rem;
}

.dashboard-attention-cta {
    min-width: 82px;
    min-height: 36px;
    font-size: 0.82rem;
}

.dashboard-chart-card {
    padding: 24px;
}

.dashboard-chart-head {
    margin-bottom: 20px;
}

.dashboard-chart-filter {
    grid-template-columns: minmax(108px, 140px) minmax(108px, 140px) auto;
    gap: 10px;
}

.dashboard-chart-shell {
    min-height: 380px;
}

.dashboard-chart-shell canvas,
.dashboard-chart-shell > canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
}

.dashboard-sidebar {
    min-width: 0;
}

.activity-card {
    position: sticky;
    top: 96px;
    padding: 14px 12px 12px;
    max-height: 70vh;
    overflow: hidden;
}

.dashboard-sidebar-head {
    align-items: flex-start;
    margin-bottom: 14px;
    padding-inline: 2px;
}

.dashboard-sidebar-head .text-muted {
    font-size: 0.82rem;
}

.dashboard-sidebar-link {
    align-self: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.dashboard-recent-activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(70vh - 56px);
    overflow-y: auto;
    padding-right: 4px;
}

.dashboard-recent-activity-list::-webkit-scrollbar {
    width: 6px;
}

.dashboard-recent-activity-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
}

.dashboard-recent-activity-list::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-recent-activity-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease;
}

.dashboard-recent-activity-item:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.16);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05);
}

.dashboard-recent-activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 1px;
}

.dashboard-recent-activity-title {
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.32;
}

.dashboard-recent-activity-message {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.81rem;
    line-height: 1.42;
}

.dashboard-recent-activity-time {
    display: block;
    margin-top: 7px;
    color: #97a6ba;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.2;
}

@media (max-width: 1199.98px) {
    .dashboard-attention-row {
        grid-template-columns: minmax(92px, 110px) minmax(0, 1fr) auto;
    }
}

@media (max-width: 1023.98px) {
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .activity-card {
        position: static;
        max-height: none;
    }

    .dashboard-recent-activity-list {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}

@media (max-width: 767.98px) {
    .dashboard-content {
        gap: 20px;
    }

    .dashboard-attention-card,
    .dashboard-chart-card {
        padding: 20px;
    }

    .dashboard-chart-head {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-attention-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .dashboard-attention-cta {
        justify-self: start;
    }

    .dashboard-chart-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-chart-filter-action {
        grid-column: 1 / -1;
    }
}

@media (max-width: 479.98px) {
    .dashboard-layout {
        gap: 18px;
    }

    .dashboard-recent-activity-item {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 10px;
    }

    .dashboard-recent-activity-icon {
        width: 28px;
        height: 28px;
        font-size: 0.84rem;
    }
}

/* Dashboard hard reset: enforce correct 2-column SaaS layout */
.dashboard-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 320px !important;
    gap: 24px !important;
    align-items: start !important;
}

.dashboard-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    min-width: 0 !important;
}

.dashboard-sidebar {
    min-width: 0 !important;
}

.dashboard-section,
.hero-panel.dashboard-section,
.dashboard-attention-card.dashboard-section,
.dashboard-chart-card.dashboard-section,
.business-summary-card.dashboard-section {
    margin: 0 !important;
    width: 100% !important;
}

.dashboard-attention-card,
.dashboard-chart-card,
.activity-card {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid #dbe4f0 !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
}

.activity-card {
    position: sticky !important;
    top: 96px !important;
    max-height: 70vh !important;
    overflow: hidden !important;
}

.dashboard-recent-activity-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    max-height: calc(70vh - 56px) !important;
    overflow-y: auto !important;
}

@media (max-width: 1023.98px) {
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .activity-card {
        position: static !important;
        max-height: none !important;
    }

    .dashboard-recent-activity-list {
        max-height: none !important;
        overflow-y: visible !important;
    }
}

@media (max-width: 767.98px) {
}

.business-summary-card {
    display: block !important;
    width: 100% !important;
    background: #fff !important;
    background-image: none !important;
    border: 1px solid #dfe7f3 !important;
    border-radius: 22px !important;
    padding: 22px !important;
    box-shadow: 0 10px 30px rgba(31, 74, 135, 0.05) !important;
    overflow: hidden !important;
}

.business-summary-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 16px !important;
    margin-bottom: 18px !important;
}

.business-summary-heading h2 {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #15233c !important;
}

.business-summary-heading p {
    margin: 6px 0 0 !important;
    font-size: 14px !important;
    color: #71819a !important;
}

.business-summary-tabs {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 4px !important;
    background: #f4f7fc !important;
    border: 1px solid #dfe7f3 !important;
    border-radius: 14px !important;
    flex-wrap: wrap !important;
}

.business-summary-card .summary-tab {
    appearance: none !important;
    border: 0 !important;
    background: transparent !important;
    color: #49617f !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    box-shadow: none !important;
    outline: none !important;
    min-width: 0 !important;
}

.business-summary-card .summary-tab.active {
    background: linear-gradient(135deg, #2f6df6, #2b84ff) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(47, 109, 246, 0.24) !important;
}

.business-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    align-items: stretch !important;
}

.business-summary-grid .stat-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 160px !important;
    background: #fff !important;
    background-image: none !important;
    border: 1px solid #e5edf7 !important;
    border-radius: 18px !important;
    padding: 20px !important;
    box-shadow: none !important;
}

.business-summary-grid .stat-label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #5f7391 !important;
}

.business-summary-grid .stat-value {
    display: block !important;
    margin-top: 10px !important;
    font-size: clamp(34px, 3vw, 56px) !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    color: #0f1f3d !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-variant-numeric: tabular-nums !important;
}

.business-summary-grid .stat-value[data-size="medium"] {
    font-size: clamp(30px, 2.7vw, 48px) !important;
}

.business-summary-grid .stat-value[data-size="small"] {
    font-size: clamp(26px, 2.35vw, 42px) !important;
    letter-spacing: -0.025em !important;
}

.business-summary-grid .stat-value[data-size="xsmall"] {
    font-size: clamp(22px, 2vw, 36px) !important;
    letter-spacing: -0.02em !important;
}

.business-summary-grid .stat-value[data-wrap="true"] {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    line-height: 1.08 !important;
}

.business-summary-grid .stat-help {
    display: block !important;
    margin-top: 12px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #6f819a !important;
}

@media (max-width: 1200px) {
    .business-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .business-summary-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .business-summary-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Dashboard UX refactor */
.dashboard-page {
    width: min(1200px, 100%);
    margin-right: auto;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 4px;
}

.dashboard-page .dashboard-section {
    margin: 0 !important;
}

.dashboard-page .crm-card,
.dashboard-page .dashboard-hero,
.dashboard-page .dashboard-kpi-card,
.dashboard-page .activity-card {
    border-radius: 12px !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05) !important;
}

.dashboard-page .dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #ffffff;
}

.dashboard-hero-copy {
    min-width: 0;
}

.dashboard-hero-kicker,
.dashboard-section-kicker {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-hero-title,
.dashboard-section-title {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.dashboard-section-note {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 0.92rem;
}

.dashboard-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-hero-btn {
    min-height: 36px;
    padding-inline: 14px;
    border-radius: 10px;
    font-weight: 700;
}

.dashboard-kpi {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    align-items: stretch !important;
}

.dashboard-kpi-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 150px;
    padding: 20px;
    background: #ffffff;
    width: 100% !important;
    max-width: none !important;
}

.dashboard-kpi-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dashboard-page .dashboard-kpi-value {
    margin-top: 12px;
    color: #0f172a;
    font-size: clamp(2rem, 3vw, 2.75rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.dashboard-page .dashboard-kpi-value[data-size="medium"] {
    font-size: clamp(1.8rem, 2.6vw, 2.35rem);
}

.dashboard-page .dashboard-kpi-value[data-size="small"] {
    font-size: clamp(1.55rem, 2.2vw, 2rem);
}

.dashboard-page .dashboard-kpi-value[data-size="xsmall"] {
    font-size: clamp(1.3rem, 1.8vw, 1.7rem);
}

.dashboard-kpi-help {
    margin-top: auto;
    padding-top: 12px;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.45;
}

.dashboard-page .dashboard-attention-card,
.dashboard-page .dashboard-chart-card,
.dashboard-page .activity-card {
    padding: 22px !important;
    background: #ffffff !important;
}

.dashboard-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-section-badge {
    min-width: 92px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    text-align: center;
}

.dashboard-section-badge span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dashboard-section-badge strong {
    display: block;
    margin-top: 4px;
    font-size: 1.3rem;
    font-weight: 800;
}

.dashboard-section-badge.is-empty {
    opacity: 0.72;
}

.dashboard-page .dashboard-attention-list {
    gap: 14px;
}

.dashboard-page .dashboard-attention-row {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 16px;
    min-height: 92px;
    padding: 20px 20px;
    border-radius: 12px;
}

.dashboard-attention-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.dashboard-page .dashboard-attention-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1rem;
}

.dashboard-page .dashboard-attention-title {
    font-size: 1rem;
    line-height: 1.45;
}

.dashboard-page .dashboard-attention-meta {
    font-size: 0.9rem;
    line-height: 1.5;
}

.dashboard-page .dashboard-attention-cta {
    min-width: 96px;
    min-height: 40px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
}

.dashboard-page .dashboard-attention-row:hover,
.dashboard-page .dashboard-attention-row:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.dashboard-main-column,
.dashboard-sidebar-column,
.dashboard-chart-heading,
.dashboard-chart-controls {
    min-width: 0;
}

.dashboard-page .dashboard-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-page .dashboard-chart-tabs {
    background: #f8fafc !important;
    border-radius: 12px !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    padding: 4px !important;
}

.dashboard-page .dashboard-chart-tabs .summary-tab {
    padding: 8px 14px !important;
    border-radius: 8px !important;
    font-size: 0.84rem !important;
}

.dashboard-page .dashboard-chart-filter {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-page .dashboard-chart-filter > div {
    min-width: 120px;
}

.dashboard-page .dashboard-chart-filter-action {
    min-width: auto;
}

.dashboard-page .dashboard-chart-shell {
    min-height: 320px;
    height: 320px;
    width: 100%;
}

.dashboard-page .dashboard-chart-shell canvas {
    width: 100% !important;
    height: 100% !important;
}

.dashboard-page .activity-card {
    position: sticky !important;
    top: 96px !important;
    width: 100%;
    max-height: 520px !important;
    overflow: hidden !important;
}

.dashboard-page .dashboard-sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-sidebar-link {
    color: #2563eb;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-sidebar-link:hover,
.dashboard-sidebar-link:focus-visible {
    color: #1d4ed8;
    text-decoration: underline;
}

.dashboard-page .dashboard-recent-activity-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    max-height: 420px !important;
    overflow-y: auto !important;
    padding-right: 4px;
}

.dashboard-page .dashboard-recent-activity-item {
    border-radius: 12px !important;
    padding: 14px !important;
    box-shadow: none !important;
}

.dashboard-page .dashboard-recent-activity-title {
    font-size: 0.9rem;
}

.dashboard-page .dashboard-recent-activity-message {
    font-size: 0.82rem;
}

.dashboard-page .dashboard-recent-activity-time {
    font-size: 0.74rem;
}

@media (max-width: 1199.98px) {
    .dashboard-kpi {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 991.98px) {
    .dashboard-page {
        margin-left: 0;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-page .activity-card {
        position: static !important;
        max-height: none !important;
    }

    .dashboard-page .dashboard-recent-activity-list {
        max-height: 320px !important;
    }
}

@media (max-width: 767.98px) {
    .dashboard-page {
        gap: 20px;
    }

    .dashboard-page .dashboard-hero,
    .dashboard-page .dashboard-attention-card,
    .dashboard-page .dashboard-chart-card,
    .dashboard-page .activity-card {
        padding: 16px !important;
    }

    .dashboard-page .dashboard-hero,
    .dashboard-section-head,
    .dashboard-page .dashboard-chart-head {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-kpi {
        grid-template-columns: 1fr !important;
    }

    .dashboard-page .dashboard-attention-row {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .dashboard-page .dashboard-attention-cta {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .dashboard-page .dashboard-chart-filter {
        flex-wrap: wrap;
    }

    .dashboard-page .dashboard-chart-filter > div {
        flex: 1 1 140px;
    }
}

/* KiotViet-like dashboard refactor */
.app-main-shell:has(.kv-dashboard) {
    padding-top: 4px;
}

.kv-dashboard {
    width: min(1300px, 100%);
    margin: 0 auto;
    padding: 16px 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
    gap: 16px;
}

.kv-dashboard-main,
.kv-dashboard-sidebar {
    min-width: 0;
}

.kv-dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kv-dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kv-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
    padding: 16px 18px;
    border: 0;
    min-width: 0;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.kv-card:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.kv-card-head,
.kv-chart-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.kv-card-kicker {
    color: #8a94a6;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kv-card-title {
    margin: 4px 0 0;
    color: #1f2937;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.3;
}

.kv-sales-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 14px;
    align-items: center;
}

.kv-sales-metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding-right: 8px;
}

.kv-sales-metric + .kv-sales-metric {
    border-left: 1px solid rgba(226, 232, 240, 0.9);
    padding-left: 18px;
}

.kv-sales-label {
    color: #8c8c8c;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
}

.kv-sales-value {
    margin-top: 8px;
    color: #111827;
    font-size: clamp(1.65rem, 2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.kv-sales-value[data-size="medium"] {
    font-size: clamp(1.35rem, 1.8vw, 1.6rem);
}

.kv-sales-value[data-size="small"] {
    font-size: clamp(1.18rem, 1.55vw, 1.38rem);
}

.kv-sales-value[data-size="xsmall"] {
    font-size: clamp(1.02rem, 1.35vw, 1.2rem);
}

.kv-chart-total {
    margin-top: 0;
    color: #1d4ed8;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.revenue-analysis-card {
    display: flex;
    flex-direction: column;
}

.revenue-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 20px;
}

.revenue-card-left {
    flex: 1;
    min-width: 0;
}

.revenue-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1f2a44;
}

.revenue-net-label {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1f2a44;
}

.revenue-net-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #2563eb;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.revenue-card-filters {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    margin: 0;
}

.revenue-card-filters select {
    width: 180px;
    min-width: 180px;
    height: 44px;
    border-radius: 10px;
    border-color: #e5e7eb;
    box-shadow: none;
    font-size: 0.9rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    flex: 0 0 auto;
}

.revenue-card-filters button {
    height: 44px;
    min-width: 150px;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 10px;
    padding: 0 20px;
}

.revenue-tabs {
    margin-bottom: 16px;
}

.revenue-chart-wrap {
    margin-top: 0;
}

.kv-toolbar-btn {
    height: 36px;
    border-radius: 8px;
    padding-inline: 12px;
    font-size: 0.82rem;
    font-weight: 700;
}

.kv-chart-tabs {
    display: inline-flex;
    gap: 8px;
    margin-top: 14px;
    margin-bottom: 14px;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 8px;
}

.kv-chart-tab {
    border: 0;
    background: transparent;
    color: #6b7280;
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.kv-chart-tab.is-active {
    background: #dbeafe;
    color: #1d4ed8;
    box-shadow: none;
}

.kv-chart-empty {
    margin-bottom: 14px;
    border: 0;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
}

.kv-chart-shell {
    height: 310px;
    min-height: 310px;
    width: 100%;
    padding-top: 6px;
    padding-bottom: 4px;
}

.kv-chart-shell canvas {
    width: 100% !important;
    height: 100% !important;
}

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

.kv-card-filter {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.74rem;
    font-weight: 700;
}

.kv-empty-state {
    display: grid;
    gap: 6px;
    min-height: 180px;
    place-content: center;
    border-radius: 8px;
    background: linear-gradient(180deg, #fbfcfd 0%, #f7f9fc 100%);
    text-align: center;
    padding: 16px;
}

.kv-empty-icon {
    width: 34px;
    height: 34px;
    margin: 0 auto 4px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #eef2f7;
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.kv-empty-state-compact {
    min-height: 0;
    place-content: start;
    text-align: left;
    padding: 14px 0 0;
    background: transparent;
}

.kv-empty-title {
    color: #1f2937;
    font-size: 0.92rem;
    font-weight: 700;
}

.kv-empty-copy {
    color: #9aa3b2;
    font-size: 0.82rem;
    line-height: 1.5;
}

.kv-top-list {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
}

.kv-top-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.kv-top-item:first-child {
    padding-top: 4px;
}

.kv-top-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.kv-top-rank {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.kv-top-content {
    min-width: 0;
}

.kv-top-name {
    color: #1f2937;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

.kv-top-meta {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 0.78rem;
    line-height: 1.4;
}

.kv-top-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 3px;
    min-width: 92px;
}

.kv-top-metric strong {
    color: #111827;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.kv-top-metric small {
    color: #94a3b8;
    font-size: 0.76rem;
    line-height: 1.35;
}

.kv-side-card {
    padding: 16px 18px;
}

.kv-action-list,
.kv-alert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.kv-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: #f8fafc;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.16s ease, transform 0.16s ease;
}

.kv-action-item:hover,
.kv-action-item:focus-visible {
    background: #eff6ff;
    transform: translateY(-1px);
}

.kv-action-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.86rem;
    font-weight: 800;
    flex: 0 0 auto;
}

.kv-action-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.kv-action-text strong {
    color: #1f2937;
    font-size: 0.84rem;
    font-weight: 700;
}

.kv-action-text small {
    color: #8a94a6;
    font-size: 0.76rem;
    line-height: 1.4;
}

.kv-alert-summary {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    margin-top: 12px;
    padding: 11px;
    border-radius: 8px;
    background: #fffdf3;
}

.kv-alert-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fdf0bf;
    color: #b45309;
    font-size: 1rem;
    font-weight: 800;
}

.kv-alert-title {
    color: #1f2937;
    font-size: 0.88rem;
    font-weight: 700;
}

.kv-alert-copy {
    margin-top: 4px;
    color: #8a94a6;
    font-size: 0.8rem;
    line-height: 1.45;
}

.kv-alert-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.kv-alert-item.is-danger {
    background: #fdf5f5;
}

.kv-alert-item.is-warn {
    background: #fffdf4;
}

.kv-alert-item.is-info {
    background: #f4f8ff;
}

.kv-alert-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    color: #475467;
    font-size: 0.8rem;
    font-weight: 800;
}

.kv-alert-content {
    display: grid;
    gap: 2px;
}

.kv-alert-content strong {
    color: #1f2937;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.4;
}

.kv-alert-content small {
    color: #8a94a6;
    font-size: 0.78rem;
    line-height: 1.45;
}

.kv-side-link {
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.kv-side-link:hover,
.kv-side-link:focus-visible {
    text-decoration: underline;
}

.kv-activity-card {
    min-height: 0;
}

.kv-activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.kv-activity-list::-webkit-scrollbar {
    width: 6px;
}

.kv-activity-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
}

.kv-activity-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: #f8fafc;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.kv-activity-item.is-clickable {
    cursor: pointer;
}

.kv-activity-item.is-clickable:hover,
.kv-activity-item.is-clickable:focus-visible {
    background: #eef6ff;
    box-shadow: 0 0 0 1px rgba(44, 123, 229, 0.14);
    outline: none;
}

.kv-activity-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 800;
}

.kv-activity-content {
    min-width: 0;
}

.kv-activity-title {
    color: #1f2937;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.4;
}

.kv-activity-message {
    margin-top: 3px;
    color: #667085;
    font-size: 0.8rem;
    line-height: 1.45;
}

.kv-activity-time {
    display: block;
    margin-top: 6px;
    color: #b0b8c5;
    font-size: 0.7rem;
    font-weight: 600;
}

.kv-order-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.42);
}

.kv-order-modal[hidden] {
    display: none;
}

.kv-order-modal-card {
    width: min(600px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.kv-order-modal-head,
.kv-order-modal-foot {
    padding: 20px;
}

.kv-order-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #eef2f7;
}

.kv-order-modal-kicker {
    color: #667085;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.kv-order-modal-title {
    margin: 3px 0 0;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 800;
}

.kv-order-modal-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    font-size: 1.35rem;
    line-height: 1;
}

.kv-order-modal-close:hover,
.kv-order-modal-close:focus-visible {
    background: #e5e7eb;
    outline: none;
}

.kv-order-modal-body {
    min-height: 180px;
    overflow-y: auto;
    padding: 20px;
}

.kv-order-modal-loading,
.kv-order-modal-error,
.kv-order-modal-empty {
    color: #667085;
    font-size: 0.92rem;
}

.kv-order-modal-error {
    border-radius: 8px;
    padding: 12px;
    background: #fff1f2;
    color: #be123c;
}

.kv-order-modal-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.kv-order-modal-summary > div {
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.kv-order-modal-summary span,
.kv-order-modal-item span,
.kv-order-modal-total span {
    display: block;
    color: #667085;
    font-size: 0.78rem;
}

.kv-order-modal-summary strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 0.95rem;
}

.kv-order-modal-items {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #eef2f7;
    border-radius: 10px;
}

.kv-order-modal-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 12px;
    border-bottom: 1px solid #eef2f7;
}

.kv-order-modal-item:last-child {
    border-bottom: 0;
}

.kv-order-modal-item strong {
    color: #111827;
    font-size: 0.92rem;
}

.kv-order-modal-price {
    text-align: right;
    white-space: nowrap;
}

.kv-order-modal-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
}

.kv-order-modal-total strong {
    color: #111827;
    font-size: 1.2rem;
    font-weight: 800;
}

.kv-order-modal-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #eef2f7;
}

@media (max-width: 1100px) {
    .kv-dashboard {
        grid-template-columns: minmax(0, 1fr);
    }

    .kv-top-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .kv-dashboard {
        gap: 16px;
        padding-top: 12px;
    }

    .kv-card,
    .kv-side-card {
        padding: 16px;
    }

    .kv-card-head,
    .kv-chart-top {
        flex-direction: column;
        align-items: stretch;
    }

    .kv-sales-grid {
        grid-template-columns: 1fr;
    }

    .kv-sales-metric + .kv-sales-metric {
        border-left: 0;
        border-top: 1px solid rgba(226, 232, 240, 0.9);
        padding-left: 0;
        padding-top: 16px;
    }

    .revenue-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 16px;
    }

    .revenue-card-filters {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .revenue-card-filters select {
        width: auto;
        min-width: 160px;
    }

    .kv-top-item {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .kv-top-metric {
        grid-column: 2;
        align-items: flex-start;
        text-align: left;
        min-width: 0;
    }

    .kv-chart-tabs {
        overflow-x: auto;
    }
}

.cashbook-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cashbook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 4px;
    margin-bottom: 2px;
}

.cashbook-title {
    margin: 0;
    color: #132238;
    font-size: clamp(1.5rem, 2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.cashbook-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.cashbook-btn-primary,
.cashbook-btn-secondary {
    min-height: 40px;
    padding-inline: 14px;
    border-radius: 10px;
    font-weight: 600;
}

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

.cashbook-kpi-card {
    border-radius: 12px;
    padding: 22px 22px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.85);
}

.cashbook-kpi-label {
    color: #8492a6;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.cashbook-kpi-value {
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: #172033;
}

.cashbook-kpi-note {
    margin-top: 10px;
    color: #94a3b8;
    font-size: 0.82rem;
    line-height: 1.45;
}

.cashbook-kpi-card.is-opening .cashbook-kpi-value {
    color: #1e293b;
}

.cashbook-kpi-card.is-receipt .cashbook-kpi-value {
    color: #15803d;
}

.cashbook-kpi-card.is-payment .cashbook-kpi-value {
    color: #dc2626;
}

.cashbook-kpi-card.is-closing .cashbook-kpi-value {
    color: #1d4ed8;
    font-size: clamp(1.65rem, 2.3vw, 2.15rem);
}

.cashbook-filter-card,
.cashbook-table-card {
    border-radius: 12px;
    overflow: hidden;
}

.cashbook-section-head,
.cashbook-table-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.cashbook-table-head {
    padding: 22px 24px 0;
}

.cashbook-section-title {
    margin: 0;
    color: #132238;
    font-size: 1.06rem;
    font-weight: 800;
}

.cashbook-section-note {
    margin-top: 5px;
    color: #7c8798;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cashbook-filter-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cashbook-filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
}

.cashbook-filter-field {
    min-width: 0;
}

.cashbook-filter-field.is-search {
    grid-column: span 2;
}

.cashbook-filter-form .form-label {
    margin-bottom: 7px;
    color: #7c8798;
    font-size: 0.78rem;
    font-weight: 600;
}

.cashbook-filter-form .form-control,
.cashbook-filter-form .form-select {
    min-height: 44px;
    border-radius: 12px;
    border-color: #e7edf5;
    box-shadow: none;
    background: #fff;
}

.cashbook-filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cashbook-table-wrap {
    padding: 0 12px 12px;
}

.cashbook-table {
    min-width: 1120px;
}

.cashbook-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    padding: 14px 16px;
}

.cashbook-table tbody td {
    padding: 16px;
    vertical-align: middle;
}

.cashbook-table tbody tr {
    transition: background-color 0.16s ease;
}

.cashbook-table tbody tr:hover td {
    background: #fbfdff;
}

.cashbook-code {
    color: #132238;
    font-weight: 800;
}

.cashbook-type,
.cashbook-time,
.cashbook-party-type,
.cashbook-note {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.45;
}

.cashbook-date,
.cashbook-party,
.cashbook-desc {
    color: #1e293b;
    font-weight: 600;
}

.cashbook-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.77rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.cashbook-badge.is-sale,
.cashbook-badge.is-other-receipt {
    color: #166534;
    background: #dcfce7;
}

.cashbook-badge.is-customer-debt-collection {
    color: #1d4ed8;
    background: #dbeafe;
}

.cashbook-badge.is-purchase,
.cashbook-badge.is-other-payment {
    color: #b45309;
    background: #fef3c7;
}

.cashbook-badge.is-supplier-payment {
    color: #b91c1c;
    background: #fee2e2;
}

.cashbook-money {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.cashbook-money.is-receipt {
    color: #15803d;
}

.cashbook-money.is-payment {
    color: #dc2626;
}

.cashbook-money.is-balance {
    color: #0f172a;
    font-weight: 800;
}

.cashbook-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.cashbook-action-link {
    color: #2563eb;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.cashbook-action-link:hover,
.cashbook-action-link:focus-visible {
    color: #1d4ed8;
    text-decoration: underline;
}

.cashbook-empty-state {
    display: grid;
    place-items: center;
    text-align: center;
    gap: 10px;
    padding: 42px 24px 48px;
    min-height: 320px;
    background: linear-gradient(180deg, #fcfdff 0%, #f7faff 100%);
}

.cashbook-empty-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    color: #2563eb;
    font-size: 1.8rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.cashbook-empty-title {
    color: #132238;
    font-size: 1.12rem;
    font-weight: 800;
}

.cashbook-empty-copy {
    max-width: 420px;
    color: #7c8798;
    line-height: 1.6;
}

.cashbook-empty-subcopy {
    max-width: 460px;
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.6;
}

.cashbook-empty-actions {
    margin-top: 6px;
}

.cashbook-empty-btn {
    min-height: 46px;
    padding-inline: 20px;
    border-radius: 12px;
    font-weight: 700;
}

.cashbook-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(3px);
}

.cashbook-modal[hidden] {
    display: none !important;
}

.cashbook-modal.is-open {
    display: grid;
}

.cashbook-modal-card {
    width: min(640px, 100%);
    max-height: min(88vh, 860px);
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.22);
    padding: 22px 22px 20px;
}

.cashbook-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.cashbook-modal-title {
    margin: 0;
    color: #132238;
    font-size: 1.18rem;
    font-weight: 800;
}

.cashbook-modal-note {
    margin: 6px 0 0;
    color: #7c8798;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cashbook-modal-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    font-size: 1.4rem;
    line-height: 1;
    flex: 0 0 auto;
}

.cashbook-modal-form .form-control,
.cashbook-modal-form .form-select {
    min-height: 44px;
    border-radius: 12px;
    border-color: #e7edf5;
    box-shadow: none;
}

.cashbook-modal-form textarea.form-control {
    min-height: 112px;
}

.cashbook-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

@media (max-width: 1199.98px) {
    .cashbook-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .cashbook-filter-field.is-search {
        grid-column: span 3;
    }
}

@media (max-width: 767.98px) {
    .cashbook-page {
        gap: 16px;
    }

    .cashbook-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 0;
    }

    .cashbook-header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .cashbook-header-actions .btn {
        flex: 1 1 180px;
    }

    .cashbook-kpi-grid {
        grid-template-columns: 1fr;
    }

    .cashbook-filter-grid {
        grid-template-columns: 1fr;
    }

    .cashbook-filter-field.is-search {
        grid-column: auto;
    }

    .cashbook-table-head {
        padding: 20px 18px 0;
    }

    .cashbook-table-wrap {
        padding: 0 8px 8px;
    }

    .cashbook-empty-state {
        min-height: 260px;
        padding-inline: 18px;
    }

    .cashbook-modal {
        padding: 16px;
    }

    .cashbook-modal-card {
        padding: 18px 18px 16px;
    }
}

.crm-mobile-nav,
.crm-mobile-sheet {
    display: none;
}

.crm-mobile-nav-icon,
.crm-mobile-sheet-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.crm-mobile-nav-icon svg,
.crm-mobile-sheet-link-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

body.crm-mobile-sheet-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    body:has(.kv-dashboard) .crm-shell.has-mobile-nav {
        --crm-mobile-header-offset: 78px;
    }

    body:has(.kv-dashboard) .crm-shell.has-mobile-nav .app-main-shell {
        padding-top: calc(var(--crm-mobile-header-offset) + 8px) !important;
    }

    body:has(.kv-dashboard) .crm-topbar,
    body:has(.kv-dashboard) .topbar,
    body:has(.kv-dashboard) .crm-navbar,
    body:has(.kv-dashboard) .crm-sticky-header {
        width: min(100vw - 16px, 100%) !important;
        border-radius: 0 0 16px 16px;
    }

    body:has(.kv-dashboard) .crm-topbar-inner {
        min-height: 56px;
        padding-inline: 10px;
        gap: 10px;
    }

    body:has(.kv-dashboard) .crm-topbar-layout {
        gap: 8px;
    }

    body:has(.kv-dashboard) .crm-topbar-brand {
        gap: 8px;
    }

    body:has(.kv-dashboard) .crm-topbar-brand img,
    body:has(.kv-dashboard) .navbar-brand img {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

    body:has(.kv-dashboard) .crm-topbar-brand span,
    body:has(.kv-dashboard) .crm-navbar .navbar-brand span {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    body:has(.kv-dashboard) .topbar-actions {
        gap: 6px !important;
    }

    body:has(.kv-dashboard) .crm-activity-bell {
        min-width: 36px;
        min-height: 36px;
        padding: 0 8px;
    }

    body:has(.kv-dashboard) .topbar-actions .btn {
        min-height: 36px;
        padding-inline: 10px;
        border-radius: 10px;
    }

    .crm-shell.has-mobile-nav {
        --crm-mobile-nav-offset: 92px;
        --crm-mobile-nav-shell-width: min(calc(100vw - 20px), 760px);
        padding-bottom: calc(var(--crm-mobile-nav-offset) + env(safe-area-inset-bottom, 0px));
    }

    .crm-mobile-nav > span,
    .crm-mobile-nav > button,
    .crm-mobile-sheet {
        display: none !important;
    }

    .crm-mobile-nav a[href="/more"] {
        position: relative;
    }

    .crm-mobile-nav a[href="/more"]::before {
        content: "⋯";
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.35rem;
        height: 1.35rem;
        margin-bottom: 4px;
        color: currentColor;
        font-size: 1.5rem;
        line-height: 1;
        font-weight: 700;
    }

    .crm-mobile-nav a[href="/more"] .crm-mobile-nav-label {
        font-size: 0;
    }

    .crm-mobile-nav a[href="/more"] .crm-mobile-nav-label::after {
        content: "Nhiều hơn";
        font-size: 0.68rem;
    }

    .crm-mobile-nav a[href="/orders"] .crm-mobile-nav-label {
        font-size: 0;
    }

    .crm-mobile-nav a[href="/orders"] .crm-mobile-nav-label::after {
        content: "Hoá đơn";
        font-size: 0.68rem;
    }

    .app-shell-container {
        width: min(100vw - 20px, 100%);
    }

    .main-wrapper,
    .app-main,
    .app-main-shell,
    main,
    .page-content,
    .crm-page {
        min-height: auto !important;
    }

    .crm-shell.has-mobile-nav .app-main-shell {
        padding-bottom: 0 !important;
    }

    .crm-topbar,
    .topbar {
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 14px;
        backdrop-filter: blur(16px);
    }

    .crm-topbar-inner {
        min-height: 62px;
        padding-inline: 12px;
        gap: 12px;
    }

    .crm-topbar-layout {
        flex-wrap: nowrap;
        align-items: center;
    }

    .crm-topbar-brand {
        gap: 10px;
        color: #111827;
        min-width: 0;
        max-width: calc(100vw - 132px);
    }

    .crm-topbar-brand img,
    .navbar-brand img {
        width: 30px;
        height: 30px;
        border-radius: 9px;
        box-shadow: none;
    }

    .crm-topbar-brand span,
    .crm-navbar .navbar-brand span {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.94rem;
        font-weight: 800;
    }

    .crm-header-menu,
    .topbar-nav {
        display: none !important;
    }

    .crm-navbar-end,
    .topbar-actions {
        margin-left: auto;
        gap: 8px !important;
    }

    .crm-activity-bell {
        min-width: 40px;
        min-height: 40px;
        padding: 0 10px;
        border-radius: 12px;
        border: 1px solid #dbeafe;
        background: #eff6ff;
        color: #2563eb;
        box-shadow: none;
    }

    .crm-activity-bell-text {
        display: none;
    }

    .crm-activity-bell-icon {
        font-size: 1rem;
    }

    .crm-activity-badge {
        top: 5px;
        right: 5px;
    }

    .crm-navbar-end .btn,
    .topbar-actions .btn {
        min-height: 38px;
        padding-inline: 12px;
        border-radius: 12px;
        font-size: 0.82rem;
        line-height: 1.1;
    }

    .crm-navbar {
        margin-bottom: 14px;
    }

    .crm-navbar .container {
        min-height: 62px;
        padding-inline: 12px;
    }

    .app-footer,
    footer.app-footer {
        display: none !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

    .crm-mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: end;
        gap: 0;
        width: var(--crm-mobile-nav-shell-width);
        min-height: 78px;
        margin: 0 auto;
        padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
        backdrop-filter: blur(16px);
        border-radius: 18px 18px 0 0;
    }

    .crm-mobile-nav-item {
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 60px;
        padding: 8px 4px 6px;
        border: 0;
        border-radius: 14px;
        background: transparent;
        color: #4b5563;
        text-decoration: none;
        transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    }

    .crm-mobile-nav-item-primary {
        width: 68px;
        min-height: 68px;
        margin: 0 auto;
        margin-top: -18px;
        padding: 10px 4px 12px;
        align-self: end;
        border-radius: 18px;
        background: linear-gradient(180deg, #3b82f6, #2563eb);
        color: #fff;
        box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
        transform: none;
    }

    .crm-mobile-nav-item-primary .crm-mobile-nav-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.16);
    }

    .crm-mobile-nav a[href="/more"] .crm-mobile-nav-icon {
        display: none;
    }

    .crm-mobile-nav-item.is-active {
        color: #2563eb;
        background: #eff6ff;
        box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
    }

    .crm-mobile-nav-item-primary.is-active {
        color: #ffffff;
        background: linear-gradient(180deg, #2563eb, #1d4ed8);
    }

    .crm-mobile-nav-item:active {
        transform: translateY(1px);
    }

    .crm-mobile-nav-label {
        margin-top: 4px;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.15;
        letter-spacing: -0.01em;
        text-align: center;
    }

    .crm-mobile-nav a[href="/dashboard"] {
        order: 1;
    }

    .crm-mobile-nav a[href="/sales"] {
        order: 2;
    }

    .crm-mobile-nav a[href="/orders"] {
        order: 3;
    }

    .crm-mobile-nav a[href="/mobile-products"] {
        order: 4;
    }

    .crm-mobile-nav a[href="/more"] {
        order: 5;
        position: relative;
    }

    .crm-mobile-nav {
        align-items: end;
        gap: 0;
        min-height: 78px;
        padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .crm-mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 60px;
        padding: 8px 4px 6px;
        border-radius: 14px;
        background: transparent;
        color: #4b5563;
        transition: color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    }

    .crm-mobile-nav-item.is-active {
        color: #2563eb;
        background: #eff6ff;
        box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
    }

    .crm-mobile-nav-item .crm-mobile-nav-label {
        color: #4b5563;
        margin-top: 4px;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.15;
    }

    .crm-mobile-nav-item.is-active .crm-mobile-nav-icon,
    .crm-mobile-nav-item.is-active .crm-mobile-nav-label {
        color: #2563eb;
    }

    .crm-mobile-nav-icon {
        width: 28px;
        height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .crm-mobile-nav i,
    .crm-mobile-nav svg {
        width: 28px;
        height: 28px;
        font-size: 28px;
        display: block;
    }

    .crm-mobile-nav-item.is-active .crm-mobile-nav-icon {
        transform: scale(1.05);
        transform-origin: center;
    }

    .crm-mobile-nav-item-primary {
        width: 68px;
        min-height: 68px;
        margin: 0 auto;
        margin-top: -18px;
        padding: 10px 4px 12px;
        align-self: end;
        border-radius: 18px;
        background: linear-gradient(180deg, #3b82f6, #2563eb);
        color: #fff;
        box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
        transform: none;
    }

    .crm-mobile-nav-item-primary .crm-mobile-nav-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.16);
    }

    .crm-mobile-nav-item-primary.is-active {
        color: #fff;
        background: linear-gradient(180deg, #2563eb, #1d4ed8);
        box-shadow: 0 16px 32px rgba(37, 99, 235, 0.28);
    }

    .crm-mobile-nav a[href="/more"] .crm-mobile-nav-icon {
        display: none;
    }

    .crm-mobile-nav a[href="/more"]::before {
        content: "\2261";
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        margin-bottom: 4px;
        color: currentColor;
        font-size: 28px;
        line-height: 1;
        font-weight: 700;
    }

    .crm-mobile-nav a[href="/more"] .crm-mobile-nav-label,
    .crm-mobile-nav a[href="/orders"] .crm-mobile-nav-label {
        font-size: 0;
    }

    .crm-mobile-nav a[href="/more"] .crm-mobile-nav-label::after,
    .crm-mobile-nav a[href="/orders"] .crm-mobile-nav-label::after {
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.15;
    }

    .crm-mobile-nav a[href="/more"] .crm-mobile-nav-label::after {
        content: "Menu";
    }

    .crm-mobile-nav a[href="/orders"] .crm-mobile-nav-label::after {
        content: "Hoá đơn";
    }

    .crm-topbar,
    .topbar,
    .crm-navbar {
        background: linear-gradient(135deg, rgba(13, 71, 161, 0.97), rgba(22, 119, 255, 0.94));
        box-shadow: 0 14px 36px rgba(13, 71, 161, 0.2);
        border-bottom: 0;
        backdrop-filter: blur(18px);
    }

    .crm-topbar,
    .topbar,
    .crm-navbar,
    .crm-sticky-header {
        position: fixed;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        max-width: var(--crm-mobile-nav-shell-width);
        z-index: 1000;
    }

    .crm-shell.has-mobile-nav {
        --crm-mobile-header-offset: 92px;
    }

    .crm-shell.has-mobile-nav .app-main-shell {
        padding-top: calc(var(--crm-mobile-header-offset) + 12px) !important;
    }

    .crm-topbar-brand {
        color: #fff;
    }

    .crm-topbar-brand img,
    .navbar-brand img {
        box-shadow: 0 8px 20px rgba(15, 76, 219, 0.22);
    }

    .crm-topbar-brand span,
    .crm-navbar .navbar-brand span {
        color: #fff;
    }

    .crm-activity-bell {
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    .crm-navbar-end .btn,
    .topbar-actions .btn {
        border-color: rgba(255, 255, 255, 0.45);
        color: #fff;
    }

    .crm-mobile-nav {
        z-index: 1000;
        width: auto;
        min-height: 72px;
        margin: 0;
        padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.98);
        border-radius: 0;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    }

    .crm-mobile-nav-item {
        min-height: 64px;
        padding: 10px 4px 10px;
        border-radius: 0;
        color: #4b5563;
    }

    .crm-mobile-nav-item.is-active {
        background: transparent;
        box-shadow: none;
    }

    .crm-mobile-nav-item.nav-dashboard {
        color: #2563eb;
    }

    .crm-mobile-nav-item.nav-sales {
        color: #16a34a;
    }

    .crm-mobile-nav-item.nav-orders {
        color: #f59e0b;
    }

    .crm-mobile-nav-item.nav-products {
        color: #0891b2;
    }

    .crm-mobile-nav-item.nav-menu {
        color: #475569;
    }

    .crm-mobile-nav-item.is-active .crm-mobile-nav-icon {
        transform: none;
    }

    .crm-mobile-nav-item-primary {
        width: 64px;
        min-height: 64px;
        margin: 0 auto;
        padding: 10px 4px 10px;
        border-radius: 16px;
        background: rgba(22, 163, 74, 0.08);
        color: inherit;
        box-shadow: 0 6px 14px rgba(22, 163, 74, 0.12);
    }

    .crm-mobile-nav-item-primary .crm-mobile-nav-icon {
        width: 28px;
        height: 28px;
        border-radius: 0;
        background: transparent;
    }

    .crm-mobile-nav-item-primary.is-active {
        color: #2563eb;
        background: linear-gradient(180deg, rgba(37, 99, 235, 0.16), rgba(22, 163, 74, 0.12));
        box-shadow: 0 8px 16px rgba(29, 78, 216, 0.14);
    }

    .crm-card,
    .hero-panel,
    .metric-card,
    .dashboard-chart-card,
    .dashboard-attention-card,
    .dashboard-page .dashboard-hero,
    .dashboard-page .dashboard-attention-card,
    .dashboard-page .dashboard-chart-card,
    .dashboard-page .activity-card,
    .dashboard-page .dashboard-kpi-card,
    .kv-card,
    .kv-side-card {
        border-radius: 18px;
    }

    .dashboard-page,
    .kv-dashboard {
        gap: 14px;
    }

    .hero-panel,
    .metric-card,
    .dashboard-chart-card,
    .dashboard-attention-card,
    .dashboard-page .dashboard-hero,
    .dashboard-page .dashboard-attention-card,
    .dashboard-page .dashboard-chart-card,
    .dashboard-page .activity-card,
    .dashboard-page .dashboard-kpi-card,
    .kv-card,
    .kv-side-card {
        padding: 14px !important;
    }

    .page-heading,
    .toolbar-row,
    .dashboard-section-head,
    .dashboard-page .dashboard-chart-head,
    .dashboard-attention-head {
        gap: 10px;
        margin-bottom: 14px;
    }

    .metric-label,
    .dashboard-kpi-label,
    .dashboard-section-note,
    .metric-foot,
    .dashboard-attention-meta,
    .dashboard-recent-activity-message {
        font-size: 0.82rem;
    }

    .metric-value,
    .dashboard-page .dashboard-kpi-value,
    .dashboard-kpi-value {
        font-size: clamp(1.45rem, 7vw, 2.1rem) !important;
        line-height: 1.04;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .dashboard-page .dashboard-attention-row,
    .dashboard-attention-row,
    .dashboard-recent-activity-item {
        min-width: 0;
    }

    .dashboard-page .dashboard-attention-row,
    .dashboard-attention-row {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .dashboard-page .dashboard-attention-cta,
    .dashboard-attention-cta {
        grid-column: 1 / -1;
        justify-self: start;
        min-width: 0;
    }

    .dashboard-page .dashboard-chart-filter {
        gap: 10px;
    }

    .dashboard-page .dashboard-chart-filter > div,
    .dashboard-chart-filter > div {
        min-width: 0;
    }

    .table-responsive,
    .crm-table-responsive {
        margin-inline: -4px;
    }

    .kv-top-grid,
    .kv-dashboard-sidebar > .kv-card:first-child {
        display: none !important;
    }

    .kv-dashboard {
        grid-template-columns: 1fr !important;
    }

    .kv-dashboard-main,
    .kv-dashboard-sidebar {
        display: grid;
        gap: 14px;
    }

    .kv-dashboard-sidebar {
        order: 3;
    }

    .kv-sales-card {
        order: 1;
    }

    .kv-chart-card {
        order: 2;
    }

    .kv-dashboard-sidebar > .kv-card:nth-child(2) {
        order: 3;
    }

    .kv-dashboard-sidebar > .kv-card:nth-child(3) {
        order: 4;
    }

    .kv-chart-card .revenue-card-header,
    .kv-chart-card .revenue-card-filters {
        gap: 10px;
    }

    .kv-chart-card .revenue-card-filters .btn,
    .kv-chart-card .revenue-card-filters .form-select {
        min-height: 40px;
    }

    .kv-activity-list {
        max-height: none;
    }

    .mobile-more-page {
        display: grid;
        gap: 0;
        padding: 4px 0 20px;
        background: #f3f4f6;
    }

    .mobile-more-header {
        padding: 6px 4px 2px;
    }

    .mobile-more-kicker {
        color: #6b7280;
        font-size: 0.74rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    .mobile-more-title {
        margin: 6px 0 4px;
        color: #111827;
        font-size: 1.6rem;
        font-weight: 800;
    }

    .mobile-more-copy {
        margin: 0;
        color: #6b7280;
        font-size: 0.92rem;
        line-height: 1.5;
    }

    .mobile-more-group {
        background: #ffffff;
        border-radius: 18px;
        padding: 20px 18px;
        margin-bottom: 16px;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    }

    .mobile-more-group-title {
        margin: 0 0 18px;
        color: #111827;
        font-size: 22px;
        font-weight: 700;
    }

    .mobile-more-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 22px;
        row-gap: 26px;
    }

    .mobile-more-item {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 42px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        color: #111827;
        text-decoration: none;
        box-shadow: none;
    }

    .mobile-more-item-icon {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: #dbeafe;
        color: #2563eb;
        flex-shrink: 0;
    }

    .mobile-more-item-icon svg {
        width: 1.05rem;
        height: 1.05rem;
    }

    .mobile-more-item-label {
        font-size: 18px;
        font-weight: 600;
        line-height: 1.25;
    }

    .mobile-more-banner {
        border-radius: 16px;
        overflow: hidden;
        background: linear-gradient(135deg, #dbeafe, #ecfeff);
        color: #0f172a;
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.5;
        padding: 16px 18px;
    }

    .mobile-more-banner.media {
        padding: 0;
    }

    .mobile-more-banner img {
        display: block;
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    .mobile-more-meta {
        display: grid;
        gap: 6px;
        margin-top: 18px;
        color: #475569;
        font-size: 0.9rem;
    }

    .mobile-content-body {
        color: #1f2937;
        font-size: 1rem;
        line-height: 1.7;
        white-space: pre-line;
    }

    .mobile-content-body.is-html {
        white-space: normal;
    }

    .mobile-content-body > :first-child {
        margin-top: 0;
    }

    .mobile-content-body > :last-child {
        margin-bottom: 0;
    }
}

.sales-mobile-hero,
.sales-mobile-product-search,
.sales-mobile-cartbar,
.sales-mobile-cart-overlay,
.sales-mobile-cart-close {
    display: none;
}

.sales-quick-customer-modal-backdrop,
.sales-quick-customer-close,
.sales-quick-customer-modal-header,
.sales-quick-customer-modal-footer {
    display: none;
}

.sales-quick-customer-modal-header {
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.sales-quick-customer-modal-body {
    margin-top: 0;
}

.sales-mobile-pos-header,
.sales-customer-panel {
    display: none;
}

@media (max-width: 768px) {
    .page-heading {
        display: none;
    }

    .sales-page {
        gap: 10px;
        padding-bottom: 104px;
    }

    .sales-mobile-hero {
        display: block;
        position: static;
    }

    .sales-mobile-hero-card {
        display: grid;
        gap: 0;
        padding: 0;
        border-radius: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .sales-mobile-hero-title {
        display: none;
    }

    .sales-mobile-hero-subtitle {
        display: none;
    }

    .sales-mobile-hero .sales-mobile-product-search {
        display: block;
    }

    .sales-mobile-hero-search {
        min-height: 48px;
        border-radius: 14px;
        border: 0;
        background: #f1f5f9;
        padding-inline: 16px;
        font-size: 14px;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    }

    .sales-mobile-hero-search::placeholder {
        color: #475569;
        opacity: 1;
    }

    .sales-mobile-pos-header {
        display: grid;
        gap: 10px;
    }

    .sales-mobile-pos-title {
        margin: 0;
        font-size: 1.3rem;
        font-weight: 800;
        color: #0f172a;
    }

    .sales-mobile-search-shell,
    .sales-customer-panel-search {
        display: grid;
        grid-template-columns: 18px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        min-height: 48px;
        padding: 0 14px;
        border: 1px solid #dbe3ee;
        border-radius: 14px;
        background: #fff;
    }

    .sales-mobile-search-icon {
        color: #64748b;
        font-size: 1rem;
        line-height: 1;
    }

    .sales-mobile-search-shell .form-control,
    .sales-customer-panel-search .form-control,
    .sales-mobile-date-field .form-control {
        min-height: 46px;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
        font-size: 0.95rem;
    }

    .sales-mobile-customer-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 124px;
        gap: 10px;
        align-items: stretch;
    }

    .sales-mobile-customer-trigger,
    .sales-mobile-date-field {
        min-width: 0;
        display: grid;
        gap: 4px;
        padding: 10px 12px;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #fff;
        text-align: left;
        color: #0f172a;
    }

    #mobileCustomerPickerTrigger {
        cursor: pointer;
        touch-action: manipulation;
    }

    .sales-mobile-customer-label {
        font-size: 0.72rem;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .sales-mobile-customer-name {
        font-size: 0.96rem;
        font-weight: 700;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sales-customer-card {
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .sales-customer-card .card-body {
        padding: 0 !important;
    }

    .sales-customer-top,
    .sales-customer-summary:not([data-quick-customer-section]),
    .sales-customer-summary.mt-3[data-quick-customer-section][hidden] {
        display: none !important;
    }

    .sales-quick-customer-root[data-quick-customer-section] {
        position: fixed !important;
        inset: 0 !important;
        z-index: 30000 !important;
        margin: 0 !important;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .sales-quick-customer-root[data-quick-customer-section] .quick-customer-overlay {
        display: block;
        position: fixed !important;
        inset: 0 !important;
        border: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 30000 !important;
    }

    .sales-quick-customer-root[data-quick-customer-section] .quick-customer-modal {
        position: fixed !important;
        top: 16px !important;
        left: 12px !important;
        right: 12px !important;
        bottom: 16px !important;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
        z-index: 30001 !important;
    }

    .sales-quick-customer-root[data-quick-customer-section] .sales-quick-customer-modal-header {
        display: flex;
        position: sticky;
        top: 0;
        padding: 16px 16px 14px;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
        z-index: 2;
    }

    .sales-quick-customer-root[data-quick-customer-section] .sales-quick-customer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        min-height: 40px;
        padding: 0 14px;
        border-radius: 999px;
    }

    .sales-quick-customer-root[data-quick-customer-section] .sales-quick-customer-modal-body {
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 16px;
        margin-top: 0;
    }

    .sales-quick-customer-root[data-quick-customer-section] .sales-quick-customer-modal-body > .sales-customer-summary-title,
    .sales-quick-customer-root[data-quick-customer-section] .sales-quick-customer-modal-body > .small.text-muted,
    .sales-quick-customer-root[data-quick-customer-section] .sales-quick-customer-modal-body .sales-customer-picker > div:last-child {
        display: none;
    }

    .sales-quick-customer-root[data-quick-customer-section] .sales-customer-picker {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sales-quick-customer-root[data-quick-customer-section] .form-label {
        display: block;
        margin-bottom: 6px;
        font-size: 0.78rem;
        font-weight: 700;
        color: #475569;
    }

    .sales-quick-customer-root[data-quick-customer-section] .form-control,
    .sales-quick-customer-root[data-quick-customer-section] .btn {
        min-height: 44px;
        border-radius: 12px;
    }

    .sales-quick-customer-root[data-quick-customer-section] .sales-quick-customer-modal-footer {
        display: grid;
        position: sticky;
        bottom: 0;
        gap: 10px;
        padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
        margin-top: 0;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), #fff 18px);
        border-top: 1px solid #e5e7eb;
        z-index: 2;
    }

    .sales-quick-customer-root[data-quick-customer-section] .sales-quick-customer-modal-footer .btn {
        min-height: 46px;
        border-radius: 14px;
        font-weight: 700;
    }

    .sales-products-card {
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .sales-page .sales-cart-card {
        display: none;
    }

    .sales-products-card .card-body {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0 !important;
    }

    .sales-products-card .sales-panel-head {
        display: none;
    }

    .sales-product-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        max-height: none;
        overflow: visible;
        padding-bottom: 24px;
    }

    .sales-product-item {
        position: relative;
        width: 100%;
        min-height: 0;
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr);
        grid-template-areas:
            "image name"
            "image meta"
            "image price";
        align-items: start;
        column-gap: 12px;
        row-gap: 4px;
        padding: 10px 12px;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        box-shadow: none;
        background: #fff;
        overflow: hidden;
        cursor: pointer;
        transition: background-color 0.14s ease, transform 0.14s ease, border-color 0.14s ease;
    }

    .sales-product-item .product-card-img,
    .sales-product-item .product-card-img-placeholder {
        grid-area: image;
        width: 48px;
        height: 48px;
        border-radius: 12px;
        object-fit: cover;
        background: #f8fafc;
        border: 1px solid #e5e7eb;
    }

    .sales-product-name {
        grid-area: name;
        padding-right: 0;
        font-size: 0.95rem;
        font-weight: 700;
        line-height: 1.24;
        min-height: 2.3em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sales-product-meta-row {
        grid-area: meta;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-width: 0;
    }

    .sales-product-sku {
        min-width: 0;
        color: #64748b;
        font-size: 0.72rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sales-product-stock {
        display: inline-flex;
        align-items: center;
        max-width: 100%;
        padding: 3px 8px;
        border-radius: 999px;
        font-size: 0.68rem;
        font-weight: 700;
        line-height: 1.15;
        white-space: nowrap;
        background: #f1f5f9;
        color: #475569;
    }

    .sales-product-stock.is-low {
        background: #fef3c7;
        color: #92400e;
    }

    .sales-product-stock.is-empty {
        background: #fee2e2;
        color: #b91c1c;
    }

    .sales-product-meta {
        display: none;
    }

    .sales-product-price {
        grid-area: price;
        display: grid;
        gap: 2px;
        text-align: left;
        color: #2563eb;
    }

    .sales-product-price-line {
        display: block;
    }

    .sales-product-price-line:first-child {
        font-size: 0.92rem;
        font-weight: 700;
        color: #2563eb;
    }

    .sales-product-price-line + .sales-product-price-line {
        font-size: 0.76rem;
        font-weight: 600;
        color: #64748b;
    }

    .sales-product-item .small.fw-semibold.text-success,
    .sales-product-add {
        display: none !important;
    }

    .sales-product-item:hover,
    .sales-product-item:focus-visible {
        background: #fff;
        border-color: #dbe3ee;
    }

    .sales-product-item:active {
        transform: scale(0.99);
        background: #eff6ff;
    }

    .sales-product-item.is-added {
        animation: salesProductPulse 180ms ease-out;
    }

    .sales-customer-panel {
        position: fixed;
        inset: 0;
        z-index: 2100;
    }

    .sales-customer-panel-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.44);
    }

    .sales-customer-panel-sheet {
        position: absolute;
        inset: 0;
        display: grid;
        grid-template-rows: auto auto auto minmax(0, 1fr);
        gap: 12px;
        padding: 16px 14px calc(96px + env(safe-area-inset-bottom, 0px));
        background: #f8fafc;
    }

    .sales-customer-panel-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
    }

    .sales-customer-panel-title {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 800;
        color: #0f172a;
    }

    .sales-customer-panel-subtitle {
        margin: 4px 0 0;
        font-size: 0.82rem;
        color: #64748b;
    }

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

    .sales-customer-panel-actions .btn {
        min-height: 42px;
        border-radius: 12px;
    }

    .sales-customer-panel-list {
        display: grid;
        gap: 10px;
        align-content: start;
        overflow-y: auto;
        padding-right: 2px;
    }

    .sales-customer-option-row {
        display: grid;
        gap: 4px;
        padding: 12px 14px;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #fff;
        text-align: left;
        color: #0f172a;
    }

    .sales-customer-option-row span,
    .sales-customer-panel-empty {
        font-size: 0.82rem;
        color: #64748b;
    }

    .sales-mobile-product-sheet {
        position: fixed;
        inset: 0;
        z-index: 10005;
    }

    .sales-mobile-product-sheet-overlay {
        position: absolute;
        inset: 0;
        border: 0;
        background: rgba(15, 23, 42, 0.44);
    }

    .sales-mobile-product-sheet-panel {
        position: absolute;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        width: 100%;
        max-width: min(100%, 768px);
        max-height: 88vh;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        background: #fff;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
    }

    .sales-mobile-product-sheet-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
        align-items: flex-start;
        padding: 16px 16px 14px;
        border-bottom: 1px solid #e5e7eb;
    }

    .sales-mobile-product-sheet-back {
        min-width: 44px;
        min-height: 44px;
        padding: 0 12px;
        border: 1px solid #dbe3ee;
        border-radius: 999px;
        background: #fff;
        color: #0f172a;
        font-weight: 600;
    }

    .sales-mobile-product-sheet-title-wrap {
        min-width: 0;
        display: grid;
        gap: 8px;
    }

    .sales-mobile-product-sheet-title {
        margin: 0;
        font-size: 1.15rem;
        font-weight: 800;
        color: #0f172a;
    }

    .sales-mobile-product-sheet-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .sales-mobile-product-sheet-sku,
    .sales-mobile-product-sheet-stock {
        display: inline-flex;
        align-items: center;
        min-height: 26px;
        padding: 0 10px;
        border-radius: 999px;
        background: #eff6ff;
        color: #1d4ed8;
        font-size: 0.78rem;
        font-weight: 600;
    }

    .sales-mobile-product-sheet-price {
        font-size: 1.05rem;
        font-weight: 800;
        color: #2563eb;
    }

    .sales-mobile-product-sheet-body {
        display: grid;
        gap: 16px;
        padding: 16px;
    }

    .sales-mobile-product-sheet-section {
        display: grid;
        gap: 10px;
    }

    .sales-mobile-product-sheet-label {
        font-size: 0.82rem;
        font-weight: 700;
        color: #334155;
    }

    .sales-mobile-product-sheet-segmented {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 4px;
        border-radius: 16px;
        background: #eff3f8;
    }

    .sales-mobile-product-sheet-segment {
        min-height: 42px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #475569;
        font-weight: 700;
        transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    }

    .sales-mobile-product-sheet-segment.is-active {
        background: #2563eb;
        color: #fff;
        box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
    }

    .sales-mobile-product-sheet-segment:disabled {
        opacity: 0.48;
    }

    .sales-mobile-product-sheet-hint {
        font-size: 0.8rem;
        color: #64748b;
    }

    .sales-mobile-product-sheet-qty {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 10px;
        align-items: center;
    }

    .sales-mobile-product-sheet-qty-btn {
        min-width: 44px;
        min-height: 44px;
        border: 1px solid #dbe3ee;
        border-radius: 14px;
        background: #fff;
        color: #0f172a;
        font-size: 1.2rem;
        font-weight: 700;
    }

    .sales-mobile-product-sheet-qty-input,
    .sales-mobile-product-sheet-input,
    .sales-mobile-product-sheet-textarea {
        min-height: 44px;
        border-radius: 14px;
        border-color: #dbe3ee;
        box-shadow: none;
    }

    .sales-mobile-product-sheet-qty-input {
        border: 1px solid #dbe3ee;
        padding: 0 12px;
        text-align: center;
        font-size: 1rem;
        font-weight: 700;
        color: #0f172a;
    }

    .sales-mobile-product-sheet-pricing {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sales-mobile-product-sheet-summary-line {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 14px;
        background: #f8fafc;
        color: #334155;
    }

    .sales-mobile-product-sheet-summary-line strong {
        color: #0f172a;
        font-size: 1rem;
    }

    .sales-mobile-product-sheet-summary-line.is-total {
        background: #eff6ff;
    }

    .sales-mobile-product-sheet-summary-line.is-total strong {
        color: #1d4ed8;
    }

    .sales-mobile-product-sheet-textarea {
        min-height: 96px;
        padding: 12px 14px;
        resize: none;
    }

    .sales-mobile-product-sheet-footer {
        position: sticky;
        bottom: 0;
        display: grid;
        gap: 10px;
        padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), #fff 18px);
        border-top: 1px solid #e5e7eb;
    }

    .sales-mobile-product-sheet-delete,
    .sales-mobile-product-sheet-submit {
        min-height: 46px;
        border-radius: 14px;
        font-weight: 700;
    }

    .sales-mobile-cartbar {
        position: fixed;
        left: 50%;
        bottom: calc(90px + env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
        width: calc(100% - 24px);
        z-index: 9997;
        display: block;
    }

    .sales-mobile-cartbar-button {
        width: 100%;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 14px;
        border: 0;
        border-radius: 18px;
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        color: #fff;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
        transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    }

    .sales-mobile-cartbar-button:active {
        transform: scale(0.98);
    }

    .sales-mobile-cartbar-left,
    .sales-mobile-cartbar-center,
    .sales-mobile-cartbar-actions {
        display: flex;
        align-items: center;
    }

    .sales-mobile-cartbar-left {
        position: relative;
        flex: 0 0 auto;
        justify-content: center;
        width: 34px;
        height: 34px;
    }

    .sales-mobile-cartbar-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        color: #fff;
    }

    .sales-mobile-cartbar-icon svg {
        width: 24px;
        height: 24px;
        display: block;
    }

    .sales-mobile-cartbar-badge {
        position: absolute;
        top: -4px;
        right: -2px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        background: #fff;
        color: #2563eb;
        font-size: 12px;
        font-weight: 700;
        line-height: 18px;
        text-align: center;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
    }

    .sales-mobile-cartbar-center {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-start;
    }

    .sales-mobile-cartbar-count {
        min-width: 0;
        font-size: 0.95rem;
        font-weight: 600;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sales-mobile-cartbar-actions {
        flex: 0 0 auto;
        gap: 10px;
    }

    .sales-mobile-cartbar-total {
        font-size: 0.95rem;
        font-weight: 700;
        color: #fff;
        white-space: nowrap;
    }

    .sales-mobile-cartbar-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        padding: 6px 10px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        font-size: 0.82rem;
        font-weight: 500;
        white-space: nowrap;
    }

    .sales-mobile-cart-overlay {
        position: fixed;
        inset: 0;
        z-index: 2000;
        display: block;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(2px);
    }

    .sales-cart-card {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2010;
        margin: 0;
        border-radius: 22px 22px 0 0;
        transform: translateY(calc(100% + 32px));
        transition: transform 0.24s ease;
        max-height: 85vh;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
        display: flex;
        flex-direction: column;
    }

    .sales-page.is-mobile-cart-open .sales-cart-card {
        transform: translateY(0);
    }

    .sales-cart-card .card-body {
        display: flex;
        flex-direction: column;
        gap: 0;
        max-height: 85vh;
        min-height: 0;
        padding: 0 !important;
    }

    .sales-cart-card .sales-panel-head {
        position: sticky;
        top: 0;
        z-index: 2;
        align-items: center;
        margin-bottom: 0;
        padding: 14px 14px 10px;
        border-bottom: 1px solid rgba(226, 232, 240, 0.92);
        background: #fff;
    }

    .sales-cart-card .sales-panel-head p {
        display: none;
    }

    .sales-cart-card .sales-mobile-cart-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: 0 12px;
        border-radius: 999px;
    }

    .sales-cart-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 12px 14px 120px;
    }

    .sales-cart-item {
        padding: 12px;
        border-radius: 14px;
    }

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

    .sales-price-control,
    .sales-line-total-wrap,
    .sales-payment-box-customer,
    .sales-payment-box-paid {
        grid-column: 1 / -1;
    }

    .sales-payment-bar {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin-top: 0;
        padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(255,255,255,0.92), #fff 18px);
        border-top: 1px solid rgba(226, 232, 240, 0.92);
    }

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

    .sales-payment-box {
        padding: 12px;
        border-radius: 14px;
    }

    .sales-payment-shortcuts {
        gap: 6px !important;
    }

    .sales-payment-shortcuts .btn {
        min-height: 36px;
        padding-inline: 10px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .sales-payment-value,
    .sales-payment-box-total .sales-payment-value {
        font-size: 1rem;
    }

    .sales-submit-button {
        min-height: 48px;
        border-radius: 14px;
        width: 100%;
    }

    body:has(.sales-page) .app-footer {
        display: none !important;
    }

    body.sales-mobile-cart-open {
        overflow: hidden;
    }

    body.sales-mobile-cart-open .sales-mobile-cartbar {
        opacity: 0;
        pointer-events: none;
        transform: translateY(16px);
    }

    body.sales-mobile-customer-panel-open {
        overflow: hidden;
    }

    body.modal-open {
        overflow: hidden;
    }

    body.sales-mobile-product-sheet-open {
        overflow: hidden;
    }
}

@keyframes salesProductPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 rgba(37, 99, 235, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
    }
}

.suppliers-mobile-list {
    display: none;
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .suppliers-page {
        gap: 14px;
        margin-bottom: 20px;
        font-size: 14px;
    }

    .suppliers-page,
    .suppliers-page * {
        max-width: 100%;
    }

    .suppliers-overview-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .suppliers-selected-panel,
    .suppliers-summary-panel,
    .suppliers-table-card {
        width: 100%;
        overflow: hidden;
        border-radius: 14px !important;
    }

    .suppliers-quick-actions {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px !important;
    }

    .suppliers-quick-actions > .btn {
        min-height: 40px;
        height: 40px;
        padding: 8px 10px;
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
        font-size: 0.76rem;
        font-weight: 700;
    }

    .suppliers-selected-panel {
        padding: 14px 16px !important;
        border: 1px solid rgba(226, 232, 240, 0.9) !important;
        background: #fff !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .suppliers-selected-title {
        margin-bottom: 6px !important;
        color: #6b7280 !important;
        font-size: 12px !important;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }

    .suppliers-selected-name {
        margin-bottom: 10px !important;
        font-size: 18px !important;
        font-weight: 600 !important;
        line-height: 1.25;
    }

    .suppliers-selected-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        margin-bottom: 10px !important;
    }

    .suppliers-selected-item {
        padding: 10px;
        border-radius: 12px;
        background: #f8fafc;
    }

    .suppliers-selected-item span {
        margin-bottom: 6px !important;
        color: #6b7280 !important;
        font-size: 11px !important;
        letter-spacing: 0.02em;
    }

    .suppliers-selected-item strong {
        font-size: 16px !important;
        font-weight: 700;
        line-height: 1.2;
    }

    .suppliers-selected-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px !important;
    }

    .suppliers-selected-actions .btn {
        min-height: 108px;
        height: auto;
        padding: 14px;
        border-radius: 14px;
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        text-align: right;
        white-space: normal;
        font-size: 0.76rem;
        line-height: 1.2;
    }

    .suppliers-summary-panel .card-body,
    .suppliers-table-card .card-body {
        padding: 12px !important;
    }

    .suppliers-summary-panel h2 {
        margin-bottom: 10px !important;
        font-size: 0.96rem;
    }

    .suppliers-summary-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .suppliers-summary-item {
        margin-bottom: 0 !important;
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .suppliers-summary-item span {
        margin-bottom: 6px !important;
        font-size: 11px !important;
    }

    .suppliers-summary-item strong {
        font-size: 17px !important;
        line-height: 1.2;
    }

    .suppliers-top-debtors {
        margin-top: 10px !important;
        padding-top: 10px !important;
    }

    .suppliers-top-debtors-list {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .suppliers-top-debtors-item {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .suppliers-toolbar {
        margin-bottom: 8px !important;
    }

    .suppliers-toolbar > div,
    .suppliers-toolbar .col-md-7,
    .suppliers-toolbar .col-md-3,
    .suppliers-toolbar .col-md-2 {
        width: 100%;
    }

    .suppliers-toolbar .form-label {
        margin-bottom: 4px !important;
        font-size: 13px !important;
    }

    .suppliers-toolbar .form-control,
    .suppliers-toolbar .form-select,
    .suppliers-toolbar [data-supplier-result-box] {
        min-height: 40px !important;
        height: 40px;
        border-radius: 10px !important;
        margin-bottom: 10px;
        font-size: 0.92rem;
    }

    .suppliers-result-meta {
        margin-bottom: 10px !important;
        font-size: 0.78rem;
    }

    .suppliers-table-wrap {
        display: none;
    }

    .suppliers-mobile-list {
        display: block;
    }

    .m-ncc-card {
        background: #fff;
        border-radius: 14px;
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(226, 232, 240, 0.88);
    }

    .m-ncc-card.is-selected {
        border-color: #93c5fd;
        background: #f8fbff;
    }

    .m-ncc-card-head {
        display: grid;
        gap: 3px;
        margin-bottom: 10px;
    }

    .m-ncc-card-name {
        color: #111827;
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.3;
    }

    .m-ncc-card-phone,
    .m-ncc-card-address {
        color: #6b7280;
        font-size: 0.8rem;
        line-height: 1.45;
    }

    .m-ncc-card-stats {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 10px;
    }

    .m-ncc-card-line {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        font-size: 0.84rem;
    }

    .m-ncc-card-line span {
        color: #6b7280;
    }

    .m-ncc-card-line strong {
        color: #111827;
        font-size: 0.95rem;
        font-weight: 700;
        text-align: right;
    }

    .m-ncc-card-line.is-debt strong {
        color: #dc2626;
    }

    .m-ncc-card-meta {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 10px;
        color: #94a3b8;
        font-size: 0.75rem;
    }

    .m-ncc-card-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .m-ncc-card-actions .btn {
        min-height: 38px;
        padding: 8px 6px;
        border-radius: 10px;
        font-size: 0.74rem;
        line-height: 1.15;
    }

    .suppliers-mobile-empty,
    .suppliers-empty-state {
        padding: 18px 12px !important;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .suppliers-page .page-heading,
    .suppliers-page .crm-card:last-child,
    .suppliers-table-card {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
  body.quick-customer-open {
    overflow: hidden !important;
  }

  body.quick-customer-open .quick-customer-modal-root,
  body.quick-customer-open .quick-customer-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 30000 !important;
    background: rgba(15, 23, 42, 0.45) !important;
  }

  body.quick-customer-open .quick-customer-modal {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 96px !important;
    top: auto !important;
    max-height: 68vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    width: auto !important;
    max-width: none !important;
    background: #fff !important;
    border-radius: 20px 20px 0 0 !important;
    z-index: 30001 !important;
    box-shadow: 0 -18px 40px rgba(15, 23, 42, 0.22) !important;
  }

  body.quick-customer-open .sales-quick-customer-sheet-handle {
    width: 44px !important;
    height: 5px !important;
    border-radius: 999px !important;
    background: #cbd5e1 !important;
    margin: 10px auto 2px !important;
    flex: 0 0 auto !important;
  }

  body.quick-customer-open .quick-customer-modal-root {
    background: transparent !important;
  }

  body.quick-customer-open .quick-customer-overlay {
    background: rgba(15, 23, 42, 0.35) !important;
  }

  body.quick-customer-open .quick-customer-modal-header {
    position: sticky !important;
    top: 0 !important;
    background: #fff !important;
    z-index: 2 !important;
    padding: 10px 16px 12px !important;
    border-bottom: 1px solid #e5e7eb !important;
  }

  body.quick-customer-open .quick-customer-modal-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding: 14px 16px 12px !important;
  }

  body.quick-customer-open .quick-customer-modal-body > .sales-customer-summary-title,
  body.quick-customer-open .quick-customer-modal-body > .small.text-muted,
  body.quick-customer-open .quick-customer-modal-body .sales-customer-picker > div:last-child {
    display: none !important;
  }

  body.quick-customer-open .quick-customer-modal .sales-customer-picker,
  body.quick-customer-open .quick-customer-modal .sales-quick-customer-mobile-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  body.quick-customer-open .sales-quick-customer-mobile-extra {
    display: block !important;
  }

  body.quick-customer-open .quick-customer-modal .form-control,
  body.quick-customer-open .quick-customer-modal .btn {
    min-height: 46px !important;
    border-radius: 14px !important;
  }

  body.quick-customer-open .quick-customer-modal-footer {
    position: sticky !important;
    bottom: 0 !important;
    background: #fff !important;
    z-index: 2 !important;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid #e5e7eb !important;
  }

  body.quick-customer-open .quick-customer-modal-footer .btn {
    min-height: 48px !important;
    font-weight: 700 !important;
  }
}

.sales-quick-customer-mobile-extra {
  display: none;
}

@media (max-width: 480px) {
  .quick-customer-modal-root,
  .quick-customer-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 30000 !important;
    background: rgba(15, 23, 42, 0.45) !important;
  }

  .quick-customer-modal {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 78px !important;
    top: auto !important;
    width: 100% !important;
    max-width: none !important;
    max-height: 72vh !important;
    overflow-y: auto !important;
    background: #fff !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 16px !important;
    z-index: 30001 !important;
  }

  .quick-customer-modal-header {
    position: sticky !important;
    top: 0 !important;
    background: #fff !important;
    z-index: 2 !important;
    padding-bottom: 10px !important;
  }

  .quick-customer-modal-footer {
    position: sticky !important;
    bottom: 0 !important;
    background: #fff !important;
    z-index: 2 !important;
    padding-top: 10px !important;
  }
}
