: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;
}

.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-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;
}

.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.6rem; }

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

.search-box input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .55rem .9rem .55rem 2.3rem;
    font-size: .85rem;
    width: 100%;
}

.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-profile-link {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    padding: .28rem .42rem .28rem .32rem;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .05);
}

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

.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: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    position: relative;
}

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

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .15rem;
}

.page-sub {
    color: var(--text-soft);
    font-size: .85rem;
    margin: 0;
}

.btn-primary-erp {
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .6rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
}

.btn-primary-erp:hover {
    background: var(--ink-soft);
    color: #fff;
}

.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.4rem 1.5rem;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.1rem;
    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;
}

.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-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;
}

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: .82rem .5rem;
}

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

.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;
}

.erp-table-tools .form-control {
    max-width: 360px;
}

.erp-table-tools .form-select {
    width: 160px;
}

.erp-table-footer {
    margin-top: .9rem;
}

.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;
}

.client-cell {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.client-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.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);
    border-radius: 10px;
    padding: .75rem .85rem;
    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-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;
}

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

.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;
}

.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;
}

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

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

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

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

.qty-control span {
    min-width: 18px;
    text-align: center;
    font-weight: 700;
}

.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;
}

.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;
    }

    .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) {
    .operation-doc-grid,
    .operation-mode-row {
        grid-template-columns: 1fr;
    }

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

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