/* Climate Vouchers POS Styles - Redesigned Layout */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    background: #f0f0f4;
    color: #1a1a2e;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

/* ===== APP SHELL: sidebar + main + cart ===== */
.app-shell {
    display: grid;
    grid-template-columns: 80px 1fr 380px;
    height: 100vh;
    overflow: hidden;
    padding: 14px;
    gap: 14px;
    background: #f0f0f4;
}

/* ===== LEFT SIDEBAR ===== */
.sidebar {
    background: #fff;
    border-radius: 45px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    gap: 6px;
    z-index: 10;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    background: #6c5ce7;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.sidebar-logo svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.sidebar-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    width: 100%;
    padding: 0 10px;
}

.sidebar-nav a {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8ea0;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav a:hover {
    background: #f0f0f5;
    color: #6c5ce7;
}

.sidebar-nav a.active {
    background: #6c5ce7;
    color: #fff;
}

.sidebar-nav a.active:hover {
    background: #5a4bd1;
    color: #fff;
}

.sidebar-nav a svg {
    width: 22px;
    height: 22px;
}

.sidebar-nav a .nav-tooltip {
    position: absolute;
    left: 58px;
    background: #1a1a2e;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 100;
}

.sidebar-nav a:hover .nav-tooltip {
    opacity: 1;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    width: 100%;
}

.sidebar-bottom a {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8ea0;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-bottom a:hover {
    background: #f0f0f5;
    color: #6c5ce7;
}

.sidebar-bottom a svg {
    width: 22px;
    height: 22px;
}

.sidebar-bottom a .nav-tooltip {
    position: absolute;
    left: 58px;
    background: #1a1a2e;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 100;
}

.sidebar-bottom a:hover .nav-tooltip {
    opacity: 1;
}

/* ===== CENTER: PRODUCT AREA ===== */
.product-area {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 24px 28px;
    background: transparent;
}

.product-area-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.product-area-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1a2e;
}

.product-area-header .store-badge {
    font-size: 0.8rem;
    color: #8e8ea0;
    font-weight: 500;
}

/* Category Tabs */
.category-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.category-tab {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1.5px solid #e0e0e8;
    background: #fff;
    color: #4a4a5a;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.category-tab:hover {
    border-color: #6c5ce7;
    color: #6c5ce7;
}

.category-tab.active {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1.5px solid #e0e0e8;
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fff;
    color: #1a1a2e;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: #6c5ce7;
}

.search-bar input::placeholder {
    color: #b0b0c0;
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #b0b0c0;
    pointer-events: none;
}

.search-bar .search-icon svg {
    width: 18px;
    height: 18px;
}

/* Payment-started warning in product area */
.product-area .alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.alert-warning {
    background-color: #fff8e1;
    color: #8d6e00;
    border: 1px solid #ffe082;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Products Grid - fixed card width, scrollable */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 180px);
    gap: 18px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
    padding-bottom: 20px;
    align-content: start;
    justify-content: start;
}

.products-grid::-webkit-scrollbar {
    width: 6px;
}

.products-grid::-webkit-scrollbar-track {
    background: transparent;
}

.products-grid::-webkit-scrollbar-thumb {
    background: #d0d0d8;
    border-radius: 3px;
}

/* Product Card - fixed size */
.product-card {
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    border: 1.5px solid #ececf0;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    width: 180px;
    min-width: 180px;
}

.product-card::before {
    display: none;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #d0d0e0;
}

.product-card-clickable {
    appearance: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.product-card-clickable:focus-visible {
    outline: 3px solid #6c5ce7;
    outline-offset: 2px;
}

.product-card-clickable:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.product-photo-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #f8f8fa;
}

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

.product-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c0c0cc;
    font-size: 0.75em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    width: 100%;
    height: 100%;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.product-info h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-info .sku {
    font-size: 0.72rem;
    color: #8e8ea0;
    margin-bottom: 0;
}

.product-info .price {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-top: 4px;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.product-card-footer .price {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a2e;
}

.product-card-footer .btn-add-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #1a1a2e;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.product-card-footer .btn-add-icon:hover {
    background: #6c5ce7;
    color: #fff;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge.eligible {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-radius: 999px;
    padding: 3px 10px;
}

.badge.eligible-small {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 999px;
}

/* ===== RIGHT: CART PANEL ===== */
.cart-panel {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow-y: auto;
    overflow-x: hidden;
}

.cart-panel::-webkit-scrollbar {
    width: 5px;
}

.cart-panel::-webkit-scrollbar-track {
    background: transparent;
}

.cart-panel::-webkit-scrollbar-thumb {
    background: #e0e0e8;
    border-radius: 3px;
}

.cart-panel-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f0f0f5;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-radius: 20px 20px 0 0;
}

.cart-panel-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 0;
}

.cart-panel-body {
    padding: 16px 24px;
}

.cart-panel-footer {
    padding: 16px 24px 24px;
}

/* Cart Items */
.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #b0b0c0;
    font-size: 0.9rem;
}

.cart-item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f7;
}

.cart-item-row:last-child {
    border-bottom: none;
}

.cart-item-media {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f8fa;
    flex-shrink: 0;
}

.cart-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c0c0cc;
    font-size: 0.5rem;
    text-transform: uppercase;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #1a1a2e;
    line-height: 1.25;
}

.cart-item-sku {
    font-size: 0.72rem;
    color: #8e8ea0;
    margin-top: 2px;
}

.cart-item-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1.5px solid #e0e0e8;
    background: #fff;
    color: #1a1a2e;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.qty-btn:hover {
    background: #f0f0f5;
    border-color: #6c5ce7;
    color: #6c5ce7;
}

.qty-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.qty-value {
    min-width: 18px;
    text-align: center;
    font-weight: 700;
    font-size: 0.88rem;
}

.cart-item-total {
    font-weight: 800;
    font-size: 0.95rem;
    color: #1a1a2e;
    white-space: nowrap;
    text-align: right;
}

/* Cart Summary */
.cart-summary {
    padding: 0;
    margin-bottom: 0;
    border: none;
    background: none;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.88rem;
    color: #6a6a7a;
}

.summary-row.total {
    font-weight: 800;
    font-size: 1.15rem;
    color: #1a1a2e;
    border-top: 1.5px solid #e8e8ed;
    padding-top: 12px;
    margin-top: 8px;
}

.summary-row.eligible-total {
    color: #2e7d32;
    font-weight: 600;
    border-top: 1px solid #f0f0f5;
    padding-top: 8px;
    margin-top: 4px;
}

/* Payment Section */
.payment-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1.5px solid #e8e8ed;
}

.payment-section h3 {
    margin-bottom: 12px;
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 700;
}

.payment-method-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.payment-method-btn {
    flex: 1;
    min-width: 80px;
    max-width: 120px;
    padding: 10px 6px;
    border: 1.5px solid #e0e0e8;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    font-family: inherit;
}

.payment-method-btn:hover {
    border-color: #6c5ce7;
}

.payment-method-btn.active {
    border-color: #6c5ce7;
    background: #f3f0ff;
}

.payment-method-btn.active::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    background: #6c5ce7;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.payment-method-img {
    width: 100%;
    max-width: 80px;
    height: auto;
    max-height: 40px;
    border-radius: 4px;
    object-fit: contain;
    display: block;
}

.payment-method-btn[data-payment-method="climate_voucher"] {
    min-width: 100px;
    max-width: 140px;
    padding: 8px;
}

.payment-method-btn[data-payment-method="climate_voucher"] span {
    font-size: 0.72em;
}

.payment-method-icon {
    font-size: 1.5em;
    line-height: 1;
}

.payment-method-btn span {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4a4a5a;
    text-align: center;
}

.payment-method-btn.active span {
    color: #6c5ce7;
}

.cash-icon { color: #2e7d32; }
.bank-icon { font-size: 1.3em; }
.card-icon { color: #6c5ce7; }

/* Process/Clear Buttons */
.btn-add, .btn-remove, .btn-process, .btn-clear {
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.2s;
    width: 100%;
    margin-top: 8px;
}

.btn-process {
    background: #6c5ce7;
    color: #fff;
    padding: 14px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.btn-process:hover {
    background: #5a4bd1;
}

.btn-clear {
    background: #f0f0f5;
    color: #6a6a7a;
}

.btn-clear:hover {
    background: #e0e0e8;
}

.btn-add {
    background: #6c5ce7;
    color: white;
    border-radius: 10px;
    font-weight: 700;
    min-height: 40px;
}

.btn-add:hover {
    background: #5a4bd1;
}

.btn-remove {
    background-color: #ef4444;
    color: white;
    padding: 5px 10px;
    width: auto;
    margin-top: 0;
}

.btn-remove:hover {
    background-color: #dc2626;
}

.btn-remove-icon {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

.btn-remove-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Theme-driven utility button for legacy inline-action controls */
.btn-theme-primary {
    background: var(--theme-primary) !important;
    color: #fff !important;
    border: none !important;
    transition: background-color 0.2s ease;
}

.btn-theme-primary:hover {
    background: var(--theme-primary-hover) !important;
    color: #fff !important;
}

a.btn-theme-primary {
    text-decoration: none;
    display: inline-block;
}

.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;
}

/* QR Scanner */
.qr-scanner-section {
    margin-bottom: 12px;
}

.qr-scanner-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.88rem;
}

.qr-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e0e0e8;
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.qr-input:focus {
    outline: none;
    border-color: #6c5ce7;
}

/* Scanner Mode Buttons */
.scanner-mode-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.btn-scanner-mode {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid #6c5ce7;
    background: white;
    color: #6c5ce7;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-scanner-mode:hover {
    background: #f3f0ff;
}

.btn-scanner-mode.active {
    background: #6c5ce7;
    color: white;
}

/* QR Reader */
#qr-reader {
    border: 1.5px solid #e0e0e8;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

#qr-reader video {
    width: 100%;
    height: auto;
}

/* Alert */
.alert {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

/* ===== LEGACY / OTHER PAGES ===== */
/* Used by products.php, transactions.php, etc. */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* When inside app-shell, container not needed */
.app-shell .container {
    max-width: none;
    padding: 0;
}

header {
    background: linear-gradient(120deg, #6c5ce7 0%, #5a4bd1 65%, #4834b5 100%);
    color: white;
    padding: 22px 30px;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 12px 28px rgba(108, 92, 231, 0.18);
}

header h1 {
    font-size: 1.8em;
    margin-bottom: 4px;
}

.store-info {
    font-size: 0.85em;
    opacity: 0.9;
}

/* Navigation (horizontal - for non-POS pages) */
.nav {
    background: #fff;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8e8ed;
}

.nav a {
    color: #4a4a5a;
    text-decoration: none;
    margin-right: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 700;
    font-size: 0.88rem;
}

.nav a:hover {
    background: #f3f0ff;
    color: #6c5ce7;
}

.nav a.active {
    background: #6c5ce7;
    color: white;
}

/* Products/Cart sections for non-POS pages */
.products-section, .cart-section {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8e8ed;
}

.products-section h2, .cart-section h2 {
    margin-bottom: 20px;
    color: #1a1a2e;
    border-bottom: 2px solid #6c5ce7;
    padding-bottom: 10px;
    font-weight: 800;
}

/* Table styling for products/transactions pages */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.cart-table th {
    background: #f8f8fa;
    padding: 12px;
    text-align: left;
    font-weight: 700;
    border-bottom: 1.5px solid #e8e8ed;
    color: #4a4a5a;
    font-size: 0.85rem;
}

.cart-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f5;
    vertical-align: middle;
    font-size: 0.88rem;
}

.cart-table tr:hover {
    background: #fafafe;
}

/* Receipt Styles */
.receipt {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed #e0e0e8;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.receipt-items { margin-bottom: 15px; }

.receipt-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f5;
}

.receipt-totals {
    border-top: 2px solid #e0e0e8;
    padding-top: 15px;
    margin-top: 15px;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.receipt-total-row.final {
    font-weight: bold;
    font-size: 1.2em;
    border-top: 2px solid #e0e0e8;
    padding-top: 10px;
    margin-top: 10px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #6c5ce7;
}

/* Payment result */
#payment-result {
    margin-top: 12px;
}

/* ===== PAYMENT PAGE ===== */
body[data-page="payment"] {
    overflow: auto;
    height: auto;
}

.payment-page-main {
    background: #f7f7fb;
    border-radius: 24px;
    padding: 24px 28px;
    overflow-y: auto;
}

.payment-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.payment-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #30303f;
    font-weight: 600;
}

.payment-methods-panel h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.1;
}

.payment-methods-subtitle {
    font-size: 1rem;
    color: #6d6d7f;
    margin-top: 6px;
    margin-bottom: 18px;
}

.payment-page-method-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.payment-page-method-grid .payment-method-btn {
    flex: 0 1 186px;
    min-width: 170px;
    max-width: none;
    min-height: 84px;
    border: 2px solid #d9deef;
    border-radius: 14px;
    background: #fff;
    padding: 14px 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.payment-page-method-grid .payment-method-btn.active {
    border-color: #25358c;
    background: #1f2532;
    box-shadow: 0 0 0 2px rgba(37, 53, 140, 0.15);
}

.payment-page-method-grid .payment-method-btn span {
    font-size: 1rem;
    color: #1f2937;
    text-align: left;
}

.payment-page-method-grid .payment-method-btn.active span {
    color: #fff;
}

.payment-page-method-grid .payment-method-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f2f4ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #6c5ce7;
}

.payment-page-method-grid .payment-method-btn.active .payment-method-icon {
    background: rgba(203, 255, 126, 0.2);
    color: #cbff7e;
}

.payment-page-method-grid .payment-method-img {
    width: 40px;
    max-width: 40px;
    max-height: 40px;
}

.payment-entry-section {
    margin-top: 18px;
    max-width: 540px;
}

.payment-entry-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2e2e3f;
}

.payment-amount-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d5d9e8;
    border-radius: 10px;
    background: #fff;
    font-size: 1rem;
}

.payment-continue-btn {
    max-width: 320px;
}

.payment-clear-btn {
    max-width: 320px;
}

.payment-finished-card {
    margin-top: 10px;
    max-width: 620px;
}

.payment-finished-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dev-idempotency-section {
    margin-top: 20px;
    max-width: 620px;
    padding: 12px;
    border: 1px dashed #9ca3af;
    border-radius: 8px;
    background: #f8fafc;
}

.dev-idempotency-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.dev-idempotency-key {
    font-family: monospace;
    word-break: break-all;
    margin-bottom: 10px;
    color: #111827;
}

.dev-idempotency-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #374151;
}

.dev-idempotency-field input {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: monospace;
    margin-bottom: 10px;
}

.dev-idempotency-checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #374151;
    font-size: 0.9rem;
}

.dev-idempotency-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dev-idempotency-actions .btn-process {
    width: auto;
    margin-top: 0;
    padding: 8px 14px;
}

#dev-idempotency-copy-msg {
    color: #059669;
    font-size: 0.9rem;
}

.payment-order-panel {
    display: flex;
    flex-direction: column;
}

.payment-order-item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-order-item-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 10px;
}

.payment-order-item-media {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    background: #f2f3f8;
}

.payment-order-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.payment-order-item-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #8a8a98;
}

.payment-order-item-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}

.payment-order-item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: #3b3b4b;
}

.payment-order-item-qty {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1f2937;
}

.payment-order-footer {
    border-top: 1px solid #e7e7ef;
    padding-top: 14px;
}

.payment-order-summary {
    margin-bottom: 0;
}

/* Main content grid for non-POS pages using old layout */
.main-content {
    display: grid;
    grid-template-columns: minmax(0, 1.857fr) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

/* ===== APP SHELL PAGE: sidebar + full-width content (no cart) ===== */
.app-shell-page {
    display: grid;
    grid-template-columns: 80px 1fr;
    height: 100vh;
    overflow: hidden;
    padding: 14px;
    gap: 14px;
    background: #f0f0f4;
}

.page-content {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow-y: auto;
    padding: 32px 36px;
}

.page-content::-webkit-scrollbar {
    width: 6px;
}

.page-content::-webkit-scrollbar-track {
    background: transparent;
}

.page-content::-webkit-scrollbar-thumb {
    background: #d0d0d8;
    border-radius: 3px;
}

.page-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-content-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1a2e;
}

.page-content-header .page-subtitle {
    font-size: 0.82rem;
    color: #8e8ea0;
    font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .app-shell {
        grid-template-columns: 72px 1fr 320px;
        padding: 10px;
        gap: 10px;
    }

    .app-shell-page {
        grid-template-columns: 72px 1fr;
        padding: 10px;
        gap: 10px;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .payment-page-main {
        padding: 20px;
    }
}

@media (max-width: 900px) {
    .app-shell,
    .app-shell-page {
        grid-template-columns: 60px 1fr;
        height: auto;
        min-height: 100vh;
        padding: 8px;
        gap: 8px;
    }

    .cart-panel {
        position: fixed;
        right: -100%;
        top: 12px;
        bottom: 12px;
        width: 340px;
        height: auto;
        z-index: 50;
        transition: right 0.3s ease;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.12);
        border-radius: 20px;
    }

    .cart-panel.open {
        right: 0;
    }

    body {
        overflow: auto;
        height: auto;
    }

    .product-area {
        padding: 16px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, 180px);
    }

    .payment-page-shell {
        grid-template-columns: 60px minmax(0, 1fr);
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .payment-page-shell .payment-order-panel {
        grid-column: 2;
        position: static;
        right: auto;
        top: auto;
        bottom: auto;
        width: 100%;
        height: auto;
        max-height: none;
        z-index: auto;
        transition: none;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
        margin-top: 0;
    }

    .payment-page-main {
        padding: 18px;
    }
}

@media (max-width: 600px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid #e8e8ed;
        padding: 0 10px;
        z-index: 50;
        border-radius: 0;
    }

    .sidebar-logo {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 0;
        justify-content: space-around;
    }

    .sidebar-bottom {
        display: none;
    }

    .product-area {
        padding: 12px;
        padding-bottom: 70px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, 160px);
        gap: 10px;
    }

    .payment-page-shell {
        grid-template-columns: 1fr;
        padding-bottom: 70px;
    }

    .payment-page-main,
    .payment-page-shell .payment-order-panel {
        grid-column: 1;
    }

    .payment-page-main {
        padding: 14px 12px;
    }

    .payment-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .payment-page-method-grid .payment-method-btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 145px;
    }

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