/* Swastik Salesman — mobile-first premium UI */
:root {
    --sm-primary: #ea580c;
    --sm-primary-dark: #c2410c;
    --sm-primary-soft: #ffedd5;
    --sm-accent: #16a34a;
    --sm-accent-soft: #ecfdf5;
    --sm-blue: #2563eb;
    --sm-blue-soft: #eff6ff;
    --sm-surface: #fffbf7;
    --sm-bg: #f5f5f4;
    --sm-card: #ffffff;
    --sm-text: #1c1917;
    --sm-muted: #78716c;
    --sm-border: #e7e5e4;
    --sm-shadow: 0 4px 20px rgba(28, 25, 23, 0.06);
    --sm-shadow-lg: 0 12px 40px rgba(28, 25, 23, 0.12);
    --sm-radius: 16px;
    --sm-radius-sm: 12px;
    --sm-tabbar-h: 64px;
    --sm-safe-b: env(safe-area-inset-bottom, 0px);
    --sm-safe-t: env(safe-area-inset-top, 0px);

    /* coverage.css compatibility */
    --cov-primary: var(--sm-primary);
    --cov-primary-soft: var(--sm-primary-soft);
    --cov-accent: var(--sm-accent);
    --cov-accent-soft: var(--sm-accent-soft);
    --cov-surface: var(--sm-surface);
    --cov-card: var(--sm-card);
    --cov-text: var(--sm-text);
    --cov-muted: var(--sm-muted);
    --cov-border: var(--sm-border);
    --cov-shadow: var(--sm-shadow);
}

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

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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(180deg, var(--sm-surface) 0%, var(--sm-bg) 120px);
    color: var(--sm-text);
    min-height: 100vh;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.sm-page { padding-bottom: calc(var(--sm-tabbar-h) + var(--sm-safe-b) + 12px); }
.sm-page--no-nav { padding-bottom: calc(16px + var(--sm-safe-b)); }
.sm-page--order { padding-bottom: calc(var(--sm-tabbar-h) + 80px + var(--sm-safe-b)); }
.sm-page--coverage { padding-bottom: calc(16px + var(--sm-safe-b)); }

.sm-shell {
    max-width: 520px;
    margin: 0 auto;
    padding: 12px 16px 20px;
}

/* ─── Login ─── */
.sm-login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 20px calc(24px + var(--sm-safe-b));
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(251, 146, 60, 0.25), transparent),
        linear-gradient(180deg, var(--sm-surface), var(--sm-bg));
}

.sm-login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.sm-login-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fb923c, var(--sm-primary));
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.3);
}

.sm-login-brand h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.sm-login-brand p {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--sm-muted);
}

.sm-login-card {
    background: var(--sm-card);
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: var(--sm-shadow-lg);
    border: 1px solid var(--sm-border);
}

.sm-login-card h2 {
    margin: 0 0 18px;
    font-size: 1.1rem;
    font-weight: 700;
}

.sm-field { margin-bottom: 14px; }

.sm-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sm-muted);
    margin-bottom: 6px;
}

.sm-input,
.sm-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1.5px solid var(--sm-border);
    border-radius: var(--sm-radius-sm);
    background: #fafaf9;
    color: var(--sm-text);
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sm-input:focus,
.sm-select:focus {
    outline: none;
    border-color: #fdba74;
    box-shadow: 0 0 0 3px rgba(253, 186, 116, 0.35);
    background: #fff;
}

.sm-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2378716c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.sm-alert {
    padding: 12px 14px;
    border-radius: var(--sm-radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.sm-alert--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.sm-alert--success {
    background: var(--sm-accent-soft);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* ─── Buttons ─── */
.sm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: var(--sm-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.sm-btn:active { transform: scale(0.98); }

.sm-btn--primary {
    width: 100%;
    background: linear-gradient(135deg, #fb923c, var(--sm-primary));
    color: #fff;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.28);
}

.sm-btn--accent {
    background: linear-gradient(135deg, #22c55e, var(--sm-accent));
    color: #fff;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}

.sm-btn--ghost {
    background: #fafaf9;
    color: var(--sm-text);
    border: 1px solid var(--sm-border);
}

.sm-btn--sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.sm-btn--block { width: 100%; }

/* ─── Top bar ─── */
.sm-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(10px + var(--sm-safe-t)) 16px 12px;
    margin: -12px -16px 16px;
    background: rgba(255, 251, 247, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--sm-border);
}

.sm-topbar__main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sm-topbar__back {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--sm-card);
    border: 1px solid var(--sm-border);
    color: var(--sm-primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
}

.sm-topbar__text { min-width: 0; }

.sm-topbar__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sm-topbar__sub {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--sm-muted);
}

.sm-topbar__actions { flex-shrink: 0; }

/* ─── Hero (dashboard) ─── */
.sm-hero {
    margin-bottom: 20px;
    padding: 4px 0;
}

.sm-hero__greet {
    font-size: 13px;
    color: var(--sm-muted);
    font-weight: 500;
}

.sm-hero__name {
    margin: 4px 0 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.sm-hero__date {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--sm-muted);
}

.sm-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--sm-blue-soft);
    color: var(--sm-blue);
    font-size: 12px;
    font-weight: 700;
}

/* ─── Stats grid ─── */
.sm-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.sm-stat {
    background: var(--sm-card);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    padding: 16px 14px;
    box-shadow: var(--sm-shadow);
}

.sm-stat--wide { grid-column: 1 / -1; }

.sm-stat__label {
    font-size: 12px;
    color: var(--sm-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sm-stat__value {
    margin-top: 6px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.sm-stat--orders .sm-stat__value { color: var(--sm-blue); }
.sm-stat--sales .sm-stat__value { color: var(--sm-accent); }
.sm-stat--customers .sm-stat__value { color: #7c3aed; }

/* ─── Action tiles ─── */
.sm-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--sm-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px;
}

.sm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}

.sm-action-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
    border-radius: var(--sm-radius);
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    min-height: 88px;
    box-shadow: var(--sm-shadow);
    transition: transform 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.sm-action-tile:active { transform: scale(0.97); }
.sm-action-tile--wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: auto; }

.sm-action-tile__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.22);
    display: grid;
    place-items: center;
    font-size: 20px;
}

.sm-action-tile--coverage { background: linear-gradient(145deg, #fb923c, #ea580c); }
.sm-action-tile--order { background: linear-gradient(145deg, #3b82f6, #2563eb); }
.sm-action-tile--catalog { background: linear-gradient(145deg, #818cf8, #4f46e5); }
.sm-action-tile--orders { background: linear-gradient(145deg, #34d399, #059669); }
.sm-action-tile--outstanding { background: linear-gradient(145deg, #a78bfa, #7c3aed); }
.sm-action-tile--stock { background: linear-gradient(145deg, #fbbf24, #d97706); }

/* ─── Cards & lists ─── */
.sm-card {
    background: var(--sm-card);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    padding: 16px;
    box-shadow: var(--sm-shadow);
    margin-bottom: 12px;
}

.sm-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sm-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
}

.sm-card__link {
    font-size: 13px;
    font-weight: 600;
    color: var(--sm-primary);
    text-decoration: none;
}

.sm-order-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--sm-border);
}

.sm-order-card:last-child { border-bottom: 0; padding-bottom: 0; }
.sm-order-card:first-child { padding-top: 0; }

.sm-order-card__id {
    font-size: 11px;
    color: var(--sm-muted);
    font-weight: 600;
}

.sm-order-card__name {
    font-size: 15px;
    font-weight: 700;
    margin-top: 2px;
}

.sm-order-card__meta {
    font-size: 12px;
    color: var(--sm-muted);
    margin-top: 2px;
}

.sm-order-card__amount {
    font-size: 16px;
    font-weight: 800;
    color: var(--sm-accent);
    white-space: nowrap;
}

a.sm-order-card-link,
.sm-card.sm-order-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.sm-order-card-link:active,
.sm-card.sm-order-card-link:active {
    border-color: var(--sm-primary);
}

.sm-order-view-kv {
    display: grid;
    gap: 14px;
}

.sm-order-view-kv__label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sm-muted);
    margin-bottom: 4px;
}

.sm-order-view-kv__sub {
    font-size: 12px;
    color: var(--sm-muted);
    margin-top: 2px;
}

.sm-order-view-total {
    font-size: 18px;
    color: var(--sm-accent);
}

.sm-order-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
}

.sm-order-status--pending_invoice { background: #fef3c7; color: #92400e; }
.sm-order-status--invoiced { background: #dbeafe; color: #1d4ed8; }
.sm-order-status--pending_delivery { background: #ffedd5; color: #9a3412; }
.sm-order-status--delivered { background: #dcfce7; color: #166534; }

.sm-order-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sm-order-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--sm-border);
}

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

.sm-order-item__main { grid-column: 1 / -1; }

.sm-order-item__name {
    font-size: 14px;
    font-weight: 700;
}

.sm-order-item__meta {
    font-size: 12px;
    color: var(--sm-muted);
    margin-top: 2px;
}

.sm-order-item__qty {
    font-size: 13px;
    color: var(--sm-muted);
    align-self: center;
}

.sm-order-item__free {
    display: block;
    font-size: 11px;
    color: #059669;
    font-weight: 600;
}

.sm-order-item__total {
    font-size: 15px;
    font-weight: 800;
    color: var(--sm-accent);
    align-self: center;
}

.sm-order-items-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    margin-top: 4px;
    border-top: 2px solid var(--sm-border);
    font-size: 15px;
}

.sm-order-items-foot strong {
    font-size: 18px;
    color: var(--sm-accent);
}

.sm-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--sm-muted);
    font-size: 14px;
}

/* ─── Bottom tab bar ─── */
.sm-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: calc(var(--sm-tabbar-h) + var(--sm-safe-b));
    padding-bottom: var(--sm-safe-b);
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--sm-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sm-tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--sm-muted);
    font-size: 10px;
    font-weight: 600;
    padding: 6px 4px;
    -webkit-tap-highlight-color: transparent;
}

.sm-tabbar__icon {
    font-size: 20px;
    line-height: 1;
    opacity: 0.7;
}

.sm-tabbar__item--active {
    color: var(--sm-primary);
}

.sm-tabbar__item--active .sm-tabbar__icon {
    opacity: 1;
}

/* ─── Order page ─── */
.sm-order-setup {
    background: var(--sm-card);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--sm-shadow);
}

.sm-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--sm-card);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    box-shadow: var(--sm-shadow);
}

.sm-filter-bar .sm-input,
.sm-filter-bar .sm-select {
    flex: 1 1 140px;
    padding: 10px 12px;
    font-size: 14px;
    margin: 0;
}

.sm-filter-bar .sm-btn { flex: 0 0 auto; padding: 10px 14px; font-size: 13px; }
.sm-filter-bar .sm-btn--filter { background: var(--sm-blue); color: #fff; }
.sm-filter-bar .sm-btn--reset { background: #78716c; color: #fff; }

.sm-products { display: grid; gap: 10px; }

.product-card {
    display: flex;
    background: var(--sm-card);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    overflow: hidden;
    box-shadow: var(--sm-shadow);
}

.product-card__img {
    width: 108px;
    min-height: 108px;
    flex-shrink: 0;
    background: #fafaf9;
}

.product-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-card__body {
    flex: 1;
    min-width: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card__name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.sm-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    margin-top: 4px;
}

.sm-tag--net { background: #f5f5f4; color: #57534e; }
.sm-tag--b1g1 { background: var(--sm-accent-soft); color: #15803d; }
.sm-tag--pct { background: var(--sm-blue-soft); color: #1d4ed8; }
.sm-tag--amt { background: #f3e8ff; color: #7c3aed; }

.product-card__rates {
    font-size: 12px;
    color: var(--sm-muted);
    margin-top: 6px;
}

.product-card__rates strong { color: var(--sm-text); }

.product-card__stock {
    font-size: 11px;
    color: var(--sm-muted);
}

.product-card__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.sm-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--sm-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fafaf9;
}

.sm-qty button {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 600;
    color: var(--sm-text);
    cursor: pointer;
}

.sm-qty input {
    width: 36px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    background: transparent;
}

.product-card .free-box,
.product-card .scheme-box {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--sm-muted);
}

.product-card .free-box input,
.product-card .scheme-box input {
    width: 52px;
    padding: 4px 6px;
    border: 1px solid var(--sm-border);
    border-radius: 6px;
    font-size: 12px;
}

.product-card .add-btn {
    margin-left: auto;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 800;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, var(--sm-blue));
    color: #fff;
    cursor: pointer;
}

.product-card .add-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.product-card .variant {
    width: 100%;
    margin-top: 6px;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid var(--sm-border);
    border-radius: 8px;
}

/* Cart sheet */
.sm-cart-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    background: var(--sm-card);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--sm-safe-b);
}

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

.sm-cart-sheet__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--sm-border);
    font-weight: 800;
    font-size: 16px;
}

.sm-cart-sheet__close {
    border: none;
    background: #fef2f2;
    color: #b91c1c;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.sm-cart-sheet__items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.sm-cart-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 12px;
    background: #fafaf9;
    border-radius: var(--sm-radius-sm);
    margin-bottom: 8px;
}

.sm-cart-row__name { font-size: 13px; font-weight: 700; }
.sm-cart-row__rate { font-size: 11px; color: var(--sm-muted); }
.sm-cart-row__free { font-size: 11px; color: var(--sm-accent); font-weight: 600; }
.sm-cart-row__total { font-size: 14px; font-weight: 800; }
.sm-cart-row .sm-qty span {
    padding: 0 10px;
    font-weight: 800;
    font-size: 14px;
}
    grid-column: 3;
    grid-row: 1 / 3;
    border: none;
    background: transparent;
    color: #dc2626;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.sm-cart-sheet__foot {
    padding: 14px 16px;
    border-top: 1px solid var(--sm-border);
}

.sm-cart-sheet__total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 12px;
}

.sm-cart-fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + var(--sm-safe-b));
    z-index: 250;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #3b82f6, var(--sm-blue));
    color: #fff;
    font-size: 24px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.sm-page--order .sm-cart-fab {
    bottom: calc(var(--sm-tabbar-h) + 12px + var(--sm-safe-b));
}

.sm-cart-fab__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
}

/* ─── Catalogue ─── */
.sm-catalog-search {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: calc(10px + var(--sm-safe-t)) 16px 12px;
    margin: -12px -16px 12px;
    background: linear-gradient(135deg, #fb923c, var(--sm-primary));
    display: flex;
    gap: 8px;
}

.sm-catalog-search input {
    flex: 1;
    padding: 12px 14px;
    border: none;
    border-radius: var(--sm-radius-sm);
    font-size: 15px;
}

.sm-catalog-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.sm-group-card {
    background: var(--sm-card);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    padding: 16px;
    margin-bottom: 10px;
    text-align: center;
    box-shadow: var(--sm-shadow);
}

.sm-group-card img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    margin-bottom: 8px;
}

.sm-group-card__name {
    font-weight: 800;
    font-size: 15px;
    margin-bottom: 8px;
}

.sm-variant-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
}

.sm-variant-btn {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1.5px solid var(--sm-border);
    background: #fafaf9;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.sm-variant-btn.active {
    background: var(--sm-primary);
    border-color: var(--sm-primary);
    color: #fff;
}

.sm-group-card__mrp {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

.sm-group-card__meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--sm-muted);
    padding: 0 4px;
}

.sm-scroll-top {
    position: fixed;
    right: 16px;
    bottom: calc(80px + var(--sm-safe-b));
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--sm-primary);
    color: #fff;
    font-size: 18px;
    box-shadow: var(--sm-shadow);
    cursor: pointer;
    display: none;
    z-index: 40;
}

.sm-scroll-top.is-visible { display: grid; place-items: center; }

/* ─── Outstanding ─── */
.sm-customer-pick {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--sm-card);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    text-decoration: none;
    color: inherit;
    margin-bottom: 8px;
    box-shadow: var(--sm-shadow);
    transition: border-color 0.15s;
}

.sm-customer-pick:active { border-color: #fdba74; }

.sm-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, var(--sm-blue));
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.sm-customer-pick__due {
    margin-left: auto;
    font-weight: 800;
    color: #dc2626;
    font-size: 15px;
}

.sm-doc-row {
    padding: 14px;
    border-radius: var(--sm-radius-sm);
    border: 1px solid var(--sm-border);
    margin-bottom: 8px;
    background: var(--sm-card);
}

.sm-doc-row--warn { background: #fffbeb; border-color: #fde68a; }
.sm-doc-row--danger { background: #fef2f2; border-color: #fecaca; }

.sm-doc-row__top {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 14px;
}

.sm-doc-row__amt { color: #dc2626; }

.sm-doc-row__meta {
    font-size: 11px;
    color: var(--sm-muted);
    margin-top: 4px;
}

.sm-total-bar {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    background: var(--sm-card);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    font-weight: 800;
    font-size: 16px;
    margin-top: 12px;
}

.sm-action-row {
    display: flex;
    gap: 10px;
    margin: 14px 0;
}

.sm-action-row .sm-btn { flex: 1; }

/* Modal */
.sm-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.sm-modal.is-open { display: flex; }

.sm-modal__sheet {
    background: var(--sm-card);
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    max-width: 300px;
    text-align: center;
}

.sm-modal__title {
    font-weight: 800;
    margin-bottom: 14px;
}

.sm-modal__link {
    display: block;
    padding: 12px;
    border-radius: var(--sm-radius-sm);
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    margin-bottom: 8px;
}

.sm-modal__link--wa { background: #22c55e; }
.sm-modal__link--biz { background: #15803d; }

/* Stock list */
.sm-stock-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--sm-card);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius-sm);
    margin-bottom: 8px;
}

.sm-stock-row__qty { font-weight: 800; }
.sm-stock-row__qty--ok { color: var(--sm-accent); }
.sm-stock-row__qty--zero { color: #dc2626; }

.sm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 13px;
}

/* Search list scroll */
.sm-scroll-list {
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sm-page--coverage .sm-topbar {
    margin: -12px -16px 16px;
}

textarea.sm-input {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}
