:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --ink: #17202a;
    --muted: #6f7b8a;
    --line: #dfe6ef;
    --brand: #f28a00;
    --brand-dark: #d97600;
    --accent: #16c8d4;
    --deep: #132523;
    --danger: #d84a4a;
    --shadow: none;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

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

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

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background: var(--bg);
}

.login-panel {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 24px;
    align-items: stretch;
}

.login-copy,
.login-card,
.content-section,
.form-section,
.delete-panel,
.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-copy {
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-copy h1,
.login-card h2,
.topbar h1,
.section-head h2,
.delete-panel h2 {
    margin: 0;
    letter-spacing: 0;
}

.login-copy h1 {
    max-width: 460px;
    font-size: 40px;
    line-height: 1.08;
}

.login-copy p:not(.eyebrow) {
    max-width: 420px;
    color: var(--muted);
    line-height: 1.7;
}

.login-card {
    padding: 34px;
}

.login-card label,
.field label {
    display: block;
    margin: 18px 0 8px;
    color: #334155;
    font-weight: 700;
    font-size: 14px;
}

.login-card input,
.form-control {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cfd9e6;
    border-radius: 8px;
    padding: 0 14px;
    color: var(--ink);
    background: #fbfdff;
    font-size: 15px;
}

input[type="file"].form-control {
    padding: 10px 12px;
    background: #ffffff;
}

textarea.form-control {
    min-height: 110px;
    padding-top: 12px;
    resize: vertical;
}

.login-card input:focus,
.form-control:focus {
    outline: 2px solid rgba(31, 138, 112, 0.2);
    border-color: var(--brand);
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--brand);
    color: white;
    font-weight: 800;
}

.brand-mark.large {
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
    font-size: 28px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.primary-button,
.ghost-button,
.text-button,
.danger-button,
.danger-submit {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 0;
    padding: 0 16px;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
}

.primary-button {
    background: var(--brand);
    color: white;
}

.primary-button:hover {
    background: var(--brand-dark);
}

.primary-button.full {
    width: 100%;
    margin-top: 22px;
}

.ghost-button {
    background: #eef3f8;
    color: #243447;
}

.text-button {
    background: #fff5e8;
    color: var(--brand-dark);
}

.danger-button,
.danger-submit {
    background: #fdecec;
    color: var(--danger);
}

.danger-submit {
    border: 0;
}

.mini-danger {
    min-height: 32px;
    border: 0;
    border-radius: 8px;
    padding: 0 10px;
    background: #fdecec;
    color: var(--danger);
    font-weight: 800;
    cursor: pointer;
}

.form-error,
.errorlist {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fdecec;
    color: var(--danger);
    list-style: none;
    font-size: 14px;
}

.app-shell {
    min-height: 100vh;
    width: 100vw;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    margin: 0;
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
}

.sidebar {
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 28px 18px;
    background: var(--deep);
    color: white;
    overflow-y: auto;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 10px;
}

.brand small {
    display: block;
    margin-top: 2px;
    color: #a7b3c5;
}

.nav {
    display: grid;
    gap: 8px;
    margin-top: 34px;
}

.nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #cbd5e1;
    font-weight: 700;
}

.nav-link svg,
.logout-form svg,
.primary-button svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    stroke-width: 2;
}

.nav-link.active,
.nav-link:hover {
    background: var(--brand);
    color: white;
}

.logout-form {
    margin-top: auto;
}

.logout-form .ghost-button {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.main {
    min-width: 0;
    padding: 0 32px 32px;
    background: var(--bg);
}

.app-topline {
    min-height: 70px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.global-search {
    width: min(260px, 100%);
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: 8px;
    background: #ececeb;
    color: #7a8390;
}

.global-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
}

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

.round-icon,
.profile-dot {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #ececeb;
    color: #687383;
    font-weight: 800;
}

.profile-dot {
    background: var(--deep);
    color: white;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding-top: 32px;
    margin-bottom: 18px;
}

.topbar h1 {
    font-size: 30px;
}

.user-chip {
    min-width: 170px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    text-align: right;
    display: none;
}

.user-chip span,
.user-chip strong {
    display: block;
}

.user-chip strong {
    margin-top: 2px;
    color: var(--brand);
    font-size: 13px;
}

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.message {
    padding: 12px 14px;
    border-radius: 8px;
    background: #e9f7f2;
    color: var(--brand-dark);
    border: 1px solid #cceade;
}

.message.error {
    background: #fdecec;
    color: var(--danger);
    border-color: #facaca;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.metric-card {
    min-height: 104px;
    padding: 18px;
    position: static;
    overflow: visible;
    box-shadow: none;
}

.metric-card span {
    color: var(--muted);
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    font-size: 28px;
}

.metric-card small,
.hero-stat small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
}

.content-section,
.form-section,
.delete-panel {
    padding: 24px;
    border-radius: 8px;
}

.form-section.wide {
    box-shadow: none;
    background: transparent;
    border: 0;
    padding: 0;
}

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

.product-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.hero-stat {
    min-height: 104px;
    padding: 18px;
    position: static;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: none;
}

.hero-stat span {
    color: var(--ink);
    font-weight: 800;
}

.hero-stat strong {
    display: block;
    margin-top: 12px;
    font-size: 26px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
    padding: 0;
    border: 0;
    background: transparent;
}

.product-toolbar {
    grid-template-columns: minmax(240px, 1fr) 190px 170px auto auto;
}

.search-box,
.select-box {
    display: grid;
    gap: 6px;
}

.search-box span,
.select-box span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.search-box input,
.select-box select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #111827;
    border-radius: 8px;
    padding: 0 12px;
    background: #ffffff;
    color: var(--ink);
    font-size: 14px;
}

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

.product-card {
    padding: 10px;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: white;
    box-shadow: none;
}

.product-image-link {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1.13 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #e9f6f7;
    color: var(--muted);
    font-weight: 800;
}

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

.product-card-body,
.product-card-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 10px 2px 0;
}

.product-card-body strong {
    display: block;
    font-size: 15px;
}

.product-card-body small,
.product-card-foot {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.more-button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: #fff7ed;
    color: var(--brand);
    font-size: 20px;
    line-height: 1;
}

.mini-toggle {
    min-height: 26px;
    border: 0;
    border-radius: 999px;
    padding: 0 10px;
    background: #edf1f4;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.mini-toggle.on {
    background: #e9f7f2;
    color: #1b9a76;
}

.card-actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
}

.card-actions a {
    flex: 1;
}

.table-card .card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-card .card-actions .primary-button {
    grid-column: 1 / -1;
}

.empty-panel {
    grid-column: 1 / -1;
    padding: 24px;
    border-radius: 8px;
    background: white;
    color: var(--muted);
    text-align: center;
}

.table-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.table-card,
.table-preview-card {
    padding: 18px;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: white;
    box-shadow: none;
}

.table-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.table-badge {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--deep);
    color: white;
    font-weight: 900;
}

.table-card h3,
.table-preview-card h3 {
    margin: 16px 0 8px;
    font-size: 22px;
}

.table-card p,
.table-preview-card p {
    color: var(--muted);
    line-height: 1.5;
}

.qr-mini-panel {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.qr-mini-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.qr-mini-head span,
.table-detail-info small,
.public-order-meta small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.qr-mini-head strong {
    color: var(--deep);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.qr-mini-code {
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 8px;
    background: white;
}

.qr-mini-code img,
.qr-display-card img {
    width: 100%;
    display: block;
}

.qr-mini-code img {
    max-width: 150px;
}

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

.qr-actions.stacked {
    grid-template-columns: 1fr;
}

.qr-actions a,
.qr-actions button {
    gap: 8px;
    min-width: 0;
    padding-inline: 10px;
}

.qr-actions svg,
.text-button svg,
.ghost-button svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}

.table-form-qr {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.table-form-qr p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.qr-display-card {
    display: grid;
    place-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.qr-display-card img {
    max-width: 210px;
}

.qr-display-card.large {
    padding: 20px;
}

.qr-display-card.large img {
    max-width: 320px;
}

.table-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-meta span {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    background: #fff5e8;
    color: var(--brand-dark);
    font-weight: 800;
    font-size: 12px;
}

.table-status-available {
    background: #e9f7f2;
    color: #1b9a76;
}

.table-status-busy {
    background: #fdecec;
    color: var(--danger);
}

.table-status-reserved {
    background: #fff5e8;
    color: var(--brand-dark);
}

.table-status-disabled {
    background: #f1f5f9;
    color: var(--muted);
}

.table-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 20px;
    align-items: start;
}

.table-detail-main,
.qr-detail-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.table-detail-main {
    padding: 24px;
}

.table-detail-hero {
    display: flex;
    gap: 18px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.table-detail-hero .table-badge {
    width: 86px;
    height: 86px;
    flex: 0 0 86px;
    font-size: 34px;
}

.table-detail-hero h2 {
    margin: 4px 0 12px;
    font-size: 34px;
}

.table-detail-info {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.table-detail-info > div {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 8px;
    background: #f7f9fb;
}

.table-detail-info strong,
.table-detail-info a {
    color: var(--deep);
    font-weight: 900;
    overflow-wrap: anywhere;
}

.table-detail-actions {
    display: flex;
    flex-wrap: wrap;
}

.qr-detail-card {
    position: sticky;
    top: 20px;
    padding: 22px;
}

.qr-detail-card h2 {
    margin: 4px 0 16px;
    font-size: 30px;
}

.qr-detail-card > p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.6;
}

.order-status-open {
    background: #fff5e8;
    color: var(--brand-dark);
}

.order-status-closed {
    background: #e9f7f2;
    color: #1b9a76;
}

.order-status-cancelled {
    background: #fdecec;
    color: var(--danger);
}

.table-preview-card {
    text-align: center;
}

.table-preview-card .table-badge {
    margin: 0 auto;
    width: 72px;
    height: 72px;
    font-size: 24px;
}

.order-items {
    display: grid;
    gap: 12px;
}

.order-item-row {
    display: grid;
    grid-template-columns: 64px minmax(200px, 1fr) minmax(140px, auto) 110px auto;
    gap: 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfbfa;
}

.order-item-media,
.order-item-thumb,
.order-item-placeholder {
    width: 64px;
    height: 64px;
}

.order-item-thumb {
    display: block;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #eef3f8;
}

.order-item-placeholder {
    place-items: center;
    border-radius: 8px;
    background: #eef3f8;
    color: var(--muted);
    padding: 4px;
    text-align: center;
    font-size: 10px;
    font-weight: 800;
}

.order-item-placeholder:not([hidden]) {
    display: grid;
}

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

.receipt-product img,
.receipt-product .order-item-placeholder {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

.item-price-summary {
    min-height: 46px;
    display: grid;
    align-content: center;
    gap: 3px;
}

.item-price-summary small,
.item-price-summary span {
    color: var(--muted);
    font-size: 12px;
}

.item-price-summary strong {
    font-size: 14px;
}

.payment-method-field[hidden] {
    display: none;
}

.add-item-button {
    margin-top: 14px;
    border: 1px dashed #111827;
    background: #ffffff;
}

.order-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.order-card {
    padding: 18px;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: white;
    box-shadow: none;
}

.order-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.order-code-label {
    display: block;
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.order-code {
    display: block;
    margin-top: 4px;
    color: var(--deep);
    font-size: 34px;
    font-weight: 950;
    line-height: 1;
}

.order-card h3 {
    margin: 16px 0 10px;
    font-size: 21px;
}

.order-total {
    margin-top: 16px;
    padding: 14px;
    border-radius: 8px;
    background: #f7f7f6;
}

.order-total small,
.order-total strong {
    display: block;
}

.payment-badge {
    width: fit-content;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    border-radius: 999px;
    padding: 0 10px;
    background: #e9f7f2;
    color: #167a60;
    font-size: 12px;
    font-weight: 900;
}

.payment-badge.unpaid,
.payment-method-mark.unpaid {
    background: #f1f5f9;
    color: var(--muted);
}

.payment-click {
    background: #e8f4ff;
    color: #136aa8;
}

.payment-card {
    background: #f0edff;
    color: #6546b8;
}

.payment-cash {
    background: #e9f7f2;
    color: #167a60;
}

.order-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 20px;
    align-items: start;
}

.receipt-panel,
.payment-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.receipt-panel {
    padding: 24px;
}

.receipt-head,
.receipt-customer,
.receipt-row,
.receipt-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.receipt-head h2 {
    margin: 4px 0;
    font-size: 28px;
}

.receipt-head > div > span,
.receipt-customer small,
.receipt-labels,
.payment-info dt {
    color: var(--muted);
    font-size: 12px;
}

.receipt-customer {
    margin: 22px 0;
    padding: 16px 0;
    border-block: 1px solid var(--line);
}

.receipt-customer > div {
    display: grid;
    gap: 5px;
}

.receipt-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 150px 60px 160px;
    min-height: 50px;
    border-bottom: 1px solid var(--line);
}

.receipt-row > :last-child {
    text-align: right;
}

.receipt-total {
    padding-top: 22px;
    font-weight: 900;
}

.receipt-total strong {
    font-size: 26px;
}

.receipt-note {
    margin: 20px 0 0;
    padding: 14px;
    border-radius: 8px;
    background: #f7f7f6;
    color: var(--muted);
}

.payment-panel {
    position: sticky;
    top: 20px;
    padding: 22px;
}

.payment-method-mark {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    padding: 0 12px;
    font-weight: 900;
}

.payment-panel h2 {
    margin: 18px 0;
    font-size: 30px;
}

.payment-panel > p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.5;
}

.payment-info {
    display: grid;
    gap: 14px;
    margin: 0;
}

.payment-info div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.payment-info dd {
    margin: 0;
    font-weight: 800;
    text-align: right;
}

.detail-actions {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.detail-actions a {
    justify-content: center;
}

.payment-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 20px;
    align-items: start;
}

.payment-order-summary,
.payment-method-form {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.payment-order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.payment-order-meta span {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    background: #eef3f8;
    color: #435466;
    font-size: 12px;
    font-weight: 800;
}

.payment-item-list {
    border-top: 1px solid var(--line);
}

.payment-item-list > div {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}

.payment-item-list span {
    color: var(--muted);
}

.payment-item-list span strong {
    color: var(--deep);
}

.payment-grand-total {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding-top: 24px;
}

.payment-grand-total span {
    color: var(--muted);
    font-weight: 800;
}

.payment-grand-total strong {
    font-size: 30px;
}

.payment-method-form h2 {
    margin: 4px 0 20px;
    font-size: 24px;
}

.payment-amount-field {
    margin-bottom: 12px;
}

.payment-amount-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 800;
}

.payment-amount-field input {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    font: inherit;
    font-size: 20px;
    font-weight: 900;
}

.payment-difference-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px;
    border-radius: 8px;
    background: #f7f7f6;
    color: var(--muted);
    font-size: 12px;
}

.payment-difference-row strong {
    display: block;
    margin-top: 4px;
    color: var(--deep);
    font-size: 14px;
}

.payment-difference-row .negative {
    color: var(--danger);
}

.payment-difference-row .positive {
    color: #167a60;
}

.payment-method-options {
    display: grid;
    gap: 10px;
}

.payment-method-option {
    min-height: 72px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(120px, 180px);
    gap: 12px;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: default;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.payment-method-option:has(input:not(:placeholder-shown)) {
    border-color: var(--brand);
    background: #f3faf7;
}

.payment-method-option input {
    width: 100%;
    min-width: 0;
    height: 44px;
    opacity: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    font: inherit;
}

.payment-option-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #eef3f8;
    color: #435466;
    font-weight: 950;
}

.payment-option-cash .payment-option-icon {
    background: #e9f7f2;
    color: #167a60;
}

.payment-option-card .payment-option-icon,
.payment-option-terminal .payment-option-icon {
    background: #f0edff;
    color: #6546b8;
}

.payment-option-click .payment-option-icon {
    background: #e8f4ff;
    color: #136aa8;
}

.payment-method-option strong,
.payment-method-option small {
    display: block;
}

.payment-method-option small {
    margin-top: 4px;
    color: var(--muted);
}

.payment-submit-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.report-filter-band {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.report-filter-note {
    flex-basis: 100%;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.cash-filter-band {
    display: block;
}

.report-filter-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.filter-status,
.clear-filter-link {
    display: flex;
    align-items: center;
    gap: 9px;
}

.clear-filter-link {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.clear-filter-link:hover {
    background: #eef1f4;
    color: var(--ink);
}

.clear-filter-link svg {
    width: 15px;
    height: 15px;
}

.period-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
    background: #eef1f4;
}

.period-tabs a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.period-tabs a.active {
    background: white;
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.report-filter-form {
    display: grid;
    grid-template-columns: 140px 140px minmax(190px, 240px) auto;
    gap: 10px;
    align-items: end;
}

.cash-report-filter {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.cash-report-filter .primary-button {
    width: fit-content;
    gap: 8px;
}

.compact-field label {
    margin: 0 0 6px;
    font-size: 12px;
}

.compact-field input,
.compact-field select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
    background: white;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.report-summary > div {
    min-width: 0;
    padding: 18px;
    border-right: 1px solid var(--line);
}

.report-summary > div:last-child {
    border-right: 0;
}

.report-summary span,
.report-summary small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.report-summary strong {
    display: block;
    overflow-wrap: anywhere;
    margin: 8px 0 5px;
    font-size: 23px;
}

.report-section {
    margin-bottom: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.compact-head {
    margin-bottom: 14px;
}

.compact-head h2 {
    margin: 0;
    font-size: 19px;
}

.report-range {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.trend-canvas-wrap {
    width: 100%;
    height: 300px;
    position: relative;
}

.report-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.method-breakdown {
    display: grid;
    gap: 18px;
}

.method-row-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.method-row-head span,
.method-row small {
    color: var(--muted);
    font-size: 12px;
}

.method-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef1f4;
}

.method-fill {
    height: 100%;
    display: block;
    border-radius: inherit;
    background: #167a60;
}

.method-fill.method-card {
    background: #6546b8;
}

.method-fill.method-click {
    background: #136aa8;
}

.method-row small {
    display: block;
    margin-top: 5px;
    text-align: right;
}

.recent-payment-list {
    display: grid;
}

.recent-payment-list > a {
    min-height: 62px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.recent-payment-list > a:last-child {
    border-bottom: 0;
}

.recent-payment-list span strong,
.recent-payment-list span small {
    display: block;
}

.recent-payment-list span small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.payment-list-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #e9f7f2;
    color: #167a60;
}

.payment-list-icon.method-card {
    background: #f0edff;
    color: #6546b8;
}

.payment-list-icon.method-click {
    background: #e8f4ff;
    color: #136aa8;
}

.payment-list-icon svg {
    width: 17px;
    height: 17px;
}

.product-sales-section td:last-child,
.product-sales-section th:last-child {
    text-align: right;
}

.daily-sales-section td:last-child,
.daily-sales-section th:last-child {
    text-align: right;
}

.product-analytics-filter {
    grid-template-columns: 130px 130px 180px minmax(190px, 230px) auto;
}

.product-report-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.top-product-band {
    min-height: 82px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid #f3d7a9;
    border-radius: 8px;
    background: #fffaf2;
}

.top-product-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fff0d5;
    color: var(--brand-dark);
}

.top-product-icon svg {
    width: 22px;
    height: 22px;
}

.top-product-band div small,
.top-product-band div strong,
.top-product-band div span {
    display: block;
}

.top-product-band div small,
.top-product-band div span {
    color: var(--muted);
    font-size: 12px;
}

.top-product-band div strong {
    margin: 4px 0;
    font-size: 18px;
}

.top-product-band > strong {
    font-size: 22px;
}

.report-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.analytics-list {
    display: grid;
}

.analytics-list > div:not(.empty-panel) {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
}

.analytics-list > div:last-child {
    border-bottom: 0;
}

.analytics-list span:last-child {
    text-align: right;
}

.analytics-list strong,
.analytics-list small {
    display: block;
}

.analytics-list small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.order-total small {
    color: var(--muted);
    font-weight: 800;
}

.order-total strong {
    margin-top: 6px;
    font-size: 22px;
}

.order-card p {
    color: var(--muted);
    font-size: 13px;
}

.delete-inline {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--danger);
    font-weight: 800;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-tabs a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    padding: 0 14px;
    background: #eef3f8;
    color: #435466;
    font-weight: 800;
    font-size: 14px;
}

.filter-tabs a.active {
    background: var(--brand);
    color: white;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table table {
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.modern-table tbody tr {
    transition: background 0.15s ease;
}

.modern-table tbody tr:hover {
    background: #f8fbfd;
}

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

.actions-col {
    width: 180px;
}

.actions {
    display: flex;
    gap: 8px;
}

.entity-cell,
.product-title-cell {
    display: flex;
    gap: 11px;
    align-items: center;
}

.product-title-cell {
    display: grid;
    gap: 4px;
}

.entity-cell strong,
.product-title-cell strong {
    display: block;
}

.entity-cell small,
.product-title-cell small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.entity-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #e9f7f2;
    color: var(--brand-dark);
    font-weight: 900;
}

.soft-pill {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    background: #eef3f8;
    color: #435466;
    font-weight: 800;
    font-size: 12px;
}

.product-thumb,
.banner-preview,
.gallery-item img {
    display: block;
    object-fit: cover;
    background: #eef3f8;
}

.product-thumb {
    width: 72px;
    height: 54px;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.image-placeholder {
    width: 72px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #eef3f8;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.status-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
}

.status-pill.on {
    background: #e9f7f2;
    color: var(--brand-dark);
}

.status-pill.off {
    background: #f1f5f9;
    color: var(--muted);
}

.toggle-button {
    min-width: 126px;
    min-height: 36px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    border: 0;
    border-radius: 999px;
    padding: 0 12px 0 7px;
    background: #f1f5f9;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

.toggle-button span {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: white;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.15);
}

.toggle-button.on {
    background: #e9f7f2;
    color: var(--brand-dark);
}

.empty-cell {
    color: var(--muted);
    text-align: center;
}

.entity-form {
    max-width: 780px;
}

.entity-form.wide-form {
    max-width: none;
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 18px;
    align-items: start;
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--line);
    box-shadow: none;
}

@media (min-width: 1500px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    .main {
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .sidebar {
        padding: 22px 14px;
    }

    .main {
        padding-left: 20px;
        padding-right: 20px;
    }

    .report-filter-band {
        align-items: stretch;
        flex-direction: column;
    }

    .report-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-report-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-report-summary > div:nth-child(2n) {
        border-right: 0;
    }

    .product-report-summary > div {
        border-bottom: 1px solid var(--line);
    }

    .report-breakdown-grid {
        grid-template-columns: 1fr;
    }
}

.form-card {
    padding: 22px;
    border: 1px solid #f0f0ef;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: none;
}

.form-card-head {
    margin-bottom: 4px;
}

.form-card-head h2 {
    margin: 0;
    font-size: 20px;
}

.media-card {
    position: sticky;
    top: 20px;
}

.upload-field {
    margin-top: 14px;
    padding: 14px;
    border-radius: 8px;
    background: #f3f3f2;
}

.upload-field input[type="file"] {
    border: 1px dashed #d8dde3;
    background: white;
}

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

.form-grid.single {
    grid-template-columns: minmax(0, 1fr);
}

.span-2 {
    grid-column: span 2;
}

.field small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.preview-block {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.preview-block.compact {
    margin-top: 16px;
    padding-top: 16px;
}

.preview-title {
    margin: 0 0 12px;
    color: var(--muted);
    font-weight: 800;
}

.banner-preview {
    width: min(520px, 100%);
    aspect-ratio: 16 / 7;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.preview-product-card {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid #f0f0ef;
    border-radius: 8px;
    background: #ffffff;
}

.preview-product-card img,
.preview-empty {
    width: 100%;
    aspect-ratio: 1.4 / 1;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f5f6f6;
    object-fit: cover;
    color: var(--muted);
    font-weight: 800;
}

.preview-product-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    margin: 16px 0 0;
}

.preview-product-card dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.preview-product-card dd {
    margin: 6px 0 0;
    font-weight: 800;
}

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

.gallery-item {
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    margin-bottom: 8px;
}

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
    font-weight: 800;
}

.switch-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfd;
}

.switch-row input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--brand);
}

.switch-row strong,
.switch-row small {
    display: block;
}

.switch-row small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.checkbox-input {
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 26px;
}

.delete-panel {
    max-width: 560px;
}

.delete-panel p {
    color: var(--muted);
    line-height: 1.6;
}

.public-qr-page {
    min-height: 100vh;
    display: grid;
    place-items: start center;
    padding: 22px 14px;
    background:
        linear-gradient(180deg, #132523 0 190px, transparent 190px),
        var(--bg);
}

.public-receipt {
    width: min(520px, 100%);
    margin-top: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.public-table-mark {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 8px;
    background: #fff5e8;
}

.public-table-mark span {
    color: var(--brand-dark);
    font-size: 15px;
    font-weight: 900;
}

.public-table-mark strong {
    min-width: 86px;
    min-height: 86px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--deep);
    color: white;
    font-size: 44px;
    line-height: 1;
}

.public-receipt-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 18px;
    border-bottom: 1px dashed #cfd9e6;
}

.public-receipt-head h1,
.public-empty-state h1 {
    margin: 4px 0;
    color: var(--deep);
    font-size: 38px;
    line-height: 1;
}

.public-receipt-head span:not(.status-pill),
.public-empty-state p,
.public-item span,
.public-note {
    color: var(--muted);
}

.public-order-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.public-order-meta > div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border-radius: 8px;
    background: #f7f9fb;
}

.public-order-meta strong {
    font-size: 16px;
}

.public-items {
    display: grid;
    border-top: 1px solid var(--line);
}

.public-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 62px;
    border-bottom: 1px solid var(--line);
}

.public-item strong,
.public-item span {
    display: block;
}

.public-item span {
    margin-top: 4px;
    font-size: 13px;
}

.public-item b {
    color: var(--deep);
    text-align: right;
    white-space: nowrap;
}

.public-total {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    padding-top: 20px;
}

.public-total span {
    color: var(--muted);
    font-weight: 900;
}

.public-total strong {
    color: var(--deep);
    font-size: 32px;
    line-height: 1.05;
    text-align: right;
}

.public-note,
.public-empty-state {
    margin: 18px 0 0;
    padding: 14px;
    border-radius: 8px;
    background: #f7f9fb;
    line-height: 1.6;
}

@media (max-width: 880px) {
    .login-panel,
    .app-shell,
    .metric-grid,
    .form-grid,
    .form-layout,
    .toolbar,
    .product-toolbar,
    .product-hero,
    .product-grid,
    .table-card-grid,
    .order-card-grid,
    .order-item-row {
        grid-template-columns: 1fr;
    }

    .report-summary,
    .report-split {
        grid-template-columns: 1fr;
    }

    .report-summary > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .report-summary > div:last-child {
        border-bottom: 0;
    }

    .period-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .period-tabs a {
        flex: 1 0 auto;
        justify-content: center;
    }

    .report-filter-form {
        grid-template-columns: 1fr;
    }

    .report-filter-topline {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-status {
        justify-content: space-between;
    }

    .cash-report-filter .primary-button {
        width: 100%;
    }

    .trend-canvas-wrap {
        height: 240px;
    }

    .top-product-band {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .top-product-band > strong {
        grid-column: 1 / -1;
        padding-top: 12px;
        border-top: 1px solid #f3d7a9;
    }

    .order-detail-layout {
        grid-template-columns: 1fr;
    }

    .table-detail-layout {
        grid-template-columns: 1fr;
    }

    .qr-detail-card {
        position: static;
    }

    .payment-workspace {
        grid-template-columns: 1fr;
    }

    .payment-order-summary,
    .payment-method-form {
        padding: 16px;
    }

    .payment-grand-total,
    .payment-submit-row {
        align-items: stretch;
        flex-direction: column;
    }

    .payment-panel {
        position: static;
    }

    .receipt-panel {
        padding: 16px;
        overflow-x: auto;
    }

    .receipt-customer {
        align-items: flex-start;
        flex-direction: column;
    }

    .receipt-row {
        min-width: 660px;
    }

    .sidebar {
        height: auto;
        min-height: auto;
        position: static;
    }

    .topbar,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-chip {
        text-align: left;
    }

    .span-2 {
        grid-column: span 1;
    }

    .media-card {
        position: static;
    }

    .app-shell {
        margin: 0;
        border-radius: 0;
    }

    .app-topline {
        flex-direction: column;
        align-items: stretch;
        padding-top: 16px;
    }
}

@media (max-width: 560px) {
    .card-actions,
    .qr-actions,
    .public-order-meta {
        grid-template-columns: 1fr;
    }

    .card-actions {
        display: grid;
    }

    .table-detail-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-detail-hero .table-badge {
        width: 78px;
        height: 78px;
        flex-basis: 78px;
    }

    .public-receipt-head {
        align-items: stretch;
        flex-direction: column;
    }

    .public-total {
        align-items: stretch;
        flex-direction: column;
    }

    .public-total strong {
        font-size: 28px;
        text-align: left;
    }
}
