:root {
    color-scheme: light;
    --ink: #18212f;
    --muted: #657184;
    --line: #d9e0ea;
    --paper: #ffffff;
    --bg: #eef3f8;
    --primary: #146c5f;
    --primary-strong: #0f5148;
    --accent: #be5b2f;
    --danger: #b42318;
    --success: #0f7b45;
    --topbar-bg: #102f2b;
    --topbar-ink: #f7fbfa;
    --topbar-muted: #c6d8d5;
    --action-primary-bg: var(--primary);
    --action-primary-border: var(--primary-strong);
    --action-soft-bg: #eef6ff;
    --action-soft-border: #a8cdef;
    --action-soft-ink: #155b92;
    --shadow-soft: 0 12px 30px rgba(24, 33, 47, .08);
    --shadow-panel: 0 18px 42px rgba(24, 33, 47, .10);
    font-family: "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

.sr-only {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
}

body.theme-green {
    --primary: #1f7a4d;
    --primary-strong: #155a38;
    --accent: #7c6f22;
    --bg: #eef6f0;
    --topbar-bg: #123f2b;
    --topbar-ink: #f5fff9;
    --topbar-muted: #bad9c7;
    --action-soft-bg: #edf8f4;
    --action-soft-border: #9fd5c2;
    --action-soft-ink: #17684c;
}

body.theme-blue {
    --primary: #1f5f8f;
    --primary-strong: #184766;
    --accent: #9a5a20;
    --bg: #eef4f8;
    --topbar-bg: #102f4a;
    --topbar-ink: #f4fbff;
    --topbar-muted: #bdd5e6;
    --action-soft-bg: #eef6ff;
    --action-soft-border: #a8cdef;
    --action-soft-ink: #155b92;
}

body.theme-light-pink {
    --primary: #b83262;
    --primary-strong: #8f244a;
    --accent: #146c5f;
    --bg: #fff1f5;
    --topbar-bg: #f9acbd;
    --topbar-ink: #2b1220;
    --topbar-muted: #5f3345;
    --action-soft-bg: #fff5f8;
    --action-soft-border: #f2a6ba;
    --action-soft-ink: #9f2f56;
}

body.theme-light-red {
    --primary: #dc2626;
    --primary-strong: #b91c1c;
    --accent: #2563eb;
    --bg: #fff5f5;
    --topbar-bg: #dc2626;
    --topbar-ink: #fffafa;
    --topbar-muted: #ffe4e6;
    --action-soft-bg: #fff5f5;
    --action-soft-border: #fca5a5;
    --action-soft-ink: #b91c1c;
}

body.theme-light-purple {
    --primary: #4b0058;
    --primary-strong: #2e0038;
    --accent: #0f766e;
    --bg: #f4eef7;
    --topbar-bg: #2e0038;
    --topbar-ink: #fff7ff;
    --topbar-muted: #e4c6ea;
    --action-soft-bg: #fbf6fc;
    --action-soft-border: #8a4b95;
    --action-soft-ink: #3b0047;
}

body.theme-light-yellow {
    --primary: #a16207;
    --primary-strong: #854d0e;
    --accent: #2563eb;
    --bg: #fffbea;
    --topbar-bg: #b7791f;
    --topbar-ink: #fffdf2;
    --topbar-muted: #fef3c7;
    --action-soft-bg: #fffbeb;
    --action-soft-border: #f4d06f;
    --action-soft-ink: #854d0e;
}

body.theme-dark {
    color-scheme: dark;
    --ink: #e7edf5;
    --muted: #a8b3c3;
    --line: #334155;
    --paper: #172033;
    --bg: #0f1726;
    --primary: #50b8a5;
    --primary-strong: #3d9d8c;
    --accent: #f2a65f;
    --danger: #ff8a7a;
    --success: #66d496;
    --topbar-bg: #080d17;
    --topbar-ink: #f2f7fb;
    --topbar-muted: #9eb0c3;
    --shadow-soft: 0 14px 34px rgba(0, 0, 0, .28);
    --shadow-panel: 0 22px 48px rgba(0, 0, 0, .34);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .item-panel,
body.theme-dark .cart-panel,
body.theme-dark .open-session form,
body.theme-dark .session-invoices,
body.theme-dark .settings-panel,
body.theme-dark .login-panel,
body.theme-dark .alert,
body.theme-dark .inline-results,
body.theme-dark .invoice-row,
body.theme-dark dialog {
    background: var(--paper);
    color: var(--ink);
}

body.theme-dark .secondary,
body.theme-dark .ghost-button,
body.theme-dark .ghost-link,
body.theme-dark .button-link,
body.theme-dark .item-tile,
body.theme-dark .item-detail-action,
body.theme-dark .item-edit-action,
body.theme-dark .inline-result-button,
body.theme-dark .invoice-actions a,
body.theme-dark .link-button {
    background: #10192a;
    color: var(--ink);
}

body.theme-dark .session-invoices,
body.theme-dark .section-head,
body.theme-dark .session-totals div {
    background: var(--paper);
    color: var(--ink);
}

body.theme-dark .section-head {
    border-bottom-color: var(--line);
}

body.theme-dark .session-totals {
    background: var(--line);
}

body.theme-dark .section-head span,
body.theme-dark .shift-invoices-title span,
body.theme-dark .invoice-filter span,
body.theme-dark .session-totals span {
    color: var(--muted);
}

body.theme-dark .section-head h2,
body.theme-dark .session-totals strong {
    color: var(--ink);
}

body.theme-dark .session-totals strong {
    color: var(--success);
}

body.theme-dark .action-view,
body.theme-dark .action-print,
body.theme-dark .action-settings,
body.theme-dark .action-profile,
body.theme-dark .action-customer,
body.theme-dark .action-add,
body.theme-dark .action-save,
body.theme-dark .action-zatca,
body.theme-dark .action-refund,
body.theme-dark .action-danger,
body.theme-dark .action-clear {
    color: var(--ink);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.brand-mark {
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--primary);
}

.pos-topbar .brand-mark {
    color: var(--topbar-ink);
    font-size: 20px;
    letter-spacing: .08em;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .20), 0 0 18px rgba(255, 255, 255, .16);
}

.login-shell {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 32%),
        linear-gradient(135deg, color-mix(in srgb, var(--topbar-bg) 92%, #000), var(--topbar-bg));
}

.login-panel {
    width: min(420px, 100%);
    padding: 32px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-panel);
}

.login-brand {
    text-align: center;
}

.login-brand img {
    background: #fff;
    border: 1px solid rgba(24, 33, 47, .10);
    border-radius: 50%;
    box-shadow: 0 12px 30px rgba(24, 33, 47, .14);
    display: block;
    height: 88px;
    margin: 0 auto 14px;
    object-fit: contain;
    padding: 6px;
    width: 88px;
}

.login-panel h1 {
    margin: 10px 0 4px;
    font-size: 28px;
}

.login-panel p {
    margin: 0 0 24px;
    color: var(--muted);
}

.counter-block {
    border-top: 1px solid var(--line);
    margin-top: 22px;
    padding-top: 18px;
}

.counter-block:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.counter-block h3 {
    align-items: center;
    display: flex;
    font-size: 16px;
    gap: 10px;
    margin: 0 0 12px;
}

.counter-block h3 span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.counter-edit-form {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.counter-edit-form input {
    min-width: 92px;
    text-align: right;
}

.counter-edit-form button {
    padding: 8px 12px;
}

.login-form,
.open-session form,
.closeout-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 650;
    color: #314056;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(20, 108, 95, .18);
    border-color: var(--primary);
}

button,
.primary {
    border: 0;
    border-radius: 6px;
    padding: 12px 18px;
    background: var(--primary);
    color: #fff;
    font-weight: 750;
}

.btn-primary,
.btn-success,
.btn-secondary,
.btn-outline-primary:hover,
.btn-outline-success:hover {
    background-color: var(--primary) !important;
    border-color: var(--primary-strong) !important;
    color: #fff !important;
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-secondary {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.btn-outline-secondary:hover {
    background-color: var(--primary) !important;
    border-color: var(--primary-strong) !important;
    color: #fff !important;
}

button,
.primary,
.secondary,
.ghost-button,
.ghost-link,
.button-link,
.link-button,
.icon-link {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    justify-content: center;
}

.action-icon {
    align-items: center;
    background: color-mix(in srgb, var(--primary) 14%, #fff);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, #fff);
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 900;
    height: 22px;
    justify-content: center;
    line-height: 1;
    min-width: 22px;
    padding: 0 6px;
}

.action-save .action-icon {
    background: rgba(255, 255, 255, .22);
    border-color: rgba(255, 255, 255, .36);
    color: #fff;
}

.action-icon .bi {
    font-size: 14px;
    line-height: 1;
}

.action-save {
    --action-bg: var(--action-primary-bg);
    --action-border: var(--action-primary-border);
    --action-ink: #fff;
    background: var(--action-bg) !important;
    border-color: var(--action-border) !important;
    color: var(--action-ink) !important;
}

.action-add,
.action-customer {
    --action-bg: var(--action-soft-bg);
    --action-border: var(--action-soft-border);
    --action-ink: var(--action-soft-ink);
    background: var(--action-bg) !important;
    border-color: var(--action-border) !important;
    color: var(--action-ink) !important;
}

.action-view,
.action-print,
.action-settings,
.action-profile {
    --action-bg: var(--action-soft-bg);
    --action-border: var(--action-soft-border);
    --action-ink: var(--action-soft-ink);
    background: var(--action-bg) !important;
    border-color: var(--action-border) !important;
    color: var(--action-ink) !important;
}

.action-zatca {
    --action-bg: var(--action-soft-bg);
    --action-border: var(--action-soft-border);
    --action-ink: var(--action-soft-ink);
    background: var(--action-bg) !important;
    border-color: var(--action-border) !important;
    color: var(--action-ink) !important;
}

.action-refund,
.action-danger {
    --action-bg: var(--action-soft-bg);
    --action-border: var(--action-soft-border);
    --action-ink: var(--action-soft-ink);
    background: var(--action-bg) !important;
    border-color: var(--action-border) !important;
    color: var(--action-ink) !important;
}

.primary.action-refund,
.primary.action-danger {
    --action-bg: var(--action-primary-bg);
    --action-border: var(--action-primary-border);
    --action-ink: #fff;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 22%, transparent);
}

.primary.action-refund .action-icon,
.primary.action-danger .action-icon {
    background: rgba(255, 255, 255, .22);
    border-color: rgba(255, 255, 255, .38);
    color: #fff;
}

.action-clear {
    --action-bg: #f6f8fb;
    --action-border: #cfd8e3;
    --action-ink: #4b5563;
    background: var(--action-bg) !important;
    border-color: var(--action-border) !important;
    color: var(--action-ink) !important;
}

.pos-topbar .action-add,
.pos-topbar .action-save,
.pos-topbar .action-customer,
.pos-topbar .action-view,
.pos-topbar .action-print,
.pos-topbar .action-settings,
.pos-topbar .action-profile,
.pos-topbar .action-zatca,
.pos-topbar .action-refund,
.pos-topbar .action-danger,
.pos-topbar .action-clear {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 8px 18px rgba(0, 0, 0, .12);
}

.action-add:hover,
.action-save:hover,
.action-customer:hover,
.action-view:hover,
.action-print:hover,
.action-settings:hover,
.action-profile:hover,
.action-zatca:hover,
.action-refund:hover,
.action-danger:hover,
.action-clear:hover {
    filter: brightness(.97);
    transform: translateY(-1px);
}

button:hover,
.primary:hover {
    background: var(--primary-strong);
}

.secondary,
.ghost-button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.secondary:hover,
.ghost-button:hover {
    background: #f4f7fa;
}

.pos-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
}

.pos-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 5px 14px;
    position: sticky;
    top: 0;
    z-index: 45;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 48%),
        var(--topbar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    box-shadow: 0 10px 26px rgba(13, 25, 43, .16);
    color: var(--topbar-ink);
}

.topbar-brand {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: 10px;
    min-width: 0;
}

.topbar-brand img {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .64);
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .16);
    flex: 0 0 auto;
    height: 34px;
    object-fit: contain;
    padding: 3px;
    width: 34px;
}

.topbar-brand > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.pos-topbar span {
    color: var(--topbar-muted);
    font-size: 11px;
}

.pos-topbar .action-icon {
    color: currentColor;
    font-size: 11px;
}

.pos-topbar strong {
    color: var(--topbar-ink);
    font-size: 14px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.pos-menu-toggle {
    flex: 0 0 auto;
    margin-right: 2px;
    min-height: 34px;
    padding: 6px 8px;
    width: 38px;
}

.pos-menu-toggle .action-icon {
    font-size: 13px;
    min-width: 24px;
}

.pos-side-menu {
    background: var(--paper);
    border-right: 1px solid var(--line);
    bottom: 0;
    box-shadow: 18px 0 44px rgba(13, 25, 43, .18);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    left: 0;
    max-width: min(360px, 88vw);
    padding: 18px;
    position: fixed;
    top: 0;
    transform: translateX(-105%);
    transition: transform .18s ease;
    width: 340px;
    z-index: 60;
}

.pos-side-menu.show {
    transform: translateX(0);
}

.pos-side-menu-head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
}

.pos-side-menu-links {
    align-content: start;
    display: grid;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 8px;
    padding-right: 8px;
    scrollbar-gutter: stable;
    overflow-x: hidden;
}

.pos-side-menu-links > *,
.pos-side-menu-links .ghost-link,
.pos-side-menu-links .ghost-button,
.pos-side-user .ghost-link,
.pos-side-user .ghost-button {
    justify-content: flex-start;
    min-height: 43px;
    padding: 10px 14px;
    width: 100%;
}

body.rtl .pos-side-menu-links {
    padding-left: 8px;
    padding-right: 0;
}

.pos-side-backdrop {
    background: rgba(13, 25, 43, .36);
    border: 0;
    bottom: 0;
    display: none;
    left: 0;
    padding: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 55;
}

.pos-side-backdrop.show {
    display: block;
}

.pos-side-user {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 -8px 18px rgba(24, 33, 47, .06);
    flex: 0 0 auto;
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
}

.pos-side-user .ghost-link,
.pos-side-user .ghost-button {
    font-size: inherit;
}

.pos-side-user .action-icon {
    height: 22px;
    min-width: 22px;
}

.pos-company-chip {
    align-items: center;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    display: flex;
    flex: 0 1 380px;
    gap: 8px;
    justify-content: flex-end;
    min-width: 0;
    padding: 5px 8px;
}

.pos-company-chip img {
    background: #fff;
    border-radius: 6px;
    flex: 0 0 auto;
    height: 32px;
    object-fit: contain;
    padding: 2px;
    width: 32px;
}

.pos-company-chip > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    text-align: right;
}

.pos-company-chip strong,
.pos-company-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ghost-link,
.button-link {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    display: inline-flex;
    font-weight: 750;
    justify-content: center;
    min-height: 43px;
    padding: 10px 14px;
    text-decoration: none;
}

.ghost-link {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .22);
    color: var(--topbar-ink);
    backdrop-filter: blur(8px);
}

.ghost-link:hover,
.button-link:hover {
    background: rgba(255, 255, 255, .18);
}

.pos-topbar .ghost-button,
.pos-topbar .ghost-link {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .22);
    color: var(--topbar-ink);
    min-height: 34px;
    padding: 7px 10px;
}

.logout-form {
    margin: 0;
}

.user-chip {
    max-width: none;
}

.user-chip span {
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-topbar .ghost-button:hover,
.pos-topbar .ghost-link:hover {
    background: rgba(255, 255, 255, .18);
}

.ab-page-header {
    align-items: center;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 48%),
        var(--topbar-bg) !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, .10) !important;
    border-radius: 0 !important;
    box-shadow: 0 10px 26px rgba(13, 25, 43, .16);
    color: var(--topbar-ink) !important;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 16px !important;
    overflow: visible;
    padding: 14px 18px !important;
}

.pos-admin-page {
    padding: 0 12px 16px;
}

.ab-page-header h1,
.ab-page-header .eyebrow {
    color: var(--topbar-ink) !important;
}

.ab-page-header .text-muted {
    color: var(--topbar-muted) !important;
}

.ab-command-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    min-width: min(100%, 220px);
    overflow: visible;
}

.ab-command-actions .btn {
    align-items: center;
    display: inline-flex;
    min-height: 38px;
    white-space: nowrap;
}

.ab-page-header .ab-command-actions .btn-outline-primary,
.ab-page-header .ab-command-actions .btn-outline-success,
.ab-page-header .ab-command-actions .btn-outline-secondary,
.ab-page-header .ab-command-actions .btn-link {
    background-color: rgba(255, 255, 255, .10) !important;
    border-color: rgba(255, 255, 255, .34) !important;
    color: var(--topbar-ink) !important;
}

.ab-page-header .ab-command-actions .btn-outline-primary:hover,
.ab-page-header .ab-command-actions .btn-outline-success:hover,
.ab-page-header .ab-command-actions .btn-outline-secondary:hover,
.ab-page-header .ab-command-actions .btn-link:hover {
    background-color: rgba(255, 255, 255, .20) !important;
    border-color: rgba(255, 255, 255, .52) !important;
    color: var(--topbar-ink) !important;
}

.ab-page-header .ab-command-actions .btn.disabled,
.ab-page-header .ab-command-actions .btn:disabled {
    color: var(--topbar-muted) !important;
    opacity: .82;
}

.ab-page-header .ab-command-actions .action-icon {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .30);
    color: currentColor;
}

.alert {
    margin: 0;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
}

.pos-message-row {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
    margin: 8px 16px 0;
}

.pos-server-messages {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.pos-server-messages:empty {
    min-height: 1px;
}

.alert.success {
    border-color: rgba(15, 123, 69, .25);
    color: var(--success);
}

.alert.warning {
    border-color: rgba(190, 91, 47, .32);
    color: #80540a;
}

.alert.danger,
.validation {
    border-color: rgba(180, 35, 24, .25);
    color: var(--danger);
}

.open-session {
    display: grid;
    place-items: center;
    padding: 14px 18px;
}

.open-session form {
    width: min(860px, 100%);
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-panel);
}

.open-session h1 {
    margin: 0;
}

.admin-config-note {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
    border-radius: 6px;
    background: color-mix(in srgb, var(--primary) 8%, #fff);
    color: var(--muted);
    font-size: 13px;
}

.admin-config-note a {
    color: var(--primary);
    font-weight: 800;
}

.admin-touch-menu {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.admin-touch-menu a {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: flex;
    font-weight: 800;
    gap: 8px;
    min-height: 56px;
    padding: 10px;
    text-decoration: none;
}

.admin-touch-menu a:hover {
    border-color: color-mix(in srgb, var(--primary) 46%, var(--line));
    box-shadow: var(--shadow-soft);
}

.admin-launch-panel {
    align-items: center;
    background: color-mix(in srgb, var(--primary) 7%, #fff);
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px;
}

.admin-launch-copy {
    display: grid;
    gap: 4px;
}

.admin-launch-copy strong {
    font-size: 18px;
}

.admin-launch-copy span {
    color: var(--muted);
    font-size: 13px;
}

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

.admin-quick-actions a {
    min-height: 48px;
    padding: 10px 14px;
    text-decoration: none;
}

.admin-hub {
    display: grid;
    gap: 16px;
    padding: 18px 22px 24px;
}

.admin-hub-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

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

.admin-action-tile {
    align-content: start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: grid;
    gap: 8px;
    min-height: 138px;
    padding: 14px;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.admin-action-tile:hover {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
    box-shadow: var(--shadow-soft);
    color: var(--ink);
    transform: translateY(-1px);
}

.admin-action-tile .action-icon {
    color: var(--primary);
    height: 30px;
    justify-self: start;
    min-width: 30px;
}

.admin-action-tile strong {
    font-size: 16px;
}

.admin-action-tile small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.admin-action-tile.primary-tile,
.admin-action-tile.security-tile {
    background: color-mix(in srgb, var(--primary) 5%, #fff);
}

.register-grid {
    align-items: start;
    display: grid;
    grid-template-columns: minmax(340px, 40%) minmax(560px, 1fr);
    gap: 12px;
    padding: 12px 16px 8px;
    min-height: 0;
}

.item-panel,
.cart-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 0;
    box-shadow: var(--shadow-soft);
}

.item-panel {
    padding: 10px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 8px;
    max-height: calc(100vh - 96px);
    min-height: 280px;
    overflow: hidden;
}

.search-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}

.search-line input {
    min-height: 40px;
    font-size: 15px;
}

.item-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    align-content: start;
    gap: 6px;
    overflow: auto;
    padding-right: 2px;
}

.item-tile {
    min-height: 78px;
    display: grid;
    gap: 3px;
    text-align: left;
    align-content: start;
    border: 1px solid var(--line);
    background: #fbfcfe;
    color: var(--ink);
    box-shadow: 0 6px 16px rgba(24, 33, 47, .05);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    padding: 8px;
    overflow: hidden;
}

.item-tile:hover {
    border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
    box-shadow: 0 10px 24px rgba(24, 33, 47, .10);
    transform: translateY(-1px);
}

.item-tile span {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.15;
}

.item-tile strong {
    display: -webkit-box;
    font-size: 12px;
    line-height: 1.2;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.item-tile b {
    color: var(--accent);
    font-size: 13px;
}

.item-tile-ar {
    direction: rtl;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-result-card {
    display: grid;
    gap: 4px;
    grid-template-rows: minmax(0, 1fr) 26px;
    min-width: 0;
}

.item-result-card .item-tile {
    min-height: 76px;
}

.item-result-actions {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-result-actions.single {
    grid-template-columns: 1fr;
}

.item-detail-action,
.item-edit-action {
    align-items: center;
    display: inline-flex;
    gap: 4px;
    justify-content: center;
    min-height: 26px;
    border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--line));
    border-radius: 6px;
    background: #fff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    padding: 3px 5px;
}

.item-detail-action {
    border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
    color: var(--accent);
}

.item-detail-action:hover,
.item-edit-action:hover {
    background: color-mix(in srgb, var(--primary) 10%, #fff);
}

.pos-popup-page.item-detail-page {
    display: grid;
    gap: 12px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px;
}

.popup-head {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 10px 12px;
}

.popup-head strong {
    display: block;
    color: var(--primary);
    font-size: 18px;
}

.popup-head span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

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

.item-detail-images {
    display: grid;
    gap: 10px;
    grid-template-columns: 1.35fr 1fr 1fr;
}

.item-detail-image {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    grid-template-rows: auto minmax(120px, 1fr);
    min-height: 160px;
    overflow: hidden;
    padding: 8px;
}

.item-detail-image.primary {
    min-height: 220px;
}

.item-detail-image span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.item-detail-image img {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.item-detail-image strong {
    align-self: center;
    color: var(--muted);
    font-size: 13px;
    justify-self: center;
}

.item-detail-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.item-detail-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-detail-grid div,
.item-detail-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.item-detail-grid div {
    padding: 8px 10px;
}

.item-detail-grid span {
    color: var(--muted);
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.item-detail-grid strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-top: 3px;
    word-break: break-word;
}

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

.item-detail-section {
    overflow: hidden;
}

.item-detail-section h2 {
    background: color-mix(in srgb, var(--primary) 7%, #fff);
    border-bottom: 1px solid var(--line);
    color: var(--primary-strong);
    font-size: 14px;
    margin: 0;
    padding: 9px 10px;
}

.item-detail-section p {
    margin: 0;
    min-height: 42px;
    padding: 10px;
}

.item-detail-section .item-detail-grid {
    padding: 10px;
}

.item-detail-table-wrap {
    overflow: auto;
}

.item-detail-table-wrap table {
    border-collapse: collapse;
    min-width: 680px;
    width: 100%;
}

.item-detail-table-wrap th,
.item-detail-table-wrap td {
    border-top: 1px solid var(--line);
    font-size: 12px;
    padding: 7px 8px;
    text-align: left;
    vertical-align: top;
}

.item-detail-table-wrap th {
    background: #f8fafc;
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 760px) {
    .pos-popup-page.item-detail-page {
        padding: 10px;
    }

    .popup-head,
    .item-detail-two {
        display: grid;
        grid-template-columns: 1fr;
    }

    .popup-actions {
        justify-content: stretch;
    }

    .popup-actions button {
        width: 100%;
    }

    .item-detail-images,
    .item-detail-grid,
    .item-detail-grid.compact {
        grid-template-columns: 1fr;
    }
}

.cart-panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(180px, auto);
    min-height: 0;
}

.cart-head,
.customer-grid,
.total-strip,
.tender-bar,
.tender-grid,
.pay-actions,
.tender-right {
    padding: 8px 10px;
}

.cart-head {
    align-items: center;
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
}

.cart-head h1 {
    margin: 0;
    font-size: 18px;
}

.cart-head-total {
    align-items: center;
    display: grid;
    gap: 2px;
    justify-items: center;
    min-width: 150px;
}

.cart-head-total span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.cart-head-total strong {
    color: var(--primary);
    font-size: 20px;
    line-height: 1;
}

.invoice-toggles {
    justify-self: end;
}

.invoice-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.toggle input {
    flex: 0 0 auto;
    width: auto;
}

.toggle span {
    min-width: 0;
}

.customer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 6px;
    border-bottom: 1px solid var(--line);
}

.tender-bar {
    align-items: end;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(240px, .8fr) minmax(320px, auto);
}

.tender-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
}

.tender-right {
    align-items: end;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(100px, 120px) auto;
}

.tender-bar label,
.customer-grid label {
    font-size: 12px;
    gap: 3px;
}

.tender-bar input,
.customer-grid input,
.customer-grid select {
    min-height: 34px;
    padding: 6px 8px;
}

.tender-status {
    align-self: stretch;
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.25;
}

.customer-grid label {
    position: relative;
}

.payments-compact {
    align-items: end;
    display: grid;
    gap: 5px;
    grid-column: 1 / -1;
    grid-template-columns:
        minmax(100px, .72fr)
        minmax(92px, .75fr)
        minmax(190px, 1.55fr)
        minmax(100px, .72fr)
        minmax(78px, .55fr)
        minmax(190px, 1.55fr)
        minmax(105px, .85fr);
}

.payments-compact label {
    min-width: 0;
}

.payments-compact input,
.payments-compact select {
    min-height: 30px;
    padding: 4px 6px;
}

.payments-compact input[type="number"] {
    text-align: right;
}

.register-grid input:not([type="hidden"]),
.register-grid select,
.register-grid textarea {
    border-color: var(--primary-strong);
}

.payment-ref-pair {
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(110px, 1.05fr) minmax(120px, .95fr);
}

.payment-ref-pair label {
    min-width: 0;
}

.customer-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.icon-link {
    align-items: center;
    background: color-mix(in srgb, var(--primary) 8%, #fff);
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
    border-radius: 6px;
    color: var(--primary);
    display: inline-flex;
    font-weight: 800;
    min-height: 41px;
    padding: 0 12px;
    text-decoration: none;
}

.icon-link.disabled {
    color: var(--muted);
    cursor: not-allowed;
    opacity: .55;
}

.inline-results {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(24, 33, 47, .14);
    display: grid;
    left: 0;
    max-height: 220px;
    overflow: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
}

.inline-results:empty {
    display: none;
}

.inline-result-button {
    background: #fff;
    border: 0;
    border-bottom: 1px solid #edf1f5;
    border-radius: 0;
    color: var(--ink);
    display: grid;
    gap: 2px;
    min-height: 48px;
    padding: 8px 10px;
    text-align: left;
}

.inline-result-button:hover {
    background: #f8fafc;
}

.inline-result-button span {
    color: var(--muted);
    font-size: 12px;
}

.cart-table-wrap {
    overflow: auto;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.cart-table th,
.cart-table td {
    padding: 5px 7px;
    border-bottom: 1px solid #edf1f5;
    vertical-align: middle;
    font-size: 12px;
}

.cart-table th {
    color: var(--muted);
    font-size: 12px;
    text-align: left;
    background: #f8fafc;
}

.cart-table th:nth-child(1) {
    width: 48px;
}

.cart-table th:nth-child(2) {
    width: 24%;
}

.cart-table th:nth-child(9) {
    width: 44px;
}

.cart-table th:nth-child(3),
.cart-table th:nth-child(4),
.cart-table th:nth-child(6),
.cart-table th:nth-child(7),
.cart-table td:nth-child(3),
.cart-table td:nth-child(4),
.cart-table td:nth-child(6),
.cart-table td:nth-child(7) {
    text-align: center;
}

.top-tender-status {
    min-height: 38px;
}

.cart-table th:nth-child(5),
.cart-table th:nth-child(8),
.cart-table td:nth-child(5),
.cart-table td:nth-child(8) {
    text-align: right;
}

.cart-table input {
    min-height: 30px;
    padding: 4px 6px;
}

.cart-table td:nth-child(3) input,
.cart-table td:nth-child(6) input {
    text-align: center;
}

.cart-table td:nth-child(5) input,
.cart-table td:nth-child(8) input {
    text-align: right;
}

.amount {
    text-align: right;
    font-weight: 750;
}

.line-no {
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.cart-item-name {
    display: block;
    font-weight: 750;
    line-height: 1.2;
}

.cart-item-name-ar {
    color: var(--muted);
    display: block;
    font-size: 11px;
    line-height: 1.25;
    margin-top: 2px;
    text-align: right;
}

.cart-uom {
    color: var(--muted);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.icon-button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: grid;
    place-items: center;
    background: #fff1ef;
    color: var(--danger);
    border: 1px solid #ffd4cf;
}

.total-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 9%, #fff), #f8fafc);
    border-top: 1px solid var(--line);
    font-size: 18px;
}

.total-strip strong {
    font-size: 28px;
    color: var(--primary);
}

.tender-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: 6px;
}

.tender-right input[readonly] {
    background: #f8fafc;
    color: var(--primary);
    font-weight: 800;
}

.tender-status {
    align-self: stretch;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border: 1px solid #f3c2c2;
    border-radius: 8px;
    background: #fff7f7;
    color: #991b1b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.tender-status.ready {
    border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
    background: color-mix(in srgb, var(--primary) 10%, #fff);
    color: var(--primary-strong);
}

.pay-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 0;
}

.pay-actions button {
    min-height: 34px;
    font-size: 13px;
    padding: 7px 10px;
    white-space: nowrap;
}

.pay-actions button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.session-invoices {
    margin: 0 22px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.section-head h2 {
    margin: 0;
    font-size: 16px;
}

.shift-invoices-head {
    align-items: center;
    display: grid;
    grid-template-columns: minmax(180px, auto) minmax(260px, 420px);
}

.shift-invoices-title {
    align-items: baseline;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.section-head span,
.empty-list {
    color: var(--muted);
}

.empty-list {
    padding: 16px;
}

.session-totals {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 1px;
    background: var(--line);
    border-bottom: 1px solid var(--line);
}

.session-totals div {
    align-items: baseline;
    background: #fff;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 6px 10px;
}

.session-totals span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.session-totals strong {
    color: var(--primary);
    font-size: 14px;
    text-align: right;
}

.invoice-pager {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 8px 14px;
}

.invoice-pager > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.invoice-pager > div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.invoice-pager a,
.invoice-pager button {
    min-height: 34px;
}

.inventory-summary-strip {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    margin-top: 0;
}

.invoice-filter {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-self: end;
    min-width: 0;
    width: min(420px, 100%);
}

.invoice-filter input {
    border: 1px solid var(--line);
    border-radius: 6px;
    flex: 1;
    min-width: 160px;
    padding: 7px 10px;
}

.invoice-filter span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.invoice-list {
    display: grid;
}

.invoice-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(260px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    border-bottom: 1px solid #edf1f5;
}

.inventory-list-table td,
.inventory-list-table th {
    white-space: nowrap;
}

.inventory-table-wrap,
.old-invoices-table-wrap,
.cash-purchases-table-wrap {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: auto;
}

.old-invoices-table-wrap {
    padding: 0;
}

.old-invoices-table-wrap .table {
    margin-bottom: 0;
    min-width: 980px;
}

.inventory-table-wrap,
.cash-purchases-table-wrap {
    padding-left: 8px;
    padding-right: 8px;
}

.inventory-list-table td:nth-child(2),
.inventory-list-table td:nth-child(3) {
    min-width: 180px;
    white-space: normal;
}

.invoice-row:last-child {
    border-bottom: 0;
}

.invoice-row > div:first-child {
    display: grid;
    gap: 2px;
}

.invoice-row span {
    color: var(--muted);
    font-size: 13px;
}

.invoice-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.zatca-pill {
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef7f5;
    color: var(--primary) !important;
}

.refund-pill {
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff0ef;
    color: var(--danger) !important;
}

.invoice-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.invoice-actions a,
.link-button {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    text-decoration: none;
    color: var(--ink);
    background: #fff;
    font-weight: 650;
    font-size: 13px;
}

.invoice-actions a:hover,
.link-button:hover {
    background: #f4f7fa;
}

.invoice-actions form {
    margin: 0;
}

dialog {
    width: min(560px, calc(100% - 28px));
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
}

.invoice-view-dialog {
    height: min(820px, calc(100% - 32px));
    width: min(760px, calc(100% - 32px));
}

.invoice-view-head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.invoice-view-head h2 {
    font-size: 18px;
    margin: 0;
}

.invoice-view-dialog iframe {
    border: 0;
    display: block;
    height: calc(100% - 59px);
    width: 100%;
}

dialog::backdrop {
    background: rgba(24, 33, 47, .55);
}

.closeout-form {
    padding: 20px;
}

.closeout-form h2 {
    margin: 0;
}

.closeout-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.closeout-summary span {
    display: grid;
    color: var(--muted);
}

.closeout-summary strong {
    color: var(--ink);
    font-size: 18px;
}

.dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.settings-shell {
    grid-template-rows: auto auto 1fr;
}

.settings-form {
    display: grid;
    gap: 16px;
    padding: 18px 22px 24px;
}

.settings-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.settings-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    padding: 16px;
}

.settings-grid .wide-field {
    grid-column: 1 / -1;
}

.alternate-uom-wrap {
    overflow-x: auto;
    padding: 16px;
}

.alternate-uom-table {
    border-collapse: collapse;
    min-width: 980px;
    width: 100%;
}

.alternate-uom-table th,
.alternate-uom-table td {
    border-bottom: 1px solid var(--line);
    padding: 7px 8px;
    text-align: left;
    vertical-align: middle;
}

.alternate-uom-table th {
    color: var(--muted);
    font-size: 12px;
}

.alternate-uom-table input,
.alternate-uom-table select {
    min-height: 34px;
    width: 100%;
}

.field-action {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.field-action button {
    min-height: 0;
    padding: 0;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
}

.setting-toggle {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 67px;
    white-space: normal;
}

.setting-toggle input {
    align-self: start;
    margin-top: 3px;
}

.setting-toggle span {
    overflow-wrap: anywhere;
}

.settings-grid.sale-saving-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.settings-grid.sale-saving-grid .setting-toggle {
    min-height: 48px;
}

.settings-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(160px, 1fr) minmax(180px, 2fr);
    justify-self: end;
    width: min(520px, 100%);
}

.pos-logo-preview {
    border-top: 1px solid var(--line);
    padding: 14px 16px;
}

.pos-logo-preview img {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: block;
    max-height: 90px;
    max-width: 220px;
    object-fit: contain;
    padding: 8px;
}

.refund-summary {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    background: var(--line);
    border-bottom: 1px solid var(--line);
}

.refund-summary div {
    background: #fff;
    display: grid;
    gap: 4px;
    padding: 12px 16px;
}

.refund-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.refund-summary strong {
    color: var(--primary);
    font-size: 18px;
}

.refund-lines {
    overflow: auto;
}

body.rtl .pos-topbar,
body.rtl .cart-head,
body.rtl .section-head,
body.rtl .total-strip {
    direction: rtl;
}

@media (max-width: 1200px) and (min-width: 901px) {
    .session-totals {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

@media (max-width: 900px) {
    .register-grid,
    .pos-message-row,
    .customer-grid,
    .tender-grid,
    .invoice-row,
    .refund-summary,
    .settings-grid,
    .admin-launch-panel,
    .admin-action-grid {
        grid-template-columns: 1fr;
    }

    .admin-quick-actions {
        justify-content: stretch;
    }

    .admin-quick-actions a {
        flex: 1 1 180px;
    }

    .invoice-meta {
        justify-content: flex-start;
    }

    .cart-panel {
        min-height: 70vh;
    }

    .cart-head {
        display: grid;
    }

    .tender-bar {
        grid-template-columns: 1fr;
    }

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

    .payments-compact {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .pay-actions {
        justify-content: stretch;
    }

    .pay-actions button {
        flex: 1 1 0;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .shift-invoices-head {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .shift-invoices-title {
        justify-content: space-between;
    }

    .invoice-filter {
        justify-self: stretch;
        width: 100%;
    }

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

    .invoice-pager > div {
        justify-content: stretch;
    }

    .invoice-pager a,
    .invoice-pager button {
        flex: 1 1 120px;
    }

    .session-totals {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}
