:root {
    --ink: #1B2B4B;
    --ink-soft: #28395C;
    --accent: #2F8F82;
    --accent-soft: #E4F2EF;
    --gold: #C08A3E;
    --bg: #F6F7F9;
    --surface: #FFFFFF;
    --text: #101828;
    --text-soft: #667085;
    --border: #E4E7EC;
    --success: #12805C;
    --warning: #B54708;
    --danger: #B42318;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
    font-size: 14px;
    overflow-x: hidden;
}

h1, h2, h3, h4, .display-num {
    font-family: "Space Grotesk", sans-serif;
}

.mono { font-family: "IBM Plex Mono", monospace; }

.sidebar {
    width: 250px;
    min-height: 100vh;
    max-height: 100vh;
    background: var(--ink);
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 40;
    transition: transform .28s ease;
}

.sidebar-brand {
    padding: 1.6rem 1.5rem 1.2rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}

.sidebar-brand .mark,
.login-brand .mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), #1c6b60);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: .82rem;
}

.sidebar-isotype {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
}

.login-logo-horizontal {
    max-width: min(260px, 100%);
    max-height: 72px;
    object-fit: contain;
}

.login-isotype {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    padding: 6px;
}

.sidebar-brand span {
    color: #fff;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
}

.nav-rail {
    position: relative;
    padding: .5rem .9rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(174, 185, 212, .4) transparent;
}

.nav-rail::-webkit-scrollbar {
    width: 8px;
}

.nav-rail::-webkit-scrollbar-track {
    background: transparent;
}

.nav-rail::-webkit-scrollbar-thumb {
    background: rgba(174, 185, 212, .28);
    border-radius: 999px;
}

.nav-section-label {
    color: #5E6D93;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-weight: 600;
    padding: 1.1rem .85rem .4rem;
}

.nav-group + .nav-group {
    margin-top: .15rem;
}

.nav-link-erp {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .85rem;
    border-radius: 10px;
    color: #AEB9D4;
    font-weight: 500;
    font-size: .88rem;
    text-decoration: none;
    margin-bottom: .15rem;
    transition: background .2s, color .2s;
}

.nav-link-erp i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

.nav-link-erp:hover,
.nav-link-erp.active {
    background: rgba(47, 143, 130, .16);
    color: #fff;
}

.disabled-link {
    opacity: .62;
    pointer-events: none;
}

.sidebar-footer {
    padding: 1rem 1.3rem 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-shrink: 0;
}

.avatar-ring {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #8a5f22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: .8rem;
}

.avatar-ring-sm {
    width: 34px;
    height: 34px;
    font-size: .74rem;
    flex: 0 0 34px;
}

.sidebar-footer .name { color: #fff; font-size: .82rem; font-weight: 600; }
.sidebar-footer .role { color: #8A97BB; font-size: .72rem; }

.main {
    margin-left: 250px;
    padding: 1.6rem 2rem 3rem;
    transition: margin-left .28s ease;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .main {
    margin-left: 0;
}

.topbar,
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar { margin-bottom: 1.6rem; }
.page-heading {
    margin-bottom: 1.7rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    max-width: 420px;
    flex: 1;
}

.search-box input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .68rem 1rem .68rem 2.45rem;
    font-size: .85rem;
    min-height: 44px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .04);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.search-box input:focus {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    box-shadow: 0 0 0 4px rgba(47, 143, 130, .08), 0 14px 30px rgba(16, 24, 40, .06);
    outline: 0;
}

.search-box i {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .9rem;
}

.topbar-actions > .btn-outline-secondary {
    border-radius: 12px;
    min-height: 42px;
    padding: .62rem 1rem;
    border-color: var(--border);
    color: var(--text);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .04);
}

.topbar-actions > .btn-outline-secondary:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    background: #fff;
}

.topbar-profile-link {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    padding: .34rem .48rem .34rem .36rem;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    box-shadow: 0 10px 28px rgba(16, 24, 40, .06);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.topbar-profile-link:hover {
    color: inherit;
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    box-shadow: 0 14px 32px rgba(16, 24, 40, .1);
    transform: translateY(-1px);
}

.topbar-profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #1c6b60);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .74rem;
    flex: 0 0 34px;
}

.topbar-profile-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
    gap: .08rem;
}

.topbar-profile-copy strong {
    font-size: .8rem;
    color: var(--text);
}

.topbar-profile-copy small {
    font-size: .72rem;
    color: var(--text-soft);
}

.topbar-profile-arrow {
    color: #98a2b3;
    font-size: .78rem;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    position: relative;
    box-shadow: 0 8px 20px rgba(16, 24, 40, .04);
    transition: border-color .2s ease, box-shadow .2s ease, color .2s ease, transform .2s ease;
}

.icon-btn:hover {
    color: var(--ink);
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    box-shadow: 0 12px 24px rgba(16, 24, 40, .08);
    transform: translateY(-1px);
}

.icon-btn .dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
}

.page-title {
    font-size: clamp(1.55rem, 2.4vw, 1.95rem);
    font-weight: 700;
    line-height: 1.06;
    margin-bottom: .22rem;
}

.page-sub {
    color: var(--text-soft);
    font-size: .87rem;
    line-height: 1.58;
    margin: 0;
    max-width: 60rem;
}

.page-heading-copy {
    max-width: 60rem;
}

.page-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .65rem;
    margin-left: auto;
}

.page-heading-actions form {
    margin: 0;
}

.page-heading-actions > * {
    flex: 0 0 auto;
}

.btn-primary-erp {
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: .68rem 1.08rem;
    font-size: .85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    min-height: 44px;
    box-shadow: 0 12px 28px rgba(27, 43, 75, .18);
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.btn-primary-erp:hover {
    background: var(--ink-soft);
    color: #fff;
    box-shadow: 0 16px 32px rgba(27, 43, 75, .22);
    transform: translateY(-1px);
}

.btn-outline-erp,
.btn-back,
.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    gap: .48rem;
    border-radius: 12px;
    font-size: .84rem;
    font-weight: 600;
    text-decoration: none;
    min-height: 44px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}

.btn-outline-erp {
    background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
    color: var(--text);
    border: 1px solid var(--border);
    padding: .66rem 1rem;
    box-shadow: 0 10px 22px rgba(16, 24, 40, .04);
}

.btn-outline-erp:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
    box-shadow: 0 14px 28px rgba(16, 24, 40, .08);
    transform: translateY(-1px);
}

.btn-back {
    background: transparent;
    color: var(--text-soft);
    border: 1px solid transparent;
    padding: .66rem 0;
    min-height: auto;
}

.btn-back:hover {
    color: var(--ink);
}

.btn-danger-outline {
    background: #fff;
    color: var(--danger);
    border: 1px solid #f4c9c4;
    padding: .66rem 1rem;
    box-shadow: 0 10px 22px rgba(180, 35, 24, .05);
}

.btn-danger-outline:hover {
    color: var(--danger);
    background: #fff8f7;
    box-shadow: 0 14px 28px rgba(180, 35, 24, .09);
    transform: translateY(-1px);
}

.page-heading-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: .48rem;
    border-radius: 12px;
    min-height: 44px;
    padding: .66rem 1rem;
    font-size: .84rem;
    font-weight: 600;
    box-shadow: 0 10px 22px rgba(16, 24, 40, .04);
}

.page-heading-actions .btn.btn-light,
.page-heading-actions .btn.btn-outline-secondary {
    background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
    color: var(--text);
    border-color: var(--border);
}

.page-heading-actions .btn.btn-outline-danger {
    color: var(--danger);
    border-color: #f4c9c4;
    background: #fff;
}

.page-heading-actions .btn:hover {
    transform: translateY(-1px);
}

.kpi-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.kpi-card {
    padding: 1.2rem 1.3rem;
    height: 100%;
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.kpi-icon,
.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.tone-primary { background: var(--accent-soft); color: var(--accent); }
.tone-warning { background: #FEF0E6; color: var(--warning); }
.tone-danger { background: #FBEAE8; color: var(--danger); }
.tone-success { background: #E7F6EF; color: var(--success); }

.kpi-label {
    color: var(--text-soft);
    font-size: .78rem;
    font-weight: 500;
    margin-bottom: .3rem;
}

.kpi-value {
    font-size: 1.7rem;
    font-weight: 700;
}

.kpi-delta {
    font-size: .76rem;
    font-weight: 600;
    margin-top: .3rem;
    color: var(--text-soft);
}

.kpi-delta.success { color: var(--success); }
.kpi-delta.warning { color: var(--warning); }
.kpi-delta.danger { color: var(--danger); }

.panel {
    padding: 1.5rem 1.6rem;
    box-shadow: 0 20px 40px rgba(16, 24, 40, .04);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.2rem;
    gap: 1rem;
}

.panel-head h2,
.module-card h2 {
    font-size: 1.02rem;
    font-weight: 600;
    margin: 0;
}

.panel-head .sub,
.module-card p {
    color: var(--text-soft);
    font-size: .78rem;
    line-height: 1.55;
}

.compact-head {
    margin-bottom: .85rem;
}

.module-card p {
    margin: .55rem 0 .7rem;
}

.badge-status {
    font-size: .72rem;
    font-weight: 600;
    padding: .32rem .6rem;
    border-radius: 7px;
    white-space: nowrap;
}

.badge-success { background: #E7F6EF; color: var(--success); }
.badge-warning { background: #FEF0E6; color: var(--warning); }
.badge-danger { background: #FBEAE8; color: var(--danger); }
.badge-neutral { background: #EEF2F6; color: var(--text-soft); }
.badge-info { background: #E8F1FB; color: #1D5F9F; }
.badge-muted { background: #F2F4F7; color: var(--text-soft); }

.icon-pill {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--pill-color, var(--accent)) 14%, #fff);
    color: var(--pill-color, var(--accent));
    flex: 0 0 34px;
}

.compact-switch {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .65rem .8rem .65rem 2.9rem;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.label-preview {
    width: min(260px, 100%);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: .9rem 1rem;
    background: #fff;
    display: grid;
    gap: .25rem;
}

.label-preview strong,
.label-preview span {
    display: block;
}

.barcode-sample {
    font-family: "IBM Plex Mono", monospace;
    font-size: 1.25rem;
    letter-spacing: .08em;
    color: var(--ink);
    line-height: 1;
}

table.erp-table {
    font-size: .83rem;
    margin-bottom: 0;
    --bs-table-bg: transparent;
}

table.erp-table thead th {
    color: var(--text-soft);
    font-weight: 600;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: .7rem;
}

table.erp-table tbody td {
    border-bottom: 1px solid var(--border);
    padding: .95rem .55rem;
}

table.erp-table tbody tr {
    transition: background .18s ease;
}

table.erp-table tbody tr:hover {
    background: #fbfcfd;
}

.product-catalog-table,
.stock-control-panel {
    overflow: visible;
}

.product-catalog-table .erp-table {
    table-layout: fixed;
    width: 100%;
}

.product-catalog-table .erp-table th,
.product-catalog-table .erp-table td {
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.product-catalog-table .erp-table th:nth-child(1),
.product-catalog-table .erp-table td:nth-child(1) { width: 10%; }
.product-catalog-table .erp-table th:nth-child(2),
.product-catalog-table .erp-table td:nth-child(2) { width: 23%; }
.product-catalog-table .erp-table th:nth-child(3),
.product-catalog-table .erp-table td:nth-child(3) { width: 9%; }
.product-catalog-table .erp-table th:nth-child(4),
.product-catalog-table .erp-table td:nth-child(4) { width: 14%; }
.product-catalog-table .erp-table th:nth-child(5),
.product-catalog-table .erp-table td:nth-child(5) { width: 13%; }
.product-catalog-table .erp-table th:nth-child(6),
.product-catalog-table .erp-table td:nth-child(6) { width: 11%; }
.product-catalog-table .erp-table th:nth-child(7),
.product-catalog-table .erp-table td:nth-child(7) { width: 7%; }
.product-catalog-table .erp-table th:nth-child(8),
.product-catalog-table .erp-table td:nth-child(8) { width: 6%; }

.availability-help {
    color: var(--text-soft);
    cursor: help;
    font-size: .78rem;
    line-height: 1;
    text-transform: none;
    vertical-align: baseline;
}

.availability-heading {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
}

.erp-sortable-column {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.erp-sortable-column::after {
    content: '\2195';
    color: var(--text-soft);
    font-size: .78rem;
    margin-left: .35rem;
}

.erp-sortable-column.is-sorted::after {
    content: '\2191';
    color: var(--accent);
}

.erp-sortable-column.is-sorted.is-desc::after {
    content: '\2193';
}

.stock-control-tabs {
    gap: .45rem;
    border-bottom: 1px solid var(--border);
}

.stock-control-tabs .nav-link {
    color: var(--text-soft);
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-weight: 600;
    padding: .6rem .8rem;
}

.stock-control-tabs .nav-link.active,
.stock-control-tabs .nav-link:hover {
    color: var(--ink);
    border-color: var(--accent);
    background: transparent;
}

.stock-control-table .text-end {
    font-variant-numeric: tabular-nums;
}

.stock-control-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.35rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.stock-control-overview-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.stock-control-overview h1 {
    margin: 0;
    font-size: 1.35rem;
}

.stock-control-overview-icon,
.stock-product-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.stock-control-overview-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    font-size: 1.2rem;
}

.stock-control-overview-icon.is-attention {
    color: #B54708;
    background: #FFF1E7;
}

.stock-control-overview-icon.is-healthy {
    color: #087F5B;
    background: #E8F6F0;
}

.stock-control-overview-metrics {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    white-space: nowrap;
}

.stock-control-overview-metrics div {
    display: grid;
    gap: .15rem;
}

.stock-control-overview-metrics dt {
    color: var(--text-soft);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.stock-control-overview-metrics dd {
    margin: 0;
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.stock-control-overview-metrics dd small {
    color: var(--text-soft);
    font-size: .8rem;
    font-weight: 600;
}

.stock-control-heading {
    margin-bottom: .5rem;
}

.stock-price-list-control {
    display: grid;
    gap: .28rem;
    min-width: 205px;
    color: var(--text-soft);
    font-size: .75rem;
    font-weight: 700;
}

.stock-price-list-control .form-select {
    min-height: 34px;
    color: var(--ink);
    font-size: .86rem;
    font-weight: 600;
}

.stock-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.1rem;
}

.stock-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 34px;
    padding: .38rem .72rem;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 650;
}

.stock-filter-chip span {
    display: inline-grid;
    min-width: 1.3rem;
    min-height: 1.3rem;
    place-items: center;
    padding: 0 .25rem;
    color: var(--ink);
    background: #F1F4F8;
    border-radius: 999px;
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
}

.stock-filter-chip:hover,
.stock-filter-chip.active {
    color: #FFF;
    background: var(--accent);
    border-color: var(--accent);
}

.stock-filter-chip:hover span,
.stock-filter-chip.active span {
    color: var(--accent);
    background: #FFF;
}

.stock-control-table th:nth-child(2) {
    min-width: 265px;
}

.stock-product-cell {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 225px;
}

.stock-product-cell strong,
.stock-product-cell .small-note,
.stock-insight strong,
.stock-insight span {
    display: block;
}

.stock-product-icon {
    width: 34px;
    height: 34px;
    color: #148C7A;
    background: #E8F4F1;
    border-radius: 7px;
}

.stock-insight {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    max-width: 430px;
}

.stock-insight strong {
    color: var(--ink);
    font-size: .9rem;
    line-height: 1.3;
}

.stock-insight span:not(.stock-insight-dot) {
    margin-top: .15rem;
    color: var(--text-soft);
    font-size: .8rem;
    line-height: 1.35;
}

.stock-insight-dot {
    width: 8px;
    height: 8px;
    margin-top: .28rem;
    border-radius: 50%;
    background: #98A2B3;
}

.stock-insight.is-danger .stock-insight-dot { background: #D92D20; }
.stock-insight.is-warning .stock-insight-dot { background: #DC6803; }
.stock-insight.is-info .stock-insight-dot { background: #2E90FA; }
.stock-insight.is-success .stock-insight-dot { background: #12B76A; }

.stock-available-cell strong,
.stock-available-cell span {
    display: block;
}

.stock-available-cell strong {
    font-size: .98rem;
}

.stock-available-cell span {
    color: var(--text-soft);
    font-size: .76rem;
}

.stock-sale-price strong,
.stock-sale-price span {
    display: block;
}

.stock-sale-price strong {
    color: var(--ink);
    font-size: .93rem;
    font-variant-numeric: tabular-nums;
}

.stock-sale-price span {
    overflow: hidden;
    max-width: 120px;
    color: var(--text-soft);
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-detail-column {
    width: 46px;
    text-align: right;
}

.stock-detail-trigger {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 7px;
}

.stock-forecast-modal .modal-header,
.stock-forecast-modal .modal-body {
    padding: 1.35rem 1.5rem;
}

.stock-modal-summary h3 {
    margin: 0 0 .4rem;
    font-size: 1.2rem;
}

.stock-modal-summary p {
    margin: 0;
    color: var(--text-soft);
}

.stock-modal-action {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 1.15rem 0;
    padding: .8rem .9rem;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-soft);
    font-size: .9rem;
}

.forecast-technical-details {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.forecast-technical-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--accent);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.forecast-technical-details summary::-webkit-details-marker { display: none; }
.forecast-technical-details[open] summary i { transform: rotate(180deg); }

.forecast-tech-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem 1rem;
}

.forecast-tech-grid div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #EEF1F5;
}

.forecast-tech-grid span,
.forecast-formula {
    color: var(--text-soft);
    font-size: .82rem;
}

.forecast-tech-grid strong {
    color: var(--ink);
    font-size: .86rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.forecast-formula { margin-top: 1rem; }

.table-actions {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
    white-space: nowrap;
}

.table-actions form {
    margin: 0;
}

.table-actions .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    border-color: var(--border);
    box-shadow: 0 6px 18px rgba(16, 24, 40, .04);
}

.purchase-actions-toggle::after {
    display: none;
}

.erp-actions-toggle::after {
    display: none;
}

.erp-actions-menu,
.purchase-actions-menu {
    min-width: 240px;
    padding: .45rem;
    border-radius: 16px;
    border-color: var(--border);
    box-shadow: 0 20px 40px rgba(15, 23, 42, .12);
}

.erp-actions-menu .dropdown-item,
.purchase-actions-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    border-radius: 12px;
    padding: .65rem .8rem;
    font-weight: 600;
}

.erp-actions-menu form,
.purchase-actions-menu form {
    margin: 0;
}

.erp-actions-menu .dropdown-item,
.erp-actions-menu button.dropdown-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.erp-actions-menu .dropdown-item i,
.purchase-actions-menu .dropdown-item i {
    font-size: 1rem;
}

.erp-actions-table {
    overflow: visible;
}

.price-list-index-table {
    width: 100%;
}

.price-list-index-table .erp-table {
    width: 100%;
    table-layout: fixed;
}

.price-list-index-table .erp-table th,
.price-list-index-table .erp-table td {
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.price-list-index-table .erp-table th:nth-child(1),
.price-list-index-table .erp-table td:nth-child(1) { width: 11%; }
.price-list-index-table .erp-table th:nth-child(2),
.price-list-index-table .erp-table td:nth-child(2) { width: 27%; }
.price-list-index-table .erp-table th:nth-child(3),
.price-list-index-table .erp-table td:nth-child(3) { width: 22%; }
.price-list-index-table .erp-table th:nth-child(4),
.price-list-index-table .erp-table td:nth-child(4),
.price-list-index-table .erp-table th:nth-child(5),
.price-list-index-table .erp-table td:nth-child(5) { width: 9%; }
.price-list-index-table .erp-table th:nth-child(6),
.price-list-index-table .erp-table td:nth-child(6) { width: 12%; }
.price-list-index-table .erp-table th:nth-child(7),
.price-list-index-table .erp-table td:nth-child(7) { width: 10%; }

.price-list-settings {
    padding: 1rem;
    margin-left: 0;
    margin-right: 0;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: .65rem;
}

.price-list-channel-options {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .85rem;
    min-height: 2.8rem;
    padding: .65rem .75rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: .5rem;
}

.price-list-channel-option {
    margin: 0;
    white-space: nowrap;
}

.price-list-products-table {
    width: 100%;
}

.price-list-products-table .erp-table {
    width: 100%;
    table-layout: fixed;
}

.price-list-products-table .erp-table th,
.price-list-products-table .erp-table td {
    overflow-wrap: anywhere;
    vertical-align: top;
}

.price-list-products-table .erp-table th:nth-child(1),
.price-list-products-table .erp-table td:nth-child(1) { width: 8%; }
.price-list-products-table .erp-table th:nth-child(2),
.price-list-products-table .erp-table td:nth-child(2) { width: 20%; }
.price-list-products-table .erp-table th:nth-child(3),
.price-list-products-table .erp-table td:nth-child(3) { width: 38%; }
.price-list-products-table .erp-table th:nth-child(4),
.price-list-products-table .erp-table td:nth-child(4) { width: 25%; }
.price-list-products-table .erp-table th:nth-child(5),
.price-list-products-table .erp-table td:nth-child(5) { width: 9%; }

.price-list-price-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .55rem;
}

.price-list-price-fields label,
.price-list-validity-fields label {
    display: grid;
    gap: .3rem;
    margin: 0;
    color: var(--text-soft);
    font-size: .72rem;
    font-weight: 600;
}

.price-list-price-fields .form-control,
.price-list-validity-fields .form-control {
    min-width: 0;
}

.price-list-validity-fields {
    display: grid;
    gap: .55rem;
}

.purchase-history-table {
    overflow: visible;
}

@media (max-width: 767.98px) {
    .erp-actions-table {
        overflow-x: auto;
        overflow-y: visible;
    }

    .price-list-index-table {
        overflow: visible;
    }

    .price-list-index-table .erp-table {
        table-layout: auto;
    }

    .price-list-products-table .erp-table,
    .price-list-products-table .erp-table tbody,
    .price-list-products-table .erp-table tr,
    .price-list-products-table .erp-table td {
        display: block;
        width: 100%;
    }

    .price-list-products-table .erp-table thead {
        display: none;
    }

    .price-list-products-table .erp-table tbody tr {
        padding: .85rem 0;
    }

    .price-list-products-table .erp-table tbody td {
        padding: .45rem 0;
        border: 0;
    }

    .price-list-price-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .purchase-history-table {
        overflow-x: auto;
        overflow-y: hidden;
    }
}

.summary-item {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: .9rem 0;
    border-bottom: 1px solid var(--border);
}

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

.summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    flex: 0 0 auto;
}

.summary-item strong {
    display: block;
    font-size: .88rem;
    margin-bottom: .18rem;
}

.summary-item span:not(.summary-icon) {
    display: block;
    color: var(--text-soft);
    font-size: .78rem;
}

.erp-table-tools,
.erp-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
}

.erp-table-tools {
    margin-bottom: .9rem;
    padding: .65rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: .65rem;
}

.erp-table-tools .form-control {
    max-width: 360px;
    min-height: 38px;
    background: #fff;
    border-color: var(--border);
}

.erp-table-tools .form-select {
    width: 160px;
    min-height: 38px;
    background-color: #fff;
    border-color: var(--border);
}

.erp-table-footer {
    margin-top: .9rem;
    padding-top: .85rem;
    border-top: 1px solid var(--border);
}

.erp-pagination {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .35rem;
}

.erp-pagination .btn.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.modal .erp-table-tools {
    margin: .2rem 0 1.1rem;
}

.modal .erp-table-footer {
    margin: 1rem 0 .2rem;
}

.category-detail-link,
.category-product-count {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.category-detail-link:hover,
.category-product-count:hover {
    color: var(--accent);
    text-decoration: underline;
}

.product-category-detail-table {
    overflow: visible;
}

.choices.mc-choices {
    margin-bottom: 0;
}

.choices.mc-choices[data-type*="select-one"]::after {
    border-color: var(--text-soft) transparent transparent;
    right: 14px;
}

.choices.mc-choices.is-open[data-type*="select-one"]::after {
    border-color: transparent transparent var(--text-soft);
    margin-top: -7px;
}

.choices.mc-choices .choices__inner {
    min-height: 42px;
    padding: .46rem 2.3rem .46rem .8rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    font-size: .84rem;
    color: var(--text);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .03);
}

.choices.mc-choices.is-focused .choices__inner,
.choices.mc-choices.is-open .choices__inner {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    box-shadow: 0 0 0 4px rgba(47, 143, 130, .08), 0 12px 26px rgba(16, 24, 40, .05);
}

.choices.mc-choices .choices__input {
    background: transparent;
    margin-bottom: 0;
    font-size: .84rem;
    color: var(--text);
}

.choices.mc-choices .choices__placeholder {
    color: var(--text-soft);
    opacity: 1;
}

.choices.mc-choices .choices__list--dropdown,
.choices.mc-choices .choices__list[aria-expanded] {
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 22px 44px rgba(16, 24, 40, .12);
    padding: .35rem;
    margin-top: .35rem;
    z-index: 1055;
}

.choices.mc-choices .choices__list--dropdown .choices__list,
.choices.mc-choices .choices__list[aria-expanded] .choices__list {
    max-height: min(55vh, 32rem);
    overflow-y: auto;
}

.choices.mc-choices .choices__list--dropdown .choices__input {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .55rem .72rem;
    margin: .2rem;
    box-shadow: none;
}

.choices.mc-choices .choices__list--dropdown .choices__item,
.choices.mc-choices .choices__list[aria-expanded] .choices__item {
    border-radius: 10px;
    padding: .62rem .72rem;
    font-size: .84rem;
}

.choices.mc-choices .choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices.mc-choices .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
    background: #f5f8fb;
    color: var(--ink);
}

.choices.mc-choices .choices__list--single {
    padding: .1rem 0;
}

.choices.mc-choices.is-disabled .choices__inner,
.choices.mc-choices.is-disabled .choices__input {
    background: #f8fafc;
}

.choices.mc-choices.is-invalid .choices__inner {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .08);
}

.client-cell {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    min-width: 220px;
}

.client-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(47, 143, 130, .08);
}

.client-copy,
.client-contact,
.client-meta-stack {
    display: grid;
    gap: .16rem;
    min-width: 0;
}

.client-name {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
}

.client-meta,
.client-contact span,
.client-meta-stack span {
    color: var(--text-soft);
    font-size: .76rem;
}

.client-contact strong,
.client-meta-stack strong {
    font-size: .85rem;
    font-weight: 600;
}

.activity-list {
    display: grid;
    gap: .85rem;
}

.activity-item {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}

.activity-item p {
    margin: 0;
    color: var(--text-soft);
    font-size: .85rem;
}

.timeline-dot {
    width: 9px;
    height: 9px;
    margin-top: .33rem;
    border-radius: 50%;
    background: var(--accent);
    flex: 0 0 auto;
}

.timeline-dot.warning { background: var(--warning); }
.timeline-dot.success { background: var(--success); }

.module-check-list {
    display: grid;
    gap: .55rem;
}

.module-check {
    display: flex;
    align-items: center;
    gap: .65rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .7rem .85rem;
    font-size: .86rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.detail-grid > div {
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 12px;
    padding: .88rem .98rem;
    min-width: 0;
}

.detail-grid span,
.contact-card span,
.module-pill span,
.small-note {
    display: block;
    color: var(--text-soft);
    font-size: .76rem;
}

.detail-grid strong,
.module-pill strong {
    display: block;
    font-size: .86rem;
    margin-top: .18rem;
    overflow-wrap: anywhere;
}

.detail-wide {
    grid-column: 1 / -1;
}

.module-pill-grid {
    display: grid;
    gap: .65rem;
}

.module-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .75rem .85rem;
}

.module-state-select {
    width: 150px;
    flex: 0 0 150px;
}

.contract-grid {
    grid-template-columns: 1fr;
}

.erp-tabs .nav-link {
    color: var(--text-soft);
    border-radius: 10px;
    font-size: .86rem;
    font-weight: 600;
}

.erp-tabs .nav-link.active {
    background: var(--ink);
    color: #fff;
}

.plan-card {
    height: 100%;
}

.plan-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.plan-head h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.plan-price {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.plan-price span {
    color: var(--text-soft);
    font-family: "Inter", sans-serif;
    font-size: .75rem;
    font-weight: 600;
}

.plan-card p {
    color: var(--text-soft);
    min-height: 42px;
    margin-bottom: 1rem;
}

.plan-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.plan-metrics div {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .65rem .75rem;
}

.plan-metrics span {
    display: block;
    color: var(--text-soft);
    font-size: .72rem;
}

.plan-metrics strong {
    display: block;
    margin-top: .2rem;
}

.limit-grid {
    display: grid;
    gap: .75rem;
}

.limit-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .8rem .85rem;
}

.limit-row {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: flex-start;
}

.limit-row strong {
    display: block;
    font-size: .88rem;
}

.limit-row span:not(.badge-status) {
    display: block;
    color: var(--text-soft);
    font-size: .76rem;
    margin-top: .12rem;
}

.limit-bar {
    height: 7px;
    border-radius: 999px;
    background: #EEF2F6;
    overflow: hidden;
    margin-top: .65rem;
}

.limit-bar span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
}

.template-list {
    display: grid;
    gap: 1rem;
}

.template-editor {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
}

.payment-inline-form {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .85rem;
}

.brand-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 74px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #F8FAFC;
    padding: .75rem;
}

.brand-preview img {
    max-width: 100%;
    max-height: 58px;
    object-fit: contain;
}

.brand-preview-square {
    width: 86px;
    min-height: 74px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.contact-card strong {
    display: block;
    font-size: .94rem;
}

.operation-workspace {
    margin-bottom: 1rem;
}

.operation-doc-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.operation-feedback {
    margin: 0;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 600;
}

.operation-doc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
}

.operation-doc-grid .form-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-soft);
    margin-bottom: .3rem;
}

.pos-workspace {
    display: grid;
    gap: 1rem;
}

.pos-status-strip {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    padding: .8rem 1rem;
    font-size: .82rem;
}

.shift-pill {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: .35rem .8rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.shift-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 1rem;
    align-items: start;
}

.pos-catalog-panel,
.pos-cart-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.pos-catalog-panel {
    padding: 1rem;
}

.pos-search-row {
    display: flex;
    gap: .7rem;
    margin-bottom: 1rem;
}

.pos-search-row .search-box {
    max-width: none;
}

.operation-mode-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin-bottom: .9rem;
}

.mode-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-soft);
    border-radius: 10px;
    padding: .65rem .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-size: .84rem;
    font-weight: 800;
}

.mode-btn.active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.scan-btn {
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0 1rem;
    font-size: .85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.category-row {
    display: flex;
    gap: .55rem;
    overflow-x: auto;
    padding-bottom: .85rem;
}

.category-pill {
    flex-shrink: 0;
    padding: .45rem .9rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-soft);
}

.category-pill.active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .85rem;
}

.product-grid-footer {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
    flex-wrap: wrap;
}

.product-grid-footer-controls {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.product-grid-footer .form-select {
    width: 150px;
}

.product-grid-empty {
    grid-column: 1 / -1;
    min-height: 220px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 78%, var(--bg));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    color: var(--text-soft);
    text-align: center;
    padding: 1.25rem;
}

.product-grid-empty i {
    font-size: 1.35rem;
    color: var(--accent);
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .85rem;
    text-align: left;
    display: grid;
    gap: .5rem;
}

.product-card:hover {
    border-color: var(--accent);
}

.product-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.pname {
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.25;
}

.pmeta {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    align-items: center;
}

.pprice {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 700;
    font-size: .84rem;
}

.pstock {
    color: var(--text-soft);
    font-size: .72rem;
}

.pos-cart-panel {
    display: flex;
    flex-direction: column;
    min-height: 660px;
    overflow: hidden;
}

.cart-head,
.customer-row,
.cart-summary {
    padding: 1rem;
}

.cart-head,
.customer-row {
    border-bottom: 1px solid var(--border);
}

.cart-head,
.customer-row,
.cart-item,
.summary-row {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.cart-head {
    justify-content: space-between;
}

.cart-head h2 {
    font-size: 1rem;
    margin: 0;
}

.cart-head .count {
    color: var(--text-soft);
    font-size: .76rem;
}

.customer-row {
    font-size: .84rem;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: .3rem 1rem;
}

.cart-item {
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}

.operation-cart-item {
    align-items: flex-start;
}

.purchase-cart-item {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: .85rem;
}

.operation-line-controls {
    display: grid;
    justify-items: end;
    gap: .45rem;
    min-width: 116px;
}

.purchase-line-controls {
    flex: 0 0 auto;
    margin-left: auto;
}

.line-money {
    display: grid;
    gap: .2rem;
    justify-items: end;
    color: var(--text-soft);
    font-size: .68rem;
    font-weight: 700;
}

.line-money input {
    width: 92px;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: .28rem .4rem;
    font-family: "IBM Plex Mono", monospace;
    font-size: .76rem;
    text-align: right;
}

.line-mode-toggle {
    display: inline-flex;
    gap: .25rem;
    background: var(--bg);
    border-radius: 8px;
    padding: .2rem;
}

.line-mode-toggle button {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-soft);
    font-weight: 900;
}

.line-mode-toggle button.active.positive {
    background: #E7F6EF;
    color: var(--success);
    border-color: #BFE8D4;
}

.line-mode-toggle button.active.negative {
    background: #FBEAE8;
    color: var(--danger);
    border-color: #F3C6C0;
}

.line-mode-label {
    font-size: .68rem;
    font-weight: 800;
}

.line-mode-label.positive {
    color: var(--success);
}

.line-mode-label.negative {
    color: var(--danger);
}

.ci-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
}

.ci-info {
    flex: 1;
    min-width: 0;
}

.purchase-ci-info {
    min-width: 220px;
}

.ci-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .55rem;
}

.ci-name {
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.purchase-cart-item .ci-name {
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
}

.ci-discount-btn {
    flex: 0 0 auto;
    margin-top: -.1rem;
}

.ci-unit {
    color: var(--text-soft);
    font-size: .72rem;
}

.purchase-line-meta {
    width: 100%;
    display: grid;
    gap: .65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.purchase-line-tags,
.purchase-line-field {
    width: 100%;
}

.purchase-line-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--bg);
    border-radius: 8px;
    padding: .2rem .3rem;
    flex: 0 0 auto;
}

.qty-control button {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
}

.qty-control .qty-control-input {
    box-sizing: content-box;
    width: 4ch;
    min-width: 4ch;
    max-width: 4ch;
    height: 24px;
    padding: 0 .2rem;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--ink);
    text-align: center;
    font-weight: 700;
    font-family: "IBM Plex Mono", monospace;
    font-variant-numeric: tabular-nums;
    appearance: textfield;
    -moz-appearance: textfield;
}

.qty-control .qty-control-input::-webkit-outer-spin-button,
.qty-control .qty-control-input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

.qty-control .qty-control-input:focus {
    outline: 2px solid color-mix(in srgb, var(--accent) 38%, transparent);
    outline-offset: 1px;
    background: var(--surface);
}

.ci-total {
    width: 76px;
    text-align: right;
    font-family: "IBM Plex Mono", monospace;
    font-weight: 700;
    font-size: .82rem;
}

.empty-cart {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    text-align: center;
    padding: 2rem;
}

.empty-cart i {
    font-size: 2.2rem;
    color: var(--border);
    margin-bottom: .6rem;
}

.summary-row {
    justify-content: space-between;
    color: var(--text-soft);
    font-size: .84rem;
    margin-bottom: .45rem;
}

.summary-row.total {
    color: var(--text);
    font-weight: 800;
    font-size: 1.12rem;
    border-top: 1px dashed var(--border);
    margin-top: .65rem;
    padding-top: .7rem;
}

.pay-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    margin: .9rem 0;
}

.pay-methods button {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 9px;
    padding: .55rem .2rem;
    color: var(--text-soft);
    font-size: .75rem;
    font-weight: 700;
    display: grid;
    justify-items: center;
    gap: .2rem;
}

.pay-methods button.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.charge-btn,
.hold-btn {
    width: 100%;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-weight: 800;
}

.charge-btn {
    border: none;
    background: var(--accent);
    color: #fff;
    padding: .8rem;
}

.hold-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-soft);
    padding: .62rem;
    margin-top: .55rem;
}

.quote-layout {
    align-items: stretch;
}

.quote-header-panel {
    margin-bottom: 0;
}

.quote-cart-panel {
    min-height: 780px;
}

.quote-customer-row {
    align-items: flex-start;
}

.quote-customer-copy {
    min-width: 0;
}

.quote-customer-name {
    font-weight: 700;
    font-size: .94rem;
    line-height: 1.2;
}

.quote-context-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.quote-context-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .8rem .9rem;
    display: grid;
    gap: .18rem;
}

.quote-context-card span {
    color: var(--text-soft);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.quote-context-card strong {
    font-size: .9rem;
    line-height: 1.25;
}

.quote-cart-item .ci-unit,
.quote-cart-item .small-note {
    overflow-wrap: anywhere;
}

.quote-qty-control {
    gap: .2rem;
}

.quote-qty-control input {
    width: 74px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
    padding: .28rem .3rem;
    text-align: center;
    font-size: .76rem;
    font-weight: 700;
}

.quote-empty-catalog {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-soft);
    font-size: .82rem;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    padding: 1rem;
}

.login-shell {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: center;
}

.login-brand {
    color: #fff;
}

.login-brand .mark {
    width: 54px;
    height: 54px;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.login-brand h1 {
    font-size: 2.4rem;
    font-weight: 700;
}

.login-brand p {
    color: #AEB9D4;
    max-width: 420px;
}

.login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
}

.login-note {
    color: var(--text-soft);
    font-size: .76rem;
    margin: 1rem 0 0;
    text-align: center;
}

.security-tip-list {
    display: grid;
    gap: .8rem;
    margin: 0;
}

.security-tip {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}

.security-tip i {
    color: var(--accent);
    font-size: 1rem;
}

.security-tip strong,
.security-tip span {
    display: block;
}

.security-tip span {
    color: var(--text-soft);
    font-size: .78rem;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .3s;
    }

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

    .main {
        margin-left: 0;
        padding: 1rem;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .topbar-profile-link {
        flex: 1;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .pos-layout {
        grid-template-columns: 1fr;
    }

    .operation-doc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-cart-panel {
        min-height: 520px;
    }
}

@media (max-width: 575.98px) {
    .stock-control-overview {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .stock-control-overview-metrics {
        width: 100%;
        justify-content: space-between;
        gap: .75rem;
    }

    .stock-control-overview-metrics dt {
        white-space: normal;
    }

    .stock-quick-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: .2rem;
    }

    .stock-filter-chip { white-space: nowrap; }

    .stock-control-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .stock-price-list-control { min-width: 0; }

    .stock-control-table th:nth-child(2) { min-width: 230px; }

    .stock-forecast-modal .modal-header,
    .stock-forecast-modal .modal-body { padding: 1rem; }

    .forecast-tech-grid { grid-template-columns: 1fr; }

    .operation-doc-grid,
    .operation-mode-row {
        grid-template-columns: 1fr;
    }

    .operation-cart-item {
        align-items: center;
    }

    .operation-line-controls {
        min-width: 100px;
    }

    .purchase-cart-item {
        align-items: flex-start;
    }

    .purchase-ci-info,
    .purchase-line-controls {
        width: 100%;
        min-width: 0;
    }

    .purchase-line-controls {
        margin-left: 0;
        justify-items: stretch;
    }

    .purchase-line-controls .qty-control {
        width: 100%;
        justify-content: space-between;
    }

    .purchase-line-controls .line-money,
    .purchase-line-meta .line-money,
    .purchase-line-field .line-money {
        justify-items: stretch;
    }

    .purchase-line-controls .line-money input,
    .purchase-line-meta .line-money input,
    .purchase-line-field .line-money input {
        width: 100%;
    }

    .purchase-line-meta {
        grid-template-columns: 1fr;
    }
}
