:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --ink: #17202a;
    --muted: #667085;
    --line: #d7dde5;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

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

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: #111827;
    color: #fff;
}

.brand {
    font-weight: 700;
    font-size: 18px;
}

.nav {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 14px;
}

.nav a {
    color: #d1d5db;
}

.nav a:hover {
    color: #fff;
}

.page {
    padding: 24px;
}

.panel,
.sidebar,
.cart-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.auth-shell {
    min-height: calc(100vh - 112px);
    display: grid;
    place-items: center;
}

.login-panel {
    width: min(420px, 100%);
}

h1,
h2 {
    margin: 0 0 16px;
}

h1 {
    font-size: 26px;
}

h2 {
    font-size: 17px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 14px;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
}

.button {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    padding: 10px 14px;
    cursor: pointer;
}

.button.primary {
    border-color: #111;
    background: #111;
    color: #fff;
}

.button.primary:hover {
    background: #000;
}

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

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 16px;
}

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

.product-card {
    min-height: 150px;
    display: grid;
    gap: 8px;
    align-content: start;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    cursor: pointer;
}

.product-card img {
    width: 100%;
    aspect-ratio: 1.6;
    object-fit: cover;
    border-radius: 6px;
    background: #eef2f7;
}

.product-card span {
    min-height: 40px;
}

.cart-items {
    display: grid;
    gap: 8px;
    min-height: 260px;
}

.cart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.totals {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding: 16px 0;
    margin-top: 16px;
    font-size: 18px;
}

.status-box {
    min-height: 42px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    background: #eef2f7;
    color: var(--muted);
    font-size: 13px;
}

.compact-list,
.compact-grid {
    display: grid;
    gap: 8px;
}

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

.text-row,
.mini-card {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    padding: 10px;
    text-align: left;
}

.mini-card {
    display: grid;
    gap: 4px;
}

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

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

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
}

.pill {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 8px;
    margin: 0 4px 4px 0;
    font-size: 12px;
}

.message {
    margin-bottom: 12px;
    border: 1px solid var(--danger);
    color: var(--danger);
    background: #fff;
    border-radius: 6px;
    padding: 10px 12px;
}

@media (max-width: 1100px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        height: auto;
        display: grid;
        gap: 12px;
        padding: 16px;
    }

    .nav {
        flex-wrap: wrap;
    }
}

body.pos-screen {
    overflow: hidden;
    background: #f5f5f5;
}

body.orders-screen {
    overflow: hidden;
    background: #f6f7f9;
}

body.orders-screen .page {
    height: 100vh;
    padding: 0;
}

.orders-shell {
    height: 100vh;
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    background: #f6f7f9;
}

body.pos-screen .page {
    height: 100vh;
    padding: 0;
}

.pos-shell {
    height: 100vh;
    display: grid;
    grid-template-columns: 124px 440px minmax(0, 1fr);
    background: #f5f5f5;
}

.pos-nav {
    min-width: 0;
    background: #0a0a0a;
    color: #fff;
    display: grid;
    grid-auto-rows: max-content;
    align-content: start;
    overflow-y: auto;
}

.store-mark {
    height: 68px;
    display: grid;
    place-items: center;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    color: #0a0a0a;
    font-size: 10px;
}

.store-mark strong {
    font-size: 9px;
    line-height: 1;
}

.store-mark small {
    font-size: 8px;
    line-height: 1;
}

.store-crown {
    width: 30px;
    height: 20px;
    border: 2px solid #0a0a0a;
    border-top: 0;
    border-radius: 50%;
    position: relative;
}

.store-crown::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 8px;
    left: 2px;
    top: -9px;
    border-top: 3px solid #0a0a0a;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
}

.nav-tile {
    min-height: 103px;
    display: grid;
    place-items: center;
    gap: 8px;
    color: #fff;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #252525;
    cursor: pointer;
    font-size: 15px;
}

.nav-tile.active,
.nav-tile:hover {
    background: #1a1a1a;
}

.nav-svg {
    width: 34px;
    height: 34px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sale-panel {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #fff;
    border-right: 1px solid #d9d9d9;
    border-radius: 0;
    overflow: hidden;
}

.sale-top {
    height: 66px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    border-bottom: 1px solid #e6e6e6;
}

.sale-top strong {
    font-size: 22px;
    font-weight: 500;
}

.round-btn,
.clear-cart {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    border: 1px solid #d4d4d4;
    color: #111;
    background: #fff;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
}

.round-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 24px;
    color: #555;
}

.clear-cart {
    color: #111;
    font-size: 36px;
    font-weight: 300;
}

.sale-list {
    overflow-y: auto;
    padding: 12px;
}

.cart-empty {
    color: #777;
    padding: 12px;
}

.cart-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 76px;
    padding: 0 0 12px;
    border-bottom: 1px solid #ededed;
}

.cart-thumb,
.cart-thumb-fallback {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    object-fit: cover;
    background: #e8e8e8;
}

.cart-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: end;
    font-size: 14px;
}

.cart-remove {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid #111;
    border-radius: 50%;
    background: #fff;
    color: #111;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.cart-remove:hover {
    background: #111;
    color: #fff;
}

.qty-pill {
    width: 54px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: #fafafa;
}

.cart-line-price {
    min-width: 72px;
    text-align: right;
    font-weight: 700;
}

.sale-bottom {
    margin: 0 18px 20px;
    border: 1px solid #dfdfdf;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
    overflow: visible;
}

.sale-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 18px 8px;
    font-size: 15px;
}

.sale-total-line small {
    color: #17213a;
    margin-left: 8px;
}

.sale-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 12px 14px;
}

.sale-tools button,
.customer-strip button,
.hold-btn,
.pay-btn {
    border: 1px solid #111;
    border-radius: 5px;
    background: #fff;
    color: #03142e;
    min-height: 30px;
    cursor: pointer;
}

.customer-strip {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 0 10px;
    padding: 8px 8px 8px 20px;
    border: 1px solid #111;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-size: 13px;
}

.customer-strip input {
    height: 38px;
    border: 0;
    background: transparent;
    color: #111;
    padding: 0;
}

.customer-strip input::placeholder {
    color: #555;
}

.customer-strip button {
    min-width: 72px;
    border-radius: 8px;
    font-size: 19px;
    font-weight: 700;
}

.customer-results {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 80;
    display: grid;
    gap: 4px;
    max-height: 230px;
    overflow-y: auto;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    padding: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}

.customer-results[hidden] {
    display: none;
}

.customer-result {
    display: grid;
    gap: 2px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #fff;
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
}

.customer-result:hover {
    background: #f2f2f2;
}

.customer-result small {
    color: #666;
}

.muted-result {
    color: #777;
    cursor: default;
}

.pay-row {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr) 142px;
    gap: 18px;
    align-items: center;
    padding: 8px 10px 14px;
    background: #fff;
    border-top: 1px solid #e6e6e6;
}

.hold-btn,
.pay-btn {
    height: 56px;
    border: 1px solid #111;
    border-radius: 10px;
    font-size: 18px;
}

.pay-row strong {
    min-width: 0;
    height: 56px;
    display: grid;
    place-items: center start;
    color: #111;
    background: #f4f4f4;
    border-radius: 10px;
    padding-left: 18px;
    font-size: 24px;
}

.pay-btn {
    background: #111;
    color: #fff;
}

.category-chip:hover,
.sale-tools button:hover,
.customer-strip button:hover,
.hold-btn:hover {
    background: #f1f1f1;
}

.pay-btn:hover,
.icon-button:hover {
    background: #000;
}

.checkout-note,
.drawer-note {
    min-height: 0;
    padding: 0 12px;
    font-size: 12px;
    color: #555;
    background: #fff;
}

.drawer-note {
    padding-bottom: 10px;
}

.catalog-panel {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
}

.catalog-header {
    height: 68px;
    display: grid;
    grid-template-columns: 190px minmax(420px, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 10px 18px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
}

.time-box {
    color: #666;
    text-align: right;
    font-size: 14px;
}

.time-box small {
    display: block;
    font-size: 11px;
}

.search-pill {
    height: 54px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 102px;
    align-items: center;
    border: 1px solid #d7d7d7;
    border-radius: 12px;
    background: #fff;
    padding: 5px;
}

.search-pill input {
    height: 44px;
    border: 0;
    background: transparent;
    padding-left: 18px;
    font-size: 16px;
}

.search-pill button {
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: #111;
    color: #fff;
    cursor: pointer;
}

.scan-mark {
    width: 24px;
    height: 24px;
    display: inline-block;
    border: 2px solid #fff;
    border-radius: 5px;
    position: relative;
}

.scan-mark::before {
    content: "";
    position: absolute;
    left: 3px;
    right: 3px;
    top: 10px;
    border-top: 2px solid #fff;
}

.search-mode {
    text-align: center;
    color: #111;
}

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

.header-actions select {
    max-width: 130px;
    height: 36px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #fff;
}

.icon-button,
.avatar-button {
    min-width: 38px;
    width: auto;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: #111;
    color: #fff;
    font-weight: 700;
    padding: 0 10px;
    font-size: 12px;
}

.avatar-button {
    border: 1px solid #111;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 36%, #fff 0 9px, transparent 10px),
        radial-gradient(circle at 50% 82%, #fff 0 15px, transparent 16px),
        #f5f5f5;
}

.category-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 10px;
    overflow-x: auto;
    padding: 12px 18px;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}

.category-chip {
    height: 74px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 22px minmax(34px, auto);
    place-items: center;
    gap: 4px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
    color: #111a33;
    padding: 7px 18px;
    white-space: normal;
    min-width: 92px;
    max-width: 180px;
}

.category-chip span:nth-child(2) {
    width: 100%;
    overflow: hidden;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.category-chip.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.category-chip.active .star {
    background: #fff;
}

.star {
    width: 18px;
    height: 18px;
    display: inline-block;
    clip-path: polygon(50% 0, 62% 34%, 98% 35%, 69% 56%, 79% 91%, 50% 70%, 21% 91%, 31% 56%, 2% 35%, 38% 34%);
    background: #111827;
}

.tiny-grid {
    display: none;
    width: 20px;
    height: 20px;
    display: inline-block;
    background:
        linear-gradient(#111 0 0) left top / 7px 7px no-repeat,
        linear-gradient(#111 0 0) right top / 7px 7px no-repeat,
        linear-gradient(#111 0 0) left bottom / 7px 7px no-repeat,
        linear-gradient(#111 0 0) right bottom / 7px 7px no-repeat;
}

.pos-product-grid {
    overflow-y: auto;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    padding: 18px;
    background: #f5f5f5;
}

.pos-product-card {
    min-height: 238px;
    padding: 0;
    gap: 0;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
    overflow: hidden;
    position: relative;
    transition: transform .12s ease, border-color .12s ease;
}

.pos-product-card:hover {
    transform: translateY(-1px);
    border-color: #111;
}

.pos-product-card img,
.product-placeholder {
    width: 100%;
    height: 154px;
    border-radius: 0;
    aspect-ratio: auto;
    object-fit: cover;
    background: #e8e8e8;
}

.stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    min-width: 34px;
    max-width: 96px;
    min-height: 24px;
    display: grid;
    place-items: center;
    padding: 3px 8px;
    border: 1px solid #111;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-name {
    min-height: 34px;
    padding: 14px 16px 0;
    color: #555;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.product-price {
    padding: 8px 16px 16px;
    color: #111;
    font-size: 16px;
}

.variant-modal[hidden],
.discount-modal[hidden],
.fee-modal[hidden],
.customer-modal[hidden],
.receipt-modal[hidden],
.category-modal[hidden] {
    display: none;
}

.variant-modal,
.discount-modal,
.fee-modal,
.customer-modal,
.receipt-modal,
.category-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
}

.variant-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .48);
}

.variant-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 32px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-radius: 14px;
    border: 1px solid #d8d8d8;
    background: #fff;
    overflow: hidden;
}

.receipt-dialog {
    position: relative;
    z-index: 1;
    width: min(420px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 32px));
    border-radius: 14px;
    border: 1px solid #d8d8d8;
    background: #fff;
    overflow: hidden;
}

.receipt-print-area {
    display: grid;
    gap: 12px;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    padding: 18px;
    color: #111;
}

.receipt-store {
    white-space: pre-line;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
}

.receipt-logo {
    justify-self: center;
    max-width: 96px;
    max-height: 96px;
    object-fit: contain;
}

.receipt-meta {
    display: grid;
    gap: 4px;
    border-top: 1px dashed #999;
    border-bottom: 1px dashed #999;
    padding: 10px 0;
    color: #444;
    font-size: 13px;
}

.receipt-lines {
    display: grid;
    gap: 10px;
}

.receipt-line,
.receipt-total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.receipt-line span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.receipt-line small {
    color: #666;
}

.receipt-total {
    border-top: 1px solid #111;
    padding-top: 12px;
    font-size: 18px;
}

.receipt-thanks {
    white-space: pre-line;
    text-align: center;
    color: #555;
    font-size: 13px;
}

.receipt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #ededed;
    padding: 14px;
}

.discount-dialog {
    position: relative;
    z-index: 1;
    width: min(420px, calc(100vw - 32px));
    border-radius: 14px;
    border: 1px solid #d8d8d8;
    background: #fff;
    overflow: hidden;
}

.discount-form {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.discount-form label {
    margin: 0;
    color: #111;
}

.discount-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-error {
    min-height: 18px;
    color: #b42318;
    font-size: 13px;
}

.orders-page {
    margin: 0;
    min-height: 100vh;
    background: #f6f7f9;
    min-width: 0;
    overflow: hidden;
}

.orders-title {
    height: 68px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 0 22px;
    background: #fff;
    border-bottom: 1px solid #dcdcdc;
}

.orders-title h1 {
    margin: 0;
    text-align: center;
    font-size: 20px;
}

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

.dashboard-content {
    height: calc(100vh - 68px);
    overflow-y: auto;
    padding: 18px;
    display: grid;
    gap: 18px;
}

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

.summary-card {
    display: grid;
    gap: 10px;
    min-height: 116px;
    align-content: center;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    padding: 18px;
}

.summary-card span {
    color: #666;
    font-size: 14px;
}

.summary-card strong {
    color: #111;
    font-size: 30px;
    line-height: 1;
}

.dashboard-table-section {
    min-width: 0;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    padding: 16px;
}

.dashboard-table-wrap {
    height: calc(100vh - 324px);
    border: 1px solid #e5e5e5;
}

.dashboard-table {
    min-width: 980px;
}

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

.orders-tabs,
.orders-filter {
    margin: 18px 0;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 6px;
}

.orders-pull-status {
    margin: -8px 18px 18px;
    border: 1px solid #d7d7d7;
    border-radius: 6px;
    background: #fff;
    padding: 10px 12px;
    color: #333;
    font-size: 13px;
}

.order-tab,
.order-refund {
    border: 1px solid #111;
    border-radius: 5px;
    padding: 8px 12px;
    color: #111;
    background: #fff;
}

.order-tab.active {
    background: #111;
    color: #fff;
}

.order-refund {
    margin-left: auto;
    border-color: #111;
    color: #111;
}

.order-tab:hover,
.order-refund:hover {
    background: #f1f1f1;
}

.order-tab.active:hover {
    background: #000;
}

.orders-filter label {
    display: grid;
    grid-template-columns: 110px minmax(220px, 1fr);
    align-items: center;
    margin: 0;
    border: 1px solid #d7d7d7;
    border-radius: 5px;
    overflow: hidden;
    color: #111;
}

.category-toolbar {
    margin: 18px 0;
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto auto;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 6px;
}

.add-category-button {
    justify-self: end;
}

.category-table td,
.category-table th {
    vertical-align: middle;
}

.product-filter {
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr) auto auto auto;
}

.add-product-button {
    justify-self: end;
}

.product-table td,
.product-table th {
    vertical-align: middle;
}

.product-title-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.product-title-cell img {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.product-title-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.publish-status {
    color: #037847;
    font-weight: 700;
}

.product-feature {
    background: #fff;
    color: #111;
}

.product-modal[hidden] {
    display: none;
}

.product-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
}

.product-dialog {
    position: relative;
    z-index: 1;
    width: min(980px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid #d8d8d8;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.product-edit-form {
    display: grid;
    gap: 14px;
    overflow-y: auto;
    padding: 18px;
}

.product-edit-form label {
    margin: 0;
    color: #111;
}

.product-edit-form textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
}

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

.product-category-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
}

.product-category-picker legend {
    padding: 0 6px;
    color: #555;
}

.settings-page {
    min-width: 0;
    height: 100vh;
    overflow: hidden;
    background: #f6f7f9;
}

.settings-scroll {
    height: calc(100vh - 68px);
    overflow-y: auto;
    padding: 18px;
    display: grid;
    gap: 18px;
}

.settings-section {
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    padding: 16px;
}

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

.settings-section-head h2 {
    margin: 0;
}

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

.settings-card {
    display: grid;
    gap: 8px;
    min-height: 110px;
    align-content: center;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    padding: 18px;
}

.settings-sync-card {
    text-align: left;
}

.settings-sync-card .button {
    width: max-content;
    margin-top: 6px;
}

.settings-card:hover {
    border-color: #111;
}

.settings-card strong {
    font-size: 18px;
}

.settings-card span {
    color: #666;
}

.sync-panel {
    display: grid;
    gap: 18px;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    padding: 22px;
}

.sync-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.sync-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.sync-head p {
    margin: 0;
    color: #666;
}

#syncPercent {
    font-size: 30px;
    line-height: 1;
}

.sync-track {
    height: 18px;
    overflow: hidden;
    border: 1px solid #111;
    border-radius: 999px;
    background: #f4f4f4;
}

.sync-fill {
    height: 100%;
    width: 0;
    background: #111;
    transition: width 260ms ease;
}

.sync-counts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.sync-counts span {
    display: grid;
    gap: 4px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 12px;
    color: #666;
}

.sync-counts strong {
    color: #111;
    font-size: 20px;
}

.sync-output {
    min-height: 150px;
    max-height: 280px;
    overflow: auto;
    margin: 0;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: #f8f8f8;
    padding: 14px;
    white-space: pre-wrap;
}

.settings-help {
    margin: 6px 0 0;
    color: #555;
    font-size: 14px;
}

.settings-modal[hidden] {
    display: none;
}

.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
}

.settings-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.settings-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.settings-dialog-body {
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    padding: 18px;
}

.crud-form {
    display: grid;
    gap: 12px;
}

.crud-form p {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: 0;
}

.crud-form label {
    margin: 0;
    color: #111;
}

.crud-form input,
.crud-form select,
.crud-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 11px;
    font: inherit;
}

.crud-form input[type="checkbox"] {
    width: auto;
    justify-self: start;
}

.crud-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 8px;
}

.settings-table-wrap {
    height: auto;
    max-height: 520px;
}

.settings-section h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.settings-section .settings-section-head h2 {
    margin: 0;
}

.settings-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #eeeeee;
}

.settings-row:first-of-type {
    border-top: 0;
}

.wide-settings-row {
    grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
}

.settings-row textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
}

.settings-row input[disabled] {
    background: #f6f6f6;
    color: #666;
}

@media (max-width: 1200px) {
    .settings-row,
    .wide-settings-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.category-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.eye-dot {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 24px;
    border: 1px solid #111;
    border-radius: 999px;
    color: transparent;
    position: relative;
}

.eye-dot::before {
    content: "";
    width: 16px;
    height: 10px;
    border: 2px solid #111;
    border-radius: 50%;
}

.eye-dot::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #111;
}

.action-square {
    min-width: 46px;
    height: 34px;
    border: 1px solid #111;
    border-radius: 6px;
    background: #111;
    color: #fff;
    cursor: pointer;
    margin-right: 6px;
}

.danger-square {
    background: #fff;
    color: #111;
}

.action-square:hover,
.danger-square:hover {
    background: #000;
    color: #fff;
}

.orders-filter label span {
    height: 34px;
    display: grid;
    place-items: center start;
    padding-left: 10px;
    background: #fafafa;
    border-right: 1px solid #d7d7d7;
}

.orders-filter select,
.orders-filter input {
    height: 34px;
    border: 0;
    min-width: 0;
}

.orders-table-wrap {
    height: calc(100vh - 262px);
    overflow: auto;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
}

.orders-table {
    min-width: 1180px;
}

.orders-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f9fafb;
    color: #111;
    text-transform: uppercase;
}

.orders-table td,
.orders-table th {
    white-space: nowrap;
}

.orders-table small {
    color: #666;
}

.details-button {
    display: inline-grid;
    place-items: center;
    min-width: 100px;
    height: 34px;
    border: 0;
    border-radius: 5px;
    background: #111;
    color: #fff;
    cursor: pointer;
}

.details-button:hover {
    background: #000;
}

.orders-footer {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: #fff;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination a,
.pagination strong {
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f2f2f2;
}

.pagination strong {
    background: #111;
    color: #fff;
}

.order-modal[hidden] {
    display: none;
}

.order-modal,
.refund-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
}

.refund-modal[hidden] {
    display: none;
}

.order-dialog {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid #d8d8d8;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.order-detail-body {
    overflow-y: auto;
    padding: 18px;
}

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

.order-action-bar {
    position: sticky;
    top: -18px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -18px -18px 16px;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e2e2;
    background: #fff;
}

.danger-button {
    border-color: #111;
    color: #111;
}

.danger-button:hover {
    background: #111;
    color: #fff;
}

#orderActionStatus {
    margin-left: auto;
    color: #555;
    font-size: 13px;
}

.order-edit-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px;
}

.order-edit-form label {
    margin: 0;
    color: #111;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-row input {
    width: auto;
}

.refund-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, calc(100vw - 32px));
    border: 1px solid #d8d8d8;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.refund-popup-form {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.refund-popup-form label {
    margin: 0;
    color: #111;
}

.refund-popup-form textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
}

.refund-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    background: #fafafa;
}

.refund-summary span {
    color: #666;
}

.refund-options {
    display: grid;
    gap: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
}

.refund-options legend {
    padding: 0 6px;
    color: #555;
}

.refund-warning {
    border-left: 3px solid #111;
    background: #f6f6f6;
    padding: 10px 12px;
    color: #333;
    font-size: 13px;
    line-height: 1.35;
}

.order-detail-grid section,
.order-lines {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    padding: 14px;
}

.order-detail-grid h3,
.order-lines h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.order-detail-grid dl {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 6px 10px;
    margin: 0;
}

.order-detail-grid dt {
    color: #666;
}

.order-detail-grid dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.address-block,
.meta-list {
    display: grid;
    gap: 4px;
    color: #333;
    overflow-wrap: anywhere;
}

.order-lines {
    margin-top: 14px;
}

.order-lines table {
    width: 100%;
}

.order-lines pre {
    max-height: 240px;
    overflow: auto;
    margin: 0;
    border-radius: 8px;
    background: #f7f7f7;
    padding: 12px;
    white-space: pre-wrap;
}

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

.variant-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #ededed;
}

.variant-head h2 {
    margin: 0;
    font-size: 18px;
}

.variant-close {
    width: 34px;
    height: 34px;
    border: 1px solid #111;
    border-radius: 8px;
    background: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.variant-list {
    display: grid;
    gap: 8px;
    padding: 14px;
    overflow-y: auto;
}

.variant-option {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    cursor: pointer;
    text-align: left;
}

.variant-option:hover {
    border-color: #111;
}

.variant-option img,
.variant-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: #e8e8e8;
}

.variant-option span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.variant-option strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.variant-option small {
    color: #666;
}

@media (max-width: 1280px) {
    .pos-shell {
        grid-template-columns: 94px 390px minmax(0, 1fr);
    }

    .orders-shell {
        grid-template-columns: 94px minmax(0, 1fr);
    }

    .nav-tile {
        min-height: 86px;
        font-size: 13px;
    }

    .catalog-header {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
    }

    .time-box {
        display: none;
    }
}

@media (max-width: 900px) {
    body.pos-screen,
    body.orders-screen {
        overflow: auto;
    }

    body.pos-screen .page,
    body.orders-screen .page,
    .pos-shell,
    .orders-shell {
        height: auto;
    }

    .pos-shell,
    .orders-shell {
        grid-template-columns: 1fr;
    }

    .pos-nav {
        grid-auto-flow: column;
        overflow-x: auto;
    }

    .nav-tile {
        min-width: 92px;
    }

    .sale-panel {
        border-radius: 0;
    }
}
