:root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
    color: #202a31;
    background: #f4f6f6;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
body { letter-spacing: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(100%, 420px); background: #fff; padding: 34px; border: 1px solid #dfe4e4; border-radius: 8px; box-shadow: 0 16px 40px rgba(17, 37, 40, .06); }
.brand-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; background: #176d68; color: #fff; border-radius: 7px; font-size: 14px; font-weight: 800; }
.brand-mark.small { width: 32px; height: 32px; font-size: 11px; }
.auth-heading { margin: 24px 0; }
.eyebrow { margin: 0 0 7px; color: #56716f; font-size: 12px; font-weight: 700; text-transform: uppercase; }
h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 700; }
.auth-form { display: grid; gap: 11px; }
.auth-form label { margin-top: 5px; font-size: 13px; font-weight: 700; }
.auth-form input { min-height: 44px; width: 100%; border: 1px solid #bac9c8; border-radius: 5px; padding: 9px 11px; background: #fff; color: #202a31; }
.auth-form input:focus { outline: 2px solid #31958d; outline-offset: 1px; }
.button-primary, .button-secondary { min-height: 43px; border-radius: 5px; padding: 10px 16px; font-weight: 700; }
.button-primary { margin-top: 14px; border: 1px solid #176d68; background: #176d68; color: #fff; }
.button-primary:hover { background: #125e59; }
.button-secondary { border: 1px solid #bdc9c9; background: #fff; color: #263c3d; }
.button-secondary:hover { background: #eef4f3; }
.form-error, .form-success { padding: 12px; border-radius: 5px; font-size: 13px; line-height: 1.4; }
.form-error { margin: 0 0 8px; color: #8f302b; background: #fff1ef; border: 1px solid #e9b6b2; }
.form-success { color: #1c6255; background: #eaf6f2; border: 1px solid #abd8cb; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 38px; background: #192d30; color: #f7fbfb; padding: 24px 16px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 19px; }
.sidebar nav { display: grid; gap: 12px; }
.nav-section { padding: 0 12px; color: #a4babc; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.nav-current { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 5px; background: #29474a; font-size: 14px; font-weight: 700; }
.nav-link { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 5px; color: #d7e4e4; font-size: 14px; text-decoration: none; }
.nav-link:hover { color: #fff; background: #29474a; }
.nav-menu-icon { flex: 0 0 auto; width: 17px; height: 17px; filter: brightness(0) invert(1); opacity: .74; }
.nav-current .nav-menu-icon, .nav-link:hover .nav-menu-icon { opacity: 1; }
.sidebar-bottom { display: grid; gap: 4px; margin-top: auto; padding: 16px 8px 0; border-top: 1px solid #385357; }
.user-name { font-size: 13px; font-weight: 700; }
.user-role { color: #a4babc; font-size: 12px; }
.main-content { min-width: 0; padding: 34px clamp(20px, 4vw, 64px); }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 28px; border-bottom: 1px solid #dce4e3; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.metric { display: grid; gap: 13px; min-height: 128px; padding: 22px; background: #fff; border: 1px solid #dce4e3; border-radius: 7px; }
.metric span { color: #5e7475; font-size: 13px; font-weight: 700; }
.metric strong { font-size: 29px; line-height: 1; }
.logout-inline { margin-top: 14px; }
.text-button { border: 0; padding: 7px 0; background: transparent; color: #176d68; font-weight: 700; }
.content-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; padding: 22px 0; }
.content-toolbar .button-primary { margin-top: 0; text-decoration: none; }
.text-link { color: #176d68; font-size: 14px; font-weight: 700; }
.user-detail { max-width: 660px; }
.user-detail h2 { margin: 10px 0 6px; font-size: 21px; }
.detail-meta { margin: 0 0 22px; color: #5e7475; font-size: 14px; }
.user-form { display: grid; gap: 9px; max-width: 520px; }
.user-form label { margin-top: 10px; font-size: 13px; font-weight: 700; }
.user-form .form-control, .user-form .form-select, .search-row .form-control { min-height: 43px; border: 1px solid #bac9c8; border-radius: 5px; padding: 9px 11px; background: #fff; color: #202a31; }
.user-form .button-primary { justify-self: start; }
.field-note { margin: 0; color: #5e7475; font-size: 12px; line-height: 1.45; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; padding-top: 20px; border-top: 1px solid #dce4e3; }
.button-danger { min-height: 43px; padding: 10px 16px; border: 1px solid #bb6b63; border-radius: 5px; background: #fff; color: #923e38; font-weight: 700; }
.button-danger:hover { background: #fff1ef; }
.search-row { display: flex; gap: 10px; margin-bottom: 18px; }
.search-row input { width: min(100%, 420px); }
.table-scroll { overflow-x: auto; border-top: 1px solid #dce4e3; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.data-table th, .data-table td { padding: 13px 14px; border-bottom: 1px solid #e3e9e8; text-align: left; white-space: nowrap; }
.data-table th { color: #526b6c; background: #f2f6f5; font-size: 12px; }
.data-table a { color: #176d68; font-weight: 700; }
.empty-cell { color: #5e7475; text-align: center !important; }
.pagination { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 16px; color: #526b6c; font-size: 13px; }
.pagination div { display: flex; gap: 16px; }
.pagination a { color: #176d68; font-weight: 700; }
.reference-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid #dce4e3; margin-top: 20px; }
.reference-tabs a { flex: 0 0 auto; padding: 11px 14px; color: #526b6c; text-decoration: none; font-size: 13px; font-weight: 700; border-bottom: 2px solid transparent; }
.reference-tabs a:hover { color: #176d68; }
.reference-tabs a.active { color: #176d68; border-bottom-color: #176d68; }
.user-form textarea.form-control { width: 100%; resize: vertical; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field .form-control { flex: 1; }
.color-swatch { display: inline-block; vertical-align: middle; width: 30px; height: 30px; padding: 0; border: 1px solid #bac9c8; border-radius: 4px; background: #fff; opacity: 1; }
.status-pill { display: inline-block; min-width: 70px; padding: 4px 7px; border-radius: 4px; font-size: 12px; font-weight: 700; text-align: center; }
.status-pill.active { color: #216759; background: #e5f4ef; }
.status-pill.inactive { color: #86552d; background: #fff0dd; }
.status-pill.archived { color: #607076; background: #eef1f2; }
.status-pill.draft { color: #536774; background: #eaf0f3; }
.status-pill.pending_approval { color: #6957a0; background: #f0eafb; }
.status-pill.changes_requested { color: #91513b; background: #fff0e8; }
.product-detail { max-width: 950px; }
.detail-heading h2 { margin: 5px 0 6px; font-size: 22px; }
.product-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 20px; max-width: 820px; margin-top: 22px; }
.product-form .field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.product-form .field.full { grid-column: 1 / -1; }
.product-form label, .photo-upload label, .reason-form label { font-size: 13px; font-weight: 700; }
.product-form .form-control, .product-form .form-select, .photo-upload .form-control, .reason-form .form-control, .product-search .form-select { min-height: 43px; width: 100%; border: 1px solid #bac9c8; border-radius: 5px; padding: 9px 11px; background: #fff; color: #202a31; }
.product-form textarea.form-control { resize: vertical; }
.product-form .button-primary { margin-top: 0; }
.product-section { margin-top: 34px; padding-top: 24px; border-top: 1px solid #dce4e3; }
.product-section h2 { margin: 0 0 18px; font-size: 20px; }
.product-section h3 { margin: 24px 0 8px; font-size: 16px; }
.product-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.product-photo { width: 150px; }
.product-photo img { display: block; width: 150px; height: 150px; object-fit: cover; border: 1px solid #dce4e3; border-radius: 5px; background: #fff; }
.product-photo .text-button { margin-top: 4px; }
.photo-upload { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; max-width: 720px; margin: 20px 0; }
.photo-upload label { width: 100%; }
.photo-upload .form-control { flex: 1 1 260px; }
.product-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; max-width: 740px; margin: 18px 0; }
.product-summary div.full { grid-column: 1 / -1; }
.product-summary dt { color: #5e7475; font-size: 12px; font-weight: 700; }
.product-summary dd { margin: 5px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.product-cell { display: flex; align-items: center; gap: 10px; }
.product-cell img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.product-cell strong { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.product-search .form-select { width: auto; min-width: 170px; }
.workflow-actions { align-items: end; }
.workflow-actions .button-primary { margin-top: 0; }
.reason-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.reason-form label { width: 100%; }
.reason-form .form-control { flex: 1 1 220px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid #bac9c8; border-radius: 5px; background: #fff; cursor: pointer; }
.icon-button:hover, .icon-button:focus-visible { background: #e8f5f2; border-color: #176d68; }
.icon-button img { width: 18px; height: 18px; }
.row-actions, .variant-heading { display: flex; align-items: center; gap: 7px; }
.row-actions form { margin: 0; }
.variant-heading { justify-content: space-between; margin-bottom: 10px; }
.variant-heading h3 { margin: 0; font-size: 16px; }
.variant-rows { display: grid; gap: 12px; }
.variant-row { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; min-width: 0; margin: 0; padding: 14px; border: 1px solid #dce4e3; border-radius: 5px; }
.variant-row legend { padding: 0 5px; color: #526b6c; font-size: 12px; font-weight: 700; }
.variant-row .remove-variant { position: absolute; top: -18px; right: 10px; }
.stock-only-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 20px; }
.stock-only-form .field { display: grid; gap: 5px; min-width: 160px; }
.stock-only-form label { font-size: 13px; font-weight: 700; }
.stock-only-form .form-control { min-height: 43px; width: 100%; border: 1px solid #bac9c8; border-radius: 5px; padding: 9px 11px; }
.stock-empty { color: #a34b40; }
.upload-preview { width: 88px; height: 88px; object-fit: cover; border: 1px solid #dce4e3; border-radius: 5px; }
.photo-upload progress { width: 100%; height: 10px; accent-color: #176d68; }
.photo-upload [role="status"] { min-width: 90px; color: #526b6c; font-size: 12px; }
.quick-dialog { width: min(94vw, 520px); max-height: 85vh; padding: 22px; border: 1px solid #dce4e3; border-radius: 7px; box-shadow: 0 18px 55px #12282b33; }
.quick-dialog::backdrop { background: #10282baa; }
.quick-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.quick-header h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.quick-photo { display: block; max-width: 100%; height: min(34vh, 230px); margin: 0 auto 14px; object-fit: contain; }
.quick-summary { margin-bottom: 0; }
.quick-variants-title { margin: 22px 0 10px; font-size: 16px; }
.quick-variants { max-height: 250px; }
.quick-variants .data-table th, .quick-variants .data-table td { padding: 9px 10px; }
.loading-overlay { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; background: #eef5f5b8; backdrop-filter: blur(2px); }
.loading-content { display: flex; align-items: center; gap: 12px; padding: 13px 17px; border: 1px solid #dce4e3; border-radius: 5px; background: #fff; color: #192d30; font-size: 14px; font-weight: 700; box-shadow: 0 8px 28px #12282b22; }
.loading-content img { width: 22px; height: 22px; animation: loading-spin 1s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
[hidden] { display: none !important; }
.stock-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stock-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 28px 0 20px; border-bottom: 1px solid #dce4e3; }
.stock-tabs a { flex: 0 0 auto; padding: 11px 14px; border-bottom: 2px solid transparent; color: #526b6c; font-size: 13px; font-weight: 700; text-decoration: none; }
.stock-tabs a.active { border-bottom-color: #176d68; color: #176d68; }
.stock-search .form-select { width: auto; min-width: 180px; }
.stock-operation, .inventory-create { margin-bottom: 24px; padding: 20px 0; border-bottom: 1px solid #dce4e3; }
.stock-operation h2, .inventory-create h2, .inventory-heading h2 { margin: 0 0 7px; font-size: 20px; }
.stock-operation p { margin: 3px 0; color: #526b6c; }
.stock-operation-form { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(120px, .5fr) minmax(220px, 1fr); gap: 12px; align-items: end; margin-top: 15px; }
.stock-operation-form .field { display: grid; gap: 6px; min-width: 0; }
.stock-operation-form .field.wide { grid-column: span 2; }
.stock-operation-form label { font-size: 13px; font-weight: 700; }
.stock-operation-form .form-control, .stock-operation-form .form-select { min-height: 43px; width: 100%; border: 1px solid #bac9c8; border-radius: 5px; padding: 9px 11px; background: #fff; }
.stock-form-actions { display: flex; align-items: center; gap: 8px; }
.stock-form-actions .btn { margin-top: 0; text-decoration: none; }
.stock-state { display: inline-block; min-width: 78px; padding: 4px 7px; border-radius: 4px; font-size: 12px; font-weight: 700; text-align: center; }
.stock-state.ok { color: #216759; background: #e5f4ef; }
.stock-state.low { color: #86552d; background: #fff0dd; }
.stock-state.out { color: #923e38; background: #fff0ee; }
.movement-delta { font-weight: 800; }
.movement-delta.positive { color: #16705f; }
.movement-delta.negative { color: #a34b40; }
.wrap-cell { max-width: 260px; white-space: normal !important; overflow-wrap: anywhere; }
.inventory-heading { display: flex; justify-content: space-between; gap: 25px; margin-bottom: 20px; }
.inventory-heading p { color: #526b6c; }
.inventory-table .form-control { min-width: 105px; min-height: 38px; border: 1px solid #bac9c8; border-radius: 5px; padding: 7px 9px; }
.inventory-count { width: 115px; }
.inventory-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.status-pill.counting { color: #6957a0; background: #f0eafb; }
.status-pill.pending_validation { color: #86552d; background: #fff0dd; }
.status-pill.validated { color: #216759; background: #e5f4ef; }
.status-pill.cancelled { color: #607076; background: #eef1f2; }
.status-pill.open, .status-pill.completed { color: #216759; background: #e5f4ef; }
.status-pill.closed, .status-pill.returned { color: #607076; background: #eef1f2; }
.status-pill.partially_returned { color: #86552d; background: #fff0dd; }
.page-message { margin: 20px 0 0; }
.header-actions, .ticket-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.header-actions { align-items: center; justify-content: flex-end; }
.header-actions form, .header-account-form { margin: 0; }
.header-actions .btn, .ticket-actions .btn, .register-status .btn { margin-top: 0; text-decoration: none; }
.button-danger img { width: 17px; height: 17px; margin-right: 5px; vertical-align: -3px; }
.danger-icon { border-color: #d7aaa5; color: #923e38; }
.danger-icon:hover { background: #fff1ef; }
.danger-icon img { filter: invert(32%) sepia(31%) saturate(1393%) hue-rotate(316deg) brightness(91%) contrast(88%); }
.register-status { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 28px 0; padding-bottom: 24px; border-bottom: 1px solid #dce4e3; }
.register-status h2, .register-action h2, .sales-section h2 { margin: 0 0 8px; font-size: 20px; }
.register-status p { margin: 5px 0 0; color: #526b6c; }
.register-action { margin: 24px 0; padding-bottom: 24px; border-bottom: 1px solid #dce4e3; }
.register-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 12px; align-items: end; max-width: 900px; }
.register-form .field, .customer-fields .field, .pos-comment { display: grid; gap: 6px; min-width: 0; }
.register-form .wide { grid-column: span 2; }
.register-form label, .customer-fields label, .pos-comment label, .comment-form label { font-size: 13px; font-weight: 700; }
.register-form .form-control, .register-form .form-select, .pos-layout .form-control, .pos-layout .form-select, .comment-form .form-control { min-height: 43px; width: 100%; border: 1px solid #bac9c8; border-radius: 5px; padding: 9px 11px; background: #fff; color: #202a31; }
.register-form .btn { margin: 0; }
.sales-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid #dce4e3; }
.empty-state { margin-top: 28px; padding: 38px 0; text-align: center; }
.empty-state h2 { font-size: 21px; }
.empty-state p { color: #526b6c; }
.empty-state .btn { display: inline-block; text-decoration: none; }
.pos-main { padding-right: clamp(18px, 3vw, 44px); padding-left: clamp(18px, 3vw, 44px); }
.pos-layout { display: grid; grid-template-columns: minmax(330px, .9fr) minmax(500px, 1.25fr); gap: 26px; margin-top: 24px; align-items: start; }
.pos-catalog, .pos-cart { min-width: 0; }
.pos-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 9px; }
.line-price-mode, .line-price { width: 145px !important; max-width: 100%; margin-bottom: 5px; }
.segmented-control { display: inline-flex; min-height: 43px; padding: 3px; border: 1px solid #bac9c8; border-radius: 5px; background: #eef3f2; }
.segmented-control label { margin: 0; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { display: grid; place-items: center; min-width: 62px; height: 35px; padding: 0 9px; border-radius: 3px; color: #526b6c; font-size: 13px; font-weight: 700; cursor: pointer; }
.segmented-control input:checked + span { background: #fff; color: #176d68; box-shadow: 0 1px 4px #12282b1c; }
.segmented-control input:focus-visible + span { outline: 2px solid #31958d; }
.search-status { min-height: 20px; margin: 12px 0; color: #526b6c; font-size: 13px; }
.sale-results { display: grid; gap: 8px; max-height: 65vh; overflow-y: auto; }
.sale-result { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 10px; border: 1px solid #dce4e3; border-radius: 6px; background: #fff; }
.sale-result > img, .sale-result-placeholder { width: 58px; height: 58px; border-radius: 4px; object-fit: cover; }
.sale-result-placeholder { display: grid; place-items: center; background: #e5efed; color: #176d68; font-size: 12px; font-weight: 800; }
.sale-result > div:not(.sale-result-side) { display: grid; min-width: 0; gap: 3px; }
.sale-result span, .sale-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale-result span { font-size: 13px; }
.sale-result small { color: #526b6c; font-size: 12px; }
.sale-result-side { display: grid; justify-items: end; gap: 7px; font-size: 13px; }
.pos-cart { padding-left: 25px; border-left: 1px solid #dce4e3; }
.pos-cart-heading, .payment-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.pos-cart-heading h2 { margin: 0; font-size: 21px; }
.pos-cart-heading > strong { color: #526b6c; font-size: 13px; }
.cart-table { margin-top: 15px; }
.cart-table td:first-child { white-space: normal; min-width: 145px; }
.cart-table td:first-child strong, .cart-table td:first-child small { display: block; }
.cart-table td:first-child small { margin-top: 3px; color: #526b6c; }
.cart-quantity { width: 74px !important; min-height: 37px !important; }
.cart-empty td { padding: 34px; color: #526b6c; text-align: center; }
.customer-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.discount-control { display: grid; grid-template-columns: minmax(125px, 1.2fr) minmax(90px, .8fr); gap: 7px; }
.payment-heading { margin: 22px 0 9px; }
.payment-heading h3, .ticket h3 { margin: 0; font-size: 16px; }
.payment-rows { display: grid; gap: 8px; }
.payment-row { display: grid; grid-template-columns: minmax(125px, .7fr) minmax(120px, .7fr) minmax(130px, 1fr) 38px; gap: 8px; }
.credit-control { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(190px, .8fr); gap: 12px; align-items: end; margin-top: 12px; padding: 12px; border: 1px solid #d6e1df; border-radius: 6px; background: #f5f9f8; }
.credit-control .field { display: grid; gap: 6px; }
.credit-control label { font-size: 13px; font-weight: 700; }
.toggle-row { display: flex; align-items: center; gap: 9px; min-height: 43px; margin: 0; }
.toggle-row input { width: 18px; height: 18px; accent-color: #176d68; }
.pos-comment { margin-top: 16px; }
.pos-comment textarea, .comment-form textarea { resize: vertical; }
.sale-totals { display: grid; gap: 7px; margin: 22px 0; }
.sale-totals div { display: flex; justify-content: space-between; gap: 20px; }
.sale-totals dt { color: #526b6c; }
.sale-totals dd { margin: 0; font-weight: 700; }
.sale-totals .grand { margin: 4px 0; padding: 11px 0; border-top: 1px solid #bac9c8; border-bottom: 1px solid #bac9c8; font-size: 20px; }
.sale-totals .balance-due, #sale-balance-row { color: #9a512b; }
.complete-sale { width: 100%; margin-top: 0; }
.complete-sale:disabled { opacity: .45; cursor: not-allowed; }
.ticket { width: min(100%, 820px); margin: 28px auto 0; padding: 24px; border: 1px solid #dce4e3; border-radius: 6px; background: #fff; }
.ticket-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.ticket-heading h2 { margin: 0; font-size: 22px; }
.ticket-heading p, .ticket-customer { color: #526b6c; font-size: 13px; }
.ticket-statuses { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.status-pill.payment-paid { color: #216759; background: #e5f4ef; }
.status-pill.payment-partial { color: #86552d; background: #fff0dd; }
.status-pill.payment-unpaid { color: #923e38; background: #fff0ee; }
.ticket-totals { width: min(100%, 360px); margin-left: auto; }
.ticket-list { margin: 10px 0 0; padding: 0; list-style: none; }
.ticket-list li { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid #e3e9e8; font-size: 13px; }
.ticket-list small, .table-note { display: block; margin-top: 3px; color: #607678; font-size: 11px; }
.text-warning { color: #9a512b; }
.payment-collection { max-width: 820px; margin-right: auto; margin-left: auto; }
.payment-collection-form { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 10px; align-items: end; }
.payment-collection-form .field { display: grid; gap: 6px; }
.payment-collection-form label { font-size: 13px; font-weight: 700; }
.payment-collection-form .form-control, .payment-collection-form .form-select { min-height: 43px; border: 1px solid #bac9c8; border-radius: 5px; padding: 9px 11px; }
.payment-collection-form .btn { margin: 0; }
.ticket-actions { width: min(100%, 820px); margin: 12px auto; justify-content: flex-end; }
.cancellation-note { margin-top: 20px; padding: 12px; color: #8f302b; background: #fff1ef; border-radius: 5px; }
.sale-comment { max-width: 820px; padding: 14px 0; border-bottom: 1px solid #dce4e3; }
.sale-comment time { margin-left: 10px; color: #526b6c; font-size: 12px; }
.sale-comment p { margin: 8px 0 0; line-height: 1.5; }
.comment-form { display: grid; gap: 8px; max-width: 820px; margin-top: 18px; }
.comment-form .btn { justify-self: start; }
.danger-zone h2 { color: #923e38; }
.nav-badge { margin-left: auto; min-width: 19px; height: 19px; padding: 2px 5px; border-radius: 9px; background: #d07845; color: #fff; font-size: 10px; text-align: center; }
.notification-button { position: relative; display: inline-grid; place-items: center; width: 43px; height: 43px; border: 1px solid #bdc9c9; border-radius: 5px; background: #fff; }
.notification-button img { width: 19px; height: 19px; }
.logout-button { padding: 0; }
.notification-button span { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 3px 5px; border-radius: 10px; background: #c45743; color: #fff; font-size: 10px; font-weight: 800; text-align: center; }
.dashboard-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0 4px; }
.dashboard-toolbar p { margin: 3px 0 0; color: #526b6c; font-size: 12px; }
.dashboard-filter { display: flex; align-items: center; gap: 8px; }
.dashboard-filter .form-select, .dashboard-filter .form-control { min-height: 40px; border: 1px solid #bac9c8; border-radius: 5px; padding: 8px 10px; background: #fff; color: #202a31; }
.dashboard-filter .form-select { min-width: 190px; }
.custom-period { display: flex; align-items: center; gap: 7px; }
.dashboard-date-controls { display: grid; justify-items: end; gap: 8px; }
.date-shortcuts { display: inline-flex; border: 1px solid #bac9c8; border-radius: 5px; overflow: hidden; background: #fff; }
.date-shortcuts button { min-height: 32px; padding: 6px 10px; border: 0; border-right: 1px solid #dce4e3; background: #fff; color: #526b6c; font-size: 11px; font-weight: 700; }
.date-shortcuts button:last-child { border-right: 0; }
.date-shortcuts button:hover, .date-shortcuts button.active { background: #e8f2f0; color: #176d68; }
.calendar-field { display: flex; align-items: center; gap: 6px; color: #526b6c; font-size: 11px; font-weight: 700; }
.calendar-field .form-control { width: 145px; }
.dashboard-status { min-height: 18px; margin: 7px 0 0; color: #923e38; font-size: 12px; }
.dashboard-status.loading { color: #526b6c; }
.dashboard-metrics { grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 12px; margin-top: 12px; }
.dashboard-metrics.without-margin { grid-template-columns: repeat(4, minmax(145px, 1fr)); }
.dashboard-metrics .metric { min-height: 115px; padding: 18px; gap: 9px; }
.dashboard-metrics .metric strong { font-size: 25px; overflow-wrap: anywhere; }
.metric-trend { font-size: 12px; font-weight: 800; }
.metric-trend.positive { color: #16705f; }
.metric-trend.negative { color: #a34b40; }
.dashboard-chart-wide, .dashboard-chart-grid, .dashboard-table-grid { margin-top: 30px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading small { color: #607678; font-size: 11px; }
.section-heading a { color: #176d68; font-size: 12px; font-weight: 700; }
.chart-frame { position: relative; width: 100%; height: 310px; min-height: 260px; padding: 16px; border: 1px solid #dce4e3; border-radius: 7px; background: #fff; }
.chart-frame-wide { height: 350px; }
.dashboard-chart-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .7fr); gap: 28px; }
.dashboard-chart-grid section, .dashboard-table-grid section { min-width: 0; }
.dashboard-table-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.dashboard-table-grid .data-table { font-size: 12px; }
.dashboard-table-grid .data-table th, .dashboard-table-grid .data-table td { padding: 11px; }
.dashboard-table-grid td:first-child strong, .dashboard-table-grid td:first-child small { display: block; }
.dashboard-table-grid td:first-child small { margin-top: 3px; color: #607678; }
.numeric-cell { font-weight: 800; text-align: right !important; }
.stock-state-cell { font-size: 11px; font-weight: 800; }
.stock-state-cell.low { color: #86552d; }
.stock-state-cell.out { color: #a23c35; }
.settings-form { max-width: 900px; }
.settings-form section { padding: 28px 0; border-bottom: 1px solid #dce4e3; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 20px; }
.settings-grid .field { display: grid; align-content: start; gap: 6px; }
.settings-grid .wide { grid-column: 1 / -1; }
.settings-grid label { font-size: 13px; font-weight: 700; }
.settings-grid .form-control, .settings-grid .form-select { min-height: 43px; width: 100%; border: 1px solid #bac9c8; border-radius: 5px; padding: 9px 11px; background: #fff; color: #202a31; }
.settings-form > .button-primary { margin-top: 20px; }
.notification-list { margin-top: 8px; border-top: 1px solid #dce4e3; }
.notification-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 14px; padding: 18px 6px; border-bottom: 1px solid #dce4e3; }
.notification-item.unread { background: #f7fbfa; }
.notification-indicator { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #8ca09f; }
.severity-info .notification-indicator { background: #427b9e; }
.severity-warning .notification-indicator { background: #d07845; }
.severity-critical .notification-indicator { background: #c45743; }
.notification-heading { display: flex; justify-content: space-between; gap: 20px; }
.notification-heading h2 { margin: 0; font-size: 15px; }
.notification-heading time { flex: 0 0 auto; color: #607678; font-size: 11px; }
.notification-item p { margin: 7px 0; color: #455d5f; font-size: 13px; line-height: 1.45; }
.notification-actions { display: flex; align-items: center; gap: 15px; }
.notification-actions form { margin: 0; }
.notification-actions .text-button, .notification-actions .text-link { font-size: 12px; }

@media (max-width: 760px) {
    .app-layout { display: block; }
    .sidebar { gap: 18px; padding: 14px 18px; }
    .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 5px; }
    .sidebar .nav-section, .sidebar-bottom { display: none; }
    .nav-link, .nav-current { padding: 8px 10px; font-size: 12px; }
    .main-content { padding: 26px 18px; }
    .page-header { align-items: center; }
    h1 { font-size: 23px; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric { min-height: 105px; }
    .search-row { flex-wrap: wrap; }
    .product-form, .product-summary { grid-template-columns: 1fr; }
    .product-summary div.full { grid-column: auto; }
    .product-search .form-select { width: 100%; }
    .variant-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-operation-form { grid-template-columns: 1fr; }
    .stock-operation-form .field.wide { grid-column: auto; }
    .stock-search .form-select { width: 100%; }
    .inventory-heading { display: block; }
    .register-status { align-items: flex-start; }
    .register-form, .pos-layout { grid-template-columns: 1fr; }
    .register-form .wide { grid-column: auto; }
    .pos-cart { padding: 24px 0 0; border-left: 0; border-top: 1px solid #dce4e3; }
    .sale-results { max-height: none; }
    .customer-fields { grid-template-columns: 1fr; }
    .credit-control, .payment-collection-form { grid-template-columns: 1fr; }
    .dashboard-toolbar { align-items: flex-start; flex-direction: column; }
    .dashboard-filter { width: 100%; flex-wrap: wrap; }
    .dashboard-filter .form-select { flex: 1; }
    .dashboard-date-controls { width: 100%; justify-items: stretch; }
    .date-shortcuts { width: 100%; }
    .date-shortcuts button { flex: 1; }
    .dashboard-metrics, .dashboard-metrics.without-margin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-chart-grid, .dashboard-table-grid { grid-template-columns: 1fr; }
    .chart-frame, .chart-frame-wide { height: 300px; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-grid .wide { grid-column: auto; }
}
@media (max-width: 560px) {
    .variant-row { grid-template-columns: 1fr; }
    .quick-summary { grid-template-columns: 1fr 1fr; }
    .register-status, .page-header { align-items: stretch; flex-direction: column; }
    .pos-toolbar { grid-template-columns: 1fr; }
    .segmented-control { width: 100%; }
    .segmented-control label { flex: 1; }
    .segmented-control span { width: 100%; }
    .payment-row { grid-template-columns: 1fr 1fr 38px; }
    .payment-row input:nth-of-type(2) { grid-column: 1 / span 2; }
    .sale-result { grid-template-columns: 48px minmax(0, 1fr) auto; }
    .sale-result > img, .sale-result-placeholder { width: 48px; height: 48px; }
    .ticket { padding: 16px; }
    .dashboard-metrics, .dashboard-metrics.without-margin { grid-template-columns: 1fr; }
    .dashboard-metrics .metric { min-height: 96px; }
    .custom-period { width: 100%; }
    .custom-period .form-control { min-width: 0; }
    .calendar-field { flex: 1 1 145px; }
    .calendar-field .form-control { width: 100%; min-width: 0; }
    .notification-heading { display: grid; gap: 5px; }
}
@media print {
    .sidebar, .page-header, .ticket-actions, .sales-section, .loading-overlay, .page-message { display: none !important; }
    .app-layout { display: block; }
    .main-content { padding: 0; }
    .ticket { width: 100%; margin: 0; padding: 0; border: 0; }
    .data-table th, .data-table td { padding: 8px; }
}
