/* ==========================================================================
   PowerPOS — design system
   ========================================================================== */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin.woff2") format("woff2");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Noto Sans Thai";
    src: url("../fonts/noto-sans-thai.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
    --bg: #f5f3ee;
    --bg-deep: #ece9e1;
    --surface: #ffffff;
    --surface-soft: #fbfaf7;
    --surface-tint: #f4f1ea;
    --ink: #17212b;
    --ink-soft: #3f4b57;
    --muted: #7a838e;
    --muted-light: #a4abb4;
    --line: #e7e3da;
    --line-strong: #d8d3c8;
    --brand: #ff5a2a;
    --brand-dark: #e74313;
    --brand-deep: #bb3410;
    --brand-soft: #fff0e9;
    --brand-faint: #fff8f4;
    --navy: #101a25;
    --navy-soft: #172533;
    --navy-line: rgba(255, 255, 255, 0.08);
    --green: #12856f;
    --green-soft: #e7f6f1;
    --amber: #b97808;
    --amber-soft: #fdf5e2;
    --red: #c73f44;
    --red-soft: #fdeeef;
    --blue: #2d62b7;
    --blue-soft: #edf3fd;
    --shadow-xs: 0 1px 2px rgba(23, 33, 43, 0.04);
    --shadow-sm: 0 2px 10px rgba(23, 33, 43, 0.05);
    --shadow-md: 0 14px 36px rgba(23, 33, 43, 0.08);
    --shadow-lg: 0 30px 70px rgba(23, 33, 43, 0.16);
    --radius-sm: 9px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --sidebar-width: 256px;
    --topbar-height: 82px;
    --font: "Inter", "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
p {
    margin: 0;
}

h1,
h2,
h3,
h4,
h5 {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

::selection {
    color: #fff;
    background: var(--brand);
}

:focus-visible {
    outline: 3px solid rgba(255, 90, 42, 0.35);
    outline-offset: 2px;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-xs {
    width: 14px;
    height: 14px;
}

.icon-sm {
    width: 17px;
    height: 17px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.nowrap {
    white-space: nowrap;
}

.text-right {
    text-align: right;
}

.mono {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    --btn-bg: var(--surface);
    --btn-color: var(--ink);
    --btn-border: var(--line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 17px;
    border: 1px solid var(--btn-border);
    border-radius: 11px;
    background: var(--btn-bg);
    color: var(--btn-color);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
        background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn .icon {
    width: 17px;
    height: 17px;
}

.btn-primary {
    --btn-bg: var(--brand);
    --btn-color: #fff;
    --btn-border: var(--brand);
    box-shadow: 0 8px 20px rgba(255, 90, 42, 0.22);
}

.btn-primary:hover {
    --btn-bg: var(--brand-dark);
    --btn-border: var(--brand-dark);
}

.btn-dark {
    --btn-bg: var(--navy);
    --btn-color: #fff;
    --btn-border: var(--navy);
}

.btn-dark:hover {
    --btn-bg: var(--navy-soft);
}

.btn-ghost {
    --btn-bg: transparent;
    --btn-border: transparent;
    box-shadow: none;
    color: var(--ink-soft);
}

.btn-ghost:hover {
    --btn-bg: var(--surface-tint);
    box-shadow: none;
}

.btn-outline {
    --btn-bg: transparent;
}

.btn-soft {
    --btn-bg: var(--brand-soft);
    --btn-color: var(--brand-deep);
    --btn-border: transparent;
    box-shadow: none;
}

.btn-soft:hover {
    --btn-bg: #ffe4d8;
}

.btn-danger {
    --btn-bg: var(--red-soft);
    --btn-color: var(--red);
    --btn-border: transparent;
    box-shadow: none;
}

.btn-danger:hover {
    --btn-bg: #fbdde0;
}

.btn-sm {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 9px;
}

.btn-lg {
    min-height: 50px;
    padding: 14px 22px;
    font-size: 14.5px;
    border-radius: 13px;
}

.btn-block {
    width: 100%;
}

.btn:disabled,
.btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-soft);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover {
    background: var(--surface-tint);
    color: var(--ink);
}

.icon-btn.is-danger:hover {
    background: var(--red-soft);
    color: var(--red);
}

.icon-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand-deep);
    font-size: 13px;
    font-weight: 600;
}

.btn-link:hover {
    color: var(--brand);
}

/* ==========================================================================
   Form controls
   ========================================================================== */

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.field > label,
.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 650;
    color: var(--ink-soft);
    letter-spacing: 0.01em;
}

.field .optional {
    font-weight: 500;
    color: var(--muted);
}

.input,
.select,
.textarea,
input[type="text"],
input[type="search"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.textarea {
    min-height: 96px;
    resize: vertical;
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--muted-light);
}

.input:hover,
.select:hover,
input:hover,
select:hover,
textarea:hover {
    border-color: #c7c1b5;
}

.input:focus,
.select:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 3.5px rgba(255, 90, 42, 0.12);
}

input[type="number"] {
    font-variant-numeric: tabular-nums;
}

.select,
select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a838e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}

.input-group {
    position: relative;
}

.input-group > .icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.input-group > input {
    padding-left: 42px;
}

.input-group.has-suffix > input {
    padding-right: 58px;
}

.input-suffix {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    pointer-events: none;
}

.input-action {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.help {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}

.error-text {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--red);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 19px;
}

.form-grid .span-2 {
    grid-column: 1 / -1;
}

.form-section + .form-section {
    margin-top: 28px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.form-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.form-section-head h3 {
    font-size: 16px;
}

.form-section-head p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12.5px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"] {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--brand);
}

.checkbox-row label {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.45;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.checkbox-card:hover {
    border-color: var(--line-strong);
    background: var(--surface);
}

.checkbox-card input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--brand);
}

.checkbox-card strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.checkbox-card small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11.5px;
}

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink-soft);
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-track {
    width: 40px;
    height: 23px;
    border-radius: 99px;
    background: #d6d1c7;
    transition: background 0.2s ease;
    flex: 0 0 auto;
}

.switch-track::after {
    content: "";
    display: block;
    width: 17px;
    height: 17px;
    margin: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch-track {
    background: var(--brand);
}

.switch input:checked + .switch-track::after {
    transform: translateX(17px);
}

.field-row {
    display: flex;
    gap: 12px;
}

/* ==========================================================================
   Shell
   ========================================================================== */

.app-body {
    min-height: 100vh;
    background: var(--bg);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    padding: 22px 15px 16px;
    color: #fff;
    background:
        radial-gradient(120% 45% at 0% 0%, rgba(255, 90, 42, 0.16), transparent 62%),
        linear-gradient(180deg, #111d29 0%, #0d1620 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 220px;
    background: radial-gradient(80% 80% at 20% 100%, rgba(255, 90, 42, 0.1), transparent 70%);
    pointer-events: none;
}

.brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 5px 8px 23px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #ff7646 0%, #ff4e1f 100%);
    box-shadow: 0 8px 22px rgba(255, 90, 42, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-mark .icon {
    width: 21px;
    height: 21px;
    stroke-width: 2.2;
}

.brand-type {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.1;
}

.brand-type strong {
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.035em;
}

.brand-type small {
    color: rgba(255, 255, 255, 0.44);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sidebar-body {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-body::-webkit-scrollbar {
    display: none;
}

.nav-label {
    padding: 17px 12px 8px;
    color: rgba(255, 255, 255, 0.33);
    font-size: 9.5px;
    font-weight: 650;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13.5px;
    font-weight: 500;
    transition: color 0.17s ease, background 0.17s ease;
}

.nav-item .icon {
    width: 19px;
    height: 19px;
    color: rgba(255, 255, 255, 0.42);
    transition: color 0.17s ease;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.055);
}

.nav-item:hover .icon {
    color: rgba(255, 255, 255, 0.8);
}

.nav-item.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.085);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.nav-item.is-active::before {
    content: "";
    position: absolute;
    left: -15px;
    top: 50%;
    width: 3px;
    height: 21px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
    transform: translateY(-50%);
    box-shadow: 0 0 16px rgba(255, 90, 42, 0.6);
}

.nav-item.is-active .icon {
    color: var(--brand);
}

.nav-dot {
    width: 5px;
    height: 5px;
    margin-left: auto;
    border-radius: 50%;
    background: rgba(255, 90, 42, 0);
    transition: background 0.17s ease;
}

.nav-item.is-active .nav-dot {
    background: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 90, 42, 0.16);
}

.sidebar-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 15px;
}

.shop-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 11px 12px;
    border: 1px solid var(--navy-line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
}

.shop-mini-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.07);
}

.shop-mini-icon .icon {
    width: 16px;
    height: 16px;
}

.shop-mini > span:last-child {
    min-width: 0;
}

.shop-mini small,
.sidebar-user small {
    display: block;
    color: rgba(255, 255, 255, 0.36);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.shop-mini strong {
    display: block;
    overflow: hidden;
    margin-top: 1px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 11px;
    color: rgba(255, 255, 255, 0.75);
    transition: background 0.17s ease;
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-user .icon:last-child {
    width: 15px;
    height: 15px;
    margin-left: auto;
    color: rgba(255, 255, 255, 0.25);
}

.sidebar-user-copy {
    min-width: 0;
    line-height: 1.25;
}

.sidebar-user-copy strong {
    display: block;
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.86);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-copy small {
    margin-top: 2px;
    letter-spacing: 0.03em;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    color: var(--brand-deep);
    background: linear-gradient(145deg, #ffe9df, #ffd4c2);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.09);
    font-size: 10.5px;
}

.app-frame {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 18px;
    height: var(--topbar-height);
    padding: 0 30px;
    border-bottom: 1px solid rgba(231, 227, 218, 0.8);
    background: rgba(250, 249, 246, 0.86);
    backdrop-filter: blur(18px);
}

.nav-toggle {
    display: none;
}

.page-heading {
    min-width: 0;
    margin-right: auto;
}

.eyebrow {
    display: block;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 650;
    letter-spacing: 0.14em;
    line-height: 1.2;
    text-transform: uppercase;
}

.page-heading h1 {
    overflow: hidden;
    margin-top: 3px;
    font-size: 21px;
    font-weight: 720;
    letter-spacing: -0.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

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

.shop-switcher {
    position: relative;
    display: flex;
    align-items: center;
}

.shop-switcher-inner {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 30px 0 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-soft);
    box-shadow: var(--shadow-xs);
}

.shop-switcher-inner > .icon {
    width: 16px;
    height: 16px;
    color: var(--muted);
}

.shop-switcher select {
    width: auto;
    max-width: 170px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    background-image: none;
    box-shadow: none;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    text-overflow: ellipsis;
    cursor: pointer;
}

.shop-switcher select:focus {
    outline: 0;
    box-shadow: none;
}

.shop-switcher .select-caret {
    position: absolute;
    right: 10px;
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.shop-switcher.is-empty {
    gap: 7px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: var(--surface);
    font-size: 12px;
}

.tier-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid #f1dfd3;
    border-radius: 99px;
    color: #9b3d17;
    background: var(--brand-faint);
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.tier-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 90, 42, 0.12);
}

.account-menu {
    position: relative;
}

.account-menu > summary {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 4px 6px;
    border-radius: 11px;
    list-style: none;
    cursor: pointer;
    transition: background 0.17s ease;
}

.account-menu > summary::-webkit-details-marker {
    display: none;
}

.account-menu > summary:hover {
    background: var(--surface-tint);
}

.account-copy {
    display: flex;
    flex-direction: column;
    max-width: 128px;
    line-height: 1.25;
}

.account-copy strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
}

.account-caret {
    width: 14px;
    height: 14px;
    color: var(--muted);
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    width: 240px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    animation: menuIn 0.16s var(--ease);
}

@keyframes menuIn {
    from { opacity: 0; transform: translateY(-5px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.account-dropdown-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 9px 12px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--line);
}

.account-dropdown-head strong {
    display: block;
    font-size: 12.5px;
}

.account-dropdown-head small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-link .icon {
    width: 16px;
    height: 16px;
    color: var(--muted);
}

.dropdown-link:hover {
    background: var(--surface-tint);
    color: var(--ink);
}

.dropdown-link.is-danger:hover {
    background: var(--red-soft);
    color: var(--red);
}

.dropdown-link.is-danger:hover .icon {
    color: var(--red);
}

.dropdown-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 4px 6px;
    padding: 7px 8px;
    border-radius: 7px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 10.5px;
    font-weight: 500;
}

.dropdown-meta .icon {
    width: 14px;
    height: 14px;
}

.account-dropdown form {
    margin: 0;
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 1640px;
    margin: 0 auto;
    padding: 28px 32px 52px;
}

.sidebar-scrim {
    display: none;
}

/* ==========================================================================
   Notices / flash / badges
   ========================================================================== */

.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 20px;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 12.5px;
    animation: flashIn 0.3s var(--ease);
}

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash .icon {
    width: 17px;
    height: 17px;
    margin-top: 1px;
}

.flash p {
    flex: 1;
    line-height: 1.45;
}

.flash-success {
    color: #0d6b57;
    border-color: #c7eadd;
    background: var(--green-soft);
}

.flash-error {
    color: #a32b31;
    border-color: #f3cfd2;
    background: var(--red-soft);
}

.flash-warning {
    color: #865907;
    border-color: #f1e2b9;
    background: var(--amber-soft);
}

.flash-info {
    color: #245192;
    border-color: #d3e0f5;
    background: var(--blue-soft);
}

.flash-close {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: currentColor;
    opacity: 0.55;
}

.flash-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.flash-close .icon {
    width: 13px;
    height: 13px;
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 23px;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.015em;
    white-space: nowrap;
}

.badge .icon {
    width: 12px;
    height: 12px;
}

.badge-green {
    color: #0c715d;
    background: var(--green-soft);
}

.badge-red {
    color: #b0353a;
    background: var(--red-soft);
}

.badge-amber {
    color: #96630b;
    background: var(--amber-soft);
}

.badge-gray {
    color: #68717b;
    background: #f0efeb;
}

.badge-brand {
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.badge-blue {
    color: #245192;
    background: var(--blue-soft);
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.alert-box {
    display: flex;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.alert-box > .icon {
    width: 19px;
    height: 19px;
    color: var(--brand);
    margin-top: 1px;
}

.alert-box strong {
    color: var(--ink);
}

/* ==========================================================================
   Panels, cards and tables
   ========================================================================== */

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 21px 23px 0;
}

.panel-head h2,
.panel-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.panel-head p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.panel-body {
    padding: 21px 23px 23px;
}

.panel-body.tight {
    padding: 12px 23px 21px;
}

.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 15px 23px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.card-pad {
    padding: 24px;
}

.table-wrap {
    overflow-x: auto;
    border-radius: inherit;
}

.data-table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 9.5px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table thead th:first-child {
    padding-left: 23px;
}

.data-table thead th:last-child {
    padding-right: 23px;
}

.data-table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid #f1eee7;
    vertical-align: middle;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.data-table tbody td:first-child {
    padding-left: 23px;
}

.data-table tbody td:last-child {
    padding-right: 23px;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr {
    transition: background 0.14s ease;
}

.data-table tbody tr:hover {
    background: #fcfbf8;
}

.data-table .cell-main {
    color: var(--ink);
    font-weight: 600;
}

.data-table .cell-sub {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 450;
}

.data-table .cell-actions {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
    white-space: nowrap;
}

.data-table .num {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    font-weight: 550;
    text-align: right;
}

.data-table .empty-row td {
    padding: 42px 20px;
    text-align: center;
    color: var(--muted);
}

.thumb {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-tint);
    object-fit: cover;
}

.thumb-lg {
    width: 58px;
    height: 58px;
    border-radius: 12px;
}

.thumb-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted-light);
    background: linear-gradient(135deg, #f3f0e9, #e9e4d9);
}

.thumb-placeholder .icon {
    width: 18px;
    height: 18px;
}

.cell-product {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 52px 24px;
    text-align: center;
}

.empty-state-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
    border-radius: 17px;
    color: var(--brand);
    background: var(--brand-soft);
}

.empty-state-icon .icon {
    width: 25px;
    height: 25px;
}

.empty-state h3 {
    font-size: 16px;
}

.empty-state p {
    max-width: 330px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.55;
}

.empty-state .btn {
    margin-top: 18px;
}

/* ==========================================================================
   Page furniture
   ========================================================================== */

.page-stack {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.page-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.page-intro h2 {
    font-size: 24px;
}

.page-intro p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12.5px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

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

.section-head p {
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-bar .input-group {
    flex: 1;
    min-width: 210px;
}

.filter-bar .select {
    width: auto;
    min-width: 135px;
    min-height: 42px;
}

.filter-divider {
    width: 1px;
    height: 24px;
    margin: 0 3px;
    background: var(--line);
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.tab.is-active {
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    padding: 18px 23px;
    border-top: 1px solid var(--line);
}

.page-btn {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink-soft);
    background: var(--surface);
    font-size: 11.5px;
    font-weight: 550;
}

.page-btn:hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

.page-btn.is-active {
    color: #fff;
    border-color: var(--navy);
    background: var(--navy);
}

.page-btn.is-disabled {
    color: var(--muted-light);
    background: var(--surface-soft);
    pointer-events: none;
}

.page-ellipsis {
    color: var(--muted);
    padding: 0 3px;
}

.divider {
    height: 1px;
    margin: 20px 0;
    border: 0;
    background: var(--line);
}

.meta-list {
    display: grid;
    gap: 10px;
}

.meta-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    font-size: 12.5px;
}

.meta-row dt {
    color: var(--muted);
}

.meta-row dd {
    margin: 0;
    color: var(--ink);
    font-weight: 550;
    text-align: right;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.dashboard-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    min-height: 196px;
    padding: 30px 34px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(90% 160% at 88% 20%, rgba(255, 90, 42, 0.26), transparent 54%),
        radial-gradient(80% 120% at 55% 120%, rgba(49, 185, 161, 0.1), transparent 50%),
        linear-gradient(120deg, #101a25 0%, #162635 68%, #182b3b 100%);
    box-shadow: 0 20px 55px rgba(16, 26, 37, 0.16);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -110px;
    width: 360px;
    height: 360px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.018),
        0 0 0 130px rgba(255, 255, 255, 0.012);
    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 540px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero-kicker .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #5cd6b8;
    box-shadow: 0 0 0 4px rgba(92, 214, 184, 0.12);
}

.dashboard-hero h2 {
    max-width: 480px;
    font-size: clamp(25px, 2.2vw, 33px);
    font-weight: 720;
    letter-spacing: -0.04em;
}

.dashboard-hero p {
    max-width: 430px;
    margin-top: 9px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12.5px;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    gap: 9px;
    margin-top: 21px;
}

.hero-actions .btn {
    min-height: 40px;
    padding: 9px 15px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: none;
}

.hero-actions .btn-ghost {
    color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.045);
}

.hero-actions .btn-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
}

.hero-visual {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    min-width: 220px;
    padding-left: 30px;
}

.hero-ticket {
    width: 215px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.075);
    backdrop-filter: blur(14px);
    transform: rotate(-2.5deg) translateY(3px);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.2);
}

.hero-ticket-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.48);
    font-size: 8.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-ticket-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 10.5px;
}

.hero-ticket-total {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px dashed rgba(255, 255, 255, 0.16);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.46);
}

.hero-ticket-total strong {
    color: #fff;
    font-size: 21px;
    letter-spacing: -0.03em;
}

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

.kpi-card {
    position: relative;
    overflow: hidden;
    padding: 19px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kpi-label {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.kpi-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: var(--ink-soft);
    background: var(--surface-tint);
}

.kpi-icon .icon {
    width: 15px;
    height: 15px;
}

.kpi-icon.is-brand {
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.kpi-icon.is-green {
    color: var(--green);
    background: var(--green-soft);
}

.kpi-icon.is-blue {
    color: var(--blue);
    background: var(--blue-soft);
}

.kpi-value {
    margin-top: 13px;
    font-size: 27px;
    font-weight: 720;
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.kpi-value small {
    margin-left: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
}

.kpi-foot {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 10.5px;
}

.kpi-foot .icon {
    width: 12px;
    height: 12px;
}

.kpi-foot strong {
    color: var(--green);
    font-weight: 600;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
    gap: 16px;
}

.chart-panel {
    min-height: 314px;
}

.chart-total {
    text-align: right;
}

.chart-total strong {
    display: block;
    font-size: 20px;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.chart-total span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: clamp(9px, 2vw, 24px);
    height: 192px;
    padding: 8px 6px 0;
}

.bar-col {
    display: flex;
    align-items: center;
    flex: 1;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    height: 100%;
    min-width: 0;
}

.bar-value {
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 550;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bar-track {
    display: flex;
    align-items: flex-end;
    width: 100%;
    max-width: 36px;
    height: 140px;
    border-radius: 7px 7px 3px 3px;
    background: var(--surface-tint);
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    min-height: 3px;
    border-radius: 7px 7px 3px 3px;
    background: #d8d2c7;
    transition: background 0.18s ease;
}

.bar-col.is-today .bar-fill {
    background: linear-gradient(180deg, #ff7b50, var(--brand));
    box-shadow: 0 4px 14px rgba(255, 90, 42, 0.22);
}

.bar-col:hover .bar-fill {
    background: var(--brand);
}

.bar-label {
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 550;
}

.bar-col.is-today .bar-label {
    color: var(--ink);
    font-weight: 650;
}

.recent-list {
    display: flex;
    flex-direction: column;
}

.recent-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 23px;
    border-bottom: 1px solid #f1eee7;
    transition: background 0.14s ease;
}

.recent-row:hover {
    background: var(--surface-soft);
}

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

.recent-main {
    min-width: 0;
    flex: 1;
}

.recent-main strong {
    display: block;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-main small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.recent-amount {
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.stock-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stock-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 23px;
}

.stock-row .thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.stock-main {
    min-width: 0;
    flex: 1;
}

.stock-main strong {
    display: block;
    overflow: hidden;
    font-size: 11.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-main small {
    color: var(--muted);
    font-size: 9.5px;
}

.stock-qty {
    color: var(--red);
    font-size: 11px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dashboard-shops {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-shop {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--surface);
    font-size: 11px;
    color: var(--ink-soft);
}

.dashboard-shop.is-current {
    border-color: #f0cfbf;
    background: var(--brand-faint);
    color: var(--brand-deep);
    font-weight: 600;
}

/* ==========================================================================
   POS
   ========================================================================== */

.pos-page .app-main {
    height: calc(100vh - var(--topbar-height));
    max-width: none;
    padding: 0;
    overflow: hidden;
}

.pos-page .flash-stack {
    position: fixed;
    top: calc(var(--topbar-height) + 14px);
    right: 18px;
    z-index: 80;
    width: min(380px, calc(100vw - 36px));
    margin: 0;
}

.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 382px;
    height: 100%;
    min-height: 0;
}

.pos-catalog {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    padding: 22px 25px 0;
}

.pos-catalog-top {
    flex: 0 0 auto;
}

.pos-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.pos-title-row h2 {
    font-size: 21px;
    letter-spacing: -0.035em;
}

.pos-title-row p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11.5px;
}

.pos-scan {
    display: flex;
    align-items: center;
    gap: 9px;
}

.pos-scan .input-group {
    width: min(330px, 42vw);
}

.pos-scan input {
    min-height: 43px;
    padding-left: 40px;
    border-color: var(--line);
    background: var(--surface);
}

.pos-scan .input-group > .icon {
    left: 12px;
    width: 17px;
    height: 17px;
}

.pos-scan .icon-btn {
    width: 43px;
    height: 43px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.category-scroller {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 1px 15px;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-scroller::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.65);
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 550;
    white-space: nowrap;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.category-tab .cat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cat-color, var(--brand));
}

.category-tab .cat-count {
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
}

.category-tab:hover {
    border-color: var(--line-strong);
    background: var(--surface);
}

.category-tab.is-active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
    box-shadow: 0 6px 16px rgba(16, 26, 37, 0.13);
}

.category-tab.is-active .cat-count {
    color: rgba(255, 255, 255, 0.55);
}

.category-tab.is-active .cat-dot {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.pos-products-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 4px 24px 1px;
    scrollbar-width: thin;
    scrollbar-color: #d3cec4 transparent;
}

.pos-products-scroll::-webkit-scrollbar {
    width: 6px;
}

.pos-products-scroll::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: #d3cec4;
}

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

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    box-shadow: var(--shadow-xs);
    transition: transform 0.17s var(--ease), border-color 0.17s ease,
        box-shadow 0.17s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: #d8ccbe;
    box-shadow: 0 12px 26px rgba(28, 35, 43, 0.09);
}

.product-card:active {
    transform: translateY(0);
}

.product-card.is-out {
    opacity: 0.58;
    cursor: not-allowed;
}

.product-card.is-out:hover {
    transform: none;
    box-shadow: var(--shadow-xs);
}

.product-image {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #f1ede4, #e7e0d4);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s var(--ease);
}

.product-card:hover .product-image img {
    transform: scale(1.035);
}

.product-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #a9a092;
    background:
        radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.75), transparent 40%),
        linear-gradient(135deg, #efe8db, #e3d8c8);
}

.product-placeholder .icon {
    width: 28px;
    height: 28px;
    opacity: 0.65;
}

.product-stock {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 21px;
    padding: 3px 7px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(16, 26, 37, 0.62);
    backdrop-filter: blur(8px);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.product-stock.is-low {
    background: rgba(185, 120, 8, 0.88);
}

.product-stock.is-out {
    background: rgba(199, 63, 68, 0.9);
}

.product-stock.is-negative {
    background: rgba(199, 63, 68, 0.86);
}

.product-add {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 4px 12px rgba(20, 25, 32, 0.24);
    opacity: 0;
    transform: translateY(4px) scale(0.9);
    transition: opacity 0.18s ease, transform 0.18s var(--ease);
}

.product-add .icon {
    width: 15px;
    height: 15px;
    stroke-width: 2.3;
}

.product-card:hover .product-add,
.product-card:focus-visible .product-add {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 12px 12px;
}

.product-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.38;
    letter-spacing: -0.01em;
    -webkit-line-clamp: 2;
    min-height: 31px;
}

.product-meta-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.product-price {
    color: var(--ink);
    font-size: 14px;
    font-weight: 720;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.product-unit {
    color: var(--muted);
    font-size: 9px;
    text-align: right;
}

.product-card.is-out .product-price {
    color: var(--muted);
}

.pos-cart {
    display: flex;
    min-height: 0;
    flex-direction: column;
    border-left: 1px solid var(--line);
    background: var(--surface);
    box-shadow: -18px 0 44px rgba(24, 33, 42, 0.035);
}

.cart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 23px 22px 16px;
    border-bottom: 1px solid var(--line);
}

.cart-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
}

.cart-head h2 .icon {
    width: 18px;
    height: 18px;
    color: var(--brand);
}

.cart-head p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10.5px;
}

.cart-head-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.cart-clear {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.cart-clear:hover {
    color: var(--red);
    background: var(--red-soft);
}

.cart-clear .icon {
    width: 13px;
    height: 13px;
}

.cart-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 9px 16px;
    scrollbar-width: thin;
    scrollbar-color: #ddd8ce transparent;
}

.cart-empty {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.cart-empty-icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin-bottom: 14px;
    border: 1px dashed #dcd5c9;
    border-radius: 18px;
    color: #b6aca0;
    background: var(--surface-soft);
}

.cart-empty-icon .icon {
    width: 25px;
    height: 25px;
}

.cart-empty h3 {
    font-size: 14px;
}

.cart-empty p {
    max-width: 210px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 6px;
    border-bottom: 1px solid #f1eee7;
    animation: cartIn 0.2s var(--ease);
}

@keyframes cartIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

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

.cart-item .thumb {
    width: 43px;
    height: 43px;
    border-radius: 9px;
}

.cart-item-main {
    min-width: 0;
    flex: 1;
}

.cart-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.cart-item-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
    -webkit-line-clamp: 2;
}

.cart-item-remove {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted-light);
}

.cart-item-remove:hover {
    color: var(--red);
    background: var(--red-soft);
}

.cart-item-remove .icon {
    width: 12px;
    height: 12px;
}

.cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 7px;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
}

.qty-stepper button {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
}

.qty-stepper button:hover {
    background: var(--surface-tint);
}

.qty-stepper button .icon {
    width: 12px;
    height: 12px;
}

.qty-stepper span {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    color: var(--ink);
    font-size: 10.5px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.cart-item-price {
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.cart-item-unit {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 8.5px;
    text-align: right;
}

.cart-foot {
    flex: 0 0 auto;
    padding: 17px 21px 20px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface) 0%, #fdfcf9 100%);
}

.cart-discount {
    margin-bottom: 12px;
}

.cart-discount summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 10px;
    font-weight: 550;
    cursor: pointer;
    list-style: none;
}

.cart-discount summary::-webkit-details-marker {
    display: none;
}

.cart-discount summary .icon {
    width: 12px;
    height: 12px;
}

.cart-discount[open] summary {
    margin-bottom: 7px;
}

.discount-input {
    position: relative;
}

.discount-input input {
    min-height: 36px;
    padding-left: 30px;
    font-size: 12px;
    background: var(--surface-soft);
}

.discount-input .prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 11px;
}

.cart-summary {
    display: grid;
    gap: 7px;
    margin-bottom: 15px;
}

.cart-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
    font-size: 11px;
}

.cart-summary-row span:last-child {
    color: var(--ink-soft);
    font-weight: 550;
    font-variant-numeric: tabular-nums;
}

.cart-summary-row.is-discount span:last-child {
    color: var(--green);
}

.cart-total-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-top: 3px;
    padding-top: 11px;
    border-top: 1px dashed var(--line-strong);
}

.cart-total-row span {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-soft);
}

.cart-total {
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.cart-checkout {
    width: 100%;
    min-height: 50px;
    border-radius: 12px;
    font-size: 13.5px;
}

.cart-checkout .icon {
    width: 18px;
    height: 18px;
}

.cart-checkout:disabled {
    opacity: 0.45;
}

.cart-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 9px;
}

.cart-note .icon {
    width: 11px;
    height: 11px;
}

.mobile-cart-btn {
    display: none;
}

/* Checkout modal */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(13, 21, 29, 0.56);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal[hidden] {
    display: none;
}

.modal-card {
    width: min(500px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.26s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 0;
}

.modal-head h2 {
    font-size: 20px;
    letter-spacing: -0.03em;
}

.modal-head p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11.5px;
}

.modal-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: var(--surface-tint);
    color: var(--muted);
}

.modal-close:hover {
    color: var(--ink);
    background: var(--bg-deep);
}

.modal-close .icon {
    width: 15px;
    height: 15px;
}

.modal-body {
    padding: 20px 24px;
}

.modal-foot {
    display: flex;
    gap: 9px;
    padding: 0 24px 24px;
}

.modal-foot .btn {
    flex: 1;
}

.pay-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 17px;
    margin-bottom: 18px;
    border-radius: 13px;
    background:
        radial-gradient(120% 180% at 100% 0, rgba(255, 90, 42, 0.15), transparent 55%),
        var(--navy);
    color: #fff;
}

.pay-total span {
    color: rgba(255, 255, 255, 0.52);
    font-size: 11px;
    font-weight: 550;
}

.pay-total strong {
    font-size: 26px;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.pay-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.pay-method {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    min-height: 72px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-size: 10.5px;
    font-weight: 600;
    transition: all 0.16s ease;
}

.pay-method .icon {
    width: 20px;
    height: 20px;
    color: var(--muted);
}

.pay-method:hover {
    border-color: var(--line-strong);
    background: var(--surface);
}

.pay-method.is-active {
    border-color: var(--brand);
    background: var(--brand-faint);
    color: var(--brand-deep);
    box-shadow: 0 0 0 1px var(--brand) inset;
}

.pay-method.is-active .icon {
    color: var(--brand);
}

.cash-fields[hidden] {
    display: none;
}

.quick-cash {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.quick-cash button {
    padding: 7px 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-size: 10.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.quick-cash button:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
    background: var(--brand-faint);
}

.change-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 13px;
    padding: 10px 12px;
    border-radius: 9px;
    background: var(--green-soft);
    color: #0d6b57;
    font-size: 11px;
    font-weight: 550;
}

.change-box strong {
    font-size: 15px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.change-box.is-short {
    background: var(--red-soft);
    color: var(--red);
}

/* ==========================================================================
   Product catalog / imports
   ========================================================================== */

.catalog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.product-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.image-panel {
    position: sticky;
    top: calc(var(--topbar-height) + 20px);
}

.image-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    aspect-ratio: 4 / 3;
    width: 100%;
    overflow: hidden;
    border: 1.5px dashed var(--line-strong);
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--muted);
    text-align: center;
    transition: border-color 0.17s ease, background 0.17s ease;
}

.image-drop:hover {
    border-color: var(--brand);
    background: var(--brand-faint);
}

.image-drop.has-image {
    border-style: solid;
    border-color: var(--line);
}

.image-drop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-drop input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-drop-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px;
}

.image-drop-prompt .icon {
    width: 26px;
    height: 26px;
    color: var(--brand);
}

.image-drop-prompt strong {
    color: var(--ink-soft);
    font-size: 12px;
}

.image-drop-prompt small {
    font-size: 10px;
}

.image-panel-note {
    margin-top: 12px;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.55;
    word-break: break-word;
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.price-field {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
}

.price-field.is-visible {
    border-color: #f0cec0;
    background: var(--brand-faint);
}

.price-field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.price-field-label .badge {
    font-size: 8px;
    text-transform: none;
    letter-spacing: 0;
}

.price-field .input-group > input {
    min-height: 38px;
    padding-left: 31px;
    font-size: 13px;
    font-weight: 600;
    background: var(--surface);
}

.price-field .input-group > .icon {
    width: 13px;
    height: 13px;
    left: 10px;
}

.import-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.dropzone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 230px;
    padding: 28px;
    border: 1.5px dashed var(--line-strong);
    border-radius: 15px;
    background: var(--surface-soft);
    text-align: center;
    transition: border-color 0.17s ease, background 0.17s ease;
    cursor: pointer;
}

.dropzone:hover,
.dropzone.is-dragging {
    border-color: var(--brand);
    background: var(--brand-faint);
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 13px;
    border-radius: 15px;
    color: var(--brand);
    background: var(--brand-soft);
}

.dropzone-icon .icon {
    width: 23px;
    height: 23px;
}

.dropzone strong {
    font-size: 14px;
}

.dropzone p {
    max-width: 330px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.dropzone small {
    margin-top: 12px;
    color: var(--muted-light);
    font-size: 10px;
}

.import-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 17px;
}

.import-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    font-size: 11px;
}

.import-file-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 7px;
    color: var(--brand);
    background: var(--brand-soft);
}

.import-file-icon .icon {
    width: 15px;
    height: 15px;
}

.import-file-copy {
    min-width: 0;
    flex: 1;
}

.import-file-copy strong {
    display: block;
    overflow: hidden;
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-file-copy small {
    display: block;
    overflow: hidden;
    margin-top: 1px;
    color: var(--muted);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-file-status {
    flex: 0 0 auto;
}

.filename-format {
    display: block;
    margin-top: 7px;
    color: var(--ink-soft);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 10.5px;
    line-height: 2;
}

.filename-format span {
    display: inline-block;
    margin: 0 1px;
    padding: 2px 5px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
}

.import-report {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.import-result {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
    font-size: 11px;
}

.import-result .icon {
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.import-result.is-success .icon {
    color: var(--green);
}

.import-result.is-error .icon {
    color: var(--red);
}

.import-result strong {
    display: block;
    font-weight: 600;
}

.import-result small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    word-break: break-word;
}

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rule {
    display: flex;
    gap: 11px;
}

.rule-num {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 7px;
    color: var(--brand-deep);
    background: var(--brand-soft);
    font-size: 10px;
    font-weight: 700;
}

.rule strong {
    display: block;
    font-size: 12px;
}

.rule p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.example-file {
    padding: 13px;
    border: 1px dashed var(--line-strong);
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 10px;
    line-height: 1.6;
    word-break: break-all;
}

/* ==========================================================================
   Categories / shops / users
   ========================================================================== */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    gap: 14px;
}

.category-card {
    position: relative;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.category-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.category-swatch {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #fff;
    background: var(--cat-color, var(--brand));
    font-size: 12px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.category-card h3 {
    margin-top: 13px;
    font-size: 15px;
}

.category-card p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.category-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
}

.category-card-actions {
    display: flex;
    gap: 2px;
}

.category-inline-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.color-input {
    width: 42px;
    height: 42px;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface);
    cursor: pointer;
}

.color-preset {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--preset);
    box-shadow: 0 0 0 1px var(--line);
}

.color-preset.is-selected {
    box-shadow: 0 0 0 2px var(--ink);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.shop-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.shop-card-banner {
    height: 8px;
    background: linear-gradient(90deg, var(--brand), #ffb27d);
}

.shop-card-body {
    padding: 19px;
}

.shop-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.shop-avatar {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    border-radius: 12px;
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.shop-avatar .icon {
    width: 20px;
    height: 20px;
}

.shop-card h3 {
    font-size: 15px;
}

.shop-card .shop-code {
    display: inline-flex;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

.shop-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 17px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.shop-stat {
    text-align: center;
}

.shop-stat strong {
    display: block;
    font-size: 15px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.shop-stat span {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shop-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 9.5px;
    font-weight: 650;
}

.role-administrator {
    color: #9b3d17;
    background: var(--brand-soft);
}

.role-manager {
    color: #245192;
    background: var(--blue-soft);
}

.role-cashier {
    color: #5c6672;
    background: #f0efeb;
}

.tier-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ink-soft);
    font-size: 10.5px;
    font-weight: 600;
}

.tier-indicator span {
    display: inline-grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border-radius: 5px;
    color: var(--brand-deep);
    background: var(--brand-soft);
    font-size: 9px;
    font-weight: 700;
}

.shop-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 7px;
}

.price-preview {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    margin-top: 12px;
    border: 1px solid #f0d5c7;
    border-radius: 10px;
    background: var(--brand-faint);
}

.price-preview-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.price-preview-icon .icon {
    width: 16px;
    height: 16px;
}

.price-preview strong {
    display: block;
    font-size: 11.5px;
}

.price-preview small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.profile-card {
    overflow: hidden;
    text-align: center;
}

.profile-cover {
    height: 100px;
    background:
        radial-gradient(120% 140% at 85% 20%, rgba(255, 90, 42, 0.3), transparent 55%),
        linear-gradient(130deg, #101a25, #233646);
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: -36px auto 12px;
    border: 4px solid var(--surface);
    border-radius: 22px;
    color: var(--brand-deep);
    background: linear-gradient(145deg, #ffe9df, #ffd4c2);
    font-size: 22px;
    font-weight: 750;
    box-shadow: var(--shadow-sm);
}

.profile-card h2 {
    font-size: 18px;
}

.profile-card > .role-badge {
    margin-top: 7px;
}

.profile-meta {
    padding: 0 24px 24px;
}

.profile-meta .meta-list {
    margin-top: 20px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
    text-align: left;
}

/* ==========================================================================
   Receipt
   ========================================================================== */

.receipt-page {
    background: #eeece5;
}

.receipt-page .app-main {
    max-width: none;
}

.receipt-wrap {
    display: grid;
    grid-template-columns: minmax(0, 390px) 220px;
    align-items: start;
    justify-content: center;
    gap: 24px;
    padding: 16px 0 60px;
}

.receipt-paper {
    position: relative;
    width: 390px;
    max-width: 100%;
    padding: 30px 29px 32px;
    border-radius: 4px;
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(31, 37, 43, 0.14);
}

.receipt-paper::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 8px;
    background-image: linear-gradient(135deg, var(--surface) 5px, transparent 0),
        linear-gradient(225deg, var(--surface) 5px, transparent 0);
    background-position: left bottom;
    background-repeat: repeat-x;
    background-size: 10px 10px;
}

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

.receipt-logo {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #ff7646, #ff4e1f);
    box-shadow: 0 8px 20px rgba(255, 90, 42, 0.25);
}

.receipt-logo .icon {
    width: 22px;
    height: 22px;
}

.receipt-brand h2 {
    font-size: 19px;
    letter-spacing: -0.03em;
}

.receipt-brand p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.5;
}

.receipt-meta {
    display: grid;
    gap: 6px;
    margin: 20px 0;
    padding: 13px 0;
    border-top: 1px dashed var(--line-strong);
    border-bottom: 1px dashed var(--line-strong);
    font-size: 10.5px;
}

.receipt-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.receipt-meta-row span {
    color: var(--muted);
}

.receipt-meta-row strong {
    font-weight: 550;
    text-align: right;
}

.receipt-items {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.receipt-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 12px;
    font-size: 10.5px;
}

.receipt-item-name {
    color: var(--ink);
    font-weight: 550;
}

.receipt-item-qty {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9.5px;
}

.receipt-item-total {
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.receipt-totals {
    display: grid;
    gap: 6px;
    margin-top: 19px;
    padding-top: 14px;
    border-top: 1px dashed var(--line-strong);
    font-size: 10.5px;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.receipt-total-row strong {
    color: var(--ink-soft);
    font-weight: 550;
    font-variant-numeric: tabular-nums;
}

.receipt-grand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 7px;
    padding-top: 12px;
    border-top: 2px solid var(--ink);
}

.receipt-grand span {
    font-size: 11px;
    font-weight: 650;
}

.receipt-grand strong {
    font-size: 23px;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.receipt-payment {
    display: grid;
    gap: 5px;
    margin-top: 11px;
    padding: 10px 0 0;
    border-top: 1px dashed var(--line-strong);
    font-size: 10px;
    color: var(--muted);
}

.receipt-payment div {
    display: flex;
    justify-content: space-between;
}

.receipt-payment strong {
    color: var(--ink-soft);
    font-weight: 550;
}

.receipt-footer {
    margin-top: 21px;
    padding-top: 15px;
    border-top: 1px dashed var(--line-strong);
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.65;
    text-align: center;
}

.receipt-footer strong {
    display: block;
    margin-bottom: 2px;
    color: var(--ink-soft);
    font-size: 10.5px;
}

.receipt-toolbar {
    position: sticky;
    top: calc(var(--topbar-height) + 20px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.receipt-toolbar .btn {
    justify-content: flex-start;
}

.receipt-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

/* ==========================================================================
   Login
   ========================================================================== */

.auth-body {
    min-height: 100vh;
    background: #0d1721;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(480px, 0.9fr);
    min-height: 100vh;
}

.auth-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 38px 46px;
    color: #fff;
    background-image: url("../img/login-hero.jpg");
    background-size: cover;
    background-position: center;
    isolation: isolate;
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(10, 18, 25, 0.78) 0%, rgba(10, 18, 25, 0.35) 38%, rgba(10, 18, 25, 0.86) 100%),
        linear-gradient(120deg, rgba(10, 18, 25, 0.55), rgba(255, 90, 42, 0.18));
}

.auth-visual::after {
    content: "";
    position: absolute;
    left: -150px;
    bottom: -240px;
    z-index: -1;
    width: 560px;
    height: 560px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    box-shadow: 0 0 0 80px rgba(255, 255, 255, 0.025),
        0 0 0 160px rgba(255, 255, 255, 0.018);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    width: fit-content;
}

.auth-brand .brand-mark {
    width: 42px;
    height: 42px;
}

.auth-brand strong {
    display: block;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.035em;
}

.auth-brand small {
    display: block;
    margin-top: 1px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 9px;
    font-weight: 550;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-hero {
    max-width: 530px;
    margin: auto 0;
    padding: 50px 0;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 99px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-kicker .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #61d7b7;
    box-shadow: 0 0 0 3px rgba(97, 215, 183, 0.13);
}

.auth-hero h1 {
    max-width: 500px;
    font-size: clamp(38px, 4.6vw, 62px);
    font-weight: 750;
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.auth-hero h1 em {
    color: #ffb18f;
    font-style: normal;
}

.auth-hero > p {
    max-width: 420px;
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    line-height: 1.65;
}

.auth-features {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 18px;
    margin-top: 27px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 10.5px;
    font-weight: 500;
}

.auth-feature .icon {
    width: 14px;
    height: 14px;
    color: #ff9d77;
}

.auth-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: rgba(255, 255, 255, 0.36);
    font-size: 9px;
    letter-spacing: 0.04em;
}

.auth-foot span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px clamp(28px, 5vw, 80px);
    background:
        radial-gradient(80% 60% at 100% 0, rgba(255, 90, 42, 0.05), transparent 55%),
        #fbfaf7;
}

.auth-form-wrap {
    width: 100%;
    max-width: 390px;
}

.auth-form-head {
    margin-bottom: 29px;
}

.auth-form-head p {
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 650;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.auth-form-head h2 {
    margin-top: 7px;
    font-size: 31px;
    letter-spacing: -0.05em;
}

.auth-form-head span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.auth-form .field > label {
    font-size: 11px;
}

.auth-form .input-group > input {
    min-height: 49px;
    border-radius: 11px;
    background: var(--surface);
    font-size: 13.5px;
}

.auth-form .input-group > .icon {
    width: 18px;
    height: 18px;
}

.auth-form .input-action .icon-btn {
    width: 36px;
    height: 36px;
}

.auth-submit {
    min-height: 50px;
    margin-top: 5px;
    border-radius: 11px;
    font-size: 13px;
}

.auth-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 12px;
    border: 1px solid #f3cfd2;
    border-radius: 9px;
    color: #a32b31;
    background: var(--red-soft);
    font-size: 11.5px;
    line-height: 1.45;
}

.auth-error .icon {
    width: 15px;
    height: 15px;
    margin-top: 1px;
}

.auth-demo {
    margin-top: 22px;
    padding: 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.55);
}

.auth-demo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.auth-demo-head strong {
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.auth-demo-creds {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--ink-soft);
}

.auth-demo-creds span {
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
}

.auth-demo button {
    border: 0;
    background: transparent;
    color: var(--brand-deep);
    font-size: 10px;
    font-weight: 600;
}

.auth-demo button:hover {
    text-decoration: underline;
}

.auth-legal {
    margin-top: 26px;
    color: var(--muted-light);
    font-size: 9.5px;
    line-height: 1.6;
    text-align: center;
}

/* ==========================================================================
   Error page
   ========================================================================== */

.error-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(80% 60% at 80% 0, rgba(255, 90, 42, 0.08), transparent 50%),
        var(--bg);
}

.error-page {
    width: min(460px, 100%);
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.error-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 17px;
    color: var(--brand);
    background: var(--brand-soft);
    font-size: 26px;
    font-weight: 750;
}

.error-page h1 {
    margin-top: 5px;
    font-size: 27px;
    letter-spacing: -0.04em;
}

.error-page > p:not(.eyebrow) {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 23px;
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(330px, calc(100vw - 40px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    font-size: 11.5px;
    line-height: 1.45;
    pointer-events: auto;
    animation: toastIn 0.25s var(--ease);
}

.toast.is-leaving {
    animation: toastOut 0.2s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(5px); }
}

.toast .icon {
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.toast.is-success .icon { color: var(--green); }
.toast.is-error .icon { color: var(--red); }
.toast.is-info .icon { color: var(--blue); }

/* ==========================================================================
   Utilities / animations
   ========================================================================== */

.is-hidden {
    display: none !important;
}

.fade-up {
    animation: fadeUp 0.35s var(--ease) both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1280px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-layout {
        grid-template-columns: minmax(0, 1fr) 356px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    }
}

@media (max-width: 1120px) {
    :root {
        --sidebar-width: 232px;
    }

    .app-main {
        padding: 24px 24px 44px;
    }

    .topbar {
        padding: 0 22px;
    }

    .account-copy {
        display: none;
    }

    .tier-chip {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-visual {
        display: none;
    }

    .dashboard-hero {
        min-height: 184px;
    }

    .product-form-grid,
    .import-layout,
    .profile-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .image-panel {
        position: static;
    }

    .image-drop {
        max-width: 380px;
    }
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        width: 264px;
        transform: translateX(-102%);
        transition: transform 0.3s var(--ease);
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
    }

    .app-shell.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 40px 0 80px rgba(0, 0, 0, 0.24);
    }

    .app-shell.nav-open .sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        border: 0;
        background: rgba(13, 21, 29, 0.44);
    }

    .app-frame {
        width: 100%;
        margin-left: 0;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: -7px;
    }

    .topbar {
        gap: 11px;
        padding: 0 18px;
    }

    .account-caret {
        display: none;
    }

    .pos-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
}

@media (max-width: 820px) {
    :root {
        --topbar-height: 70px;
    }

    .app-main {
        padding: 20px 18px 40px;
    }

    .topbar {
        height: var(--topbar-height);
    }

    .page-heading h1 {
        font-size: 18px;
    }

    .shop-switcher-inner {
        max-width: 44px;
        padding: 0 10px;
    }

    .shop-switcher select {
        position: absolute;
        inset: 0;
        width: 100%;
        opacity: 0;
    }

    .shop-switcher .select-caret {
        display: none;
    }

    .shop-switcher-inner > .icon {
        color: var(--ink-soft);
    }

    .page-actions .btn span {
        display: none;
    }

    .page-actions .btn {
        width: 38px;
        min-height: 38px;
        padding: 0;
    }

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

    .auth-visual {
        min-height: 260px;
        padding: 25px 26px;
    }

    .auth-hero {
        padding: 38px 0 16px;
    }

    .auth-hero h1 {
        font-size: 36px;
    }

    .auth-hero > p,
    .auth-features {
        display: none;
    }

    .auth-foot {
        display: none;
    }

    .auth-panel {
        padding: 34px 24px 50px;
    }

    .receipt-wrap {
        grid-template-columns: minmax(0, 1fr);
        max-width: 420px;
        margin: 0 auto;
    }

    .receipt-toolbar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .receipt-paper {
        width: 100%;
    }

    .pos-page .app-main {
        height: auto;
        min-height: calc(100vh - var(--topbar-height));
        overflow: visible;
    }

    .pos-page .flash-stack {
        top: calc(var(--topbar-height) + 10px);
    }

    .pos-layout {
        display: block;
        height: auto;
    }

    .pos-catalog {
        min-height: calc(100vh - var(--topbar-height));
        padding: 18px 16px 92px;
    }

    .pos-title-row {
        align-items: stretch;
        flex-direction: column;
        gap: 13px;
    }

    .pos-scan .input-group {
        width: 100%;
    }

    .pos-cart {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 90;
        height: min(74vh, 610px);
        border: 1px solid var(--line);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -20px 60px rgba(19, 28, 37, 0.2);
        transform: translateY(calc(100% + 20px));
        transition: transform 0.32s var(--ease);
    }

    .pos-cart.is-open {
        transform: translateY(0);
    }

    .mobile-cart-btn {
        position: fixed;
        right: 16px;
        bottom: 18px;
        z-index: 85;
        display: inline-flex;
        align-items: center;
        gap: 9px;
        min-height: 50px;
        padding: 0 18px;
        border: 0;
        border-radius: 99px;
        color: #fff;
        background: var(--navy);
        box-shadow: 0 14px 34px rgba(16, 26, 37, 0.3);
        font-size: 12px;
        font-weight: 650;
    }

    .mobile-cart-btn .icon {
        width: 18px;
        height: 18px;
    }

    .mobile-cart-btn .cart-badge {
        display: grid;
        place-items: center;
        min-width: 21px;
        height: 21px;
        padding: 0 5px;
        border-radius: 99px;
        color: var(--navy);
        background: #fff;
        font-size: 9.5px;
        font-weight: 700;
    }

    .mobile-cart-btn .cart-total {
        color: rgba(255, 255, 255, 0.66);
        font-weight: 500;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .pos-products-scroll {
        overflow: visible;
    }

    .dashboard-hero {
        padding: 24px;
        min-height: 180px;
    }

    .hero-actions {
        flex-wrap: wrap;
    }

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

    .kpi-card {
        padding: 16px;
    }

    .kpi-value {
        font-size: 22px;
    }

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

    .form-grid .span-2 {
        grid-column: auto;
    }

    .category-grid,
    .shop-grid {
        grid-template-columns: 1fr;
    }

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

    .filter-bar .input-group,
    .filter-bar .select {
        width: 100%;
        max-width: none;
    }

    .filter-divider {
        display: none;
    }

    .page-intro {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .data-table {
        min-width: 640px;
    }
}

@media (max-width: 560px) {
    .topbar {
        padding: 0 13px;
    }

    .app-main {
        padding: 17px 13px 34px;
    }

    .eyebrow {
        font-size: 8.5px;
    }

    .page-heading h1 {
        font-size: 16px;
    }

    .account-menu > summary {
        padding: 3px;
    }

    .account-menu .avatar {
        width: 34px;
        height: 34px;
    }

    .account-dropdown {
        right: -4px;
    }

    .shop-switcher-inner {
        width: 38px;
        max-width: 38px;
        height: 36px;
        justify-content: center;
        padding: 0;
    }

    .shop-switcher-inner > .icon {
        margin: 0;
    }

    .page-actions {
        display: none;
    }

    .dashboard-hero {
        border-radius: 18px;
        padding: 22px;
    }

    .dashboard-hero h2 {
        font-size: 24px;
    }

    .hero-actions .btn {
        flex: 1;
    }

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

    .kpi-label {
        font-size: 9px;
    }

    .kpi-value {
        font-size: 19px;
    }

    .kpi-icon {
        width: 27px;
        height: 27px;
    }

    .chart-panel {
        min-height: 290px;
    }

    .bar-chart {
        gap: 8px;
        height: 170px;
    }

    .panel-head,
    .panel-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .panel-body.tight {
        padding-left: 16px;
        padding-right: 16px;
    }

    .recent-row {
        padding-left: 16px;
        padding-right: 16px;
    }

    .stock-row {
        padding-left: 16px;
        padding-right: 16px;
    }

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

    .modal {
        padding: 10px;
    }

    .modal-card {
        max-height: calc(100vh - 20px);
        border-radius: 17px;
    }

    .modal-head,
    .modal-body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .modal-foot {
        padding: 0 18px 18px;
    }

    .pay-total strong {
        font-size: 23px;
    }

    .auth-visual {
        min-height: 220px;
    }

    .auth-hero h1 {
        font-size: 30px;
    }

    .auth-form-head h2 {
        font-size: 27px;
    }

    .auth-panel {
        padding: 28px 18px 40px;
    }

    .receipt-paper {
        padding: 25px 20px 27px;
    }

    .receipt-wrap {
        padding-top: 4px;
    }

    .pos-catalog {
        padding: 15px 12px 92px;
    }

    .pos-title-row h2 {
        font-size: 19px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .product-name {
        font-size: 11px;
    }

    .product-price {
        font-size: 13px;
    }

    .category-tab {
        padding: 6px 10px;
        font-size: 10.5px;
    }

    .cart-head {
        padding: 18px 17px 14px;
    }

    .cart-foot {
        padding: 14px 17px 18px;
    }

    .cart-total {
        font-size: 23px;
    }
}

/* ==========================================================================
   Print receipt
   ========================================================================== */

@media print {
    @page {
        size: 80mm auto;
        margin: 4mm;
    }

    body.receipt-page {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .sidebar-scrim,
    .flash-stack,
    .receipt-toolbar,
    .toast-stack,
    .sidebar::after {
        display: none !important;
    }

    .app-frame {
        width: 100%;
        margin: 0;
    }

    .app-main {
        padding: 0;
        max-width: none;
    }

    .receipt-wrap {
        display: block;
        padding: 0;
    }

    .receipt-paper {
        width: 72mm;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .receipt-paper::after {
        display: none;
    }

    .receipt-grand strong {
        font-size: 20px;
    }

    .receipt-toolbar,
    .receipt-note {
        display: none !important;
    }
}

/* ==========================================================================
   Late additions / composed layouts
   ========================================================================== */

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.sticky-panel {
    position: sticky;
    top: calc(var(--topbar-height) + 20px);
}

.pos-tier-form {
    display: inline-flex;
    align-items: center;
}

.pos-tier-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-soft);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
}

.pos-tier-form label > .icon {
    width: 15px;
    height: 15px;
    color: var(--brand);
}

.pos-tier-form label > span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.pos-tier-form select {
    width: auto;
    min-height: 0;
    max-width: 82px;
    padding: 0 16px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    background-image: none;
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
    box-shadow: none;
    appearance: none;
    cursor: pointer;
}

.pos-tier-form select:focus {
    outline: 0;
    box-shadow: none;
}

.pos-tier-form label > .icon:last-child {
    width: 12px;
    height: 12px;
    margin-left: -11px;
    color: var(--muted);
    pointer-events: none;
}

.cart-mobile-close {
    display: none;
}

.btn-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

.filter-bar input[type="date"] {
    width: auto;
    min-width: 145px;
    min-height: 42px;
    font-size: 12px;
}

.receipt-paper p {
    margin-top: 2px;
}

@media (max-width: 1120px) {
    .split-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .sticky-panel {
        position: static;
    }
}

@media (max-width: 820px) {
    .pos-tier-form {
        display: none;
    }

    .cart-mobile-close {
        display: inline-flex;
    }

    body.cart-open {
        overflow: hidden;
    }

    .filter-bar input[type="date"] {
        width: 100%;
    }
}


input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.filename-format span {
    white-space: nowrap;
}


.pos-inline-tier {
    display: none;
}

.cart-scrim {
    display: none;
}

@media (max-width: 820px) {
    .pos-inline-tier {
        display: inline-flex;
        margin-top: 9px;
    }

    .pos-inline-tier label {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 6px 9px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        color: var(--muted);
        font-size: 10px;
        font-weight: 600;
    }

    .pos-inline-tier label > .icon {
        width: 13px;
        height: 13px;
        color: var(--brand);
    }

    .pos-inline-tier select {
        width: auto;
        min-height: 0;
        padding: 0 18px 0 0;
        border: 0;
        background: transparent;
        background-image: none;
        color: var(--ink);
        font-size: 11px;
        font-weight: 650;
        box-shadow: none;
    }

    .pos-inline-tier label > .icon:last-child {
        width: 12px;
        height: 12px;
        margin-left: -17px;
        color: var(--muted);
        pointer-events: none;
    }

    .cart-scrim {
        position: fixed;
        inset: 0;
        z-index: 89;
        border: 0;
        background: rgba(13, 21, 29, 0.46);
        backdrop-filter: blur(2px);
    }

    .cart-scrim.is-visible {
        display: block;
    }
}

/* ==========================================================================
   Shop image
   ========================================================================== */

.shop-mini-icon.has-image,
.shop-avatar.has-image {
    overflow: hidden;
    padding: 0;
    background: #e9e4d9;
}

.shop-mini-icon img,
.shop-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-switch-image {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    border-radius: 5px;
    object-fit: cover;
}

.receipt-logo.has-image {
    overflow: hidden;
    padding: 2px;
    border: 1px solid var(--line);
    background: #fff;
}

.receipt-logo.has-image img {
    width: 100%;
    height: 100%;
    border-radius: 9px;
    object-fit: contain;
}

.shop-image-editor {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}

.shop-image-preview {
    display: grid;
    place-items: center;
    width: 124px;
    height: 124px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--muted-light);
}

.shop-image-preview.has-image {
    border-style: solid;
    border-color: var(--line);
    background: #e9e4d9;
}

.shop-image-preview .icon {
    width: 27px;
    height: 27px;
}

.shop-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-image-control {
    min-width: 220px;
    flex: 1;
}

.shop-image-control input[type="file"] {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 12px;
}

@media (max-width: 560px) {
    .shop-image-preview {
        width: 96px;
        height: 96px;
    }

    .shop-image-control {
        min-width: 180px;
    }
}

/* ==========================================================================
   On-screen product barcode
   ========================================================================== */

.product-barcode {
    display: block;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px dashed var(--line);
    background: #fff;
}

.product-barcode .barcode-svg {
    display: block;
    width: 100%;
    height: 32px;
}

.product-barcode-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    margin-top: 1px;
    color: var(--ink-soft);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 7.5px;
    font-weight: 550;
    letter-spacing: 0.045em;
    line-height: 1.2;
    text-align: center;
}

.product-barcode-text > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .product-barcode .barcode-svg {
        height: 28px;
    }
}

.barcode-zoom {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 14px;
    height: 12px;
    color: var(--muted-light);
    opacity: 0.6;
    transition: color 0.16s ease, opacity 0.16s ease;
}

.product-barcode {
    position: relative;
    cursor: zoom-in;
}

.product-barcode:hover .barcode-zoom {
    color: var(--brand);
    opacity: 1;
}

.barcode-zoom .icon {
    width: 10px;
    height: 10px;
}

.barcode-modal-card {
    width: min(680px, 100%);
}

.barcode-large {
    padding: 16px 20px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.barcode-large .barcode-svg {
    display: block;
    width: 100%;
    height: 112px;
}

.barcode-large-code {
    margin-top: 9px;
    color: var(--ink);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-align: center;
    word-break: break-all;
}

@media (max-width: 560px) {
    .barcode-large .barcode-svg {
        height: 82px;
    }

    .barcode-large-code {
        font-size: 15px;
    }
}

/* ==========================================================================
   Reports
   ========================================================================== */

.rank-badge {
    display: inline-grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 7px;
    color: var(--muted);
    background: var(--surface-tint);
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.rank-badge.is-top {
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.weekday-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.weekday-row {
    display: grid;
    grid-template-columns: 34px minmax(65px, 1fr) minmax(128px, auto);
    align-items: center;
    gap: 10px;
}

.weekday-label {
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.weekday-track {
    height: 9px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--surface-tint);
}

.weekday-fill {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffb795, var(--brand));
}

.weekday-value {
    color: var(--ink-soft);
    font-size: 10.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.weekday-value small {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 8.5px;
    font-weight: 450;
}

.quick-ranges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 2px 0 19px;
}

.quick-range {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--surface);
    color: var(--muted);
    font-size: 10px;
    font-weight: 550;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.quick-range:hover,
.quick-range.is-active {
    border-color: #f0cfbf;
    color: var(--brand-deep);
    background: var(--brand-faint);
}

.report-table tfoot td {
    padding-top: 13px;
    padding-bottom: 15px;
    border-top: 2px solid var(--ink);
    border-bottom: 0;
    color: var(--ink);
    background: var(--surface);
    font-size: 11px;
    font-weight: 650;
}

.report-table tbody tr.is-zero-row td {
    color: var(--muted-light);
}

.report-table tbody tr.is-zero-row .cell-main {
    color: var(--ink-soft);
}

.report-total-row td:first-child {
    padding-left: 23px;
    color: var(--ink-soft);
    font-size: 11px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.report-table .num {
    white-space: nowrap;
}

@media (max-width: 560px) {
    .weekday-row {
        grid-template-columns: 30px minmax(55px, 1fr) minmax(110px, auto);
        gap: 8px;
    }

    .weekday-value {
        font-size: 9.5px;
    }

    .weekday-value small {
        font-size: 8px;
    }
}

/* Receipt shop logo: 80% width, no frame or decoration */
.receipt-logo.has-image {
    display: block;
    width: 80%;
    height: auto;
    margin: 0 auto 12px;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.receipt-logo.has-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
}


.receipt-email-form {
    margin: 0;
}

.receipt-email-form .btn {
    width: 100%;
    justify-content: flex-start;
}

/* Keep the POS register viewport-bound even with very large catalogs. */
.pos-page .app-frame {
    height: 100vh;
    overflow: hidden;
}

.pos-page .app-main {
    min-height: 0;
}

@media (max-width: 820px) {
    .pos-page .app-frame {
        height: auto;
        overflow: visible;
    }
}

@media (max-width: 820px) {
    .pos-page .app-main {
        min-height: calc(100vh - var(--topbar-height));
    }
}


.cart-last-receipt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 9px;
    color: var(--brand-deep);
    font-size: 10px;
    font-weight: 650;
}

.cart-last-receipt:hover {
    color: var(--brand);
    text-decoration: underline;
}

.cart-last-receipt .icon {
    width: 13px;
    height: 13px;
}

/* Administrator price selector in the top bar and account menu */
.tier-switcher {
    display: inline-flex;
    align-items: center;
}

.tier-switcher .tier-chip {
    padding-right: 8px;
    cursor: pointer;
}

.tier-switcher .tier-chip select {
    width: auto;
    min-height: 0;
    padding: 0 13px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    background-image: none;
    color: inherit;
    font: inherit;
    font-weight: 650;
    letter-spacing: inherit;
    line-height: 1;
    box-shadow: none;
    appearance: none;
    cursor: pointer;
}

.tier-switcher .tier-chip select:focus {
    outline: 0;
    box-shadow: none;
}

.tier-switcher .tier-chip .tier-caret {
    width: 11px;
    height: 11px;
    margin-left: -12px;
    color: #9b3d17;
    pointer-events: none;
}

.dropdown-tier-form {
    margin: 2px 0 5px;
    padding: 8px 9px 11px;
    border-bottom: 1px solid var(--line);
}

.dropdown-tier-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.dropdown-tier-label .icon {
    width: 13px;
    height: 13px;
    color: var(--brand);
}

.dropdown-tier-control {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-tier-control select {
    width: 100%;
    min-height: 34px;
    padding: 0 30px 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 600;
    appearance: none;
    cursor: pointer;
}

.dropdown-tier-control .icon {
    position: absolute;
    right: 10px;
    width: 12px;
    height: 12px;
    color: var(--muted);
    pointer-events: none;
}

@media (max-width: 820px) {
    .tier-switcher {
        display: none;
    }
}

/* Keep the seven-field filename recipe copy-friendly without horizontal overflow */
.filename-format {
    overflow-wrap: anywhere;
}

/* Filename examples must stay legible and copyable; never break mid-name. */
.filename-format {
    overflow-x: auto;
    overflow-wrap: normal;
    white-space: nowrap;
    scrollbar-width: thin;
}

.example-file {
    overflow-x: auto;
    word-break: normal;
    white-space: nowrap;
    scrollbar-width: thin;
}

/* Pending bills */
.cart-pending {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.cart-pending:hover,
.cart-pending.has-bills {
    color: var(--brand-deep);
    background: var(--brand-faint);
}

.cart-pending .icon {
    width: 13px;
    height: 13px;
}

.cart-pending-count {
    display: inline-grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 99px;
    background: var(--surface-tint);
    color: var(--ink-soft);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
}

.cart-pending.has-bills .cart-pending-count {
    color: #fff;
    background: var(--brand);
}

.cart-order-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
}

.cart-hold {
    min-height: 50px;
    padding: 0 13px;
    border-radius: 12px;
    font-size: 11.5px;
    white-space: nowrap;
}

.cart-hold .icon {
    width: 16px;
    height: 16px;
}

.cart-hold:disabled {
    opacity: 0.45;
}

.pending-modal-card {
    width: min(580px, 100%);
}

.pending-loading {
    padding: 34px 12px;
    color: var(--muted);
    font-size: 11.5px;
    text-align: center;
}

.pending-loading.is-error {
    color: var(--red);
}

.pending-empty {
    padding: 34px 16px;
    text-align: center;
}

.pending-empty-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
    border-radius: 14px;
    color: var(--brand);
    background: var(--brand-faint);
}

.pending-empty-icon .icon {
    width: 22px;
    height: 22px;
}

.pending-empty h3 {
    margin: 0 0 4px;
    font-size: 15px;
    letter-spacing: -0.02em;
}

.pending-empty p {
    max-width: 320px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.pending-bill {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.pending-bill + .pending-bill {
    margin-top: 9px;
}

.pending-bill-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pending-bill-head strong {
    display: block;
    color: var(--ink);
    font-size: 12.5px;
    line-height: 1.35;
}

.pending-bill-head small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 9.5px;
}

.pending-bill-total {
    flex: 0 0 auto;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pending-bill-summary {
    margin: 9px 0 11px;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.5;
}

.pending-bill-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pending-bill-actions .btn {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 10.5px;
}

.pending-bill-actions .btn-ghost {
    color: var(--muted);
}

.pending-bill-actions .btn-ghost:hover {
    color: var(--red);
    background: var(--red-faint);
}

@media (max-width: 420px) {
    .cart-pending > span:not(.cart-pending-count) {
        display: none;
    }
}

.pending-wait {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
}

.pending-wait.is-fresh {
    color: var(--green);
    background: var(--green-soft);
}

.pending-wait.is-medium {
    color: var(--amber);
    background: var(--amber-soft);
}

.pending-wait.is-long {
    color: var(--red);
    background: var(--red-soft);
}

.pending-bill-timeline {
    margin-top: 1px !important;
    color: var(--muted-light) !important;
    font-size: 8.5px !important;
    letter-spacing: 0.01em;
}

/* Pending-bill filmstrip across the top of the register */
.pos-page .app-main {
    display: flex;
    flex-direction: column;
}

.pos-page .pos-layout {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
}

.pending-rail {
    flex: 0 0 auto;
    padding: 8px 25px 9px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.pending-rail-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
}

.pending-rail-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.pending-rail-title .icon {
    width: 13px;
    height: 13px;
    color: var(--brand);
}

.pending-rail-count {
    display: inline-grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 99px;
    color: var(--brand-deep);
    background: var(--brand-faint);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
}

.pending-rail-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 4px 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--brand-deep);
    font-size: 9px;
    font-weight: 650;
}

.pending-rail-all:hover {
    background: var(--brand-faint);
}

.pending-rail-all .icon {
    width: 12px;
    height: 12px;
}

.pending-rail-viewport {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.pending-rail-track {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding: 1px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.pending-rail-track::-webkit-scrollbar {
    display: none;
}

.pending-rail-arrow {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 26px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
}

.pending-rail-arrow:hover:not(:disabled) {
    color: var(--brand-deep);
    border-color: #efcabb;
    background: var(--brand-faint);
}

.pending-rail-arrow:disabled {
    opacity: 0.25;
    cursor: default;
}

.pending-rail-arrow .icon {
    width: 13px;
    height: 13px;
}

.pending-rail-card {
    display: flex;
    flex: 0 0 222px;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 7px 10px 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pending-rail-card:hover {
    border-color: #efcabb;
    background: #fffaf6;
}

.pending-rail-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.pending-rail-card-head strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 10.5px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-rail-card-total {
    flex: 0 0 auto;
    color: var(--ink);
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pending-rail-card-line {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: var(--muted);
    font-size: 9px;
    white-space: nowrap;
}

.pending-rail-card-line .pending-wait {
    padding: 1px 5px;
    font-size: 8px;
}

.pending-rail-card-sub {
    overflow: hidden;
    color: var(--muted-light);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-rail.is-highlight {
    animation: pendingRailPulse 1.2s ease;
}

@keyframes pendingRailPulse {
    0%, 100% { background: var(--surface-soft); }
    35% { background: var(--brand-faint); }
}

@media (max-width: 820px) {
    .pending-rail {
        padding: 7px 14px 8px;
    }

    .pending-rail-card {
        flex-basis: 205px;
    }
}

.cart-order-actions.has-kitchen {
    grid-template-columns: auto auto minmax(0, 1fr);
}

.cart-kitchen {
    min-height: 50px;
    padding: 0 11px;
    border-radius: 12px;
    font-size: 11.5px;
    white-space: nowrap;
}

.cart-kitchen .icon {
    width: 16px;
    height: 16px;
}

.cart-kitchen:disabled {
    opacity: 0.45;
}

@media (max-width: 380px) {
    .cart-order-actions.has-kitchen {
        gap: 5px;
    }

    .cart-order-actions.has-kitchen .btn {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 10.5px;
    }
}

.hold-modal-card {
    width: min(440px, 100%);
}

/* Kitchen printer page: keep IP inputs wide and visible */
.printer-page .profile-grid {
    grid-template-columns: minmax(0, 1fr);
}

.printer-routing-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    overflow: hidden;
}

.printer-route-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

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

.printer-route-copy strong {
    display: block;
    color: var(--ink);
    font-size: 12px;
}

.printer-route-copy small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 9.5px;
}

.printer-route-row input {
    width: 100%;
    min-height: 38px;
}

@media (max-width: 620px) {
    .printer-route-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }
}

/* Separate cart lines, locked held lines, grouped payment summary */
.cart-item.is-locked {
    background: var(--surface-soft);
}
[data-theme="dark"] .cart-item.is-locked {
    background: var(--surface-tint);
    border-color: var(--line);
}

.cart-locked {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 99px;
    color: var(--amber);
    background: var(--amber-soft);
    font-size: 8.5px;
    font-weight: 700;
    white-space: nowrap;
}

.cart-locked .icon {
    width: 11px;
    height: 11px;
}

.cart-line-qty {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.checkout-item-summary {
    margin-top: 13px;
    padding: 10px 0 2px;
    border-top: 1px dashed var(--line-strong);
    border-bottom: 1px dashed var(--line-strong);
    max-height: 178px;
    overflow-y: auto;
}

.checkout-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.checkout-summary-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 7px;
    padding: 4px 0;
    color: var(--ink-soft);
    font-size: 11px;
}

.checkout-summary-qty {
    color: var(--brand-deep);
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.checkout-summary-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-summary-name small {
    color: var(--muted);
    font-size: 9px;
}

.checkout-summary-total {
    color: var(--ink);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.cart-qty-input {
    width: 54px;
    min-height: 28px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    text-align: center;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.cart-qty-input:focus {
    outline: 0;
    border-radius: 5px;
    background: var(--brand-faint);
}

.cart-ordered-at {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 8.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cart-ordered-at .icon {
    width: 11px;
    height: 11px;
    color: var(--brand);
}

/* Receipt paper selection */
.paper-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-tint);
}

.paper-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 29px;
    padding: 4px 6px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 650;
    text-align: center;
}

.paper-option:hover {
    color: var(--ink);
}

.paper-option.is-active {
    color: var(--brand-deep);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

/* A4 invoice */
.receipt-wrap.is-a4 {
    grid-template-columns: minmax(0, 820px) 220px;
}

.a4-invoice {
    width: 100%;
    max-width: 210mm;
    padding: 16mm;
    border-radius: 3px;
    background: #fff;
    color: #17212b;
    box-shadow: 0 18px 50px rgba(31, 37, 43, 0.14);
}

.a4-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
}

.a4-shop {
    min-width: 0;
}

.a4-logo {
    display: block;
    max-width: 190px;
    max-height: 72px;
    margin-bottom: 12px;
    object-fit: contain;
}

.a4-shop h1 {
    margin: 0;
    color: #17212b;
    font-size: 23px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.a4-shop p {
    margin-top: 3px;
    color: #6b7681;
    font-size: 10px;
    line-height: 1.45;
}

.a4-document {
    flex: 0 0 auto;
    min-width: 235px;
    text-align: right;
}

.a4-document-type {
    display: block;
    color: var(--brand);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.a4-number {
    display: block;
    margin-top: 5px;
    color: #17212b;
    font-size: 14px;
    font-weight: 700;
}

.a4-document dl {
    display: grid;
    gap: 3px;
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid #e6e2da;
}

.a4-document dl > div {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    font-size: 9.5px;
}

.a4-document dt {
    color: #87919b;
}

.a4-document dd {
    margin: 0;
    color: #27323c;
    font-weight: 600;
}

.a4-divider {
    height: 2px;
    margin: 18px 0 14px;
    background: #17212b;
}

.a4-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.a4-items th {
    padding: 7px 6px;
    border-bottom: 1px solid #dcd6ca;
    color: #7a838e;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
}

.a4-items th:nth-child(2),
.a4-items th:nth-child(3),
.a4-items th:nth-child(4),
.a4-items td:nth-child(2),
.a4-items td:nth-child(3),
.a4-items td:nth-child(4) {
    text-align: right;
}

.a4-items td {
    padding: 9px 6px;
    border-bottom: 1px solid #eee9e0;
    color: #27323c;
    vertical-align: top;
}

.a4-items td strong {
    display: block;
    color: #17212b;
    font-size: 10.5px;
    font-weight: 600;
}

.a4-items td small {
    display: block;
    margin-top: 2px;
    color: #9aa2aa;
    font-size: 8px;
}

.a4-items .is-amount {
    color: #17212b;
    font-weight: 650;
    white-space: nowrap;
}

.a4-bottom {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    margin-top: 18px;
}

.a4-notes {
    max-width: 330px;
    color: #6b7681;
    font-size: 9.5px;
    line-height: 1.5;
}

.a4-notes p {
    margin: 0 0 8px;
}

.a4-notes strong {
    color: #27323c;
    font-weight: 650;
}

.a4-thanks {
    color: #27323c;
    font-weight: 600;
}

.a4-void {
    color: var(--red);
}

.a4-totals {
    flex: 0 0 235px;
    font-size: 10px;
}

.a4-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 4px 0;
    color: #6b7681;
}

.a4-totals strong {
    color: #27323c;
    font-variant-numeric: tabular-nums;
}

.a4-totals .a4-grand {
    margin: 5px 0;
    padding: 9px 0;
    border-top: 2px solid #17212b;
    border-bottom: 1px solid #e6e2da;
    color: #17212b;
    font-size: 12px;
    font-weight: 700;
}

.a4-totals .a4-grand strong {
    font-size: 18px;
    letter-spacing: -0.03em;
}

.a4-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 10px;
    border-top: 1px solid #e6e2da;
    color: #9aa2aa;
    font-size: 8px;
}

@media (max-width: 900px) {
    .receipt-wrap.is-a4 {
        grid-template-columns: minmax(0, 1fr);
    }

    .a4-invoice {
        padding: 20px 16px;
    }

    .a4-head,
    .a4-bottom {
        gap: 16px;
    }

    .a4-document {
        min-width: 180px;
    }
}

@media (max-width: 600px) {
    .a4-head,
    .a4-bottom {
        display: block;
    }

    .a4-document {
        margin-top: 18px;
        text-align: left;
    }

    .a4-document dl > div {
        justify-content: space-between;
    }

    .a4-totals {
        margin-top: 18px;
    }
}

/* PromptPay payment QR */
.promptpay-panel {
    margin-top: 15px;
    padding: 13px;
    border: 1px solid #e7dfd3;
    border-radius: 12px;
    background: #fffaf6;
}

.promptpay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.promptpay-head > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand-deep);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.promptpay-head .icon {
    width: 15px;
    height: 15px;
}

.promptpay-head strong {
    color: var(--ink);
    font-size: 17px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.promptpay-body {
    display: flex;
    align-items: center;
    gap: 14px;
}

.promptpay-qr {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 174px;
    height: 174px;
    padding: 7px;
    border: 1px solid #e4ded4;
    border-radius: 9px;
    background: #fff;
}

.promptpay-qr:empty {
    display: none;
}

.promptpay-qr svg {
    display: block;
    width: 100%;
    height: 100%;
}

.promptpay-info {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.promptpay-info strong {
    color: var(--ink);
    font-size: 12px;
}

.promptpay-info span {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.promptpay-info #promptpay-status {
    margin-top: 2px;
    color: var(--ink-soft);
}

@media (max-width: 480px) {
    .promptpay-body {
        align-items: flex-start;
        flex-direction: column;
    }

    .promptpay-qr {
        margin: 0 auto;
    }
}

/* Pre-bill printed for customer verification before payment */
.prebill-print {
    display: none;
}

@media print {
    @page {
        size: 80mm auto;
        margin: 4mm;
    }

    body.printing-prebill > *:not(.prebill-print) {
        display: none !important;
    }

    body.printing-prebill .app-shell,
    body.printing-prebill .app-frame,
    body.printing-prebill .sidebar,
    body.printing-prebill .topbar,
    body.printing-prebill .toast-stack,
    body.printing-prebill .flash-stack,
    body.printing-prebill .modal,
    body.printing-prebill .cart-scrim,
    body.printing-prebill .mobile-cart-btn {
        display: none !important;
    }

    body.printing-prebill {
        margin: 0;
        padding: 0;
        background: #fff;
    }

    body.printing-prebill .app-frame {
        display: block !important;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        margin: 0;
        overflow: visible !important;
    }

    body.printing-prebill .app-main {
        height: auto !important;
        min-height: 0 !important;
        max-width: none;
        padding: 0;
        overflow: visible !important;
    }

    body.printing-prebill .app-main > *:not(.prebill-print) {
        display: none !important;
    }

    body.printing-prebill .prebill-print {
        display: block !important;
        width: 72mm;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
        color: #000;
        background: #fff;
        font-family: Arial, "Noto Sans Thai", sans-serif;
    }

    .prebill-shop {
        text-align: center;
    }

    .prebill-logo {
        display: block;
        width: 80%;
        max-height: 28mm;
        margin: 0 auto 3mm;
        object-fit: contain;
    }

    .prebill-shop h1 {
        margin: 0;
        font-size: 16px;
        line-height: 1.25;
    }

    .prebill-shop p {
        margin: 1px 0 0;
        font-size: 8.5px;
        line-height: 1.4;
    }

    .prebill-banner {
        margin: 4mm 0 2mm;
        padding: 2mm 0;
        border-top: 2px solid #000;
        border-bottom: 2px solid #000;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-align: center;
    }

    .prebill-meta,
    .prebill-note {
        display: grid;
        gap: 1px;
        padding: 1mm 0;
        font-size: 9px;
        border-bottom: 1px dashed #999;
    }

    .prebill-meta > div,
    .prebill-note > div {
        display: flex;
        justify-content: space-between;
        gap: 3mm;
    }

    .prebill-note > span {
        display: block;
        margin-bottom: 1mm;
    }

    .prebill-note strong {
        font-weight: 600;
    }

    .prebill-items {
        padding: 2mm 0 1mm;
        border-bottom: 1px dashed #999;
    }

    .prebill-item {
        display: grid;
        grid-template-columns: 8mm minmax(0, 1fr) auto;
        gap: 2mm;
        padding: 1mm 0;
        font-size: 9.5px;
        line-height: 1.35;
    }

    .prebill-qty {
        font-weight: 700;
    }

    .prebill-name small {
        color: #555;
        font-size: 8px;
    }

    .prebill-amount {
        font-weight: 600;
        white-space: nowrap;
    }

    .prebill-totals {
        padding-top: 2mm;
        font-size: 9.5px;
    }

    .prebill-totals > div {
        display: flex;
        justify-content: space-between;
        gap: 3mm;
        padding: 0.7mm 0;
    }

    .prebill-grand {
        margin-top: 1mm;
        padding-top: 2mm !important;
        border-top: 2px solid #000;
        font-size: 13px;
        font-weight: 700;
    }

    .prebill-footer {
        margin: 4mm 0 0;
        padding-top: 2mm;
        border-top: 1px dashed #999;
        font-size: 8.5px;
        line-height: 1.5;
        text-align: center;
    }
}

.prebill-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    margin-top: 13px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.prebill-tools-copy strong {
    display: block;
    color: var(--ink);
    font-size: 11px;
}

.prebill-tools-copy small {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 9px;
}

.prebill-tools .select {
    min-height: 34px;
    padding: 0 26px 0 9px;
    font-size: 10.5px;
}

.prebill-tools .btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 10.5px;
}

@media (max-width: 480px) {
    .prebill-tools {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .prebill-tools-copy {
        grid-column: 1 / -1;
    }
}

@media print {
    body.printing-prebill.prebill-a4 .prebill-print {
        width: 100%;
        max-width: none;
        padding: 0;
        font-size: 12px;
    }

    body.printing-prebill.prebill-a4 .prebill-logo {
        width: auto;
        max-width: 65mm;
        max-height: 35mm;
        margin: 0 auto 6mm;
    }

    body.printing-prebill.prebill-a4 .prebill-shop h1 {
        font-size: 28px;
    }

    body.printing-prebill.prebill-a4 .prebill-shop p {
        font-size: 12px;
        line-height: 1.5;
    }

    body.printing-prebill.prebill-a4 .prebill-banner {
        margin: 8mm 0 4mm;
        padding: 3mm 0;
        font-size: 16px;
    }

    body.printing-prebill.prebill-a4 .prebill-meta,
    body.printing-prebill.prebill-a4 .prebill-note {
        gap: 2mm;
        padding: 3mm 0;
        font-size: 12px;
    }

    body.printing-prebill.prebill-a4 .prebill-items {
        padding: 4mm 0 2mm;
    }

    body.printing-prebill.prebill-a4 .prebill-item {
        grid-template-columns: 12mm minmax(0, 1fr) auto;
        gap: 4mm;
        padding: 2.5mm 0;
        border-bottom: 1px solid #eee;
        font-size: 13px;
    }

    body.printing-prebill.prebill-a4 .prebill-name small {
        font-size: 10px;
    }

    body.printing-prebill.prebill-a4 .prebill-totals {
        width: 85mm;
        margin-left: auto;
        padding-top: 4mm;
        font-size: 13px;
    }

    body.printing-prebill.prebill-a4 .prebill-grand {
        font-size: 19px;
    }

    body.printing-prebill.prebill-a4 .prebill-footer {
        margin-top: 10mm;
        padding-top: 3mm;
        font-size: 11px;
    }
}

.prebill-promptpay {
    margin-top: 4mm;
    padding-top: 3mm;
    border-top: 1px dashed #999;
    text-align: center;
    break-inside: avoid;
    page-break-inside: avoid;
}

.prebill-promptpay-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.prebill-promptpay-qr {
    width: 36mm;
    margin: 2mm auto;
}

.prebill-promptpay-qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.prebill-promptpay-amount {
    display: block;
    margin-top: 1mm;
    font-size: 14px;
    font-weight: 700;
}

.prebill-promptpay-account {
    display: block;
    margin-top: 1px;
    font-size: 8.5px;
}

.prebill-promptpay-note {
    display: block;
    margin-top: 1mm;
    color: #555;
    font-size: 8px;
}

@media print {
    body.printing-prebill.prebill-a4 .prebill-promptpay {
        margin-top: 15mm;
        padding-top: 6mm;
    }

    body.printing-prebill.prebill-a4 .prebill-promptpay-qr {
        width: 45mm;
    }

    body.printing-prebill.prebill-a4 .prebill-promptpay-amount {
        font-size: 20px;
    }

    body.printing-prebill.prebill-a4 .prebill-promptpay-title {
        font-size: 12px;
    }

    body.printing-prebill.prebill-a4 .prebill-promptpay-account,
    body.printing-prebill.prebill-a4 .prebill-promptpay-note {
        font-size: 11px;
    }
}

.receipt-format-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
}

.receipt-format-copy strong {
    display: block;
    color: var(--ink);
    font-size: 10.5px;
}

.receipt-format-copy small {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 8.5px;
}

.receipt-format-row .select {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 25px 0 8px;
    font-size: 10px;
}

@media (max-width: 420px) {
    .receipt-format-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Camera barcode scanner */
.camera-scan-trigger {
    color: var(--brand) !important;
    border-color: rgba(255, 90, 42, 0.28) !important;
    background: #fff8f4 !important;
}

.camera-scan-card {
    width: min(500px, calc(100vw - 24px));
}

.camera-scan-card .modal-body {
    padding-top: 12px;
}

.camera-scan-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: #0c151e;
}

.camera-scan-stage video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-scan-frame {
    position: absolute;
    top: 27%;
    right: 12%;
    bottom: 27%;
    left: 12%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 0 0 999px rgba(5, 10, 15, 0.36);
    pointer-events: none;
}

.camera-scan-frame::before,
.camera-scan-frame::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: var(--brand);
    border-style: solid;
}

.camera-scan-frame::before {
    top: -2px;
    left: -2px;
    border-width: 3px 0 0 3px;
    border-radius: 10px 0 0;
}

.camera-scan-frame::after {
    right: -2px;
    bottom: -2px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 10px;
}

.camera-scan-line {
    position: absolute;
    top: 28%;
    right: 13%;
    left: 13%;
    height: 2px;
    background: var(--brand);
    box-shadow: 0 0 8px rgba(255, 90, 42, 0.8);
    animation: cameraScanLine 2.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cameraScanLine {
    0%, 100% { transform: translateY(0); opacity: 0.35; }
    50% { transform: translateY(44vh); opacity: 1; }
}

.camera-scan-status {
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-size: 11px;
    text-align: center;
}

.camera-scan-error {
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(211, 68, 68, 0.24);
    border-radius: 8px;
    background: #fff5f3;
    color: var(--red);
    font-size: 10px;
    line-height: 1.45;
}

.camera-scan-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.camera-scan-actions .btn {
    min-height: 36px;
    font-size: 10.5px;
}

#print-bill-native {
    grid-column: 1 / -1;
    justify-self: end;
}

.kitchen-browser-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0;
    padding: 10px 11px;
    border: 1px solid #f0d7a4;
    border-radius: 9px;
    background: #fffaf0;
    color: #7b6030;
    font-size: 9.5px;
    line-height: 1.5;
}

.kitchen-browser-warning .icon {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin-top: 1px;
    color: #b7791f;
}

.kitchen-browser-warning strong {
    color: #6b4d1b;
}

.auth-download {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.auth-download-qr {
    flex: 0 0 auto;
    width: 78px;
    height: 78px;
    padding: 4px;
    border-radius: 7px;
    background: #fff;
}

.auth-download-qr:empty {
    display: none;
}

.auth-download-qr svg {
    display: block;
    width: 100%;
    height: 100%;
}

.auth-download-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.auth-download-copy strong {
    color: var(--ink);
    font-size: 10.5px;
}

.auth-download-copy span {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.45;
}

.auth-download-copy a {
    color: var(--brand-deep);
    font-size: 8.5px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.auth-printer-warning {
    margin: 14px 0 0;
    text-align: left;
}

.auth-printer-warning .icon {
    margin-top: 1px;
}

.build-compare {
    margin: 0 32px 24px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #faf8f2;
}

.build-compare-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.build-compare-head strong { font-size: 11px; }
.build-compare-head span { color: var(--muted); font-size: 9px; }

.build-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.build-option div { display: grid; gap: 2px; }
.build-option strong { font-size: 10.5px; }
.build-option small { color: var(--muted); font-size: 9px; }
.build-option a { color: var(--brand-deep); font-size: 10px; font-weight: 700; text-decoration: none; }
.build-compare-hash { margin: 8px 0 0; color: var(--muted); font-size: 8px; overflow-wrap: anywhere; }
.build-compare-hash code { color: var(--ink); font-size: 8px; }

@media (max-width: 640px) {
    .build-compare { margin: 0 20px 20px; }
}

.auth-signup-cta {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(255, 90, 42, 0.18);
    border-radius: 12px;
    background:
        radial-gradient(130% 150% at 100% 0%, rgba(255, 90, 42, 0.1), transparent 60%),
        #fffaf6;
}

.auth-signup-cta > span {
    color: var(--brand-deep);
    font-size: 8.5px;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-signup-cta > strong {
    display: block;
    margin-top: 4px;
    color: var(--ink);
    font-size: 16px;
    letter-spacing: -0.02em;
}

.auth-signup-cta > p {
    margin: 4px 0 11px;
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.5;
}

.auth-signup-cta .btn {
    width: 100%;
}

/* Login and signup use distinct actions: sign in is deep teal, demo signup is orange. */
.auth-submit.auth-login-btn {
    background: linear-gradient(135deg, #0f766e, #115e59);
    border-color: #0f766e;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.24);
}

.auth-submit.auth-login-btn:hover {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    border-color: #0d9488;
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.28);
}

.calendar-nav { display: flex; align-items: center; gap: 10px; }
.calendar-nav h3 { margin: 0; min-width: 150px; text-align: center; }
.expiry-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendar-dow { padding: 5px; color: var(--muted); font-size: 8px; font-weight: 700; text-align: center; text-transform: uppercase; }
.calendar-day { min-height: 78px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.calendar-day.is-outside { opacity: 0.35; }
.calendar-day.is-today { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(255,90,42,.1); }
.calendar-day.is-expired { background: #fff5f3; }
.calendar-number { display: block; margin-bottom: 3px; font-size: 10px; font-weight: 700; }
.calendar-shop { display: block; overflow: hidden; margin-top: 2px; padding: 2px 3px; border-radius: 3px; background: #eefaf5; color: #0f766e; font-size: 7.5px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-day.is-expired .calendar-shop { background: #ffe8e4; color: #b42318; }
.calendar-more { display: block; margin-top: 2px; color: var(--muted); font-size: 7.5px; }
@media (max-width: 700px) { .expiry-calendar { gap: 2px; } .calendar-day { min-height: 62px; padding: 3px; } .calendar-shop { font-size: 6.5px; } }

/* Login theme switch */
.auth-panel { position: relative; }
.auth-theme-toggle {
    position: absolute;
    top: 18px;
    right: 20px;
    min-width: 54px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink-soft);
    font: inherit;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);
}
.auth-theme-toggle:hover { border-color: var(--brand); color: var(--brand-deep); }

[data-theme="dark"] { color-scheme: dark; }
[data-theme="dark"] .auth-panel {
    background:
        radial-gradient(80% 60% at 100% 0, rgba(34, 211, 197, 0.08), transparent 55%),
        #0f1a24;
}
[data-theme="dark"] .auth-theme-toggle {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #d7e3ea;
}
[data-theme="dark"] .auth-theme-toggle:hover { border-color: #22d3c5; color: #fff; }
[data-theme="dark"] .auth-form-head h2 { color: #f2f7f9; }
[data-theme="dark"] .auth-form-head p { color: #8fa6b4; }
[data-theme="dark"] .auth-form-head span { color: #a0b2bd; }
[data-theme="dark"] .auth-form .field label { color: #c4d2da; }
[data-theme="dark"] .auth-form .input-group input {
    border-color: #2a3b48;
    background: #16242f;
    color: #f2f7f9;
}
[data-theme="dark"] .auth-form .input-group input::placeholder { color: #728895; }
[data-theme="dark"] .auth-form .input-group > .icon { color: #8fa6b4; }
[data-theme="dark"] .auth-form .input-action .icon-btn { color: #a7bac5; }
[data-theme="dark"] .auth-legal { color: #8fa6b4; }
[data-theme="dark"] .auth-legal a { color: #5eead4 !important; }
[data-theme="dark"] .auth-signup-cta {
    border-color: rgba(34, 211, 197, 0.24);
    background: #14232d;
}
[data-theme="dark"] .auth-signup-cta > span { color: #5eead4; }
[data-theme="dark"] .auth-signup-cta > strong { color: #f2f7f9; }
[data-theme="dark"] .auth-signup-cta > p { color: #a0b2bd; }
[data-theme="dark"] .auth-download {
    border-color: #2a3b48;
    background: #14232d;
}
[data-theme="dark"] .auth-download-copy strong { color: #f2f7f9; }
[data-theme="dark"] .auth-download-copy span { color: #a0b2bd; }
[data-theme="dark"] .auth-download-copy a { color: #5eead4; }
[data-theme="dark"] .kitchen-browser-warning {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
    color: #e7c57e;
}

/* Application theme switch (login preference persists after sign-in). */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b141d;
    --bg-deep: #081019;
    --surface: #121f2a;
    --surface-soft: #0f1b25;
    --surface-tint: #162530;
    --ink: #f2f7f9;
    --ink-soft: #c4d2da;
    --muted: #8fa6b4;
    --muted-light: #728895;
    --line: #263846;
    --line-strong: #344b5c;
    --brand-soft: #3a2019;
    --brand-faint: #241a17;
}
[data-theme="dark"] .topbar {
    border-bottom-color: #263846;
    background: rgba(11, 20, 29, 0.9);
}
[data-theme="dark"] .panel,
[data-theme="dark"] .card,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .product-card,
[data-theme="dark"] .shop-card,
[data-theme="dark"] .receipt-paper,
[data-theme="dark"] .a4-invoice,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .account-dropdown,
[data-theme="dark"] .pos-cart,
[data-theme="dark"] .empty-state {
    background: var(--surface);
    color: var(--ink);
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .input-group input {
    border-color: var(--line);
    background: var(--surface-tint);
    color: var(--ink);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--muted-light); }
[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td { border-color: var(--line); }
[data-theme="dark"] .data-table tbody tr:hover { background: var(--surface-tint); }
[data-theme="dark"] .receipt-page { background: var(--bg); }
[data-theme="dark"] .receipt-toolbar .btn-outline { background: var(--surface); color: var(--ink); }
[data-theme="dark"] .theme-toggle {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}
.theme-toggle {
    min-width: 50px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    font: inherit;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
}

.auth-lang-switch {
    position: absolute;
    top: 18px;
    right: 82px;
    z-index: 1;
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}
.auth-lang-switch a { padding: 4px 7px; border-radius: 999px; color: var(--muted); font: inherit; font-size: 8px; font-weight: 700; text-decoration: none; }
.auth-lang-switch a.is-active { background: var(--brand); color: #fff; }
[data-theme="dark"] .auth-lang-switch { border-color: #2a3b48; background: #14232d; }
[data-theme="dark"] .auth-lang-switch a { color: #a0b2bd; }
[data-theme="dark"] .auth-lang-switch a.is-active { color: #fff; }

.linux-download { margin: 0 32px 24px 44px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #f2fbfa; }
.linux-download .build-compare-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0; }
.linux-download .build-compare-head strong { display:block; font-size:11px; }
.linux-download .build-compare-head span { display:block; margin-top:2px; color:var(--muted); font-size:9px; }
.linux-download .build-compare-head > a { padding:7px 10px; border-radius:7px; background:#0f766e; color:#fff; font-size:9px; font-weight:700; text-decoration:none; }
.linux-download p { margin:8px 0 5px; color:var(--muted); font-size:9px; line-height:1.5; }
.linux-download small { color:var(--muted); font-size:7.5px; overflow-wrap:anywhere; }
.linux-download code { font-size:7.5px; }
@media(max-width:640px){.linux-download{margin:0 20px 20px;}}

/* Printing must always produce a light document, regardless of the UI theme. */
@media print {
    html[data-theme="dark"],
    html[data-theme="dark"] body {
        --bg: #fff;
        --surface: #fff;
        --surface-soft: #fff;
        --surface-tint: #fff;
        --ink: #000;
        --ink-soft: #000;
        --muted: #333;
        --muted-light: #555;
        --line: #bbb;
        --line-strong: #999;
        background: #fff !important;
        color: #000 !important;
    }

    html[data-theme="dark"] .receipt-paper,
    html[data-theme="dark"] .a4-invoice,
    html[data-theme="dark"] .prebill-print {
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
    }

    html[data-theme="dark"] .a4-invoice *,
    html[data-theme="dark"] .receipt-paper *,
    html[data-theme="dark"] .prebill-print * {
        color: #000 !important;
        border-color: #999 !important;
        background-color: transparent !important;
        text-shadow: none !important;
        box-shadow: none !important;
    }

    html[data-theme="dark"] .a4-invoice .a4-divider {
        background: #000 !important;
    }

    html[data-theme="dark"] .prebill-promptpay-qr,
    html[data-theme="dark"] .a4-logo,
    html[data-theme="dark"] .prebill-logo {
        background: #fff !important;
    }
}

/* Monthly sales chart */
.bar-chart.is-monthly { gap: clamp(4px, 1vw, 14px); }
.bar-chart.is-monthly .bar-track { max-width: 28px; }
.bar-chart.is-monthly .bar-value { font-size: 8px; }
.bar-chart.is-monthly .bar-label { font-size: 9px; }
@media (max-width: 700px) {
    .bar-chart.is-monthly { gap: 3px; overflow-x: auto; }
    .bar-chart.is-monthly .bar-col { min-width: 24px; }
    .bar-chart.is-monthly .bar-value { font-size: 0; }
    .bar-chart.is-monthly .bar-value::after { content: "•"; font-size: 8px; }
}

/* POS product photos: show the whole image, never crop it. */
.pos-page .product-image img {
    object-fit: contain;
    object-position: center;
    padding: 4px;
    background: #fff;
    transform: none !important;
}

.pos-page .product-card:hover .product-image img {
    transform: none !important;
}

.pos-page .product-image {
    background: #fff;
}

.browser-support-warning { display:flex; gap:8px; margin:0 auto 14px; padding:10px 12px; max-width:390px; border:1px solid #f0d7a4; border-radius:9px; background:#fffaf0; color:#7b6030; font-size:9.5px; line-height:1.5; }
.browser-support-warning .icon { flex:0 0 auto; width:14px; height:14px; color:#b7791f; }
@media print { .browser-support-warning { display:none !important; } }

/* POS category tabs: larger, higher-contrast labels */
.pos-page .category-tab {
    min-height: 38px;
    padding: 8px 14px;
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    font-weight: 650;
}

.pos-page .category-tab .cat-count {
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 700;
}

.pos-page .category-tab:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
}

.pos-page .category-tab.is-active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

.pos-page .category-tab.is-active .cat-count {
    color: rgba(255, 255, 255, 0.75);
}

[data-theme="dark"] .pos-page .category-tab {
    border-color: #344b5c;
    background: #162530;
    color: #f2f7f9;
}
[data-theme="dark"] .pos-page .category-tab .cat-count { color: #c4d2da; }

/* Strong, unmistakable selected category state */
.pos-page .category-tab.is-active {
    border-color: var(--brand) !important;
    background: linear-gradient(135deg, #ff6a37, #f04b18) !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(255, 90, 42, 0.22), 0 7px 18px rgba(255, 90, 42, 0.25) !important;
}

.pos-page .category-tab.is-active .cat-count {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.16);
    padding: 2px 5px;
    border-radius: 999px;
}

.pos-page .category-tab.is-active .cat-dot {
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22) !important;
}

.pos-page .category-tab:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

[data-theme="dark"] .pos-page .category-tab.is-active {
    color: #fff !important;
    background: linear-gradient(135deg, #ff6a37, #f04b18) !important;
}

/* Larger pending-bill text for readability */
.pending-bill-head strong { font-size: 15px !important; line-height: 1.4; }
.pending-bill-head small { font-size: 11.5px !important; }
.pending-bill-total { font-size: 17px !important; }
.pending-bill-summary { font-size: 12.5px !important; line-height: 1.6; }
.pending-bill-actions .btn { min-height: 38px; padding: 8px 12px; font-size: 12px !important; }
.pending-wait { font-size: 10px !important; }
.pending-loading { font-size: 13px !important; }
.pending-empty h3 { font-size: 17px !important; }
.pending-empty p { font-size: 12.5px !important; }

.pending-rail-card { flex-basis: 238px; }
.pending-rail-card-head strong { font-size: 12.5px !important; }
.pending-rail-card-total { font-size: 12.5px !important; }
.pending-rail-card-line { font-size: 10.5px !important; }
.pending-rail-card-sub { font-size: 9.5px !important; }
.pending-rail-card-line .pending-wait { font-size: 9.5px !important; }
