:root {
    --navy: #06213f;
    --navy-2: #0b315c;
    --orange: #ff5a00;
    --orange-ink: #d24a00;
    --bg: #f5f7fa;
    --card: #ffffff;
    --line: #e3e7ee;
    --text: #12161f;
    --muted: #6b7280;
    --ok: #1f9d55;
    --ok-bg: #e8f7ee;
    --warn: #b45309;
    --warn-bg: #fdf3e3;
    --danger: #d1352c;
    --danger-bg: #fdecec;
    --shadow: 0 1px 2px rgba(6, 15, 30, .04), 0 10px 26px rgba(6, 15, 30, .07);
    --radius: 14px;
    --radius-sm: 10px;
    --fw-body: 400;
    --fw-label: 500;
    --fw-heading: 600;
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14.5px; font-weight: var(--fw-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
.vendor-shell { min-height: 100vh; }

/* topbar */
.topbar {
    position: sticky; top: 0; z-index: 10; min-height: 64px; padding: 10px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: var(--navy); color: #fff;
}
.brand { display: inline-flex; align-items: center; color: #fff; text-decoration: none; }
.brand img { width: 210px; max-width: 46vw; height: auto; display: block; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.vendor-select, .icon-btn, .primary-btn, .secondary-btn, .danger-btn {
    border: 0; border-radius: var(--radius-sm); min-height: 38px; padding: 0 16px; font-weight: var(--fw-label); cursor: pointer;
    transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.vendor-select { background: #fff; color: var(--text); min-width: 190px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius-sm); }
.icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-btn:hover { background: rgba(255, 255, 255, .16); }
.exit-btn, .app-link {
    display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px;
    border-radius: var(--radius-sm); border: 1px solid rgba(255, 255, 255, .16); background: transparent;
    color: rgba(255, 255, 255, .75); font-weight: var(--fw-label); text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.exit-btn svg, .app-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.exit-btn:hover, .app-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* layout */
.workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.workspace.is-auth-screen { display: block; min-height: calc(100vh - 64px); background: var(--bg); }
.sidebar { position: sticky; top: 64px; align-self: start; min-height: calc(100vh - 64px); padding: 16px 10px; background: var(--card); border-right: 1px solid var(--line); }
.nav-link {
    position: relative; width: 100%; border: 0; background: transparent; color: var(--muted);
    display: flex; align-items: center; min-height: 40px; border-radius: 999px; padding: 0 16px;
    font-weight: var(--fw-label); cursor: pointer; margin-bottom: 3px; text-align: left;
    transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.is-active { background: #fff1e8; color: var(--orange-ink); }
.screen { padding: 22px 24px; max-width: 1360px; width: 100%; }

/* headings */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page-head h1, .login-panel h1 { margin: 0; font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.01em; font-weight: var(--fw-heading); }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; color: var(--orange); font-size: .72rem; font-weight: var(--fw-label); letter-spacing: .07em; }
.muted { color: var(--muted); }

/* grids + cards */
.grid { display: grid; gap: 14px; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); gap: 0; overflow: hidden; }
.content-grid { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); }
.card, .table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.kpi { padding: 18px; display: grid; align-content: center; gap: 6px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi span { color: var(--muted); font-weight: var(--fw-label); font-size: .8rem; }
.kpi strong { font-size: 1.5rem; font-weight: var(--fw-heading); letter-spacing: -0.02em; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.primary-btn { background: var(--orange); color: #fff; }
.primary-btn:hover { background: var(--orange-ink); }
.secondary-btn { background: #fff; color: var(--text); border: 1px solid var(--line); }
.secondary-btn:hover { border-color: #c7cfdb; }
.secondary-btn.is-selected { background: var(--text); border-color: var(--text); color: #fff; }
.danger-btn { background: var(--danger-bg); color: var(--danger); border: 1px solid #f7c9c5; }
.danger-btn:hover { background: #fbdedc; }

.status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: .76rem; font-weight: var(--fw-label); background: var(--bg); color: var(--muted); }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.danger { background: var(--danger-bg); color: var(--danger); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .74rem; font-weight: var(--fw-label); text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: var(--bg); }

/* items */
.item-list { display: grid; gap: 10px; }
.item-row { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s ease; }
.item-row:hover { border-color: #c7cfdb; }
.item-row img, .placeholder-img { width: 68px; height: 68px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg); display: grid; place-items: center; color: var(--muted); font-weight: var(--fw-heading); }

/* campaigns / share */
.share-link-row { display: flex; gap: 8px; margin: 14px 0; }
.share-link-row input { background: var(--bg); color: var(--muted); font-size: .86rem; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 16px; border-radius: 999px; font-weight: var(--fw-label); font-size: .84rem; color: #fff; border: 0; cursor: pointer; transition: opacity .15s ease; }
.share-btn:hover { opacity: .88; }
.share-btn--whatsapp { background: #25d366; }
.share-btn--facebook { background: #1877f2; }
.share-btn--x { background: #111; }
.share-btn--native { background: var(--navy); }

.package-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.package-row:last-child { border-bottom: 0; }
.package-row__price { font-weight: var(--fw-heading); color: var(--text); white-space: nowrap; text-align: right; }

/* reports */
.report-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.range-chip { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; min-height: 34px; padding: 0 14px; font-weight: var(--fw-label); font-size: .82rem; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.range-chip:hover { border-color: #c7cfdb; }
.range-chip.is-active { background: var(--orange); border-color: var(--orange); color: #fff; }
.range-custom { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.range-custom input { min-height: 34px; padding: 0 10px; width: auto; }

.mini-chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; margin: 16px 0 6px; padding: 0 2px; overflow-x: auto; }
.mini-chart__col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1 0 36px; min-width: 36px; height: 100%; justify-content: flex-end; }
.mini-chart__bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; width: 100%; justify-content: center; }
.mini-chart__bar { width: 12px; border-radius: 3px 3px 0 0; min-height: 2px; }
.mini-chart__bar--new { background: var(--orange); }
.mini-chart__bar--returning { background: var(--navy-2); }
.mini-chart__col label { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.mini-chart__legend { display: flex; gap: 18px; margin-top: 6px; }
.mini-chart__legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.mini-chart__legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mini-chart__legend i.mini-chart__bar--new { background: var(--orange); }
.mini-chart__legend i.mini-chart__bar--returning { background: var(--navy-2); }

.clientele-layout .card {
    min-height: 100%;
}

.clientele-kpis .kpi strong {
    letter-spacing: 0;
}

.clientele-layout textarea {
    min-height: 118px;
}

.campaign-shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.campaign-shortcut b {
    display: block;
    color: var(--text);
    font-weight: var(--fw-heading);
}

.campaign-shortcut span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: var(--fw-label);
}

.clientele-cards {
    display: grid;
    gap: 10px;
}

.clientele-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.clientele-card__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.clientele-card__head h3 {
    margin: 0;
    color: var(--text);
    font-size: .98rem;
    font-weight: var(--fw-heading);
    letter-spacing: -0.01em;
}

.clientele-card__head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .82rem;
    font-weight: var(--fw-label);
    word-break: break-word;
}

.clientele-card__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
}

.clientele-card__stats span {
    min-width: 0;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--muted);
    font-size: .78rem;
    font-weight: var(--fw-label);
}

.clientele-card__stats b {
    color: var(--text);
    font-weight: var(--fw-heading);
}

.purchase-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.purchase-list span {
    display: grid;
    gap: 2px;
    max-width: 220px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

.purchase-list b {
    overflow: hidden;
    color: var(--text);
    font-size: .78rem;
    font-weight: var(--fw-label);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-list small,
.purchase-list em {
    color: var(--muted);
    font-size: .72rem;
    font-style: normal;
    font-weight: var(--fw-label);
}

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 6px; color: var(--muted); font-weight: var(--fw-label); }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 40px; padding: 9px 12px; color: var(--text); background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: none; }
textarea { min-height: 96px; resize: vertical; }
.auth-form { display: grid; gap: 14px; }
.field-wide { grid-column: 1 / -1; }
.checkline { display: flex; align-items: center; gap: 9px; min-height: 42px; color: var(--text); font-weight: var(--fw-label); }
.checkline input { width: 17px; height: 17px; min-height: 0; accent-color: var(--navy); }
.row { display: flex; gap: 12px; align-items: center; }
.spread { justify-content: space-between; }

.read-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.read-grid div { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.read-grid span { display: block; color: var(--muted); font-size: .74rem; font-weight: var(--fw-label); }
.read-grid strong { display: block; margin-top: 4px; word-break: break-word; font-weight: var(--fw-heading); }

.branch-card { display: grid; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.branch-card:last-child { border-bottom: 0; }
.branch-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.branch-head h3 { margin: 0 0 4px; font-size: .98rem; font-weight: var(--fw-heading); letter-spacing: -0.01em; }
.branch-head p { margin: 0; }
.branch-form { margin-top: 4px; padding: 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); }

/* sheets */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 18px; background: rgba(6, 33, 63, .38); }
.bottom-sheet { width: min(860px, 100%); max-height: min(86vh, 780px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border-radius: 18px 18px 12px 12px; background: #fff; box-shadow: var(--shadow); }
.compact-sheet { width: min(560px, 100%); }
.sheet-header { padding: 12px 18px 14px; border-bottom: 1px solid var(--line); }
.sheet-header h2 { margin: 0; font-size: 1.05rem; font-weight: var(--fw-heading); letter-spacing: -0.01em; }
.sheet-header p { margin: 4px 0 0; }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 14px; border-radius: 999px; background: #d7dfe8; }
.sheet-body { min-height: 0; overflow: auto; padding: 18px; }
.sheet-footer { padding: 14px 18px 18px; border-top: 1px solid var(--line); background: #fff; }
.stack-right { display: grid; justify-items: end; gap: 10px; }

.menu-admin-row { grid-template-columns: 68px minmax(0, 1fr) auto; }
.category-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.order-filter-card { margin-bottom: 14px; }

/* auth */
.vendor-auth-page--solo { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: clamp(28px, 4vw, 56px) 20px; }
.auth-card { width: min(400px, 100%); padding: 30px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-logo-tile { width: 180px; max-width: 100%; margin: 0 auto 22px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--navy); }
.auth-logo { width: 100%; display: block; }
.auth-card h2 { margin: 0; font-size: 1.15rem; font-weight: var(--fw-heading); line-height: 1.2; letter-spacing: -0.01em; }
.auth-card .primary-btn { min-height: 46px; margin-top: 4px; }
.store-link { display: inline-flex; margin-top: 12px; color: var(--muted); font-weight: var(--fw-label); text-decoration: none; }
.store-link:hover { color: var(--text); text-decoration: underline; }
.link-btn { display: block; width: 100%; margin-top: 16px; background: transparent; border: 0; color: var(--muted); font-weight: var(--fw-label); font-size: .86rem; text-align: center; cursor: pointer; }
.link-btn:hover { color: var(--text); }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 99; max-width: 360px; padding: 14px 16px; background: var(--text); color: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-weight: var(--fw-label); }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: #fff; }
.loading-card { width: min(520px, 100%); margin: 8vh auto; padding: 24px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); text-align: center; color: var(--muted); font-weight: var(--fw-label); }

/* POS */
.pos-shell { display: block; }
.pos-main { min-width: 0; }
.pos-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.pos-summary div { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.pos-summary span, .pos-item small, .pos-cart-line small { display: block; color: var(--muted); font-size: .74rem; font-weight: var(--fw-label); }
.pos-summary strong { display: block; margin-top: 4px; color: var(--text); font-size: 1.15rem; font-weight: var(--fw-heading); }
.pos-toolbar { display: grid; grid-template-columns: minmax(180px, .35fr) minmax(0, 1fr); gap: 10px; margin-bottom: 12px; }
.pos-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; }
.pos-chips button, .pos-payments button { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; min-height: 34px; padding: 0 14px; font-weight: var(--fw-label); }
.pos-chips button.is-active, .pos-payments button.is-active { background: var(--orange); border-color: var(--orange); color: #fff; }
.pos-menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.pos-item { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; min-height: 88px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text); cursor: pointer; }
.pos-item.is-disabled { opacity: .5; cursor: not-allowed; }
.pos-item-img { width: 54px; height: 54px; border-radius: 10px; display: grid; place-items: center; background: var(--bg) center / cover no-repeat; color: var(--muted); font-weight: var(--fw-heading); }
.pos-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-label); }
.pos-item strong { display: block; margin-top: 3px; color: var(--text); font-weight: var(--fw-heading); }

.pos-cart-lines { display: grid; gap: 10px; margin-bottom: 4px; }
.pos-cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pos-qty { display: grid; grid-template-columns: 30px 26px 30px; align-items: center; text-align: center; }
.pos-qty button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-weight: var(--fw-heading); }
.pos-remove-btn { width: 30px; height: 30px; border: 1px solid #f7c9c5; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-weight: var(--fw-heading); font-size: 1.05rem; line-height: 1; }
.pos-receipt-field { display: grid; gap: 6px; margin: 14px 0 0; color: var(--muted); font-size: .74rem; font-weight: var(--fw-label); }
.pos-receipt-field span b { color: var(--text); font-weight: var(--fw-heading); }
.pos-receipt-field input { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); padding: 0 12px; color: var(--text); font-weight: var(--fw-label); }
.pos-sms-toggle { display: flex; align-items: center; gap: 9px; margin-top: 10px; color: var(--muted); font-size: .8rem; font-weight: var(--fw-label); }
.pos-sms-toggle input { width: 17px; height: 17px; accent-color: var(--navy); }
.pos-payments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.pos-total { display: flex; flex-direction: column; line-height: 1.3; margin-right: auto; }
.pos-total span { color: var(--muted); font-size: .74rem; font-weight: var(--fw-label); }
.pos-total strong { font-size: 1.3rem; color: var(--text); font-weight: var(--fw-heading); }
.pos-sheet-footer { align-items: center; }
.pos-complete { min-height: 44px; }

.pos-cart-counter { position: fixed; left: 0; right: 0; bottom: 22px; z-index: 30; display: flex; justify-content: center; padding: 0 16px; }
.pos-cart-counter__btn { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 20px 0 8px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; cursor: pointer; box-shadow: var(--shadow); }
.pos-cart-counter__badge { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: var(--fw-heading); font-size: .84rem; }
.pos-cart-counter__label { font-weight: var(--fw-label); }
.pos-cart-counter__btn strong { margin-left: 4px; font-size: .98rem; font-weight: var(--fw-heading); }

@media (max-width: 640px) {
    .report-range { flex-direction: column; align-items: stretch; }
    .range-custom { margin-left: 0; flex-wrap: wrap; }
}
@media (max-width: 900px) {
    .workspace { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 20; min-height: 0;
        display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0;
        padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
        background: rgba(255, 255, 255, .98); border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(6, 15, 30, .06);
    }
    .nav-link { flex: 0 0 auto; width: 100%; min-height: 44px; justify-content: center; padding: 0 4px; margin: 0; border-radius: 10px; font-size: .68rem; }
    .screen { padding: 14px 14px calc(76px + env(safe-area-inset-bottom)); }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi:nth-child(2) { border-right: 0; }
    .content-grid, .form-grid { grid-template-columns: 1fr; }
    .clientele-card__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .campaign-shortcut { align-items: stretch; flex-direction: column; }
    .vendor-auth-page--solo { padding: 20px 14px 28px; }
    .auth-card { padding: 22px; }
    .topbar { min-height: 56px; padding: 8px 12px; align-items: center; gap: 10px; }
    .brand { min-width: 0; flex: 1 1 auto; }
    .brand img { width: 164px; max-width: min(46vw, 164px); }
    .topbar-actions { flex: 0 0 auto; flex-wrap: nowrap; gap: 8px; }
    .vendor-select { min-width: 170px; }
    .sidebar { scrollbar-width: none; -ms-overflow-style: none; }
    .sidebar::-webkit-scrollbar { display: none; }
    .read-grid, .branch-head { grid-template-columns: 1fr; display: grid; }
    .sheet-backdrop { padding: 8px; }
    .bottom-sheet { max-height: 92vh; border-radius: 16px 16px 10px 10px; }
    .menu-admin-row, .category-row { grid-template-columns: 60px minmax(0, 1fr); }
    .menu-admin-row .stack-right, .category-row button { grid-column: 1 / -1; justify-items: stretch; }
    .pos-cart-counter { bottom: calc(76px + env(safe-area-inset-bottom) + 12px); padding: 0 12px; }
}
@media (max-width: 720px) {
    .topbar { min-height: 52px; }
    .brand img { width: 146px; max-width: calc(100vw - 224px); }
    .vendor-select { min-width: 0; max-width: 108px; min-height: 34px; padding: 0 8px; font-size: .76rem; }
    .icon-btn, .exit-btn, .app-link { width: 36px; min-width: 36px; min-height: 36px; padding: 0; justify-content: center; }
    .icon-btn span, .exit-btn span, .app-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .icon-btn svg, .exit-btn svg, .app-link svg { width: 16px; height: 16px; }
}
@media (max-width: 480px) {
    .topbar { padding: 8px 10px; gap: 8px; }
    .brand img { width: 120px; max-width: calc(100vw - 200px); }
    .topbar-actions { gap: 6px; flex-wrap: nowrap; }
    .icon-btn, .exit-btn, .app-link { width: 32px; min-width: 32px; min-height: 32px; }
    .exit-btn svg, .icon-btn svg, .app-link svg { width: 14px; height: 14px; }
    .vendor-select { min-width: 0; max-width: 92px; font-size: .74rem; padding: 0 8px; }
    .sidebar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .nav-link { font-size: .66rem; min-height: 38px; }
    .pos-toolbar, .pos-summary { grid-template-columns: 1fr; }
    .pos-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-item { grid-template-columns: 1fr; }
    .pos-item-img { width: 100%; height: 76px; }
}
@media (max-width: 380px) {
    .brand img { width: 104px; max-width: calc(100vw - 186px); }
    .icon-btn, .exit-btn, .app-link { width: 30px; min-width: 30px; min-height: 30px; border-radius: 8px; }
}
