:root {
    color-scheme: light;
    --page-bg: #e2ebe6;
    --surface: #ffffff;
    --surface-soft: #f0f5f2;
    --surface-green: #dff4ea;
    --surface-amber: #fff0d7;
    --surface-gray: #e4ebe7;
    --text: #17231f;
    --muted: #6b7d76;
    --line: #c2d0c9;
    --line-strong: #a9bbb2;
    --accent: #0f8f63;
    --accent-dark: #08724f;
    --danger: #cf3f55;
    --danger-soft: #ffe3ea;
    --warning: #b87500;
    --warning-soft: #ffe8bd;
    --shadow: 0 24px 70px rgba(17, 40, 31, 0.16);
    font-family: "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(15, 143, 99, 0.10), transparent 360px),
        linear-gradient(135deg, #edf3ef, var(--page-bg));
    color: var(--text);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.66;
}

h1,
h2,
p {
    margin: 0;
}

.app-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 10px;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-view {
    width: min(430px, 100%);
    min-height: calc(100vh - 20px);
    display: grid;
    align-content: center;
    gap: 22px;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.brand-row h1 {
    font-size: 28px;
    line-height: 1.1;
}

.brand-row p,
label,
.section-heading span,
.list-main span,
.list-side,
.owner-header p,
.jump-card small,
.eyebrow {
    color: var(--muted);
}

.login-panel {
    display: grid;
    gap: 15px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

label {
    display: grid;
    gap: 7px;
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text);
    background: var(--surface);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(15, 143, 99, 0.58);
    box-shadow: 0 0 0 3px rgba(15, 143, 99, 0.12);
}

.login-panel button,
.modal-actions button {
    min-height: 44px;
    border-radius: 8px;
    padding: 0 16px;
    color: #fff;
    background: var(--accent);
    font-weight: 800;
}

.secondary-button {
    color: var(--accent-dark) !important;
    background: var(--surface-green) !important;
}

.danger-button {
    color: #fff !important;
    background: var(--danger) !important;
}

.form-error {
    min-height: 20px;
    color: var(--danger);
    font-weight: 800;
}

.dashboard-view {
    width: 100%;
    display: grid;
    place-items: center;
}

.owner-shell {
    width: min(430px, 100%);
    height: min(840px, calc(100vh - 20px));
    min-height: 640px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.owner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 8px;
    background: var(--surface);
}

.owner-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.owner-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.eyebrow {
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.owner-header h1 {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
    line-height: 1.15;
}

.owner-header p {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-button {
    min-width: 38px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text);
    background: var(--surface);
    font-size: 12px;
    font-weight: 900;
}

.refresh-icon {
    color: var(--accent-dark);
}

.exit-button {
    color: #fff;
    background: #22312d;
    border-color: #22312d;
}

.orders-heading-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.compact-action {
    min-height: 2.55rem;
    padding: .55rem .8rem;
    white-space: nowrap;
}

.paper-invoice-modal {
    width: min(62rem, calc(100vw - 1rem));
    max-height: calc(100dvh - 1rem);
    overflow: auto;
}

.paper-invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.paper-invoice-header h2,
.paper-invoice-header p {
    margin-top: 0;
}

.paper-invoice-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
}

.paper-invoice-checkbox {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    gap: .55rem;
    padding-top: 1.65rem;
}

.paper-invoice-checkbox input {
    width: 1.2rem;
    height: 1.2rem;
}

.paper-invoice-add-row {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto auto;
    gap: .65rem;
    margin: 1rem 0;
}

.paper-invoice-lines {
    display: grid;
    gap: .65rem;
}

.paper-invoice-line {
    display: grid;
    grid-template-columns: minmax(10rem, 2fr) minmax(5.5rem, .7fr) minmax(5.5rem, .8fr) minmax(6.5rem, 1fr) minmax(5.5rem, .7fr) auto;
    gap: .55rem;
    align-items: end;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: var(--surface, #fff);
}

.paper-invoice-line label {
    min-width: 0;
}

.paper-invoice-line input {
    width: 100%;
}

.paper-invoice-line-remove {
    min-height: 2.65rem;
    color: var(--danger, #b42318);
}

.paper-invoice-footer-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
    margin-top: 1rem;
}

.paper-invoice-total {
    min-width: 11rem;
    padding: .8rem 1rem;
    border: 1px solid var(--line);
    border-radius: .75rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

@media (max-width: 760px) {
    .orders-heading-actions .compact-action {
        font-size: .78rem;
        padding-inline: .6rem;
    }

    .paper-invoice-fields {
        grid-template-columns: 1fr 1fr;
    }

    .paper-invoice-add-row,
    .paper-invoice-footer-fields {
        grid-template-columns: 1fr;
    }

    .paper-invoice-line {
        grid-template-columns: 1fr 1fr;
    }

    .paper-invoice-line label:first-child {
        grid-column: 1 / -1;
    }
}

.form-error.is-warning {
    color: #8a5a00;
}

.security-button {
    color: #8b1e1e;
    background: #fff7f7;
    border-color: #efcaca;
}

.unlink-shop-button {
    color: #8b1e1e;
    background: #fff0f0;
    border-color: rgba(176, 35, 35, 0.35);
}

.shop-strip {
    padding: 0 16px 10px;
    background: var(--surface);
}

.shop-strip select {
    min-height: 36px;
    border-color: #cfeee0;
    background: var(--surface-green);
    color: #10241d;
    font-size: 13px;
    font-weight: 800;
}

.current-shop-name {
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid #cfeee0;
    border-radius: 8px;
    color: #10241d;
    background: var(--surface-green);
    font-size: 13px;
    font-weight: 800;
}

.form-notice {
    min-height: 18px;
    color: #17633f;
    font-size: 12px;
    font-weight: 700;
}

.page-dots {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: 8px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.page-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    padding: 0;
    background: #d9e2de;
}

.page-dot.active {
    width: 18px;
    background: var(--accent);
}

.page-track {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-y;
    background: #e9f0ec;
}

.page-track::-webkit-scrollbar {
    display: none;
}

.page-screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 14px 16px 16px;
    scrollbar-width: thin;
    transform: translateX(100%);
    transition: transform 220ms ease;
    pointer-events: none;
}

.page-screen.active {
    pointer-events: auto;
}

.page-track.no-page-transition .page-screen {
    transition: none;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-heading h2 {
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
    color: #687a72;
    text-transform: uppercase;
}

.section-heading span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 700;
}

.with-search {
    display: grid;
    align-items: stretch;
}

.panel-search {
    min-height: 38px;
    background: var(--surface-soft);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

.products-catalog-screen {
    padding: 12px 16px 22px;
    background: #e9f0ec;
}

.product-page-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-bottom: 8px;
}

.product-page-heading h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
}

.product-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.product-actions-bar .product-add-button {
    flex: 1;
    min-height: 48px;
    font-weight: 800;
}

.product-capability-warning {
    font-size: 0.78rem;
    color: var(--danger, #d33);
    line-height: 1.3;
}

html[dir="rtl"] .product-capability-warning {
    text-align: right;
}

.product-actions-bar .product-add-button[disabled] {
    opacity: 0.55;
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    margin-top: 4px;
}


.product-search-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

html[dir="rtl"] .product-search-row {
    direction: ltr;
}

html[dir="rtl"] .product-search-wrap {
    direction: rtl;
}

.product-filter-button {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid #72c5a4;
    border-radius: 14px;
    background: linear-gradient(180deg, #ecfbf4, #dcf4e7);
    box-shadow: 0 4px 12px rgba(20, 77, 56, 0.12);
}

.product-filter-button.has-active-filter {
    border-color: #0f8f63;
    background: linear-gradient(180deg, #daf5e8, #c8eed9);
}

.product-filter-glyph {
    width: 18px;
    height: 15px;
    position: relative;
    display: block;
}

.product-filter-glyph span {
    position: absolute;
    left: 1px;
    right: 1px;
    height: 2px;
    border-radius: 999px;
    background: #0c6b49;
}

.product-filter-glyph span:nth-child(1) {
    top: 1px;
}

.product-filter-glyph span:nth-child(2) {
    top: 7px;
}

.product-filter-glyph span:nth-child(3) {
    bottom: 0;
}

.product-filter-glyph::before,
.product-filter-glyph::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    border: 2px solid #0c6b49;
    border-radius: 50%;
    background: #ecfbf4;
}

.product-filter-glyph::before {
    top: -1px;
    inset-inline-start: 10px;
}

.product-filter-glyph::after {
    top: 5px;
    inset-inline-start: 2px;
}

.product-search-wrap {
    position: relative;
}

.product-search-wrap .panel-search {
    width: 100%;
    min-height: 48px;
    border-color: #dfe9e4;
    border-radius: 14px;
    padding-inline: 16px 44px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(27, 68, 51, 0.04);
}

.product-search-icon {
    position: absolute;
    z-index: 1;
    inset-inline-end: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #819088;
    font-size: 25px;
    pointer-events: none;
}

.product-filter-meta {
    min-height: 22px;
    margin-bottom: 12px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 900;
}

.product-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.product-summary-card {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(30, 71, 53, 0.08);
}

.product-summary-card > span:last-child {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.product-summary-card strong {
    color: var(--text);
    font-size: 19px;
    line-height: 1;
}

.product-summary-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.product-summary-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--accent);
    background: #e9f7f1;
    font-size: 20px;
}

.product-card-list {
    gap: 10px;
}

.product-card {
    position: relative;
    min-height: 174px;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: visible;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(31, 65, 52, 0.10);
}

.product-card-title {
    display: block;
    width: 100%;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.45;
    overflow-wrap: anywhere;
    text-align: center;
}

.product-card-body {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) 84px;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.product-card .product-card-visual {
    width: 82px;
    height: 108px;
    border: 0;
    border-radius: 16px;
    color: #76aa96;
    background: linear-gradient(145deg, #f5faf8, #edf5f1);
    font-family: Georgia, serif;
    font-size: 42px;
}

.product-card-main {
    min-width: 0;
    align-self: stretch;
    display: grid;
    align-content: center;
}

.product-card-metadata {
    display: grid;
    gap: 7px;
}

.product-card-metadata > span {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.product-card-metadata b {
    width: 14px;
    flex: 0 0 auto;
    color: #8b9b94;
    font-size: 13px;
}

.product-card-metadata span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-metadata time {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-side {
    position: relative;
    overflow: visible;
    align-self: stretch;
    display: grid;
    align-content: space-between;
    justify-items: center;
    align-items: start;
    gap: 8px;
    padding-inline-start: 12px;
    border-inline-start: 1px solid #edf1ef;
}

.product-card.has-open-menu {
    z-index: 30;
}

.product-card-menu {
    position: relative;
    order: 1;
    z-index: 2;
}

.product-card-menu > summary {
    list-style: none;
}

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

.product-card-menu-trigger {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    color: var(--muted);
    background: var(--surface);
    font-size: 21px;
    font-weight: 900;
    line-height: 1;
}

.product-card-menu-trigger:hover,
.product-card-menu-trigger:focus-visible,
.product-card-menu[open] .product-card-menu-trigger {
    border-color: #72c5a4;
    color: var(--accent-dark);
    background: var(--surface-green);
    outline: none;
}

.product-card-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    min-width: 176px;
    display: grid;
    gap: 3px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(17, 40, 31, 0.18);
}

.product-card-menu-item {
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--text);
    background: transparent;
    font-size: 11px;
    font-weight: 800;
    text-align: start;
    white-space: nowrap;
}

.product-card-menu-item:hover,
.product-card-menu-item:focus-visible {
    background: var(--surface-soft);
    outline: none;
}

.product-card-menu-item.danger {
    color: var(--danger);
}

.product-card-menu-item.danger:hover,
.product-card-menu-item.danger:focus-visible {
    background: var(--danger-soft);
}

.product-card-stock {
    order: 2;
    display: grid;
    justify-items: center;
    gap: 2px;
    color: var(--muted);
}

.product-card-stock small {
    font-size: 10px;
    font-weight: 800;
}

.product-card-stock strong {
    color: #5f6d67;
    font-size: 18px;
}

.product-card-side .compact-button {
    order: 3;
    width: 100%;
    min-height: 32px;
    padding: 0 7px;
    border: 1px solid #72c5a4;
    color: var(--accent-dark) !important;
    background: #fff !important;
    font-size: 10px;
}

@media (max-width: 370px) {
    .product-search-row {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 8px;
    }

    .product-filter-button {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .product-card-body {
        grid-template-columns: 68px minmax(0, 1fr) 76px;
        gap: 9px;
        padding: 11px;
    }

    .product-card-title {
        padding: 11px 14px;
        font-size: 16px;
    }

    .product-card .product-card-visual {
        width: 68px;
        height: 96px;
    }
}

.compact-heading {
    margin: 14px 0 10px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.metric-card {
    min-height: 70px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 14px;
    border-radius: 8px;
}

.metric-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.metric-card strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 22px;
    line-height: 1.1;
}

.metric-green {
    background: var(--surface-green);
}

.metric-amber {
    background: var(--surface-amber);
}

.metric-gray {
    background: var(--surface-gray);
}

.jump-list,
.list {
    display: grid;
}

.jump-list {
    gap: 10px;
}

.jump-card {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface);
    text-align: left;
}

.jump-card strong,
.jump-card small {
    display: block;
}

.jump-card strong {
    margin-bottom: 3px;
    font-size: 15px;
}

.jump-card small {
    font-size: 12px;
    font-weight: 700;
}

.chevron {
    color: var(--accent);
    font-size: 24px;
    font-weight: 900;
}

.list-row {
    min-height: 62px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.product-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
}

.product-thumb-button {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 11px;
    font-weight: 900;
}

.product-thumb-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumb-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.list-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.list-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1.2;
}

.list-main span,
.list-side {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.product-actions,
.customer-balance {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.order-row-actions {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.compact-button {
    min-height: 32px;
    border-radius: 8px;
    padding: 0 11px;
    color: #fff;
    background: var(--accent);
    font-size: 12px;
    font-weight: 900;
}


.receipt-button {
    width: fit-content;
    justify-self: end;
}

.secondary-compact-button {
    color: var(--accent-dark);
    background: var(--surface-green);
}

.danger-compact-button {
    color: #fff;
    background: var(--danger);
}

#receipt-balance {
    display: inline-block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.order-button,
.receipt-button {
    width: fit-content;
    justify-self: end;
}

.customer-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 7px 22px rgba(25, 61, 51, 0.08);
}

.customer-card-list {
    gap: 16px;
}

.customer-section-heading {
    display: grid;
    place-items: center;
    margin-bottom: 14px;
}

.customer-section-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
    text-align: center;
}

.customer-section-copy h2 {
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.15;
}

.customer-section-copy span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.customer-section-search {
    width: 100%;
    min-height: 48px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(25, 61, 51, 0.06);
}

.customer-view-toolbar {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px;
}

.customer-sync-summary {
    display: inline-flex;
    height: 38px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 10px;
    color: var(--muted);
    background: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.customer-sync-summary time {
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 900;
}

.customer-view-toggle {
    display: inline-grid;
    height: 38px;
    grid-template-columns: repeat(2, auto);
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
}

.customer-view-toggle button {
    min-height: 30px;
    border: 0;
    border-radius: 7px;
    padding: 0 10px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 800;
}

.customer-view-toggle button.active {
    color: var(--accent-dark);
    background: #fff;
    box-shadow: 0 2px 8px rgba(25, 61, 51, 0.1);
}

.customer-card-header {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(100deg, #eef8f4, #e6f4ef);
}

.customer-card-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(22, 158, 116, 0.28);
    border-radius: 50%;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.72);
}

.customer-avatar-icon {
    width: 21px;
    height: 21px;
}

.customer-card-title {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 18px;
    line-height: 1.25;
}

.customer-compact-balance {
    display: none;
    margin-inline-start: auto;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.customer-compact-balance.due {
    color: #9a6700;
    background: #fff4d9;
}

.customer-compact-balance.credit,
.customer-compact-balance.settled {
    color: var(--accent-dark);
    background: #fff;
}

.customer-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 14px;
    padding: 14px 16px 10px;
}

.customer-card-information {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
}

.customer-info-cell {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 9px 8px;
    border-bottom: 1px solid rgba(55, 108, 91, 0.15);
}

.customer-info-label {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.customer-info-value {
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
}

.customer-total-cell {
    border-bottom: 0;
}

.customer-wide-cell {
    grid-column: 1 / -1;
}

.customer-balance-card {
    display: grid;
    min-height: 126px;
    align-self: center;
    place-items: center;
    align-content: center;
    gap: 5px;
    border-radius: 14px;
    padding: 12px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 900;
}

.customer-balance-card strong {
    font-size: 19px;
}

.customer-balance-card small {
    font-size: 10px;
    font-weight: 800;
}

.customer-balance-card.due {
    color: #9a6700;
    background: #fff4d9;
}

.customer-balance-card.credit,
.customer-balance-card.settled {
    color: var(--accent-dark);
    background: var(--surface-green);
}

.customer-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0 16px 14px;
}

.customer-action-button {
    display: inline-flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(22, 158, 116, 0.3);
    background: #fff;
    text-decoration: none;
}

.customer-action-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: var(--accent);
}

.customer-card-list.compact .customer-card-body {
    display: none;
}

.customer-card-list.compact .customer-card-header {
    min-height: 54px;
}

.customer-card-list.compact .customer-compact-balance {
    display: inline-flex;
}

.customer-card-list.compact .customer-card-actions {
    padding-top: 12px;
}

@media (max-width: 720px) {
    .customer-card-body {
        grid-template-columns: minmax(0, 1fr) 82px;
        gap: 8px;
        padding-inline: 12px;
    }

    .customer-card-actions {
        padding-inline: 12px;
    }
}

.order-modal {
    max-height: calc(100dvh - 32px);
    overflow: auto;
}

.order-modal.order-redesign {
    position: relative;
    width: min(100%, 440px);
    height: min(100dvh - 18px, 820px);
    max-height: calc(100dvh - 18px);
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto;
    gap: 12px;
    overflow: hidden;
    padding-bottom: 70px;
}

.order-modal:not(.order-redesign) .order-product-search-row,
.order-modal:not(.order-redesign) .order-product-list-heading,
.order-modal:not(.order-redesign) .order-products-list,
.order-modal:not(.order-redesign) .order-cart-toggle,
.order-modal:not(.order-redesign) .order-cart-footer {
    display: none;
}

.order-modal.order-redesign .order-add-grid,
.order-modal.order-redesign .order-footer-cancel {
    display: none;
}

.order-screen-header {
    min-height: 42px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
}

.order-screen-header h2 {
    margin: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 20px;
}

.order-close-button {
    width: 40px;
    height: 40px;
    color: var(--text);
    background: var(--surface-soft);
    font-size: 24px;
}

.order-customer-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 5px 9px;
    margin: 0;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.order-customer-summary > span:first-child {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.order-customer-summary strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: end;
}

.order-customer-summary #order-customer-meta {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: end;
}

.order-product-search-row {
    display: grid;
}

.order-product-list-heading {
    color: var(--text);
    font-size: 16px;
    font-weight: 950;
    text-align: end;
}

.order-product-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.order-product-view-toggle {
    flex: 0 0 auto;
    height: 34px;
}

.order-product-view-toggle button {
    min-height: 26px;
}

.order-products-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 2px 10px;
}

.order-product-row {
    min-height: 82px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 104px;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.order-product-name {
    grid-column: 1 / -1;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
    line-height: 1.35;
    text-align: start;
    white-space: normal;
}

.order-product-row.is-unavailable {
    opacity: 0.58;
}

.order-product-quantity {
    display: grid;
    grid-template-columns: 34px 36px 34px;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface);
}

.order-product-step {
    width: 34px;
    min-height: 34px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: transparent;
    font-size: 18px;
    font-weight: 950;
}

.order-product-step:disabled {
    color: var(--muted);
    opacity: 0.5;
}

.order-product-quantity-value {
    width: 36px;
    height: 34px;
    min-height: 34px;
    appearance: textfield;
    border-inline: 1px solid var(--line);
    border-block: 0;
    border-radius: 0;
    padding: 0;
    color: var(--text);
    background: transparent;
    direction: ltr;
    font-size: 13px;
    font-weight: 950;
    text-align: center;
}

.order-product-quantity-value::-webkit-inner-spin-button,
.order-product-quantity-value::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.order-product-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
    text-align: start;
}

.order-product-copy span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.order-products-list.compact .order-product-row {
    min-height: 56px;
    grid-template-columns: minmax(0, 1fr) 104px;
    grid-template-rows: auto;
    gap: 12px;
}

.order-products-list.compact .order-product-thumb,
.order-products-list.compact .order-product-copy {
    display: none;
}

.order-products-list.compact .order-product-quantity {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
}

.order-products-list.compact .order-product-name {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
}

.order-product-copy b {
    color: var(--accent);
    font-size: 12px;
}

.order-product-thumb {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 10px;
    font-weight: 900;
}

.order-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-cart-sheet {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    gap: 10px;
    padding: 10px 14px max(14px, env(safe-area-inset-bottom));
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -12px 34px rgba(18, 47, 37, 0.13);
    backdrop-filter: blur(10px);
    transition: transform 180ms ease;
}

.order-modal:not(.order-redesign) .order-cart-sheet {
    position: static;
    display: grid;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.order-cart-sheet.is-collapsed {
    transform: translateY(calc(100% - 58px));
    border-radius: 22px 22px 0 0;
}

.order-modal:not(.order-redesign) .order-cart-sheet.is-collapsed {
    transform: none;
}

.order-cart-toggle {
    min-height: 42px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 9px;
    color: var(--text);
    background: transparent;
    text-align: start;
}

.order-cart-handle {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 46px;
    height: 4px;
    border-radius: 999px;
    background: #aab9b4;
    transform: translateX(-50%);
}

.order-cart-title {
    padding-top: 8px;
    font-size: 17px;
    font-weight: 950;
}

.order-cart-count {
    min-width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: var(--accent-dark);
    background: #dff5ec;
    font-size: 12px;
    font-weight: 950;
}

.order-cart-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text);
    font-size: 18px;
    font-weight: 950;
}

.order-cart-footer strong {
    color: var(--accent-dark);
    font-size: 19px;
}

.order-cart-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-top: 0;
}

.order-cart-actions button {
    min-width: 0;
    min-height: 50px;
    border-radius: 10px;
    font-weight: 950;
}

.order-note-panel {
    display: grid;
    gap: 6px;
}

.order-note-panel > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.order-note-panel textarea {
    min-height: 82px;
    resize: none;
}

.order-cart-sheet .order-line-list {
    min-height: 0;
    max-height: none;
    align-content: start;
    grid-auto-rows: max-content;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-inline-end: 2px;
}

.order-cart-sheet.is-collapsed .order-line-list,
.order-cart-sheet.is-collapsed .order-cart-footer,
.order-cart-sheet.is-collapsed .order-note-panel,
.order-cart-sheet.is-collapsed .order-cart-actions {
    visibility: hidden;
}

@media (max-width: 720px) {
    #order-dialog.modal-backdrop {
        place-items: stretch;
        padding: 0;
        background: var(--surface);
    }

    .order-modal.order-redesign {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        padding: max(12px, env(safe-area-inset-top)) 14px 70px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .order-modal.order-redesign .order-cart-sheet {
        border-inline: 0;
        border-radius: 0;
    }

    .order-modal.order-redesign .order-cart-sheet.is-collapsed {
        border-radius: 22px 22px 0 0;
    }
}

.order-add-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    align-items: end;
    gap: 10px;
}

.order-add-grid button {
    grid-column: 1 / -1;
}

.order-add-grid .product-picker-field {
    grid-column: auto;
}

.product-picker-field {
    width: 100%;
    min-height: 42px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text);
    background: var(--surface);
    text-align: start;
}

.product-picker-field:focus-visible {
    border-color: rgba(15, 143, 99, 0.58);
    outline: 3px solid rgba(15, 143, 99, 0.12);
}

.product-picker-field:disabled {
    color: var(--muted);
}

.product-picker-field > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-picker-chevron {
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
}

.order-product-picker {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    background: var(--surface);
}

.order-product-picker-header {
    min-height: 62px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    padding: max(10px, env(safe-area-inset-top)) 16px 10px;
    border-bottom: 1px solid var(--line);
}

.order-product-picker-header h2 {
    font-size: 20px;
}

.order-product-picker-close {
    width: 42px;
    height: 42px;
    color: var(--text);
    background: var(--surface-soft);
    font-size: 25px;
}

.order-product-picker-search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.order-product-picker-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 16px max(16px, env(safe-area-inset-bottom));
}

.order-product-picker-row {
    min-height: 72px;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.order-product-picker-row.is-unavailable .order-product-picker-select {
    cursor: not-allowed;
    opacity: 0.56;
}

.order-product-picker-row.is-unavailable .order-product-picker-check {
    display: none;
}

.order-product-picker-thumb {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 10px;
    font-weight: 800;
}

.order-product-picker-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-product-picker-thumb:disabled {
    cursor: default;
    opacity: 1;
}

.order-product-picker-select {
    min-width: 0;
    min-height: 71px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: var(--text);
    background: transparent;
    text-align: start;
}

.order-product-picker-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.order-product-picker-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
}

.order-product-picker-copy span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.order-product-picker-check {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 50%;
    color: transparent;
    font-size: 13px;
    font-weight: 900;
}

.order-product-picker-select[aria-checked="true"] .order-product-picker-check {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}

html[dir="rtl"] .product-picker-chevron {
    transform: scaleX(-1);
}

.order-line-list {
    display: grid;
    gap: 8px;
    max-height: 190px;
    overflow: auto;
    padding-right: 2px;
}

.order-line-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.owner-extra-requests {
    margin: 10px 14px;
    padding: 12px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--surface-soft);
}

.owner-extra-requests h3 {
    font-size: .86rem;
    color: var(--text-strong);
}

.owner-extra-requests > p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: .7rem;
    line-height: 1.4;
}

.owner-extra-request-list {
    display: grid;
    gap: 7px;
    margin-top: 9px;
}

.owner-extra-request-card {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
}

.owner-extra-request-card strong,
.owner-extra-request-card span,
.owner-extra-request-card small {
    display: block;
}

.owner-extra-request-card span,
.owner-extra-request-card small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: .7rem;
}

.owner-extra-request-card b {
    color: var(--primary);
    font-size: .7rem;
    white-space: nowrap;
}

.order-line-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.order-line-main strong,
.order-line-main span {
    overflow-wrap: anywhere;
}

.order-line-main span {
    color: var(--muted);
    font-size: 12px;
}

.supplier-card-avatar {
    color: #8a5b11;
    background: #fff3d6;
}

.remove-line-button {
    background: #64736d;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 8px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    color: #59675f;
    background: #eef2f1;
}

.status-pill.success {
    color: var(--accent-dark);
    background: #d8f5e8;
}

.status-pill.processing {
    color: #075985;
    background: #e0f2fe;
}

.status-pill.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.status-pill.danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.status-pill.muted {
    color: #64736d;
    background: #edf2ef;
}

.empty-state {
    padding: 20px 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.command-modal {
    max-height: calc(100dvh - 32px);
    overflow: auto;
}

.command-detail-list {
    display: grid;
    gap: 8px;
}

.command-detail-row {
    display: grid;
    grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.command-detail-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.command-detail-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.35;
}
.sync-screen {
    padding: 12px 12px 20px;
    background:
        radial-gradient(circle at top right, rgba(31, 177, 126, 0.14), transparent 220px),
        linear-gradient(180deg, #f7fbf8 0%, #f4f8f6 100%);
}

.sync-page-heading {
    min-height: 44px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 12px 12px 6px 6px;
    color: #fff;
    background: linear-gradient(135deg, #05885d, var(--accent));
    box-shadow: 0 7px 18px rgba(0, 133, 91, 0.18);
}

.sync-heading-action {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.96);
    background: rgba(255, 255, 255, 0.12);
}

.sync-heading-action svg {
    width: 20px;
    height: 20px;
}

.sync-heading-copy {
    min-width: 0;
    text-align: center;
}

.sync-heading-copy h2 {
    overflow: hidden;
    color: inherit;
    font-size: 16px;
    font-weight: 950;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-heading-copy span {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    font-weight: 800;
}

.command-filter-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 12px;
}

.command-filter-card {
    min-width: 0;
    min-height: 60px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 5px;
    border: 1px solid #dce8e2;
    border-radius: 10px;
    padding: 8px 6px;
    color: #5f7068;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 3px 12px rgba(25, 61, 51, 0.045);
}

.command-filter-card span {
    max-width: 100%;
    overflow: hidden;
    font-size: 10px;
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-filter-card strong {
    color: var(--text);
    font-size: 19px;
    font-weight: 950;
    line-height: 1;
}

.command-filter-card.active {
    border-color: #bfe3d2;
    color: var(--accent-dark);
    background: linear-gradient(145deg, #ebfaf3, #e1f5ec);
}

.command-filter-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.command-filter-card.attention.active {
    border-color: #ffd8a8;
    color: #a75d00;
    background: linear-gradient(145deg, #fff7e8, #fff0d6);
}

.command-timeline {
    position: relative;
    display: grid;
    gap: 0;
    margin-bottom: 16px;
    padding: 4px 0 8px;
}

.command-day-pill {
    justify-self: end;
    margin: 4px 0 8px;
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--accent-dark);
    background: #dff6eb;
    font-size: 10px;
    font-weight: 900;
}

.command-timeline-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 54px 24px minmax(0, 1fr);
    gap: 0;
    cursor: pointer;
    direction: ltr;
}

.command-timeline-time {
    padding-top: 13px;
    color: #6a7972;
    font-size: 10px;
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
    direction: ltr;
}

.command-timeline-rail {
    position: relative;
    display: grid;
    justify-items: center;
}

.command-timeline-rail::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #cde2d8;
}

.command-timeline-marker {
    z-index: 1;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    margin-top: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 0 0 2px #dff6eb;
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
}

.command-timeline-item.processing .command-timeline-marker {
    background: #0f77b7;
    box-shadow: 0 0 0 2px #dcefff;
}

.command-timeline-item.warning .command-timeline-marker,
.command-timeline-item.danger .command-timeline-marker {
    background: #f59e0b;
    box-shadow: 0 0 0 2px #fff0d6;
}

.command-timeline-card {
    min-width: 0;
    display: grid;
    gap: 6px;
    margin-bottom: 9px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 4px 14px rgba(25, 61, 51, 0.055);
}

.command-timeline-item:hover .command-timeline-card,
.command-timeline-item:focus-visible .command-timeline-card {
    border-color: #b9d8ca;
    box-shadow: 0 7px 20px rgba(25, 61, 51, 0.10);
}

.command-timeline-item:focus-visible {
    outline: none;
}

.command-timeline-item:focus-visible .command-timeline-marker {
    box-shadow: 0 0 0 3px rgba(7, 142, 97, 0.25);
}

.command-timeline-card-header {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
}

.command-timeline-card-header strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 950;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-timeline-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    margin: 0;
    color: #6c7a73;
    font-size: 11px;
    font-weight: 720;
    line-height: 1.45;
}

.command-timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    color: #8a9891;
    font-size: 10px;
    font-weight: 800;
}

.sync-screen .empty-state {
    margin: 8px 0 14px;
    padding: 26px 16px;
    border: 1px dashed #c9d8d1;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    text-align: center;
}

.sync-heading {
    margin-top: 8px;
}

html[dir="rtl"] .sync-page-heading,
html[dir="rtl"] .command-timeline-card {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .command-day-pill {
    justify-self: start;
}

html[dir="rtl"] .command-timeline-item {
    grid-template-columns: 54px 24px minmax(0, 1fr);
}

@media (max-width: 370px) {
    .sync-screen {
        padding-inline: 9px;
    }

    .command-filter-cards {
        gap: 5px;
    }

    .command-filter-card {
        min-height: 56px;
        padding-inline: 4px;
    }

    .command-filter-card span {
        font-size: 9px;
    }

    .command-filter-card strong {
        font-size: 17px;
    }

    .command-timeline-item {
        grid-template-columns: 48px 22px minmax(0, 1fr);
    }
}

.bottom-nav {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 8px 10px 10px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    scrollbar-width: none;
    scroll-snap-type: inline proximity;
    -webkit-overflow-scrolling: touch;
}

.bottom-nav::-webkit-scrollbar {
    display: none;
}

.bottom-nav-item {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 48px;
    display: grid;
    place-items: center;
    padding-inline: 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #687a72;
    background: transparent;
    font-size: 14px;
    font-weight: 900;
    scroll-snap-align: center;
    white-space: nowrap;
}

.bottom-nav-item.active {
    border-color: #101915;
    color: var(--accent);
    background: #fff;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.42);
}

.product-filter-dialog {
    --product-filter-left: 16px;
    --product-filter-top: 160px;
    --product-filter-width: min(398px, calc(100vw - 32px));
    display: block;
    padding: 0;
    background: rgba(15, 23, 42, 0.28);
}

.product-filter-sheet {
    position: fixed;
    top: var(--product-filter-top);
    left: var(--product-filter-left);
    width: var(--product-filter-width);
    max-height: min(460px, calc(100dvh - var(--product-filter-top) - 14px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 12px;
    overflow: hidden;
    padding: 14px 16px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(14, 34, 27, 0.22);
}

.product-filter-sheet-header h2 {
    font-size: 19px;
    font-weight: 900;
}

.product-filter-category-search {
    position: relative;
}

.product-filter-category-search span {
    position: absolute;
    z-index: 1;
    inset-inline-end: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #819088;
    font-size: 21px;
    pointer-events: none;
}

.product-filter-category-search input {
    min-height: 44px;
    border-radius: 13px;
    padding-inline: 14px 40px;
    background: #f8fbf9;
}

.product-filter-options {
    display: grid;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding-inline-end: 2px;
}

.product-filter-option {
    width: 100%;
    min-height: 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid #d9e5df;
    border-radius: 14px;
    color: var(--text);
    background: #fff;
    text-align: start;
}

.product-filter-option.is-selected {
    border-color: #84cda8;
    background: #daf2e1;
}

.product-filter-option-name {
    font-size: 15px;
    font-weight: 850;
}

.product-filter-option-count {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.product-filter-option-check {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 2px solid #a7b8b1;
    border-radius: 50%;
    color: transparent;
    font-size: 13px;
    font-weight: 900;
}

.product-filter-option.is-selected .product-filter-option-check {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}

.product-filter-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.product-filter-actions button {
    min-height: 44px;
    border-radius: 12px;
    padding: 0 16px;
    color: #fff;
    background: var(--accent);
    font-weight: 800;
}

.modal-panel {
    width: min(420px, 100%);
    max-height: calc(100dvh - 32px);
    display: grid;
    gap: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.modal-panel h2 {
    font-size: 20px;
}

.modal-copy {
    color: var(--muted);
    line-height: 1.45;
}

.modal-panel textarea {
    min-height: 92px;
    padding: 10px 12px;
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-actions button {
    min-width: 132px;
}

.image-source-panel {
    width: min(300px, 100%);
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(17, 40, 31, 0.22);
}

.image-source-panel h2 {
    font-size: 18px;
    text-align: center;
}

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

.image-source-actions button {
    min-height: 48px;
    border-radius: 12px;
    padding: 0 12px;
    font-weight: 900;
}

.image-source-actions .primary-button {
    color: #fff;
    background: var(--accent);
}

.image-source-cancel {
    min-height: 38px;
    color: var(--muted);
    background: transparent;
    font-weight: 800;
}

#image-source-dialog {
    z-index: 100;
}

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    place-items: center;
    gap: 12px;
    padding: max(20px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom));
    background: rgba(5, 12, 10, 0.94);
}

.image-viewer img {
    max-width: 100%;
    max-height: calc(100dvh - 174px);
    object-fit: contain;
    border-radius: 8px;
}

.image-viewer-close {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    font-size: 26px;
    line-height: 1;
}

.image-viewer-caption {
    max-width: min(420px, 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.image-viewer-footer {
    width: min(420px, 100%);
    display: grid;
    gap: 10px;
}

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

.image-viewer-actions button {
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    padding: 0 14px;
    color: #fff;
    font-weight: 900;
}

.image-viewer-change {
    background: var(--accent);
}

.image-viewer-delete {
    background: var(--danger);
}

.overview-version {
    margin-inline-start: auto;
}

/* Owner overview dashboard */
.overview-screen { padding-bottom: 26px; background: radial-gradient(circle at 12% 4%, rgba(15,143,99,.08), transparent 26%), #f7faf8; }
.overview-heading,.overview-section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.overview-heading { margin-bottom:12px; }
.overview-heading h2,.overview-section-title h3 { margin:0; color:var(--text); font-size:18px; font-weight:950; }
.overview-heading p { margin:3px 0 0; color:var(--muted); font-size:11px; font-weight:700; }
.overview-live-badge { display:inline-flex; align-items:center; gap:6px; padding:6px 9px; border:1px solid rgba(15,143,99,.18); border-radius:999px; color:var(--accent-dark); background:#fff; font-size:10px; font-weight:900; white-space:nowrap; }
.overview-live-badge i,.overview-sync-dot { width:7px; height:7px; border-radius:50%; background:#22b573; box-shadow:0 0 0 4px rgba(34,181,115,.12); }
.overview-attention { display:grid; grid-template-columns:38px minmax(0,1fr); align-items:center; gap:11px; margin-bottom:12px; padding:12px 14px; border:1px solid rgba(238,145,30,.38); border-radius:14px; color:#714207; background:linear-gradient(135deg,#fff8ec,#fffdf8); }
.overview-attention-icon { width:36px; height:36px; display:grid; place-items:center; border-radius:50%; color:#fff; background:#f29a1f; font-size:20px; font-weight:950; }
.overview-attention strong,.overview-attention p { display:block; margin:0; }
.overview-attention strong { font-size:13px; }
.overview-attention p { margin-top:3px; color:#8a6d45; font-size:10px; line-height:1.5; }
.overview-sales-hero { display:grid; grid-template-columns:minmax(125px,.75fr) minmax(0,1.35fr); align-items:center; gap:14px; padding:17px; border:1px solid rgba(15,143,99,.22); border-radius:18px; background:linear-gradient(145deg,#fff,#f0faf5); box-shadow:0 10px 30px rgba(27,67,52,.08); }
.overview-sales-copy { min-width:0; display:grid; gap:5px; }
.overview-card-eyebrow { color:var(--muted); font-size:11px; font-weight:900; }
.overview-sales-copy>strong { color:#0f2c22; font-size:clamp(25px,7vw,35px); font-weight:950; letter-spacing:-.04em; line-height:1.05; }
.overview-change { width:fit-content; color:#0b8a5d; font-size:11px; font-weight:900; }
.overview-change.negative { color:var(--danger); }
.overview-sales-copy small { color:var(--muted); font-size:9px; }
.overview-chart-wrap { min-width:0; }
.overview-chart { width:100%; height:112px; overflow:visible; }
.overview-chart line { stroke:#dceae3; stroke-width:1; stroke-dasharray:4 5; }
#overview-trend-area { fill:rgba(15,143,99,.11); }
#overview-trend-line { fill:none; stroke:#0f9968; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.overview-chart-labels { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:2px; margin-top:-3px; color:#75867f; font-size:8px; text-align:center; }
.overview-kpi-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-top:11px; }
.overview-kpi-card { position:relative; min-height:116px; display:grid; align-content:start; gap:5px; padding:14px; border:1px solid #dce7e1; border-radius:15px; background:rgba(255,255,255,.92); }
.overview-kpi-card>span:not(.overview-kpi-icon) { max-width:calc(100% - 34px); color:#51665d; font-size:11px; font-weight:850; }
.overview-kpi-card>strong { margin-top:5px; color:#142a22; font-size:22px; font-weight:950; line-height:1.1; }
.overview-kpi-card>small { color:#7a8d84; font-size:9px; }
.overview-kpi-icon { position:absolute; top:12px; inset-inline-end:12px; width:31px; height:31px; display:grid; place-items:center; border-radius:10px; color:var(--accent-dark); background:var(--surface-green); font-size:17px; font-weight:900; }
.overview-kpi-due { border-color:rgba(238,145,30,.28); background:#fffaf2; }
.overview-kpi-due .overview-kpi-icon { color:#b66b0d; background:#fff0d8; }
.overview-section-title { margin:17px 2px 9px; }
.overview-section-title h3 { font-size:14px; }
.overview-highlight-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.overview-highlight-card { min-height:94px; display:grid; grid-template-columns:34px minmax(0,1fr); align-items:start; gap:9px; padding:13px; border:1px solid #dce7e1; border-radius:15px; background:#fff; }
.overview-highlight-icon,.overview-activity-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; color:#b46e12; background:#fff1da; font-size:16px; }
.overview-highlight-card div { min-width:0; display:grid; gap:4px; }
.overview-highlight-card small,.overview-highlight-card span { color:var(--muted); font-size:9px; }
.overview-highlight-card strong { overflow:hidden; color:var(--text); font-size:12px; font-weight:950; text-overflow:ellipsis; white-space:nowrap; }
.overview-activity-card,.overview-notification-card { margin-top:12px; padding:1px 14px 4px; border:1px solid #dce7e1; border-radius:16px; background:#fff; }
.overview-activity-card .overview-section-title,.overview-notification-card .overview-section-title { margin:12px 0 4px; }
.overview-notification-count { color:var(--muted); font-size:10px; font-weight:900; }
.overview-activity-row,.overview-notification-row { display:grid; grid-template-columns:34px minmax(0,1fr); align-items:center; gap:10px; padding:10px 0; border-top:1px solid #edf2ef; }
.overview-activity-row:first-child,.overview-notification-row:first-child { border-top:0; }
.overview-activity-icon { color:var(--accent-dark); background:var(--surface-green); }
.overview-activity-row div,.overview-notification-row div { min-width:0; display:grid; gap:3px; }
.overview-activity-row strong,.overview-notification-row strong { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.overview-activity-row small,.overview-notification-row small { color:var(--muted); font-size:9px; line-height:1.45; }
.overview-notification-marker { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; color:#9b6416; background:#fff1da; font-weight:950; }
.overview-notification-row.severity-3 .overview-notification-marker { color:#a12626; background:#fde8e8; }
.overview-notification-row.severity-2 .overview-notification-marker { color:#a76009; background:#fff0d8; }
.overview-notification-row.is-actionable { cursor:pointer; border-radius:10px; }
.overview-notification-row.is-actionable:hover { background:#f7faf8; }
.overview-notification-row.is-actionable:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.overview-empty { margin:10px 0; color:var(--muted); font-size:10px; text-align:center; }
.overview-sync-strip { display:flex; align-items:center; justify-content:center; gap:8px; margin:13px 0 0; color:#667a71; font-size:9px; font-weight:800; }
.overview-sync-strip time::before { content:'·'; margin-inline-end:8px; }
.overview-screen .overview-version { margin:8px auto 0; }
.overview-support-card { margin-top:10px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 12px; border:1px solid #dce7e1; border-radius:14px; background:#fff; }
.overview-support-card div { min-width:0; display:grid; gap:3px; }
.overview-support-card small { color:var(--muted); font-size:9px; font-weight:900; text-transform:uppercase; }
.overview-support-card strong,.overview-support-card span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.overview-support-card strong { color:var(--text); font-size:11px; font-weight:950; }
.overview-support-card span { color:var(--muted); font-size:10px; }
.overview-support-card button { flex:0 0 auto; min-height:34px; border-radius:8px; padding:0 11px; color:#fff; background:var(--accent); font-size:11px; font-weight:900; }
@media (max-width:360px) { .overview-sales-hero { grid-template-columns:1fr; } .overview-chart { height:94px; } .overview-kpi-card>strong { font-size:19px; } }

.settings-screen {
    background:
        radial-gradient(circle at top right, rgba(31, 177, 126, 0.12), transparent 220px),
        #f5f8f6;
}

.settings-owner-card,
.settings-card {
    border: 1px solid #dce7e1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(20, 42, 34, 0.06);
}

.settings-owner-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.settings-owner-card h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 17px;
    line-height: 1.2;
}

.settings-owner-card p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.settings-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.settings-section-title {
    color: var(--muted);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

.settings-field {
    display: grid;
    gap: 7px;
}

.settings-field > span {
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
}

.settings-field select {
    width: 100%;
    min-height: 40px;
    border-color: #cfeee0;
    background: var(--surface-green);
    color: #10241d;
    font-size: 13px;
    font-weight: 850;
}

.settings-field .current-shop-name {
    min-height: 40px;
}

.settings-support-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settings-support-row div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.settings-support-row strong,
.settings-support-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-support-row strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 950;
}

.settings-support-row span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.settings-support-row button,
.settings-action-button {
    min-height: 38px;
    border-radius: 8px;
    padding: 0 13px;
    font-size: 12px;
    font-weight: 950;
}

.settings-support-row button {
    flex: 0 0 auto;
    color: #fff;
    background: var(--accent);
}

.settings-danger-card {
    gap: 8px;
}

.settings-action-button {
    width: 100%;
    border: 1px solid var(--line);
}

.app-version-badge {
    display: inline-flex;
    width: fit-content;
    margin-top: 14px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.86);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.3;
    pointer-events: none;
}

@media (max-width: 520px) {
    .app-shell {
        padding: 0;
    }

    .auth-view {
        min-height: 100dvh;
        padding: 16px;
    }

    .owner-shell {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .owner-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .bottom-nav {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 360px) {
    .owner-header h1,
    .owner-header p {
        max-width: 160px;
    }

    .metric-card strong {
        font-size: 19px;
    }

    .bottom-nav-item {
        font-size: 13px;
    }
}
.language-select {
    width: auto;
    min-width: 62px;
    min-height: 34px;
    padding: 0 8px;
    border-color: var(--line);
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 900;
}

.brand-row .language-select {
    margin-inline-start: auto;
}

.quantity-order-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px 0;
}

.quantity-line-actions {
    display: grid;
    grid-template-columns: 42px 34px minmax(74px, 1fr) 34px;
    align-items: center;
    gap: 7px;
}

.quantity-remove-button,
.quantity-step-button {
    min-height: 34px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.quantity-remove-button {
    border-color: rgba(207, 63, 85, 0.58);
    color: var(--danger);
    background: #fff7f9;
}

.line-quantity-input {
    min-height: 34px;
    padding: 0 8px;
    text-align: center;
    font-weight: 900;
}

html[dir="rtl"] body {
    direction: rtl;
}
html[dir="rtl"] .page-screen {
    direction: rtl;
}

html[dir="rtl"] .jump-card,
html[dir="rtl"] .modal-panel,
html[dir="rtl"] .panel-search,
html[dir="rtl"] .list-main,
html[dir="rtl"] .section-heading,
html[dir="rtl"] .owner-header {
    text-align: right;
}

html[dir="rtl"] .jump-card {
    flex-direction: row-reverse;
}

html[dir="rtl"] .product-actions,
html[dir="rtl"] .customer-balance,
html[dir="rtl"] .order-row-actions {
    justify-items: start;
}

html[dir="rtl"] .modal-actions {
    justify-content: flex-start;
}

html[dir="rtl"] .line-quantity-input {
    direction: ltr;
}

@media (min-width: 420px) {
    .quantity-order-line {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .quantity-line-actions {
        width: 190px;
    }
}
.dashboard-view {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

.bottom-nav-item span:last-child {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

@supports (height: 100svh) {
    .dashboard-view,
    .owner-shell {
        height: 100svh;
        max-height: 100svh;
    }
}

@media (max-width: 520px) {
    html,
    body,
    .app-shell,
    .dashboard-view {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: hidden;
    }

    .owner-shell {
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .bottom-nav {
        flex-shrink: 0;
    }

    .bottom-nav-item {
        min-height: 46px;
    }
}

@media (max-width: 520px) and (max-height: 720px) {
    .owner-header {
        padding-block-end: 6px;
    }

    .shop-strip {
        padding-bottom: 8px;
    }

    .page-dots {
        height: 24px;
    }

    .bottom-nav {
        padding-top: 6px;
    }
}

/* Recent orders */
.orders-screen {
    padding: 12px 12px 20px;
    background:
        radial-gradient(circle at top right, rgba(54, 188, 137, 0.09), transparent 210px),
        #f5f8f6;
}

.orders-page-heading {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.orders-heading-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.orders-heading-copy > div {
    min-width: 0;
}

.orders-heading-copy h2 {
    color: var(--text);
    font-size: 21px;
    font-weight: 900;
    line-height: 1.15;
}

.orders-heading-copy small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.orders-heading-icon,
.orders-filter-button {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--accent-dark);
    background: linear-gradient(145deg, #e8f8f0, #d9f2e6);
}

.orders-heading-icon svg {
    width: 22px;
    height: 22px;
}

.orders-filter-button {
    border: 1px solid transparent;
    background: transparent;
}

.orders-filter-button:hover,
.orders-filter-button:focus-visible,
.orders-filter-button.has-active-filter {
    border-color: #84cdaa;
    background: #e9f7f1;
}

.orders-filter-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.orders-filter-glyph {
    width: 20px;
    height: 20px;
}

.orders-search-wrap {
    position: relative;
    margin-bottom: 9px;
}

.orders-search-wrap .panel-search {
    min-height: 42px;
    border-color: #dce7e1;
    border-radius: 13px;
    padding-inline: 14px 42px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 3px 12px rgba(27, 68, 51, 0.04);
}

.orders-search-icon {
    position: absolute;
    inset-inline-end: 15px;
    top: 50%;
    transform: translateY(-52%);
    color: #819088;
    font-size: 22px;
    pointer-events: none;
}

.orders-filter-panel {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin-bottom: 10px;
    padding: 1px 1px 5px;
    scrollbar-width: none;
}

.orders-filter-panel::-webkit-scrollbar {
    display: none;
}

.orders-filter-panel button {
    min-height: 32px;
    flex: 0 0 auto;
    border: 1px solid #d9e5df;
    border-radius: 999px;
    padding: 0 12px;
    color: #5f6f68;
    background: #fff;
    font-size: 11px;
    font-weight: 850;
}

.orders-filter-panel button.active {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}

.order-card-list {
    gap: 10px;
}

.order-card {
    min-height: 150px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 116px;
    overflow: hidden;
    border: 1px solid #dbe5e0;
    border-radius: 15px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 5px 17px rgba(25, 61, 51, 0.07);
}

.order-card:hover {
    border-color: #b9d8ca;
    box-shadow: 0 7px 21px rgba(25, 61, 51, 0.10);
}

.order-card-main {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 12px;
    padding: 13px 14px;
}

.order-card-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-card-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--accent);
    background: #edf8f3;
}

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

.order-card-identity-copy {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.order-card-identity-copy > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    line-height: 1.15;
}

.order-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.order-status-badge,
.order-source-badge {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    border-radius: 7px;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.order-status-badge.success {
    color: var(--accent-dark);
    background: #dff6eb;
}

.order-status-badge.processing {
    color: #075985;
    background: #e0f2fe;
}

.order-status-badge.warning {
    color: #91600a;
    background: #fff1d7;
}

.order-status-badge.danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.order-status-badge.muted,
.order-source-badge {
    color: #63716b;
    background: #f0f3f2;
}

.order-card-metadata {
    display: grid;
    gap: 5px;
    padding-inline-start: 4px;
}

.order-card-meta-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #718078;
    font-size: 11px;
    font-weight: 750;
}

.order-card-meta-row > span:last-child,
.order-card-meta-row time {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-card-meta-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    color: #8a9992;
}

.order-card-side {
    min-width: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 13px 10px;
    border-inline-start: 1px solid #edf1ef;
}

.order-card-total {
    display: grid;
    justify-items: center;
    gap: 3px;
    align-self: center;
    direction: ltr;
}

.order-card-total strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--accent-dark);
    font-size: 16px;
    line-height: 1.1;
}

.order-card-total small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
}

.order-card-actions {
    display: grid;
    gap: 7px;
}

.order-card-actions:empty {
    display: none;
}

.order-card-action {
    width: 100%;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #4bae86;
    border-radius: 8px;
    padding: 0 8px;
    color: var(--accent-dark);
    background: #fff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.1;
    white-space: normal;
}

.order-card-action.danger {
    border-color: #ec7b8c;
    color: var(--danger);
}

.order-card-action:hover:not(:disabled),
.order-card-action:focus-visible {
    background: #edf9f4;
}

.order-card-action.danger:hover:not(:disabled),
.order-card-action.danger:focus-visible {
    background: #fff3f5;
}

.order-card-action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

.order-card-action-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.orders-screen .empty-state {
    margin-top: 8px;
    padding: 28px 16px;
    border: 1px dashed #c9d8d1;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    text-align: center;
}

html[dir="rtl"] .orders-page-heading,
html[dir="rtl"] .order-card {
    text-align: right;
}

@media (max-width: 370px) {
    .orders-screen {
        padding-inline: 9px;
    }

    .order-card {
        grid-template-columns: minmax(0, 1fr) 100px;
    }

    .order-card-main {
        padding-inline: 11px;
    }

    .order-card-identity-copy > strong {
        font-size: 15px;
    }

    .order-card-side {
        padding-inline: 7px;
    }
}
