/* 衣掌柜 · 门店收银/进销存 —— 基础样式 */
:root {
    --brand: #b4233b;
    --brand-dark: #921a2f;
    --brand-soft: #fbeaee;
    --brand-line: #f2cdd5;
    --gold: #c3984f;
    --ink: #1d2129;
    --ink-2: #343a46;
    --muted: #7c8493;
    --muted-2: #a3a9b4;
    --line: #e8eaef;
    --line-soft: #f0f2f5;
    --bg: #f5f6f8;
    --card: #ffffff;
    --dark: #171b24;
    --dark-2: #202634;
    --green: #16865c;
    --green-soft: #e7f6ef;
    --amber: #a96c0c;
    --amber-soft: #fdf3e0;
    --red: #bd3a31;
    --red-soft: #fceceb;
    --blue: #2563b8;
    --blue-soft: #eaf1fb;
    --purple: #7251b5;
    --purple-soft: #f1ecfb;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --shadow: 0 1px 2px rgba(23, 27, 36, .035), 0 8px 28px rgba(23, 27, 36, .045);
    --shadow-lg: 0 20px 60px rgba(17, 20, 28, .18);
    --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
button, a { touch-action: manipulation; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
::selection { background: var(--brand-soft); color: var(--brand-dark); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cdd2da; border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b8bec9; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.icon {
    width: 18px; height: 18px; flex: 0 0 auto;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ============ 整体框架 ============ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: 246px; display: flex; flex-direction: column;
    background: linear-gradient(180deg, #1b202b 0%, #141821 100%);
    color: #cdd3de; padding: 0 14px 16px;
    overflow-y: auto; transition: transform .25s ease;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #3b4353; }
.brand {
    display: flex; align-items: center; gap: 11px;
    padding: 22px 8px 20px; color: #fff;
}
.brand:hover { color: #fff; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #cf3a52, #9c1830);
    color: #fff; font-family: "Songti SC", "STSong", serif;
    font-size: 22px; font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 16px rgba(180,35,59,.35);
    flex: 0 0 auto;
}
.brand-mark-sm { width: 34px; height: 34px; font-size: 18px; border-radius: 9px; }
.brand-mark-light { background: #f7e9d2; color: #7b2820; box-shadow: none; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { font-size: 18px; letter-spacing: 3px; font-weight: 700; }
.brand-copy small { color: #7f8a9d; font-size: 9px; letter-spacing: 2.4px; margin-top: 3px; }

.nav { flex: 1; padding-top: 4px; }
.nav-group { margin-bottom: 17px; }
.nav-label {
    color: #667085; font-size: 10px; letter-spacing: 1.7px;
    padding: 0 12px; margin-bottom: 6px; font-weight: 600;
}
.nav-item {
    position: relative; display: flex; align-items: center; gap: 11px;
    height: 42px; padding: 0 12px; margin: 2px 0;
    border-radius: 9px; color: #aeb6c4; font-size: 13.5px;
    transition: all .16s ease;
}
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item.is-active {
    background: linear-gradient(90deg, rgba(196,57,78,.23), rgba(196,57,78,.08));
    color: #fff; font-weight: 600;
}
.nav-item.is-active::before {
    content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px;
    width: 3px; border-radius: 0 3px 3px 0; background: #e05a72;
}
.nav-item .icon { width: 18px; height: 18px; opacity: .86; }
.nav-item.is-active .icon { color: #ef7a8e; opacity: 1; }
.nav-badge {
    margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px;
    border-radius: 10px; background: #c4394e; color: #fff;
    font-style: normal; font-size: 10.5px; line-height: 19px; text-align: center;
}
.sidebar-foot { padding-top: 8px; }
.store-chip {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px; border-radius: 10px;
    background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.055);
}
.store-dot {
    width: 8px; height: 8px; margin-top: 6px; border-radius: 50%;
    background: #31b77f; box-shadow: 0 0 0 4px rgba(49,183,127,.12); flex: 0 0 auto;
}
.store-chip strong { display: block; color: #eef1f6; font-size: 12.5px; font-weight: 500; }
.store-chip small { display: block; color: #788396; font-size: 10.5px; margin-top: 2px; }
.sidebar-help {
    margin-top: 12px; padding: 12px; border-radius: 10px;
    background: rgba(195,152,79,.09); border: 1px solid rgba(195,152,79,.13);
}
.sidebar-help span { color: #d6b77d; font-size: 11px; display: flex; align-items: center; gap: 5px; }
.sidebar-help .icon { width: 13px; height: 13px; }
.sidebar-help p { color: #8992a2; font-size: 10.5px; line-height: 1.65; margin-top: 5px; }

.app-main { flex: 1; min-width: 0; margin-left: 246px; }
.topbar {
    height: 76px; padding: 0 28px; display: flex; align-items: center; gap: 18px;
    background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 30;
}
.page-heading h1 { font-size: 19px; font-weight: 700; letter-spacing: -.2px; line-height: 1.3; }
.page-heading p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.topbar-search {
    position: relative; display: flex; align-items: center;
    width: 250px; height: 38px; padding: 0 10px; gap: 8px;
    background: #f3f4f7; border: 1px solid transparent; border-radius: 9px;
    transition: all .16s ease;
}
.topbar-search:focus-within { background: #fff; border-color: #d6dae2; box-shadow: 0 0 0 3px rgba(180,35,59,.07); }
.topbar-search .icon { color: #939aa7; width: 16px; height: 16px; }
.topbar-search input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    font-size: 12.5px; color: var(--ink);
}
.topbar-search kbd {
    border: 1px solid #d9dde5; background: #fff; color: #9aa1ad;
    border-radius: 4px; padding: 0 5px; font-size: 10px; line-height: 17px; font-family: var(--font);
}
.icon-btn {
    position: relative; width: 38px; height: 38px; border: 1px solid var(--line);
    border-radius: 9px; background: #fff; color: #5f6776;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .16s ease;
}
.icon-btn:hover { border-color: #d2d6df; color: var(--ink); background: #fafbfc; }
.dot-badge {
    position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
    padding: 0 4px; background: var(--brand); color: #fff; border-radius: 9px;
    border: 2px solid #fff; font-size: 9px; line-height: 13px; text-align: center;
}
.menu-toggle { display: none; }
.user-menu { position: relative; }
.user-menu summary {
    display: flex; align-items: center; gap: 9px; list-style: none;
    padding: 4px 4px 4px 6px; border-radius: 10px; cursor: pointer;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: #f4f5f7; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(145deg, #f3dfe4, #e8c4cc); color: #922f41;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.user-copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 82px; }
.user-copy strong { font-size: 12px; font-weight: 600; }
.user-copy small { font-size: 10px; color: var(--muted); margin-top: 1px; }
.user-menu[open] summary { background: #f4f5f7; }
.user-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); width: 208px; z-index: 50;
    background: #fff; border: 1px solid var(--line); border-radius: 11px;
    box-shadow: var(--shadow-lg); padding: 7px; animation: drop .16s ease;
}
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
.user-dropdown-head { padding: 9px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 5px; }
.user-dropdown-head strong { display: block; font-size: 12.5px; }
.user-dropdown-head span { color: var(--muted); font-size: 11px; }
.user-dropdown a, .user-dropdown button {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 9px 10px; border: 0; border-radius: 7px; background: none;
    color: var(--ink-2); font-size: 12.5px; text-align: left;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: #f5f6f8; color: var(--ink); }
.user-dropdown .icon { width: 15px; height: 15px; color: #858c99; }
.content { padding: 24px 28px 46px; max-width: 1600px; margin: 0 auto; }
.sidebar-mask { display: none; }

/* ============ 通用组件 ============ */
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-head {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px; border-bottom: 1px solid var(--line-soft);
}
.card-head h2, .card-head h3 { font-size: 14.5px; font-weight: 700; }
.card-head p { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.card-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 15px 20px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px; padding: 0 15px; border-radius: 9px;
    border: 1px solid transparent; font-size: 12.5px; font-weight: 600;
    white-space: nowrap; transition: all .16s ease; line-height: 1;
    background: #fff; color: var(--ink-2);
}
.btn:hover { color: var(--ink); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(180,35,59,.16); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-secondary { background: #fff; border-color: #d8dce4; color: var(--ink-2); }
.btn-secondary:hover { border-color: #b9bfca; background: #fafbfc; }
.btn-ghost { background: transparent; color: #687181; }
.btn-ghost:hover { background: #f2f3f6; color: var(--ink); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: #f7dce2; color: var(--brand-dark); }
.btn-danger { background: #fff; border-color: #efcbca; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-dark { background: #232936; border-color: #232936; color: #fff; }
.btn-dark:hover { background: #11151d; color: #fff; }
.btn-sm { height: 31px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-group { display: inline-flex; gap: 7px; flex-wrap: wrap; }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px; border-radius: 6px;
    font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-gray { background: #f0f2f5; color: #7b8290; }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; background: #f5f6f8; border-radius: 20px;
    color: #697181; font-size: 10.5px;
}
.pill .icon { width: 12px; height: 12px; }

.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.tiny { font-size: 10.5px; }
.strong { font-weight: 700; }
.mono { font-family: var(--mono); font-size: .94em; }
.brand-text { color: var(--brand); }
.green-text { color: var(--green); }
.red-text { color: var(--red); }
.amber-text { color: var(--amber); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hide { display: none !important; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1fr) 340px; }

.page-actions {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-actions h2 { font-size: 17px; }
.page-actions p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.page-actions .actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ============ 表单 ============ */
:where(input[type="text"], input[type="search"], input[type="number"], input[type="password"],
input[type="tel"], input[type="email"], input[type="date"], input[type="datetime-local"], select, textarea) {
    width: 100%; height: 40px; padding: 0 11px;
    border: 1px solid #dde1e8; border-radius: 8px; background: #fff;
    color: var(--ink); outline: none; transition: all .15s ease;
    font-size: 13px;
}
textarea { height: auto; min-height: 82px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
:where(input, select, textarea):focus {
    border-color: #c88b98; box-shadow: 0 0 0 3px rgba(180,35,59,.075);
}
:where(input, textarea)::placeholder { color: #aab0bb; }
select {
    appearance: none; padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8493' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center;
}
input[type="date"] { color-scheme: light; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label, .field-label {
    display: block; font-size: 12px; color: #555d6b; font-weight: 600; margin-bottom: 6px;
}
.form-group label .req, .field-label .req { color: var(--brand); margin-left: 2px; }
.form-hint { font-size: 10.5px; color: var(--muted-2); margin-top: 5px; line-height: 1.5; }
.form-error { font-size: 11px; color: var(--red); margin-top: 5px; }
.input-error { border-color: #df9c98 !important; background: #fffafa !important; }
.input-group { display: flex; align-items: stretch; }
.input-group > input, .input-group > select { border-radius: 8px 0 0 8px; }
.input-group .btn { border-radius: 0 8px 8px 0; height: 40px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px;
    border: 1px solid #dfe3ea; border-radius: 8px; background: #fff;
    font-size: 12px; cursor: pointer; transition: all .15s ease; user-select: none;
}
.check-chip:has(input:checked) { border-color: #c97d8b; background: var(--brand-soft); color: var(--brand-dark); }
.check-chip input { width: 14px; height: 14px; accent-color: var(--brand); margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.switch input { width: 34px; height: 19px; appearance: none; background: #d4d8e0; border-radius: 20px; position: relative; transition: .18s; cursor: pointer; flex: 0 0 auto; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .18s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(15px); }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.form-actions .spacer { flex: 1; }
.help-block { background: #fafbfc; border: 1px dashed #dfe3ea; border-radius: 9px; padding: 12px 14px; color: var(--muted); font-size: 11.5px; line-height: 1.7; }

/* ============ 表格 ============ */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.data-table th {
    text-align: left; padding: 10px 14px; background: #fafbfc;
    color: #7b8290; font-size: 10.5px; font-weight: 600; letter-spacing: .3px;
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfcfd; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions .btn + .btn { margin-left: 5px; }
.data-table .strong { font-weight: 600; }
.table-empty { padding: 55px 20px; text-align: center; color: var(--muted); }
.table-empty .empty-icon {
    width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 14px;
    background: #f5f6f8; display: flex; align-items: center; justify-content: center; color: #aeb5c0;
}
.table-empty .empty-icon .icon { width: 25px; height: 25px; }
.table-empty strong { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }
.table-empty p { font-size: 11.5px; }
.table-sub { color: var(--muted); font-size: 10.5px; margin-top: 2px; }

.product-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.product-thumb {
    width: 42px; height: 42px; border-radius: 8px; background: #f3f4f7;
    object-fit: cover; flex: 0 0 auto; border: 1px solid #eceef2;
}
.product-thumb.thumb-lg { width: 62px; height: 62px; border-radius: 10px; }
.product-cell-placeholder {
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f6eee9, #ede6e1); color: #b39c91;
    font-family: "Songti SC", "STSong", serif; font-size: 15px;
}
.product-cell .name { font-weight: 600; color: var(--ink); font-size: 12.5px; line-height: 1.35; }
.product-cell .meta { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.sku-tag { display: inline-block; padding: 1px 6px; background: #f4f5f7; border-radius: 4px; color: #6e7684; font-size: 10px; }

/* ============ 统计卡 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card {
    position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px 19px; box-shadow: var(--shadow);
}
.stat-card .stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-card .stat-label { color: var(--muted); font-size: 11.5px; }
.stat-card .stat-value { font-size: 27px; font-weight: 700; letter-spacing: -.6px; line-height: 1.2; margin-top: 7px; font-variant-numeric: tabular-nums; }
.stat-card .stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat-card .stat-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 9px; font-size: 10.5px; color: var(--muted); }
.stat-icon {
    width: 38px; height: 38px; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; flex: 0 0 auto;
}
.stat-icon .icon { width: 19px; height: 19px; }
.stat-icon.brand { background: var(--brand-soft); color: var(--brand); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }
.trend-up { color: var(--green); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.trend-down { color: var(--red); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.trend-up .icon, .trend-down .icon { width: 11px; height: 11px; }

/* ============ 筛选与标签页 ============ */
.filter-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 14px 16px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow);
}
.filter-bar .search-box { position: relative; flex: 1; min-width: 190px; max-width: 310px; }
.filter-bar .search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #9ba2ae; width: 15px; height: 15px; }
.filter-bar .search-box input { padding-left: 33px; height: 37px; background: #fafbfc; }
.filter-bar select { width: auto; min-width: 120px; height: 37px; background-color: #fafbfc; }
.filter-bar input[type="date"] { width: 145px; height: 37px; background: #fafbfc; }
.filter-bar .filter-label { color: var(--muted); font-size: 11px; }
.filter-bar .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
    padding: 10px 15px; color: var(--muted); font-size: 12.5px;
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab .count { font-size: 10px; background: #f0f2f5; border-radius: 10px; padding: 1px 6px; margin-left: 4px; color: #7a8190; }
.tab.is-active .count { background: var(--brand-soft); color: var(--brand); }
.sub-tabs { display: flex; gap: 6px; padding: 4px; background: #f3f4f7; border-radius: 9px; }
.sub-tabs a { padding: 6px 12px; border-radius: 6px; color: var(--muted); font-size: 11.5px; }
.sub-tabs a.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.07); font-weight: 600; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line-soft); gap: 12px; flex-wrap: wrap; }
.pagination .pagination-info { color: var(--muted); font-size: 11px; }
.pagination .pages { display: flex; gap: 4px; }
.pagination .page-link {
    min-width: 30px; height: 30px; padding: 0 7px; display: inline-flex;
    align-items: center; justify-content: center; border: 1px solid var(--line);
    border-radius: 6px; color: #5f6776; background: #fff; font-size: 11.5px;
}
.pagination .page-link:hover { border-color: #c9ced8; color: var(--ink); }
.pagination .page-link.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .page-link.disabled { opacity: .4; pointer-events: none; }

/* ============ 提示 ============ */
.flash-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.flash {
    display: flex; align-items: center; gap: 9px; padding: 10px 14px;
    border-radius: 9px; font-size: 12px; border: 1px solid transparent;
    animation: slide-in .25s ease;
}
@keyframes slide-in { from { opacity: 0; transform: translateY(-4px); } }
.flash .icon { width: 16px; height: 16px; flex: 0 0 auto; }
.flash-success { background: #effaf4; border-color: #cbeadb; color: #126b4b; }
.flash-error { background: #fef3f2; border-color: #f3d3d0; color: #a52f26; }
.flash-info { background: #eff5fe; border-color: #d5e3f8; color: #24589e; }
.flash-warning { background: #fff9ed; border-color: #f1e0bd; color: #906010; }
.flash-close { margin-left: auto; border: 0; background: none; color: currentColor; opacity: .55; padding: 2px; display: flex; }
.flash-close:hover { opacity: 1; }
.flash-close .icon { width: 13px; height: 13px; }

.alert {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
    border-radius: 9px; font-size: 12px; line-height: 1.6; background: #fafbfc;
    border: 1px solid var(--line); color: #5f6776;
}
.alert .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--amber); }
.alert.alert-danger { background: #fef6f5; border-color: #f2d5d2; color: #8e3129; }
.alert.alert-success { background: #f1faf6; border-color: #d2ecdf; color: #176a4b; }

/* ============ 弹窗 / 提示条 ============ */
.modal {
    position: fixed; inset: 0; z-index: 100; display: none;
    align-items: flex-start; justify-content: center; padding: 6vh 18px 30px;
    overflow-y: auto; background: rgba(18, 21, 28, .48); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.modal.is-open { display: flex; }
.modal-card {
    width: 100%; max-width: 520px; background: #fff; border-radius: 15px;
    box-shadow: var(--shadow-lg); animation: modal-in .18s ease;
}
.modal-card.modal-lg { max-width: 760px; }
.modal-card.modal-sm { max-width: 390px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 0; }
.modal-head h3 { font-size: 16px; }
.modal-head p { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.modal-head .modal-close { margin-left: auto; }
.modal-body { padding: 18px 22px 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px 20px; }
.modal-close {
    width: 30px; height: 30px; border: 0; background: #f3f4f6; border-radius: 8px;
    color: #707887; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #e9ebef; color: var(--ink); }
.modal-close .icon { width: 15px; height: 15px; }

/* ============ 仪表盘 ============ */
.welcome-banner {
    position: relative; overflow: hidden; border-radius: var(--radius);
    padding: 22px 26px; margin-bottom: 18px;
    background: linear-gradient(115deg, #241e26 0%, #33232b 55%, #4a2631 100%);
    color: #fff; display: flex; align-items: center; gap: 22px;
    box-shadow: 0 12px 34px rgba(43, 26, 32, .18);
}
.welcome-banner::after {
    content: ""; position: absolute; width: 320px; height: 320px; right: -70px; top: -170px;
    border-radius: 50%; background: radial-gradient(circle, rgba(218,113,134,.26), transparent 64%);
}
.welcome-banner::before {
    content: ""; position: absolute; width: 190px; height: 190px; right: 160px; bottom: -140px;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.12);
}
.welcome-copy { position: relative; z-index: 1; flex: 1; }
.welcome-copy .eyebrow { color: #d7aab4; font-size: 10px; letter-spacing: 2px; font-weight: 600; }
.welcome-copy h2 { font-size: 21px; margin-top: 6px; font-weight: 600; letter-spacing: .5px; }
.welcome-copy p { color: #b9b2b7; font-size: 11.5px; margin-top: 5px; }
.welcome-actions { position: relative; z-index: 1; display: flex; gap: 9px; flex-wrap: wrap; }
.welcome-actions .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(4px); }
.welcome-actions .btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.welcome-actions .btn-primary { background: #fff; border-color: #fff; color: #7e2032; }
.welcome-actions .btn-primary:hover { background: #fdf3f5; color: #7e2032; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .85fr); gap: 18px; }
.dashboard-chart-card { display: flex; flex-direction: column; }
.dashboard-chart-card .card-body { display: flex; flex-direction: column; flex: 1; }
.dashboard-chart-card .bar-chart { flex: 1; min-height: 220px; height: auto; }
.chart-box { padding: 20px; }
.chart-legend { display: flex; gap: 14px; align-items: center; font-size: 10.5px; color: var(--muted); }
.chart-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; min-width: 0; }
.bar-col .bar-value { font-size: 9.5px; color: var(--muted); opacity: 0; transition: opacity .15s; white-space: nowrap; }
.bar-col:hover .bar-value { opacity: 1; }
.bar-col .bar-track { width: 100%; max-width: 34px; flex: 1; display: flex; align-items: flex-end; }
.bar-col .bar {
    width: 100%; border-radius: 5px 5px 2px 2px; min-height: 3px;
    background: linear-gradient(180deg, #cf566b, #b4233b); transition: height .5s ease;
    box-shadow: 0 3px 8px rgba(180,35,59,.12);
}
.bar-col.is-empty .bar { background: #eceef2; box-shadow: none; }
.bar-col .bar-label { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.rank-list { display: grid; gap: 2px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.rank-item:last-child { border-bottom: 0; }
.rank-no { width: 19px; height: 19px; border-radius: 5px; background: #f2f3f6; color: #7c8493; font-size: 10px; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 0 auto; }
.rank-item:nth-child(1) .rank-no { background: #fbf0d8; color: #9a6b13; }
.rank-item:nth-child(2) .rank-no { background: #f0f1f4; color: #687080; }
.rank-item:nth-child(3) .rank-no { background: #f8ece4; color: #a36a4a; }
.rank-main { flex: 1; min-width: 0; }
.rank-main strong { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-main small { color: var(--muted); font-size: 10px; }
.rank-value { font-size: 11.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.quick-item {
    display: flex; align-items: center; gap: 9px; padding: 11px;
    border: 1px solid var(--line); border-radius: 9px; background: #fff;
    color: var(--ink-2); font-size: 11.5px; transition: all .15s;
}
.quick-item:hover { border-color: #e2bcc4; background: #fffbfc; color: var(--brand); transform: translateY(-1px); }
.quick-item .q-icon { width: 31px; height: 31px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #f6f7f9; color: #687181; }
.quick-item .q-icon .icon { width: 16px; height: 16px; }
.quick-item:hover .q-icon { background: var(--brand-soft); color: var(--brand); }
.quick-item strong { display: block; font-size: 11.5px; font-weight: 600; }
.quick-item small { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.mini-list { display: grid; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 11.5px; }
.mini-row:last-child { border-bottom: 0; }
.mini-row .mini-time { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.todo-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.todo-row:last-child { border-bottom: 0; }
.todo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: 0 0 auto; }
.todo-dot.red { background: var(--red); }
.todo-main { flex: 1; min-width: 0; }
.todo-main strong { display: block; font-size: 11.5px; font-weight: 600; }
.todo-main small { color: var(--muted); font-size: 10px; }
.pay-breakdown { display: grid; gap: 12px; }
.pay-row-top { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: #5f6776; margin-bottom: 5px; }
.pay-row-top strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress { height: 5px; background: #f0f2f5; border-radius: 5px; overflow: hidden; margin-bottom: 3px; }
.progress-bar { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #c74b60, #b4233b); }

/* ============ 商品 / 图片 ============ */
.product-hero { display: flex; gap: 18px; align-items: flex-start; }
.product-hero-img {
    width: 112px; height: 140px; border-radius: 11px; object-fit: cover;
    background: #f2f3f6; border: 1px solid var(--line);
}
.product-hero-info { flex: 1; min-width: 0; }
.product-hero-info h2 { font-size: 20px; letter-spacing: -.2px; }
.product-hero-info .hero-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.product-hero-info .hero-price { margin-top: 12px; font-size: 24px; font-weight: 700; color: var(--brand); }
.product-hero-info .hero-price small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.color-dots { display: inline-flex; gap: 3px; align-items: center; }
.color-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); display: inline-block; }
.image-placeholder {
    width: 100%; height: 100%; border-radius: inherit;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f6eee9, #ede6e1); color: #b39c91;
    font-family: "Songti SC", serif; font-size: 20px;
}

/* ============ 详情 / 时间线 ============ */
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 20px; }
.detail-item .label { color: var(--muted); font-size: 10.5px; margin-bottom: 2px; }
.detail-item .value { font-size: 12.5px; color: var(--ink-2); }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: ""; position: absolute; left: -18px; top: 5px; width: 9px; height: 9px;
    border-radius: 50%; background: #fff; border: 2px solid #c9ced8;
}
.timeline-item.is-done::before { border-color: var(--brand); background: var(--brand); }
.timeline-item .t-title { font-size: 12px; font-weight: 600; }
.timeline-item .t-desc { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.timeline-item .t-time { font-size: 10px; color: var(--muted-2); margin-top: 2px; }

.total-panel { background: #fafbfc; border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px 16px; }
.total-row { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; color: #687181; font-size: 12px; }
.total-row strong { color: var(--ink); font-weight: 600; }
.total-row.grand { border-top: 1px dashed #dfe3ea; margin-top: 7px; padding-top: 10px; font-size: 13px; }
.total-row.grand strong { font-size: 19px; color: var(--brand); }
.empty-state { padding: 45px 22px; text-align: center; color: var(--muted); }
.empty-state .empty-icon {
    width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
    background: #f6f7f9; color: #b0b7c2; display: flex; align-items: center; justify-content: center;
}
.empty-state .empty-icon .icon { width: 28px; height: 28px; }
.empty-state h3 { font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.empty-state p { font-size: 11.5px; max-width: 380px; margin: 0 auto; line-height: 1.7; }
.empty-state .btn { margin-top: 14px; }

/* ============ 登录页 ============ */
.auth-body { background: #f7f5f2; }
.auth-shell { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 100vh; }
.auth-showcase {
    position: relative; overflow: hidden; display: flex; flex-direction: column;
    padding: 40px 52px; color: #fff;
    background:
        radial-gradient(900px 520px at 84% 8%, rgba(170,62,82,.5), transparent 55%),
        radial-gradient(700px 500px at 6% 100%, rgba(126,80,48,.28), transparent 60%),
        linear-gradient(145deg, #1b1b22 0%, #281d23 54%, #1a161b 100%);
}
.auth-showcase::before {
    content: ""; position: absolute; width: 540px; height: 540px; right: -220px; top: -240px;
    border: 1px solid rgba(255,255,255,.08); border-radius: 50%;
}
.auth-showcase::after {
    content: ""; position: absolute; width: 380px; height: 380px; right: -80px; bottom: -220px;
    border: 1px solid rgba(255,255,255,.06); border-radius: 50%;
}
.auth-showcase-top { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.auth-brand { font-size: 17px; font-weight: 700; letter-spacing: 3px; display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand small { font-size: 8.5px; letter-spacing: 3px; color: #968489; font-weight: 500; margin-top: 3px; }
.auth-showcase-copy { position: relative; z-index: 1; margin-top: 12vh; max-width: 500px; }
.auth-showcase-copy .eyebrow { color: #c99ba4; font-size: 10px; letter-spacing: 2.6px; font-weight: 600; }
.auth-showcase-copy h1 { font-family: "Songti SC", "STSong", serif; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.42; font-weight: 600; letter-spacing: 2px; margin-top: 16px; }
.auth-showcase-copy p { color: #b8adb1; font-size: 12.5px; line-height: 1.9; margin-top: 18px; max-width: 390px; }
.auth-showcase-art { position: relative; z-index: 1; height: 160px; margin-top: 42px; max-width: 470px; }
.art-card {
    position: absolute; padding: 13px 15px; border-radius: 10px;
    background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(8px); box-shadow: 0 14px 34px rgba(0,0,0,.16);
    display: flex; flex-direction: column; gap: 2px;
}
.art-card span { color: #b9a8ac; font-size: 9.5px; }
.art-card strong { font-size: 19px; font-weight: 600; letter-spacing: .5px; }
.art-card em { font-style: normal; font-size: 9.5px; color: #8fc9ab; }
.art-card-a { left: 0; top: 8px; width: 158px; transform: rotate(-2deg); }
.art-card-b { left: 158px; top: 48px; width: 145px; transform: rotate(2.4deg); }
.art-rack { position: absolute; right: 10px; bottom: 0; display: flex; align-items: flex-end; gap: 7px; height: 120px; opacity: .75; }
.art-rack::before { content: ""; position: absolute; left: -12px; right: -12px; top: 8px; height: 1px; background: rgba(255,255,255,.22); }
.art-rack i { width: 44px; border-radius: 20px 20px 5px 5px; display: block; background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.1); }
.art-rack i:nth-child(1) { height: 74px; }
.art-rack i:nth-child(2) { height: 100px; background: linear-gradient(180deg, rgba(188,88,106,.45), rgba(188,88,106,.08)); }
.art-rack i:nth-child(3) { height: 86px; }
.art-rack i:nth-child(4) { height: 112px; background: linear-gradient(180deg, rgba(203,177,133,.3), rgba(203,177,133,.05)); }
.art-rack i:nth-child(5) { height: 70px; }
.auth-showcase-foot { position: relative; z-index: 1; margin-top: auto; color: #736a6e; font-size: 10px; letter-spacing: .4px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 38px; background: #fbfaf8; }
.auth-panel-inner { width: 100%; max-width: 360px; }
.auth-mobile-brand { display: none; }
.auth-form-head { margin-bottom: 26px; }
.auth-form-head .eyebrow { color: var(--brand); font-size: 10px; letter-spacing: 2.4px; font-weight: 600; }
.auth-form-head h2 { font-size: 25px; letter-spacing: .5px; margin-top: 8px; font-weight: 700; }
.auth-form-head p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.auth-form .form-group { margin-bottom: 15px; }
.auth-form input { height: 44px; background: #fff; }
.auth-submit { width: 100%; height: 45px; margin-top: 5px; font-size: 13.5px; letter-spacing: 1px; }
.auth-demo {
    margin-top: 19px; padding: 11px 13px; border-radius: 9px; background: #f4f1ec;
    border: 1px dashed #ded6cb; color: #7d736a; font-size: 10.5px; line-height: 1.7;
}
.auth-demo strong { color: #5d544d; font-weight: 600; }
.auth-demo code { background: #fff; padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 10px; color: #9a4a50; }
.auth-copyright { text-align: center; color: #b1aea9; font-size: 9.5px; margin-top: 34px; }

/* ============ POS 收银台 ============ */
.pos-body { background: #eef0f3; overflow: hidden; }
.pos-topbar {
    height: 62px; padding: 0 20px; background: #171b24; color: #fff;
    display: flex; align-items: center; gap: 20px; position: relative; z-index: 20;
}
.pos-brand { display: flex; align-items: center; gap: 9px; color: #fff; min-width: 160px; }
.pos-brand:hover { color: #fff; }
.pos-brand span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.pos-brand strong { font-size: 14px; letter-spacing: 2px; }
.pos-brand small { color: #7e899b; font-size: 9px; letter-spacing: 1.4px; }
.pos-topbar-center { display: flex; align-items: center; gap: 18px; color: #9aa4b4; font-size: 11.5px; }
.pos-store, .pos-cashier { display: inline-flex; align-items: center; gap: 5px; }
.pos-store .icon, .pos-cashier .icon { width: 14px; height: 14px; }
.pos-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.pos-topbar .btn-ghost { color: #c4cad4; }
.pos-topbar .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.pos-clock { color: #778193; font-size: 11px; font-family: var(--mono); margin-left: 7px; min-width: 122px; text-align: right; }
.pos-flash-wrap { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); width: min(520px, 92vw); z-index: 60; }
.pos-main { height: calc(100vh - 62px); }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 418px; height: 100%; }
.pos-catalog { display: flex; flex-direction: column; min-width: 0; padding: 16px 18px 0; overflow: hidden; }
.pos-search-row { display: flex; gap: 9px; align-items: center; }
.pos-search { position: relative; flex: 1; }
.pos-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8a929f; width: 18px; height: 18px; }
.pos-search input {
    height: 47px; padding: 0 96px 0 42px; border: 1px solid #dfe3ea;
    border-radius: 11px; font-size: 14px; background: #fff;
    box-shadow: 0 2px 10px rgba(23,27,36,.035);
}
.pos-search .scan-hint {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: #9aa1ad; font-size: 10px; display: flex; align-items: center; gap: 4px;
}
.pos-search .scan-hint .icon { position: static; transform: none; width: 12px; height: 12px; }
.pos-cat-row { display: flex; gap: 6px; overflow-x: auto; padding: 12px 1px 2px; scrollbar-width: none; }
.pos-cat-row::-webkit-scrollbar { display: none; }
.pos-cat {
    flex: 0 0 auto; padding: 6px 13px; border: 1px solid #e3e6ec; border-radius: 20px;
    background: #fff; color: #687181; font-size: 11.5px; white-space: nowrap;
}
.pos-cat:hover { border-color: #c9ced8; color: var(--ink); }
.pos-cat.is-active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(180,35,59,.18); }
.pos-result-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 2px 9px; color: var(--muted); font-size: 11px; }
.pos-result-head strong { color: var(--ink-2); font-weight: 600; }
.pos-grid {
    flex: 1; overflow-y: auto; display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 11px;
    grid-auto-rows: max-content;
    align-content: start; padding: 2px 2px 18px;
}
.pos-card {
    background: #fff; border: 1px solid #e6e9ee; border-radius: 12px;
    overflow: hidden; cursor: pointer; transition: all .15s ease; text-align: left; padding: 0;
}
.pos-card:hover { border-color: #d8b7be; box-shadow: 0 8px 22px rgba(23,27,36,.09); transform: translateY(-2px); }
.pos-card:active { transform: translateY(0); }
.pos-card .pos-img {
    position: relative; display: block; aspect-ratio: 1.24 / 1; background: #f4f1ee; overflow: hidden;
}
.pos-card .pos-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.pos-card:hover .pos-img img { transform: scale(1.035); }
.pos-card .stock-tag {
    position: absolute; right: 7px; top: 7px; padding: 2px 6px;
    border-radius: 5px; background: rgba(255,255,255,.91); color: #697181;
    font-size: 9.5px; font-weight: 600; backdrop-filter: blur(4px);
}
.pos-card .stock-tag.low { background: #fdf1df; color: #a4680b; }
.pos-card .stock-tag.out { background: #fceceb; color: #b13a31; }
.pos-card-body { padding: 9px 10px 10px; }
.pos-card-body .p-name { font-size: 11.5px; font-weight: 600; color: var(--ink); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
.pos-card-body .p-meta { color: var(--muted); font-size: 9.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-card-body .p-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.pos-card-body .p-price { color: var(--brand); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-card-body .p-price small { font-size: 9px; font-weight: 500; }
.pos-card-body .p-add { width: 23px; height: 23px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.pos-card-body .p-add .icon { width: 13px; height: 13px; }
.pos-empty { grid-column: 1 / -1; padding: 80px 20px; text-align: center; color: var(--muted); }
.pos-empty .empty-icon { width: 66px; height: 66px; border-radius: 18px; background: #e8eaee; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; color: #aeb5c0; }
.pos-empty .empty-icon .icon { width: 30px; height: 30px; }
.pos-empty strong { display: block; color: #555d6b; margin-bottom: 3px; font-size: 13px; }
.pos-empty p { font-size: 11px; }

.pos-cart { background: #fff; border-left: 1px solid #e0e3e9; display: flex; flex-direction: column; min-width: 0; }
.cart-head { padding: 15px 18px 12px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 8px; }
.cart-head h2 { font-size: 14px; font-weight: 700; }
.cart-head .cart-count { font-size: 10px; background: var(--brand-soft); color: var(--brand); padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.cart-head .btn { margin-left: auto; }
.cart-member { padding: 10px 18px; border-bottom: 1px solid var(--line-soft); background: #fcfcfd; }
.member-empty { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; }
.member-empty .icon { width: 15px; height: 15px; }
.member-empty .btn { margin-left: auto; }
.member-chip { display: flex; align-items: center; gap: 9px; }
.member-avatar { width: 31px; height: 31px; border-radius: 50%; background: linear-gradient(145deg, #f2dfd2, #e7c8b6); color: #7e4a33; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.member-info { flex: 1; min-width: 0; }
.member-info strong { display: block; font-size: 12px; font-weight: 600; }
.member-info small { display: block; color: var(--muted); font-size: 9.5px; margin-top: 1px; }
.member-discount { font-size: 10px; color: var(--amber); background: var(--amber-soft); padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.member-clear { border: 0; background: none; color: var(--muted); padding: 3px; display: flex; }
.member-clear:hover { color: var(--red); }
.member-clear .icon { width: 14px; height: 14px; }
.cart-lines { flex: 1; overflow-y: auto; padding: 2px 18px; }
.cart-line { display: flex; gap: 9px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.cart-line:last-child { border-bottom: 0; }
.cart-line-img { width: 46px; height: 52px; border-radius: 7px; object-fit: cover; background: #f4f5f7; border: 1px solid #eceef2; flex: 0 0 auto; }
.cart-line-main { flex: 1; min-width: 0; }
.cart-line-main .c-name { font-size: 11.5px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-line-main .c-sku { font-size: 9.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.cart-line-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.cart-line-price { color: var(--brand); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-line-price small { color: var(--muted); font-weight: 400; font-size: 9px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid #e0e3e9; border-radius: 6px; overflow: hidden; height: 25px; }
.stepper button { width: 24px; height: 23px; border: 0; background: #fafbfc; color: #687181; display: flex; align-items: center; justify-content: center; }
.stepper button:hover { background: #f0f2f5; color: var(--ink); }
.stepper button .icon { width: 11px; height: 11px; }
.stepper input {
    width: 30px; height: 23px; border: 0; border-left: 1px solid #eceef2; border-right: 1px solid #eceef2;
    text-align: center; padding: 0; font-size: 11px; font-weight: 600; border-radius: 0;
    -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-line-remove { border: 0; background: none; color: #b3b9c3; padding: 2px; align-self: flex-start; }
.cart-line-remove:hover { color: var(--red); }
.cart-line-remove .icon { width: 13px; height: 13px; }
.cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); padding: 30px; text-align: center; }
.cart-empty .empty-icon { width: 62px; height: 62px; border-radius: 18px; background: #f5f6f8; color: #b4bac4; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.cart-empty .empty-icon .icon { width: 27px; height: 27px; }
.cart-empty strong { color: #6a7280; font-size: 13px; }
.cart-empty p { font-size: 10.5px; margin-top: 3px; }
.cart-summary { border-top: 1px solid var(--line); padding: 13px 18px 16px; background: #fff; }
.summary-row { display: flex; align-items: center; justify-content: space-between; padding: 2px 0; font-size: 11.5px; color: #687181; }
.summary-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.summary-row.discount strong { color: var(--red); }
.summary-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 9px; padding-top: 11px; border-top: 1px dashed #e0e3e9; }
.summary-total span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.summary-total strong { font-size: 27px; font-weight: 700; color: var(--brand); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.summary-total strong small { font-size: 12px; font-weight: 500; }
.cart-actions { display: flex; gap: 8px; margin-top: 12px; }
.cart-actions .btn { flex: 1; }
.cart-actions .btn-primary { flex: 1.7; height: 44px; }
.cart-actions .btn-secondary { height: 44px; }
.cart-foot-note { display: flex; align-items: center; justify-content: center; gap: 5px; color: #a4aab5; font-size: 9.5px; margin-top: 8px; }
.cart-foot-note .icon { width: 11px; height: 11px; }

/* POS 结账弹窗 */
.checkout-total { text-align: center; padding: 6px 0 16px; }
.checkout-total small { color: var(--muted); font-size: 10.5px; }
.checkout-total .amount { font-size: 34px; font-weight: 700; color: var(--brand); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 13px; }
.pay-method {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    height: 57px; border: 1px solid #e2e5eb; border-radius: 9px; background: #fff;
    color: #687181; font-size: 10.5px; cursor: pointer; transition: all .15s;
}
.pay-method .icon { width: 18px; height: 18px; }
.pay-method:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.pay-method input { display: none; }
.pay-summary { background: #fafbfc; border: 1px solid var(--line-soft); border-radius: 9px; padding: 11px 13px; margin-bottom: 13px; }
.pay-summary .summary-row { font-size: 11px; }
.pay-summary .summary-row strong { font-size: 12px; }
.cash-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.cash-quick button { border: 1px solid #e0e4ea; background: #fff; border-radius: 6px; padding: 4px 9px; font-size: 10.5px; color: #687181; }
.cash-quick button:hover { border-color: #c8a2aa; color: var(--brand); background: #fffafb; }

/* POS 移动端购物车 */
.pos-mobile-bar, .pos-cart-backdrop, .mobile-cart-close { display: none; }

/* 小票 */
.print-body { background: #e9ebef; font-family: var(--mono); }
.receipt {
    width: 300px; margin: 24px auto; background: #fff; padding: 22px 18px;
    color: #1d2129; font-size: 11px; line-height: 1.65; box-shadow: 0 6px 30px rgba(0,0,0,.12);
}
.receipt-head { text-align: center; padding-bottom: 10px; }
.receipt-head h1 { font-family: var(--font); font-size: 17px; letter-spacing: 2px; }
.receipt-head p { font-size: 9.5px; color: #666; margin-top: 2px; }
.receipt-divider { border-top: 1px dashed #999; margin: 9px 0; }
.receipt-row { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; }
.receipt-row span:first-child { color: #666; }
.receipt-items { margin: 8px 0; }
.receipt-item { padding: 4px 0; }
.receipt-item .r-line { display: flex; justify-content: space-between; gap: 8px; }
.receipt-item .r-meta { color: #777; font-size: 9px; display: flex; justify-content: space-between; }
.receipt-total { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; margin: 8px 0; }
.receipt-foot { text-align: center; color: #777; font-size: 9px; margin-top: 12px; line-height: 1.7; }
.receipt-barcode { text-align: center; font-family: var(--mono); letter-spacing: 4px; font-size: 20px; margin-top: 8px; }
.no-print { text-align: center; margin: 16px auto; }
.no-print .btn { margin: 0 4px; }

.toast-stack {
    position: fixed; top: 84px; left: 50%; transform: translateX(-50%);
    z-index: 200; display: grid; gap: 8px; width: min(360px, 90vw);
}
.pos-body .toast-stack { top: 74px; }
.toast {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: #fff; border: 1px solid var(--line); border-radius: 9px;
    box-shadow: 0 10px 30px rgba(23,27,36,.14); font-size: 12px;
    animation: slide-in .2s ease; transition: all .22s ease;
}
.toast.is-out { opacity: 0; transform: translateY(-6px); }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.toast-error .toast-dot { background: var(--red); }
.toast-info .toast-dot { background: var(--blue); }

.cart-line-remove .icon { width: 13px; height: 13px; }
.cart-price-wrap {
    display: inline-flex; align-items: center; gap: 1px;
    border: 1px solid #e3e6ec; border-radius: 6px; padding: 0 5px; height: 26px;
    background: #fff; color: var(--brand); font-size: 10px;
}
.cart-price-wrap:focus-within { border-color: #c58a97; box-shadow: 0 0 0 2px rgba(180,35,59,.06); }
.cart-price-input {
    width: 56px; height: 24px; padding: 0; border: 0 !important; border-radius: 0 !important;
    box-shadow: none !important; background: transparent !important; text-align: right;
    color: var(--brand); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}
.cart-price-input::-webkit-outer-spin-button, .cart-price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-line-tag { color: var(--muted-2); font-size: 9px; margin-top: 3px; }
.cart-line-img.image-placeholder { display: flex; align-items: center; justify-content: center; }
.pos-cart .cart-lines { min-height: 120px; }
.pos-cart .cart-empty { min-height: 190px; }
.member-result-list { margin-top: 11px; max-height: 320px; overflow-y: auto; }
.member-result {
    display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 8px;
    border: 0; border-bottom: 1px solid var(--line-soft); background: #fff; text-align: left;
    border-radius: 7px;
}
.member-result:hover { background: #faf7f7; }
.member-result:last-child { border-bottom: 0; }
.member-result-main { flex: 1; min-width: 0; }
.member-result-main strong { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.member-result-main small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.member-result-arrow { color: #b3bac5; }
.member-result-arrow .icon { width: 14px; height: 14px; }
.sku-option-list { display: grid; gap: 7px; }
.sku-option {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px;
    border: 1px solid #e3e6ec; border-radius: 9px; background: #fff; text-align: left;
    transition: all .15s ease;
}
.sku-option:hover { border-color: #d6a7b0; background: #fffafb; }
.sku-option.is-out { opacity: .45; cursor: not-allowed; }
.sku-color { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); flex: 0 0 auto; }
.sku-option-main { flex: 1; min-width: 0; }
.sku-option-main strong { display: block; font-size: 12.5px; font-weight: 600; }
.sku-option-main small { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; font-family: var(--mono); }
.sku-option-stock { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.sku-option-price { font-size: 13px; font-weight: 700; color: var(--brand); min-width: 60px; text-align: right; }
.success-ring {
    width: 62px; height: 62px; border-radius: 50%; margin: 0 auto;
    background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 9px rgba(22,134,92,.06);
}
.success-ring .icon { width: 30px; height: 30px; stroke-width: 2.2; }
.pos-card .pos-img .image-placeholder { width: 100%; height: 100%; font-size: 30px; }
.pos-card .pos-card-body { display: block; }
.pos-card .p-name { display: -webkit-box; }
.pos-card .p-foot { display: flex; }
.cart-summary .summary-total strong { display: inline-flex; align-items: baseline; gap: 1px; }

/* ============ 采购 / 搜索选择 ============ */
.purchase-search { position: relative; }
.purchase-search > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #8b93a0; width: 17px; height: 17px; z-index: 1; }
.purchase-search > input[type="search"] {
    height: 46px; padding-left: 40px; padding-right: 112px; font-size: 13.5px;
    background: #fafbfc;
}
.purchase-search .scan-hint {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; gap: 4px; color: #9aa1ad; font-size: 10px;
}
.purchase-search .scan-hint .icon { width: 12px; height: 12px; }
.search-results {
    display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px);
    z-index: 45; background: #fff; border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; padding: 5px;
}
.search-results.is-open { display: block; }
.result-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px;
    border: 0; border-radius: 7px; background: #fff; text-align: left;
}
.result-item:hover { background: #faf6f7; }
.result-item img, .result-thumb {
    width: 38px; height: 44px; border-radius: 6px; object-fit: cover;
    background: #f3efec; color: #a98f83; display: flex; align-items: center; justify-content: center;
    font-family: "Songti SC", serif; font-size: 16px; flex: 0 0 auto;
}
.result-main { flex: 1; min-width: 0; }
.result-main strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-main small { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-stock { text-align: right; font-size: 10.5px; color: var(--muted); flex: 0 0 auto; }
.result-stock b { color: var(--ink-2); font-size: 12px; }
.result-stock small { display: block; font-size: 9.5px; color: var(--muted-2); }
.search-empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 11.5px; }

/* ============ 报表 / 调拨 / 售后 ============ */
.report-bars {
    display: flex; align-items: flex-end; gap: 5px; height: 190px;
    padding: 16px 2px 0; border-bottom: 1px solid var(--line); overflow-x: auto;
}
.report-bar-col {
    flex: 1 0 11px; min-width: 11px; height: 100%; display: flex;
    flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px;
}
.report-bars-stack { flex: 1; width: 100%; max-width: 26px; display: flex; align-items: flex-end; gap: 2px; }
.report-bars-stack .bar { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; }
.report-bars-stack .bar.net { background: linear-gradient(180deg, #cf566b, #b4233b); }
.report-bars-stack .bar.profit { background: linear-gradient(180deg, #dfbc7b, #c3984f); }
.report-bars .bar-label { font-size: 8.5px; color: var(--muted); white-space: nowrap; }
.warehouse-stat { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.warehouse-stat:last-child { border-bottom: 0; }
.transfer-route {
    display: flex; align-items: center; gap: 16px; padding: 17px 18px;
    background: linear-gradient(110deg, #faf8f6, #f6f7f9); border: 1px solid var(--line-soft); border-radius: 11px;
}
.route-node { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.route-node .route-label { color: var(--muted); font-size: 10px; }
.route-node strong { font-size: 17px; letter-spacing: .3px; }
.route-node small { color: var(--muted-2); font-size: 10px; }
.route-arrow { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--brand); }
.route-arrow span { font-size: 9.5px; color: var(--muted); }
.route-arrow .icon { width: 30px; height: 30px; }
.item-product-box {
    display: flex; align-items: center; gap: 11px; padding: 10px;
    background: #fafbfc; border: 1px solid var(--line-soft); border-radius: 9px;
}
.item-product-box img { width: 48px; height: 56px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.item-product-box strong { display: block; font-size: 12.5px; }
.item-product-box small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.after-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.after-images a { display: block; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.after-images img { width: 100%; height: 100%; object-fit: cover; }

.attr-list { display: grid; gap: 1px; margin-bottom: 12px; }
.attr-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 6px 8px; border-radius: 6px; font-size: 12px;
}
.attr-row:nth-child(odd) { background: #fafbfc; }
.attr-row.is-off { opacity: .42; text-decoration: line-through; }
.attr-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.attr-delete { border: 0; background: none; color: #b6bdc7; padding: 3px; display: flex; border-radius: 4px; }
.attr-delete:hover { color: var(--red); background: var(--red-soft); }
.attr-delete .icon { width: 12px; height: 12px; }
.attr-add { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.attr-add input[type="text"] { height: 34px; font-size: 12px; }
.attr-add input[type="number"], .attr-add select { height: 34px; font-size: 11px; padding: 0 8px; }
.attr-add .btn { height: 34px; }

/* ============ 错误页 ============ */
.error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 30px; }
.error-card { text-align: center; max-width: 420px; }
.error-code { font-size: 70px; font-weight: 800; letter-spacing: -4px; color: #e4e6eb; line-height: 1; }
.error-card h1 { font-size: 21px; margin-top: 8px; }
.error-card p { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.error-card .btn { margin-top: 18px; }

/* ============ 响应式 ============ */
@media (max-width: 1280px) {
    .topbar-search { width: 200px; }
    .stat-grid { gap: 12px; }
    .stat-card { padding: 15px 16px; }
    .stat-card .stat-value { font-size: 24px; }
}
@media (max-width: 1120px) {
    .topbar-search { display: none; }
    .pos-layout { grid-template-columns: minmax(0, 1fr) 380px; }
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
    .dash-grid { grid-template-columns: 1fr; }
    .grid-main-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: 14px 0 40px rgba(0,0,0,.18); }
    .sidebar.is-open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .sidebar-mask { display: none; position: fixed; inset: 0; background: rgba(15,18,24,.4); z-index: 35; }
    .sidebar-mask.is-open { display: block; }
    .topbar { padding: 0 18px; height: 68px; }
    .content { padding: 18px 18px 40px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-showcase { display: none; }
    .auth-panel { min-height: 100vh; background: #fbfaf8; }
    .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
    .auth-mobile-brand strong { font-size: 18px; letter-spacing: 2px; }
    .pos-body { overflow: auto; -webkit-overflow-scrolling: touch; }
    .pos-main { height: auto; min-height: calc(100vh - 62px); min-height: calc(100dvh - 62px); padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
    .pos-layout { display: block; height: auto; }
    .pos-catalog { height: auto; max-height: none; padding: 12px 14px 8px; overflow: visible; }
    .pos-grid { flex: none; overflow: visible; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .pos-search input { height: 46px; font-size: 16px; }
    .pos-cart {
        display: none; position: fixed; top: 62px; left: 0; right: 0; bottom: 0;
        z-index: 54; min-height: 0; border: 0; border-radius: 18px 18px 0 0;
        box-shadow: 0 -18px 50px rgba(17, 20, 28, .2); overflow: hidden;
    }
    body.pos-cart-open { overflow: hidden; }
    body.pos-cart-open .pos-cart { display: flex; }
    body.pos-cart-open .pos-mobile-bar { display: none; }
    .pos-cart-backdrop { display: none; }
    .pos-cart-backdrop.is-open {
        display: block; position: fixed; top: 62px; left: 0; right: 0; bottom: 0;
        z-index: 50; background: rgba(18, 21, 28, .42); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    }
    .mobile-cart-close { display: inline-flex; margin-left: 4px; }
    .pos-cart .cart-lines { max-height: none; }
    body.pos-cart-open .cart-summary { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
    .pos-mobile-bar {
        display: flex; align-items: center; gap: 10px;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
        box-shadow: 0 -8px 30px rgba(23, 27, 36, .09); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    }
    .pos-mobile-info { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; min-width: 0; }
    .pos-mobile-icon {
        position: relative; width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto;
        background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center;
    }
    .pos-mobile-icon .icon { width: 19px; height: 19px; }
    .pos-mobile-icon em {
        position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px;
        padding: 0 4px; border-radius: 9px; background: var(--brand); color: #fff;
        font-style: normal; font-size: 9px; line-height: 17px; text-align: center; border: 2px solid #fff;
    }
    .pos-mobile-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
    .pos-mobile-copy strong { color: var(--brand); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
    .pos-mobile-copy small { color: var(--muted); font-size: 10px; margin-top: 2px; }
    .pos-mobile-checkout { width: 112px; height: 44px; flex: 0 0 auto; border-radius: 10px; }
    .pos-topbar-actions .btn { padding: 0 10px; }
    .pos-brand { min-width: 0; }
    input, select, textarea { font-size: 16px; }
    .cart-price-input { width: 64px; font-size: 16px; }
    .cart-qty-input { font-size: 16px; }
    .stepper { height: 34px; }
    .stepper button { width: 34px; height: 33px; }
    .stepper input { width: 38px; height: 33px; font-size: 16px; }
    .form-actions { flex-wrap: wrap; }
    .auth-panel { min-height: 100vh; min-height: 100dvh; background: #fbfaf8; }
}
@media (max-width: 640px) {
    .content { padding: 14px 12px 34px; }
    .topbar { padding: 0 12px; gap: 10px; }
    .page-heading h1 { font-size: 16px; }
    .page-heading p { display: none; }
    .user-copy { display: none; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card { padding: 13px; }
    .stat-card .stat-value { font-size: 20px; }
    .stat-icon { width: 32px; height: 32px; }
    .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .detail-list { grid-template-columns: 1fr; }
    .page-actions { align-items: flex-start; }
    .filter-bar { padding: 11px 12px; gap: 7px; }
    .filter-bar .search-box { max-width: none; flex-basis: 100%; }
    .welcome-banner { padding: 18px; flex-direction: column; align-items: flex-start; gap: 14px; }
    .welcome-copy h2 { font-size: 18px; }
    .card-head { padding: 14px 15px; flex-wrap: wrap; }
    .card-body { padding: 15px; }
    .product-hero { flex-direction: column; }
    .product-hero-img { width: 100%; height: 190px; }
    .quick-grid { grid-template-columns: 1fr; }
    .pos-topbar-center { display: none; }
    .pos-clock { display: none; }
    .pos-topbar-actions .btn span { display: none; }
    .pos-topbar-actions .btn { padding: 0 8px; }
    .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-search .scan-hint { display: none; }
    .pos-search input { padding-right: 14px; }
    .pos-catalog { padding: 10px 10px 6px; }
    .pos-grid { gap: 8px; }
    .pos-card-body { padding: 8px 9px 9px; }
    .pos-card-body .p-price { font-size: 13px; }
    body.pos-cart-open .pos-cart { border-radius: 14px 14px 0 0; }
    .pay-methods { grid-template-columns: repeat(3, 1fr); }
    .table-wrap { margin: 0 -15px; width: calc(100% + 30px); }
    .data-table th, .data-table td { padding: 10px 11px; }
    .auth-panel { padding: 28px 22px; }
}

@media print {
    .no-print, .sidebar, .topbar { display: none !important; }
    .print-body { background: #fff; }
    .receipt { box-shadow: none; margin: 0 auto; width: 72mm; padding: 0; }
    @page { margin: 4mm; size: 80mm auto; }
}
