/* =====================================================================
   Gift Register - Stylesheet
   Responsive (PC + Tablet)
   ===================================================================== */

:root {
    --primary:        #1B2A4E;  /* ABC Group navy (from "ABC HOME CENTER" logo background) */
    --primary-dark:   #0F1B36;  /* darker variant for hover/active states */
    --primary-light:  #3A4D7A;  /* lighter variant for soft accents */
    --accent:         #d4a017;
    --danger:         #c0392b;
    --warning:        #e67e22;
    --success:        #27ae60;
    --gray-100:       #f7f7f7;
    --gray-200:       #ececec;
    --gray-300:       #d6d6d6;
    --gray-400:       #b3b3b3;
    --gray-500:       #888;
    --gray-700:       #444;
    --gray-900:       #1a1a1a;
    --white:          #fff;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg:      0 10px 30px rgba(0,0,0,0.2);
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--gray-900);
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ============================== VIEWS ============================== */
.view {
    display: none;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
}
.view.active { display: block; }

/* ============================== LOGIN ============================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    text-align: center;
    margin-bottom: 16px;
    font-size: 56px;
}
.login-title {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 4px;
    font-size: 26px;
}
.login-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 24px;
    font-size: 13px;
}

.form-group { margin-bottom: 16px; position: relative; }
.form-label {
    display: block;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-weight: 600;
}
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--white);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,95,42,0.12);
}

.password-wrap {
    position: relative;
}
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--gray-500);
    font-size: 18px;
}
.password-toggle:hover { color: var(--primary); }

/* ============================== BUTTONS ============================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.05s, box-shadow 0.15s, opacity 0.15s, background 0.15s;
    user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-900); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-300); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover:not(:disabled) { filter: brightness(0.92); }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ============================== HEADER ============================== */
.app-header {
    height: 56px;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    padding: 0 12px;
    box-shadow: var(--shadow-md);
    position: sticky; top: 0; z-index: 50;
    gap: 8px;
}
.app-header h1 {
    font-size: 17px;
    font-weight: 700;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.app-header .badge {
    background: rgba(255,255,255,0.18);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
.header-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.app-header .header-btn {
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}
.app-header .header-btn:hover { background: rgba(255,255,255,0.1); }
.app-header .header-btn-danger {
    border-color: rgba(255,160,160,0.5);
    color: #ffcccc;
}
.app-header .header-btn-danger:hover {
    background: rgba(192,57,43,0.4);
    color: #fff;
}
.header-menu-btn {
    background: transparent;
    color: var(--white);
    border: none;
    font-size: 24px;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}
.header-menu-btn:hover { background: rgba(255,255,255,0.15); }

/* Toggle visibility based on screen size */
.desktop-only { display: inline-flex; }
.mobile-only  { display: none; }
@media (max-width: 720px) {
    .desktop-only { display: none !important; }
    .mobile-only  { display: inline-flex !important; }
}

/* ============================== MOBILE MENU (slide-out) ============================== */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
}
.mobile-menu.show { display: block; }
.mobile-menu-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
    animation: fadeIn 0.15s ease;
}
.mobile-menu-panel {
    position: absolute;
    top: 0; right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.18s ease;
}
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--primary);
    color: var(--white);
    font-size: 15px;
    border-bottom: 1px solid var(--gray-200);
}
.mobile-menu-close {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.mobile-menu-item {
    background: transparent;
    border: none;
    text-align: left;
    padding: 16px 20px;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    font-family: inherit;
    color: var(--gray-900);
}
.mobile-menu-item:hover { background: var(--gray-100); }
.mobile-menu-item.danger { color: var(--danger); }
.mobile-menu-sep {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 8px 0;
}

/* ============================== POS LIST ============================== */
.pos-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    padding: 24px;
    align-items: start;
}
.pos-branch-col {
    background: var(--white);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
}
.pos-branch-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary-dark);
    letter-spacing: 0.6px;
    padding: 4px 8px 12px;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pos-branch-count {
    background: var(--primary);
    color: var(--white);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}
.pos-branch-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pos-branch-cards.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.pos-card {
    background: var(--white);
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s, border-color 0.1s;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 40px;
}
.pos-card:hover:not(.disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}
.pos-card.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
.pos-card-name {
    font-weight: 600;
    font-size: 12.5px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pos-card-status {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.pos-card-status.available { background: #d4edda; color: #155724; }
.pos-card-status.in-use    { background: #fff3cd; color: #856404; }
.pos-card-status.resume    { background: #cce5ff; color: #004085; }
.pos-card-user {
    font-size: 10px;
    color: var(--gray-500);
    margin-left: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

@media (max-width: 720px) {
    .pos-branch-cards.two-cols { grid-template-columns: 1fr; }
}

/* ============================== MAIN LAYOUT (gift register UI) ============================== */
.gr-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    height: calc(100vh - 56px);
    overflow: hidden;
}
.gr-left  { padding: 16px; overflow-y: auto; }
.gr-right { background: var(--white); border-left: 1px solid var(--gray-200); display: flex; flex-direction: column; overflow: hidden; }

.section-card {
    background: var(--white);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.section-card h3 {
    font-size: 13px;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.customer-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0;
}
.customer-row .customer-info { flex: 1; }
.customer-row .customer-info .name { font-weight: 600; }
.customer-row .customer-info .meta { font-size: 12px; color: var(--gray-500); }

/* ============================== SCANNER + INPUT ============================== */
.scanner-row {
    display: flex; gap: 8px; align-items: center;
}
.scanner-row input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 16px;
}
.scanner-row input:focus { outline: none; border-color: var(--primary); }
.scanner-toggle {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}
#scannerContainer {
    margin-top: 10px;
    display: none;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
#scannerContainer.active { display: block; }

/* ============================== CART (right panel) ============================== */
.cart-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-header h3 { font-size: 16px; }
.cart-header .count { color: var(--gray-500); font-size: 12px; }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
}
.cart-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
}
.cart-item-img {
    width: 50px; height: 50px;
    background: var(--gray-100);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-meta { font-size: 11px; color: var(--gray-500); }
.cart-item-qty {
    display: flex; align-items: center; gap: 6px;
    margin-top: 4px;
}
.cart-item-qty button {
    width: 26px; height: 26px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.cart-item-qty input {
    width: 56px;
    text-align: center;
    padding: 3px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}
.cart-item-price { font-weight: 700; font-size: 13px; white-space: nowrap; }
.cart-item-remove {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
}

.cart-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--gray-500);
}

.cart-totals {
    border-top: 2px solid var(--gray-200);
    padding: 12px 16px;
}
.cart-totals .row {
    display: flex; justify-content: space-between;
    margin-bottom: 4px;
    font-size: 13px;
}
.cart-totals .grand {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--gray-300);
    font-size: 19px;
    font-weight: 800;
    color: var(--primary-dark);
}

.cart-footer { padding: 12px 16px; border-top: 1px solid var(--gray-200); }

/* ============================== MODAL ============================== */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 540px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 820px; }
.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
    background: none; border: none; font-size: 24px;
    cursor: pointer; color: var(--gray-500);
}
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }

/* ============================== PAYMENT MODAL (split) ============================== */
.pay-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--gray-100);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}
.pay-total span:last-child {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-dark);
}
.pay-add-row {
    display: grid;
    grid-template-columns: 1fr 130px auto;
    gap: 8px;
    margin-bottom: 12px;
}
.pay-add-row .btn { white-space: nowrap; }
.pay-lines {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    min-height: 60px;
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
}
.pay-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}
.pay-line:last-child { border-bottom: none; }
.pay-line .pay-line-method { font-weight: 600; flex: 1; }
.pay-line .pay-line-amount { color: var(--primary-dark); font-weight: 700; margin-right: 8px; }
.pay-line-remove {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 20px;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
}
.pay-empty {
    padding: 18px;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
}
.pay-summary {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 12px 16px;
}
.pay-summary .row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}
.pay-summary .row:last-child { font-weight: 700; font-size: 16px; }
#payRemaining.fully-paid { color: var(--success); }
#payRemaining.unpaid     { color: var(--danger);  }

@media (max-width: 720px) {
    .pay-add-row {
        grid-template-columns: 1fr;
    }
}

.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--gray-200);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* ============================== CUSTOMER MODAL (search list) ============================== */
.search-box {
    position: relative;
    margin-bottom: 12px;
}
.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
}
.search-box .search-icon {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}

.customer-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}
.customer-list-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    display: flex; gap: 10px; align-items: center;
}
.customer-list-item:last-child { border-bottom: none; }
.customer-list-item:hover { background: var(--gray-100); }
.customer-list-item .avatar {
    width: 36px; height: 36px;
    background: var(--primary-light);
    color: var(--white);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.customer-list-item .info { flex: 1; }
.customer-list-item .info .name { font-weight: 600; }
.customer-list-item .info .meta { font-size: 12px; color: var(--gray-500); }

.empty-state {
    padding: 30px 20px;
    text-align: center;
    color: var(--gray-500);
}
.empty-state-text { margin-top: 8px; }

.toggle-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

/* ============================== ADMIN PANEL ============================== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.stat-card .label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.4px;
}
.stat-card .value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-dark);
}

.admin-table {
    width: 100%;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-200);
}
.admin-table th {
    background: var(--gray-100);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    color: var(--gray-700);
    letter-spacing: 0.4px;
}
.admin-table tr:hover td { background: var(--gray-100); }
.admin-table .status-paid     { color: var(--success); font-weight: 600; }
.admin-table .status-draft    { color: var(--warning); font-weight: 600; }
.admin-table .status-cancelled{ color: var(--danger); font-weight: 600; }

.admin-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}
.admin-toolbar input, .admin-toolbar select {
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
}

/* ============================== TOAST ============================== */
.toast-container {
    position: fixed; top: 16px; right: 16px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--gray-900);
    color: var(--white);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.2s ease;
    max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Quantity toast (after scanning a product) */
.qty-toast {
    background: var(--white);
    color: var(--gray-900);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.2s ease;
    width: 360px;
    max-width: calc(100vw - 32px);
    display: flex;
    align-items: center;
    gap: 10px;
}
.qty-toast-img {
    width: 44px; height: 44px;
    background: var(--gray-100);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.qty-toast-img img { width: 100%; height: 100%; object-fit: contain; }
.qty-toast-body {
    flex: 1;
    min-width: 0;
}
.qty-toast-name {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qty-toast-meta {
    font-size: 11px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qty-toast-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.qty-toast-controls button {
    width: 32px; height: 32px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--white);
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}
.qty-toast-controls button:hover { background: var(--primary-dark); }
.qty-toast-controls input {
    width: 50px;
    text-align: center;
    padding: 6px 4px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    -moz-appearance: textfield;
}
.qty-toast-controls input::-webkit-outer-spin-button,
.qty-toast-controls input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-toast-close {
    background: transparent;
    border: none;
    color: var(--gray-500);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    line-height: 1;
}
.qty-toast-close:hover { color: var(--danger); }

@media (max-width: 720px) {
    .toast-container {
        top: 70px;
        right: 12px;
        left: 12px;
    }
    .toast { max-width: none; }
    .qty-toast { width: auto; }
}

/* ============================== LOADING ============================== */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9998;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 14px;
}
.spinner {
    width: 50px; height: 50px;
    border: 4px solid rgba(255,255,255,0.25);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-text { color: var(--white); font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================== MOBILE: cart FAB + bottom sheet ============================== */
.cart-fab {
    display: none;
}
.cart-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 80;
    animation: fadeIn 0.15s ease;
}
.cart-backdrop.show { display: block; }
.cart-close {
    background: transparent;
    border: none;
    color: var(--gray-700);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

/* ============================== RESPONSIVE ============================== */
@media (max-width: 720px) {
    /* Mobile only (phones in portrait). Tablets and desktops keep the 2-column layout. */
    /* Stack content; cart panel becomes a bottom sheet that slides up */
    .gr-container {
        display: block;
        height: auto;
        min-height: calc(100vh - 56px);
        padding-bottom: 76px; /* room for FAB */
    }
    .gr-left {
        padding: 12px;
        max-height: none;
        overflow: visible;
    }
    .section-card { padding: 10px 12px; margin-bottom: 8px; }
    .section-card h3 {
        font-size: 12px;
        margin-bottom: 6px;
    }
    .empty-state { padding: 12px; }
    .empty-state-text { font-size: 13px; }
    .customer-row { padding: 4px 0; }

    /* Hide the desktop cart panel; show as slide-up sheet when toggled */
    .gr-right {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 90;
        height: 75vh;
        max-height: 75vh;
        border-left: none;
        border-top: 1px solid var(--gray-200);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
        transform: translateY(100%);
        transition: transform 0.22s ease;
        display: flex !important;
    }
    .gr-right.show { transform: translateY(0); }

    .cart-header { padding: 14px 16px; }
    .cart-items  { padding: 8px 16px 100px; } /* extra bottom for sticky footer */
    .cart-footer {
        position: sticky;
        bottom: 0;
        background: var(--white);
        box-shadow: 0 -2px 6px rgba(0,0,0,0.08);
    }

    /* Floating cart button */
    .cart-fab {
        display: flex !important;
        position: fixed;
        bottom: 16px; right: 16px;
        z-index: 70;
        background: var(--primary);
        color: var(--white);
        border: none;
        border-radius: 28px;
        padding: 12px 18px;
        box-shadow: 0 6px 18px rgba(26,95,42,0.4);
        cursor: pointer;
        align-items: center;
        gap: 10px;
        font-size: 15px;
        font-weight: 700;
        font-family: inherit;
        max-width: calc(100vw - 32px);
    }
    .cart-fab-icon {
        font-size: 20px;
    }
    .cart-fab-count {
        background: var(--white);
        color: var(--primary-dark);
        border-radius: 12px;
        padding: 2px 8px;
        font-size: 12px;
        font-weight: 700;
        min-width: 24px;
        text-align: center;
    }
    .cart-fab-total {
        font-weight: 800;
    }
    .cart-fab.has-items {
        animation: pulse 0.4s ease;
    }
    @keyframes pulse {
        0%   { transform: scale(1); }
        50%  { transform: scale(1.08); }
        100% { transform: scale(1); }
    }
}

@media (max-width: 480px) {
    .app-header h1 { font-size: 14px; }
    .pos-list { grid-template-columns: 1fr; padding: 12px; }
    .cart-fab { padding: 10px 14px; font-size: 14px; }
}

/* ============================================================
   EVENT FLOW - new screens
   ============================================================ */

/* Choose action (post-login hinge) */
.choose-action {
    max-width: 720px;
    margin: 40px auto;
    padding: 20px;
    text-align: center;
}
.choose-action h2 {
    margin: 0 0 24px;
    font-size: 22px;
    color: var(--gray-700);
}
.action-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.action-tile {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    font-family: inherit;
}
.action-tile:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.action-icon { font-size: 48px; margin-bottom: 12px; }
.action-title { font-size: 20px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.action-sub { font-size: 13px; color: var(--gray-600); }

/* Centered forms (name, details) */
.centered-form {
    max-width: 800px;
    margin: 20px auto;
    padding: 16px;
}
.form-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.form-card-wide { max-width: none; }
.form-help { color: var(--gray-600); margin: 0 0 16px; font-size: 14px; }
.form-control-lg { font-size: 18px; padding: 12px 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
.form-row.two { grid-template-columns: 1fr 1fr; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-section { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--gray-100); }
.form-section:last-of-type { border-bottom: none; }
.form-section-title {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.required { color: var(--danger); }

/* Category tiles screen */
.page-intro {
    text-align: center;
    color: var(--gray-700);
    font-size: 16px;
    padding: 20px 16px 8px;
}
.category-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    padding: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Live search above the category tiles - lets the user type any subtype name
   and jump straight to it without browsing the tiles. */
.category-search {
    max-width: 800px;
    margin: 8px auto 0;
    padding: 0 16px;
}
.category-search input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    background: white;
}
.category-search input:focus {
    border-color: var(--primary);
    outline: none;
}
.category-search-results {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}
.category-search-results:empty { display: none; }
.cat-search-list {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    margin-top: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    max-height: 360px;
    overflow-y: auto;
}
.cat-search-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    transition: background 0.1s ease;
}
.cat-search-item:last-child { border-bottom: none; }
.cat-search-item:hover { background: #eef1f7; }
.cat-search-item .name {
    font-weight: 600;
    color: var(--gray-800);
    flex: 1;
    min-width: 0;
}
.cat-search-item .name mark {
    background: #fff3a0;
    color: var(--gray-800);
    padding: 0;
    font-weight: 700;
}
.cat-search-item .cat {
    font-size: 11px;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.cat-search-empty {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    margin-top: 8px;
    padding: 18px;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
}
.category-tile {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 24px 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    font-family: inherit;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.category-tile:hover {
    border-color: var(--primary);
    background: #eef1f7;
    transform: translateY(-2px);
}
.category-tile-icon { font-size: 36px; margin-bottom: 8px; }
.category-tile-name { font-size: 14px; font-weight: 700; color: var(--primary-dark); }
.category-tile-count { font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.category-tile.other { background: #fff7e6; border-color: #f0c878; }

/* Subtype list */
.subtype-list {
    max-width: 760px;
    margin: 16px auto;
    padding: 0 16px;
}
.subtype-row {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.12s ease;
}
.subtype-row:hover {
    border-color: var(--primary);
    background: #eef1f7;
}
.subtype-name { font-weight: 600; color: var(--gray-800); }
.subtype-prefix { font-size: 11px; color: var(--gray-500); background: var(--gray-100); padding: 2px 8px; border-radius: 10px; }
.subtype-custom-row {
    background: #fff7e6;
    border: 1px dashed #f0c878;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 8px;
}
.subtype-custom-row label { font-weight: 600; color: var(--gray-800); display: block; margin-bottom: 8px; }

/* Search page */
.search-page { max-width: 1000px; margin: 16px auto; padding: 0 16px; }
.search-filters {
    background: white;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.search-results { background: white; border-radius: 10px; min-height: 120px; padding: 6px; }
.event-row {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}
.event-row:last-child { border-bottom: none; }
.event-row-info { min-width: 0; }
.event-row-title { font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.event-row-meta { font-size: 12px; color: var(--gray-600); display: flex; gap: 12px; flex-wrap: wrap; }
.event-row-meta .pill {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}
.event-row-meta .pill.status-open    { background: #d6dff0; color: #1B2A4E; }
.event-row-meta .pill.status-closed  { background: #f0d0d0; color: #8a1a1a; }
.event-row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.event-row-actions .btn { padding: 6px 12px; font-size: 12px; }

/* Event view (read-only mode C) */
.event-view { max-width: 1100px; margin: 16px auto; padding: 0 16px; }
.event-summary {
    background: white;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 14px;
}
.event-summary .kv { display: flex; gap: 8px; padding: 4px 0; font-size: 13px; }
.event-summary .kv b { min-width: 130px; color: var(--gray-700); }
.event-progress {
    background: var(--gray-100);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
}
.event-progress .bar { background: #e0e0e0; height: 8px; border-radius: 4px; margin-top: 6px; overflow: hidden; }
.event-progress .bar .fill { background: var(--primary); height: 100%; transition: width 0.3s; }
.event-items-table, .event-sales-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}
.event-items-table table, .event-sales-table table {
    width: 100%;
    border-collapse: collapse;
}
.event-items-table th, .event-sales-table th {
    background: var(--gray-100);
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}
.event-items-table td, .event-sales-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
}
.event-items-table .qty-cell { text-align: right; }
.event-items-table .sold-out td { color: var(--gray-500); text-decoration: line-through; }

/* Sale page (sell to guest) */
.sale-page { max-width: 1300px; margin: 12px auto; padding: 0 12px; }

/* Banner at the top of the sale view that reminds the employee what event
   they are selling for - including the honoree(s) name */
.event-banner {
    background: linear-gradient(135deg, #1B2A4E 0%, #2A3D70 100%);
    color: white;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.event-banner .icon { font-size: 28px; }
.event-banner .body { flex: 1; min-width: 200px; }
.event-banner .title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}
.event-banner .subtitle {
    font-size: 13px;
    opacity: 0.9;
}
.event-banner .pill-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.event-banner .info-pill {
    background: rgba(255,255,255,0.18);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Step hint - explanatory text inside a step block */
.step-hint {
    font-size: 13px;
    color: var(--gray-600);
    margin: 0 0 12px;
    padding: 8px 12px;
    background: #f4f9f4;
    border-left: 3px solid var(--primary);
    border-radius: 4px;
}

/* Previous-purchases summary shown under step 1 to reinforce that other
   guests have already bought from this same event */
.previous-purchases {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--gray-200);
}
.previous-purchases:empty { display: none; }
.previous-purchases .pp-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    font-weight: 700;
    margin-bottom: 8px;
}
.previous-purchases .pp-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.previous-purchases .pp-pill {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.previous-purchases .pp-empty {
    font-size: 12px;
    color: var(--gray-500);
    font-style: italic;
}

/* Numbered steps that walk the employee through the sale */
.sale-step {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 2px solid var(--gray-200);
    transition: border-color 0.2s ease;
}
.sale-step.required-pending {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(192,57,43,0.08);
}
.sale-step.completed { border-color: #c5d1e8; }
.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.step-num {
    background: var(--primary);
    color: white;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.sale-step.required-pending .step-num { background: var(--danger); }
.sale-step.completed .step-num        { background: var(--success, #27ae60); }
.step-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    flex: 1;
    min-width: 0;
}
.step-required {
    background: #ffe0e0;
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.step-done {
    background: #d6dff0;
    color: #1B2A4E;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    display: none;
}
.sale-step.completed .step-required { display: none; }
.sale-step.completed .step-done     { display: inline-block; }
.step-tools { margin-left: auto; }

/* Customer row inside step 1 */
.sale-customer-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.sale-customer-info {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    background: var(--gray-100);
    border-radius: 8px;
    font-size: 14px;
}
.sale-customer-info .name { font-weight: 700; color: var(--gray-800); }

.sale-status {
    background: white;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.hide-sold-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* Product grid with the lock overlay shown while step 1 is incomplete */
.sale-grid-wrap { position: relative; }
.sale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 80px;
}
.sale-grid-lock {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    z-index: 5;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}
.sale-step.required-pending .sale-grid-lock { display: flex; }
.sale-step.required-pending .sale-grid { pointer-events: none; opacity: 0.5; }
.lock-msg {
    background: white;
    border: 2px solid var(--danger);
    border-radius: 12px;
    padding: 18px 24px;
    text-align: center;
    max-width: 360px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.lock-icon  { font-size: 36px; margin-bottom: 6px; }
.lock-title { font-size: 16px; font-weight: 700; color: var(--danger); margin-bottom: 4px; }
.lock-sub   { font-size: 12px; color: var(--gray-600); }
.sale-tile {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    padding: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.12s ease;
    overflow: hidden;
}
.sale-tile:hover { border-color: var(--primary); transform: translateY(-1px); }
.sale-tile.selected { border-color: var(--primary); background: #eef1f7; }
.sale-tile.partial { border-color: #d68910; }
.sale-tile.sold-out { cursor: not-allowed; opacity: 0.65; }
.sale-tile.sold-out:hover { transform: none; border-color: var(--gray-200); }
.sale-tile-img {
    width: 100%;
    height: 110px;
    background: var(--gray-100);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
}
.sale-tile-img img { max-width: 100%; max-height: 100%; }
.sale-tile-img .ph { font-size: 32px; color: var(--gray-400); }
.sale-tile-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.sale-tile-sku { font-size: 11px; color: var(--gray-500); margin-bottom: 6px; }
.sale-tile-progress { font-size: 11px; color: var(--gray-600); margin-bottom: 6px; }
.sale-tile-progress .strong { font-weight: 700; color: var(--primary-dark); }
.sale-tile-stock {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    font-size: 10px;
}
.stock-pill {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 2px 6px;
    border-radius: 8px;
}
.stock-pill.zero { background: #f0d0d0; color: #8a1a1a; }
.stock-pill.low  { background: #ffe4b0; color: #8a5a00; font-weight: 700; }
.sale-tile-selected-mark {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}
.sold-banner {
    position: absolute;
    top: 14px;
    left: -36px;
    width: 130px;
    background: var(--danger);
    color: white;
    text-align: center;
    transform: rotate(-45deg);
    padding: 4px 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sale-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid var(--gray-200);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    z-index: 90;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.sale-selected { font-size: 14px; }
.sale-total { font-size: 22px; font-weight: 800; color: var(--primary-dark); }

/* Sale event scan workspace - reuse styles from grView; only minor extras */
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.cart-actions .btn { width: 100%; }

/* Center/pad helpers */
.center { text-align: center; }
.pad    { padding: 20px; }
.small  { font-size: 12px; }

@media (max-width: 720px) {
    .form-row.two, .form-row.three { grid-template-columns: 1fr; }
    .event-row { grid-template-columns: 1fr; }
    .event-row-actions { justify-content: stretch; }
    .event-row-actions .btn { flex: 1; }

    /* Sale tiles: smaller minmax so 2 fit side by side on a phone */
    .sale-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 8px; }
    .sale-tile { padding: 8px; }
    .sale-tile-img { height: 85px; }
    .sale-tile-name { font-size: 12px; }
    .sale-tile-sku  { font-size: 10px; }
    .sale-tile-progress { font-size: 10px; }
    .sale-tile-stock .stock-pill { font-size: 9px; padding: 1px 4px; }

    /* Sale footer: stack vertically so the big Continue button stays tappable */
    .sale-footer { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
    .sale-footer .btn { width: 100%; }
    .sale-selected, .sale-total { text-align: center; }
    .sale-page { padding-bottom: 140px; }

    /* Category tiles: smaller padding to fit more on screen */
    .category-tile { padding: 16px 10px; min-height: 110px; }
    .category-tile-icon { font-size: 28px; }
    .category-tile-name { font-size: 13px; }

    /* Choose action tiles */
    .action-tiles { gap: 12px; }
    .action-tile { padding: 22px 16px; }
    .action-icon { font-size: 38px; }
    .action-title { font-size: 18px; }

    /* Subtype rows: a bit denser */
    .subtype-row { padding: 12px 14px; }

    /* Centered form: less padding on mobile */
    .centered-form { padding: 10px; }
    .form-card     { padding: 16px; }

    /* Event view summary: smaller key column */
    .event-summary .kv b { min-width: 100px; }
    .event-items-table, .event-sales-table { overflow-x: auto; }
}

/* Event scan - cart actions row (Print + Save) */
.cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--gray-200);
    background: var(--white);
}
.cart-actions .btn { width: 100%; }

@media (max-width: 720px) {
    .cart-actions { grid-template-columns: 1fr; }
}

/* ============================================================
 * Persistent User Manual button (always-visible FAB)
 * Bottom-LEFT of the viewport. We pick the left side because:
 *  - the top is taken by the app-header buttons (Logout, Back, Cancel)
 *  - the bottom-right is taken by the mobile cart FAB on small screens
 *    and by Continue to Payment on the sale view footer
 * ============================================================ */
#userManualFab {
    position: fixed;
    bottom: 18px;
    left: 18px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 10px 14px;
    background: var(--primary);
    color: var(--white);
    border: 1px solid var(--primary-dark);
    border-radius: 24px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    line-height: 1;
}
#userManualFab:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.30);
}
#userManualFab .umf-icon { font-size: 16px; }
#userManualFab .umf-label { white-space: nowrap; }

/* Hide on login screen (body gets .user-manual-hidden when loginView active) */
body.user-manual-hidden #userManualFab { display: none; }

/* Mobile: shrink to icon-only circle so it doesn't take screen real estate */
@media (max-width: 720px) {
    #userManualFab {
        bottom: 14px;
        left: 14px;
        padding: 12px;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        justify-content: center;
    }
    #userManualFab .umf-icon { font-size: 20px; }
    #userManualFab .umf-label { display: none; }
}
/* ============================================================
 * Guest identification (event sale, step 1)
 * Two free-text inputs (Name + Phone) side by side. The Name
 * input is wired to a <datalist> that autocompletes from Odoo's
 * res.partner. Both fields are optional.
 * ============================================================ */
.step-optional {
    background: #f0f2f7;
    color: var(--gray-700, #4a5568);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.guest-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 180px;
}
.guest-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-700, #4a5568);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.guest-field input {
    padding: 10px 12px;
    border: 1px solid var(--gray-300, #d0d0d0);
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.guest-field input:focus {
    outline: none;
    border-color: var(--primary, #1B2A4E);
    box-shadow: 0 0 0 3px rgba(27, 42, 78, 0.12);
}
.guest-linked {
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: flex-end;
    margin-bottom: 2px;
}
.linked-badge {
    background: #d6dff0;
    color: #1B2A4E;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.btn-linkless {
    background: transparent;
    border: 1px solid var(--gray-300, #d0d0d0);
    color: var(--gray-700, #4a5568);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.btn-linkless:hover {
    background: #ffe0e0;
    border-color: var(--danger, #c0392b);
    color: var(--danger, #c0392b);
}