:root {
    --color-primary: #6352cf;
    --color-primary-hover: #5140b7;
    --color-primary-soft: #f0edfc;
    --color-secondary: #657185;
    --sidebar-background: #ffffff;
    --border-color: #e7e9ef;
    --text-primary: #23283b;
    --text-secondary: #697386;
    --text-muted: #737d90;
    --surface-background: #f7f8fb;
    --surface-white: #ffffff;
    --color-success: #23794e;
    --color-success-soft: #eaf6ef;
    --color-warning: #8b631a;
    --color-warning-soft: #fff6e3;
    --color-danger: #c13e4c;
    --color-danger-soft: #fcedef;
    --radius: 10px;
    --shadow-subtle: 0 2px 5px rgb(24 32 56 / 3%);
    --shadow-floating: 0 12px 40px rgb(24 32 56 / 10%);
    --sidebar-width: 244px;
    --sidebar-compact-width: 78px;
    --bs-primary: var(--color-primary);
    --bs-primary-rgb: 99, 82, 207;
    --bs-secondary: var(--color-secondary);
    --bs-secondary-rgb: 101, 113, 133;
    --bs-body-color: var(--text-primary);
    --bs-body-bg: var(--surface-background);
    --bs-border-color: var(--border-color);
    --bs-border-radius: var(--radius);
    --bs-link-color: var(--color-primary);
    --bs-link-hover-color: var(--color-primary-hover);
    --bs-body-font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body { font-size: .875rem; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
.text-secondary { color: var(--text-secondary) !important; }
.btn { --bs-btn-font-size: .8125rem; --bs-btn-font-weight: 600; --bs-btn-padding-x: 1rem; --bs-btn-padding-y: .6rem; --bs-btn-border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-primary { --bs-btn-bg: var(--color-primary); --bs-btn-border-color: var(--color-primary); --bs-btn-hover-bg: var(--color-primary-hover); --bs-btn-hover-border-color: var(--color-primary-hover); --bs-btn-active-bg: var(--color-primary-hover); --bs-btn-active-border-color: var(--color-primary-hover); --bs-btn-disabled-bg: var(--color-primary); --bs-btn-disabled-border-color: var(--color-primary); box-shadow: var(--shadow-subtle); }
.btn-outline-primary { --bs-btn-color: var(--color-primary); --bs-btn-border-color: var(--color-primary); --bs-btn-hover-bg: var(--color-primary); --bs-btn-hover-border-color: var(--color-primary); --bs-btn-active-bg: var(--color-primary-hover); --bs-btn-active-border-color: var(--color-primary-hover); }
.btn-outline-secondary { --bs-btn-color: var(--text-secondary); --bs-btn-border-color: var(--border-color); --bs-btn-hover-bg: var(--surface-background); --bs-btn-hover-color: var(--text-primary); --bs-btn-hover-border-color: var(--color-secondary); --bs-btn-active-bg: var(--border-color); --bs-btn-active-color: var(--text-primary); --bs-btn-active-border-color: var(--border-color); background: var(--surface-white); }
.btn-outline-danger { --bs-btn-color: var(--color-danger); --bs-btn-border-color: var(--border-color); --bs-btn-hover-bg: var(--color-danger-soft); --bs-btn-hover-color: var(--color-danger); --bs-btn-hover-border-color: var(--color-danger); --bs-btn-active-bg: var(--color-danger-soft); --bs-btn-active-color: var(--color-danger); --bs-btn-active-border-color: var(--color-danger); }
.btn-danger { --bs-btn-bg: var(--color-danger); --bs-btn-border-color: var(--color-danger); }
.btn-light { --bs-btn-bg: var(--surface-background); --bs-btn-color: var(--text-secondary); --bs-btn-border-color: var(--border-color); }
.btn-sm { --bs-btn-padding-x: .65rem; --bs-btn-padding-y: .35rem; --bs-btn-font-size: .75rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; color: var(--text-secondary); flex-shrink: 0; }
.btn-icon:hover { background: var(--surface-background); color: var(--text-primary); }
.btn-icon i { font-size: 1.15rem; }
.app-sidebar { --bs-offcanvas-width: var(--sidebar-width); background: var(--sidebar-background) !important; border-right: 1px solid var(--border-color); }
.app-sidebar .sidebar-brand { display: flex; gap: .7rem; padding: 1.5rem 1.2rem; min-height: 89px; }
.brand-mark { display: inline-grid; place-items: center; width: 37px; height: 37px; border-radius: 9px; flex-shrink: 0; background: var(--color-primary); color: var(--surface-white); font-size: 1.2rem; }
.brand-copy { display: flex; flex-direction: column; font-size: 1.15rem; font-weight: 750; letter-spacing: -.04em; }
.brand-caption { font-size: .5rem; letter-spacing: .14em; color: var(--text-muted); font-weight: 600; margin-top: .2rem; }
.app-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: .4rem .85rem 1rem; }
.sidebar-nav { width: 100%; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .75rem; padding: .72rem .8rem; color: var(--text-secondary); border-radius: 8px; font-weight: 550; margin-bottom: .25rem; white-space: nowrap; min-height: 42px; }
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-nav a:hover { color: var(--text-primary); background: var(--surface-background); }
.sidebar-nav .nav-link.active { background: var(--color-primary-soft); color: var(--color-primary); }
.sidebar-nav .unavailable { color: var(--text-muted); cursor: default; }
.nav-soon { font-size: .6rem; border: 1px solid var(--border-color); border-radius: 4px; padding: .1rem .3rem; margin-left: auto; font-weight: 500; }
.nav-group { margin-bottom: 1.55rem; }
.sidebar-caption { padding: 0 .8rem; font-size: .7rem; color: var(--text-muted); }
.nav-group-label { padding: 0 .8rem; margin-bottom: .65rem; color: var(--text-muted); font-size: .625rem; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; padding: 1.25rem .8rem 0; border-top: 1px solid var(--border-color); display: flex; align-items: center; gap: .6rem; color: var(--text-muted); font-size: .7rem; white-space: nowrap; }
.workspace-dot, .status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.workspace-dot { color: var(--color-success); }
.app-main { min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.app-topbar { height: 89px; padding: 1rem 2rem; background: var(--surface-white); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-context { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.header-location { min-width: 0; }
.header-page-title { display: block; font-size: .9rem; font-weight: 650; }
.breadcrumb { --bs-breadcrumb-divider-color: var(--text-muted); --bs-breadcrumb-item-active-color: var(--text-muted); font-size: .7rem; margin: .3rem 0 0; gap: .1rem; }
.breadcrumb a { color: var(--text-secondary); }
.user-menu-toggle { padding: .2rem; gap: .65rem; border: 0; font-weight: 500; }
.user-menu-copy { display: flex; flex-direction: column; text-align: left; max-width: 170px; }
.user-name { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: var(--text-muted); font-size: .65rem; margin-top: .15rem; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 37px; height: 37px; border-radius: 50%; background: var(--color-primary-soft); color: var(--color-primary); font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.avatar-sm { width: 32px; height: 32px; font-size: .65rem; }
.dropdown-menu { --bs-dropdown-font-size: .8125rem; --bs-dropdown-border-color: var(--border-color); --bs-dropdown-link-active-bg: var(--color-primary); --bs-dropdown-link-hover-bg: var(--surface-background); padding: .4rem; box-shadow: var(--shadow-floating); min-width: 220px; max-width: min(340px, 90vw); }
.dropdown-item { border-radius: 6px; padding: .6rem .7rem; }
.dropdown-account { padding: .65rem .7rem; display: flex; flex-direction: column; gap: .25rem; overflow-wrap: anywhere; }
.dropdown-account span { color: var(--text-secondary); font-size: .7rem; }
.app-content { flex: 1; padding: 2rem; width: 100%; max-width: 1560px; margin: 0 auto; }
.app-footer { font-size: .7rem; padding: 1rem 2rem; color: var(--text-muted); }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -.04em; margin: 0; line-height: 1.25; }
.page-header p { margin: .5rem 0 0; color: var(--text-secondary); font-size: .8125rem; }
.page-header-actions { display: flex; gap: .65rem; flex-shrink: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); font-size: .625rem; font-weight: 650; margin-bottom: .65rem; }
.card { --bs-card-bg: var(--surface-white); --bs-card-border-color: var(--border-color); --bs-card-border-radius: var(--radius); box-shadow: var(--shadow-subtle); overflow-wrap: anywhere; }
.card-body { padding: 1.5rem; }
.card-footer { background: var(--surface-white); padding: 1rem 1.5rem; }
.card-title { font-size: .95rem; font-weight: 650; }
.stat-card { padding: 1.2rem; height: 100%; }
.stat-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; color: var(--text-secondary); font-size: .75rem; font-weight: 550; }
.stat-icon { color: var(--color-primary); background: var(--color-primary-soft); border-radius: 8px; display: grid; place-items: center; width: 32px; height: 32px; }
.stat-value { font-size: 1.65rem; font-weight: 650; letter-spacing: -.035em; margin-top: .7rem; }
.stat-description { font-size: .7rem; color: var(--text-muted); margin: .35rem 0 0; }
.dashboard-welcome { padding: 2rem; display: flex; align-items: center; gap: 1.5rem; }
.welcome-icon, .empty-state-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; background: var(--color-primary-soft); color: var(--color-primary); border-radius: var(--radius); font-size: 1.3rem; flex-shrink: 0; }
.dashboard-welcome h2 { font-size: 1.05rem; font-weight: 650; margin: 0 0 .5rem; }
.dashboard-welcome p { margin: 0; color: var(--text-secondary); max-width: 600px; font-size: .8125rem; }
.table-toolbar { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.table-search { display: flex; align-items: center; gap: .5rem; width: min(100%, 460px); }
.search-field { position: relative; min-width: 0; flex: 1; }
.search-field i { position: absolute; top: 50%; left: .85rem; transform: translateY(-50%); color: var(--text-muted); }
.search-field input { padding-left: 2.25rem; }
.table-count { font-size: .75rem; color: var(--text-secondary); white-space: nowrap; }
.table { --bs-table-bg: var(--surface-white); --bs-table-color: var(--text-primary); --bs-table-border-color: var(--border-color); --bs-table-hover-bg: var(--surface-background); font-size: .8rem; vertical-align: middle; margin: 0; }
.table > :not(caption) > * > * { padding: .9rem 1.1rem; }
.table thead th { background: var(--surface-background); color: var(--text-secondary); font-size: .675rem; font-weight: 600; white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table-user { display: flex; align-items: center; gap: .7rem; min-width: 150px; }
.table-user-name { font-weight: 600; overflow-wrap: anywhere; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; white-space: nowrap; }
.table-actions form { display: inline-flex; }
.role-label { font-size: .7rem; color: var(--text-secondary); padding: .3rem .5rem; border: 1px solid var(--border-color); border-radius: 6px; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .6875rem; font-weight: 550; padding: .3rem .55rem; border-radius: 6px; white-space: nowrap; }
.status-success { color: var(--color-success); background: var(--color-success-soft); }
.status-warning { color: var(--color-warning); background: var(--color-warning-soft); }
.status-danger { color: var(--color-danger); background: var(--color-danger-soft); }
.status-neutral { color: var(--text-secondary); background: var(--surface-background); }
.status-primary { color: var(--color-primary); background: var(--color-primary-soft); }
.empty-state { text-align: center; padding: 3rem 1.25rem; }
.empty-state h2 { font-size: .95rem; font-weight: 650; margin: 1rem 0 .5rem; }
.empty-state p { color: var(--text-secondary); font-size: .8rem; max-width: 380px; margin: 0 auto; }
.empty-state-actions { margin-top: 1.25rem; }
.form-layout { max-width: 1080px; }
.form-section { padding: 1.75rem; }
.form-section + .form-section { border-top: 1px solid var(--border-color); }
.form-section-header { margin-bottom: 1.5rem; }
.form-section-header h2 { font-size: .9rem; font-weight: 650; margin: 0 0 .4rem; }
.form-section-header p { font-size: .75rem; color: var(--text-secondary); margin: 0; }
.form-label { font-size: .75rem; font-weight: 550; margin-bottom: .5rem; }
.form-control, .form-select { font-size: .8125rem; min-height: 40px; padding: .6rem .8rem; background-color: var(--surface-white); border-color: var(--border-color); border-radius: 8px; }
.form-select { padding-right: 2.3rem; }
.form-control::placeholder { color: var(--text-muted); opacity: 1; }
.form-control:focus, .form-select:focus { background-color: var(--surface-white); border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--color-danger); }
.form-text { color: var(--text-muted); font-size: .7rem; line-height: 1.6; }
.invalid-feedback { color: var(--color-danger); font-size: .7rem; margin-top: .4rem; }
.required-mark { color: var(--color-danger); margin-left: .15rem; }
.form-footer { display: flex; justify-content: flex-end; gap: .6rem; }
.alert { --bs-alert-border-radius: var(--radius); padding: 1rem 1.25rem; font-size: .8125rem; }
.alert-success { --bs-alert-bg: var(--color-success-soft); --bs-alert-color: var(--color-success); --bs-alert-border-color: var(--color-success-soft); }
.alert-danger { --bs-alert-bg: var(--color-danger-soft); --bs-alert-color: var(--color-danger); --bs-alert-border-color: var(--color-danger-soft); }
.alert-warning { --bs-alert-bg: var(--color-warning-soft); --bs-alert-color: var(--color-warning); --bs-alert-border-color: var(--color-warning-soft); }
.alert-info { --bs-alert-bg: var(--color-primary-soft); --bs-alert-color: var(--color-primary); --bs-alert-border-color: var(--color-primary-soft); }
.alert-dismissible { padding-right: 3rem; }
.modal-content { border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: var(--shadow-floating); background: var(--surface-white); }
.modal-header { border-bottom: 0; padding: 1.5rem 1.5rem 0; }
.modal-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius); background: var(--color-danger-soft); color: var(--color-danger); font-size: 1.25rem; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-title { font-size: 1.1rem; font-weight: 650; margin-bottom: .6rem; }
.modal-body p { color: var(--text-secondary); margin-bottom: 0; line-height: 1.7; }
.modal-footer { padding: 1rem 1.5rem; border-color: var(--border-color); }
.pagination { --bs-pagination-color: var(--text-secondary); --bs-pagination-bg: var(--surface-white); --bs-pagination-border-color: var(--border-color); --bs-pagination-active-bg: var(--color-primary); --bs-pagination-active-border-color: var(--color-primary); --bs-pagination-focus-box-shadow: 0 0 0 3px var(--color-primary-soft); font-size: .75rem; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(ellipse at top, var(--color-primary-soft), transparent 65%), var(--surface-background); }
.auth-shell { width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: .7rem; margin-bottom: 2rem; font-size: 1.3rem; font-weight: 700; letter-spacing: -.04em; }
.auth-card { padding: 2rem; }
.auth-card h1 { font-size: 1.4rem; letter-spacing: -.025em; font-weight: 650; margin: 0 0 .5rem; }
.auth-description { font-size: .8125rem; color: var(--text-secondary); margin-bottom: 1.75rem; }
.auth-note { font-size: .7rem; color: var(--text-secondary); text-align: center; margin: 1.5rem 0 0; }
.skip-link { position: absolute; z-index: 1100; background: var(--surface-white); padding: 1rem; }
.flatpickr-calendar { border-radius: var(--radius); box-shadow: var(--shadow-floating); border: 1px solid var(--border-color); }
.flatpickr-day.selected { background: var(--color-primary); border-color: var(--color-primary); }
@media (min-width: 992px) {
    .app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; z-index: 1020; }
    .app-sidebar .offcanvas-body { flex: 1; overflow-y: auto; }
    .app-main { margin-left: var(--sidebar-width); }
    .sidebar-collapsed .app-sidebar { width: var(--sidebar-compact-width); }
    .sidebar-collapsed .app-main { margin-left: var(--sidebar-compact-width); }
    .sidebar-collapsed .brand-copy, .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-soon, .sidebar-collapsed .nav-group-label { display: none; }
    .sidebar-collapsed .sidebar-brand { padding-inline: 1.2rem; }
    .sidebar-collapsed .sidebar-nav .nav-link { justify-content: center; padding-inline: .5rem; }
    .sidebar-collapsed .sidebar-footer { justify-content: center; }
}
@media (max-width: 991.98px) {
    .app-topbar { padding: 1rem 1.25rem; }
    .app-content { padding: 1.5rem; }
    .app-sidebar .offcanvas-body { flex: 1; }
}
@media (max-width: 575.98px) {
    .app-topbar { height: 76px; padding: .75rem 1rem; gap: .5rem; }
    .header-context { gap: .5rem; }
    .user-menu-copy, .user-menu-toggle > .bi-chevron-down { display: none; }
    .breadcrumb { font-size: .625rem; }
    .app-content { padding: 1.25rem 1rem; }
    .app-footer { padding: 1rem; }
    .page-header { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .page-header h1 { font-size: 1.4rem; }
    .page-header-actions { width: 100%; }
    .page-header-actions .btn { flex: 1; }
    .table-toolbar { flex-direction: column; align-items: stretch; padding: 1rem; }
    .table-count { align-self: flex-start; }
    .form-section { padding: 1.25rem; }
    .form-footer { padding: 1rem; }
    .form-footer .btn { flex: 1; }
    .dashboard-welcome { padding: 1.5rem; align-items: flex-start; flex-direction: column; }
    .auth-card { padding: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Lead enquiry views */
.leads-table { min-width: 1380px; }
.leads-table td { max-width: 220px; overflow-wrap: anywhere; }
.table-secondary { display: block; color: var(--text-muted); font-size: .7rem; margin-top: .25rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin: 0; }
.detail-stack { display: grid; gap: 1.25rem; margin: 0; }
.detail-item dt { font-size: .7rem; font-weight: 500; color: var(--text-secondary); margin-bottom: .4rem; }
.detail-item dd { margin: 0; font-size: .85rem; overflow-wrap: anywhere; }
.lead-notes { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; font-size: .85rem; margin: 0; }
@media (max-width: 575.98px) { .detail-grid { grid-template-columns: 1fr; } .page-header-actions { flex-wrap: wrap; } }

/* Simple lead activity history */
.follow-up-overdue { color: var(--color-danger); font-weight: 600; }
.activity-timeline { list-style: none; margin: 0; padding: 1.5rem; }
.activity-entry { display: flex; gap: .9rem; position: relative; padding-bottom: 1.75rem; }
.activity-entry:last-child { padding-bottom: 0; }
.activity-entry:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 1px; background: var(--border-color); }
.activity-icon { display: grid; place-items: center; width: 35px; height: 35px; flex-shrink: 0; border-radius: 50%; color: var(--color-primary); background: var(--color-primary-soft); }
.activity-content { min-width: 0; flex: 1; padding-top: .2rem; }
.activity-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .4rem 1rem; }
.activity-heading h3 { font-size: .85rem; font-weight: 600; margin: 0; }
.activity-heading time, .activity-author, .activity-next { font-size: .7rem; color: var(--text-secondary); }
.activity-author { margin: .3rem 0 .65rem; }
.activity-next { display: flex; gap: .45rem; margin-top: .65rem; }
@media (max-width: 575.98px) { .activity-timeline { padding: 1.1rem; } }

.catalog-description { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; margin: 0; }

[data-customer-picker] [hidden] { display: none !important; }
[data-customer-results] .list-group-item { font-size: .8125rem; border-color: var(--border-color); text-align: left; }

.invoice-items-table { min-width: 1240px; }
.invoice-items-table td { padding: .75rem .5rem; }
.invoice-items-table .invoice-item-picker { min-width: 230px; width: 23%; }
.invoice-items-table td:nth-child(3) { min-width: 155px; }
.invoice-items-table td:nth-child(4), .invoice-items-table td:nth-child(7) { min-width: 80px; }
.invoice-items-table td:nth-child(5), .invoice-items-table td:nth-child(6) { min-width: 110px; }
.invoice-total-lines > div { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; }
.invoice-total-lines dt { font-weight: 400; color: var(--text-secondary); }
.invoice-total-lines dd { margin: 0; font-variant-numeric: tabular-nums; }
.invoice-grand-total { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--border-color); padding-top: 1rem; align-items: center; }
.invoice-grand-total strong { font-size: 1.5rem; color: var(--color-primary); font-variant-numeric: tabular-nums; }
.invoice-save-bar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem; background: var(--surface-white); border: 1px solid var(--border-color); border-radius: var(--radius); }
.customer-billing-details, .preserve-lines { white-space: pre-line; overflow-wrap: anywhere; }
.invoice-items-table [hidden], .invoice-items-table input[type="hidden"] { display: none !important; }

.dashboard-sales-chart { min-height: 280px; }
.dashboard-sales-figures { font-size: .8125rem; color: var(--text-secondary); }
.dashboard-sales-figures summary { cursor: pointer; padding: .5rem 0; }
@media (max-width: 575.98px) { .dashboard-sales-chart { min-height: 230px; } }

.global-search { flex: 1 1 20rem; max-width: 28rem; min-width: 0; }
@media (max-width: 991.98px) {
    .app-topbar { height: auto; flex-wrap: wrap; }
    .global-search { order: 3; flex-basis: 100%; max-width: none; }
}

.gst-disabled [data-gst] { display: none !important; }

.catalog-search-results { max-height: 16rem; overflow-y: auto; }

/* Shared UI review: readable controls, consistent rhythm and narrow-screen layouts. */
body { line-height: 1.55; }
.page-header-actions { flex-wrap: wrap; }
.header-page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28vw; }
.form-label { font-size: .8125rem; font-weight: 600; }
.form-text, .invalid-feedback { font-size: .75rem; }
.form-section { padding: 1.5rem; }
.form-section-header { margin-bottom: 1.1rem; }
.form-section .row { --bs-gutter-y: 1.15rem; }
.form-section textarea { min-height: 88px; }
.form-control, .form-select { min-width: 0; }
.form-control[readonly] { background: var(--surface-background); }
.form-control:disabled, .form-select:disabled { color: var(--text-secondary); }
.form-footer { position: sticky; bottom: 0; z-index: 5; border-top: 1px solid var(--border-color); border-radius: 0 0 var(--radius) var(--radius); }
.form-field { scroll-margin-block: 2rem; }
.table thead th { font-size: .75rem; }
.table td.text-end, .table th.text-end { font-variant-numeric: tabular-nums; }
.table tbody th { font-weight: 600; }
.table-responsive { border-radius: var(--radius); overscroll-behavior-x: contain; }
.table-responsive:focus-visible { outline-offset: -3px; }
.status-badge { font-size: .75rem; }
.empty-state { padding: 2.5rem 1.25rem; }
.alert { line-height: 1.6; }
.modal-footer { gap: .5rem; }
.modal-footer > * { margin: 0; }
.modal-body { overscroll-behavior: contain; }
.invoice-items-table .form-control, .invoice-items-table .form-select { font-size: .8125rem; }
.invoice-items-table [data-field="quantity"] { max-width: 90px; }
.invoice-items-table [data-field="unit_price"], .invoice-items-table [data-field="discount"] { max-width: 140px; }
.gst-disabled .invoice-items-table { min-width: 980px; }
.invoice-save-bar { position: sticky; bottom: .5rem; z-index: 5; box-shadow: var(--shadow-floating); }
.catalog-search-results .list-group-item { padding: .65rem; font-size: .8125rem; }
.catalog-search-results .list-group-item:focus { background: var(--color-primary-soft); color: var(--color-primary); }
@media (max-width: 767.98px) {
    .card-body, .form-section { padding: 1.1rem; }
    .form-control, .form-select, .invoice-items-table .form-control, .invoice-items-table .form-select { font-size: 1rem; min-height: 44px; }
    .btn { min-height: 44px; }
    .btn-icon { width: 44px; }
    .table-actions { gap: .5rem; }
    .table > :not(caption) > * > * { padding: .8rem; }
    .header-page-title { max-width: 55vw; }
    .invoice-items-table, .gst-disabled .invoice-items-table { min-width: 0; display: block; }
    .invoice-items-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .invoice-items-table tbody { display: block; padding: .75rem; }
    .invoice-items-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding: 1rem; margin-bottom: .75rem; border: 1px solid var(--border-color); border-radius: var(--radius); }
    .invoice-items-table td, .invoice-items-table td:nth-child(n), .invoice-items-table .invoice-item-picker { display: block; min-width: 0; width: auto; padding: 0; border: 0; }
    .invoice-items-table td::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: var(--text-secondary); margin-bottom: .35rem; text-align: left; }
    .invoice-items-table td:nth-child(1), .invoice-items-table td:nth-child(2), .invoice-items-table td:nth-child(3) { grid-column: 1 / -1; }
    .invoice-items-table td:first-child::before { display: none; }
    .invoice-items-table [data-field="quantity"], .invoice-items-table [data-field="unit_price"], .invoice-items-table [data-field="discount"] { max-width: none; }
    .invoice-save-bar { position: static; padding: .85rem; }
    .invoice-save-bar > div { flex: 1; }
    .invoice-save-bar .btn { flex: 1; white-space: nowrap; }
    .modal-dialog { margin: .75rem; }
    .modal-header, .modal-body, .modal-footer { padding: 1rem; }
    .modal-footer .btn { flex: 1; }
    .card[aria-label^="Filter"] .row { --bs-gutter-y: .85rem; }
}
.empty-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; }
@media (max-width: 767.98px) {
    .card[aria-label^="Filter"] .btn { flex: 1; }
    .page-header-actions > form { display: flex; flex: 1; }
}

.discount-disabled [data-discount] { display: none !important; }
