:root {
    --navy: #0C3B5C;
    --navy-dark: #082944;
    --blue: #185FA5;
    --blue-light: #E6F1FB;
    --ink: #1E2126;
    --ink-soft: #5A6270;
    --border: #DCE2E8;
    --bg: #F5F7FA;
    --white: #FFFFFF;
    --green: #1E7B4D;
    --green-bg: #E4F5EC;
    --red: #B23A2E;
    --red-bg: #FBEAE8;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

/* ---------- Auth page ---------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
}

.auth-card {
    background: var(--white);
    width: 100%;
    max-width: 360px;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.auth-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
    color: var(--navy);
}

.auth-subtitle {
    margin: 0 0 1.5rem;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

/* ---------- Forms (shared) ---------- */
form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 1rem 0 0.35rem;
    color: var(--ink);
}

form input[type="text"],
form input[type="password"],
form input[type="number"],
form textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    font-family: inherit;
}

form input:focus {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
    border-color: var(--blue);
}

.form-error {
    color: var(--red);
    font-size: 0.85rem;
    min-height: 1.1em;
    margin-top: 0.6rem;
}

.form-success {
    color: var(--green);
    font-size: 0.85rem;
    margin-top: 0.6rem;
    overflow-wrap: anywhere;
}

.modal-subtitle {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

button { font-family: inherit; cursor: pointer; }

.btn-primary {
    background: var(--blue);
    color: var(--white);
    border: none;
    padding: 0.65rem 1.1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}
.btn-primary:hover { background: var(--navy); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-secondary {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--border);
    padding: 0.65rem 1.1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.btn-secondary:hover { background: var(--bg); }

.btn-link {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
}
.btn-link:hover { text-decoration: underline; }

.auth-card button[type="submit"] {
    width: 100%;
    margin-top: 1.4rem;
    background: var(--blue);
    color: var(--white);
    border: none;
    padding: 0.7rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
}
.auth-card button[type="submit"]:hover { background: var(--navy); }

/* ---------- App shell ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--navy);
    color: var(--white);
    padding: 0.85rem 1.5rem;
}
.topbar-brand { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 0.6rem; }
.topbar-brand span { font-weight: 400; opacity: 0.75; }
.topbar-back-link {
    color: var(--white);
    display: flex;
    align-items: center;
    text-decoration: none;
    opacity: 0.9;
}
.topbar-back-link:hover { opacity: 1; }

/* Centered-title header variant, used on shop/detail-style pages where
   the page title lives in the header itself. Uses equal-width outer
   columns so the title stays visually centered regardless of how wide
   the back link vs. the nav menu actually are. */
.topbar-centered { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.topbar-centered .topbar-back-link { grid-column: 1; justify-self: start; }
.topbar-centered .topbar-nav { grid-column: 3; justify-self: end; }
.topbar-center-title {
    grid-column: 2;
    font-weight: 700;
    font-size: 1.05rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55vw;
}
.topbar-center-stack {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 65vw;
}
.topbar-center-stack-title {
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.topbar-center-stack-subtitle {
    font-size: 0.72rem;
    font-weight: 400;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 0.1rem;
}
.topbar-nav { display: flex; align-items: center; gap: 1rem; font-size: 0.85rem; }
.topbar-user { opacity: 0.85; }
.topbar .btn-link { color: var(--white); }

.nav-dropdown { position: relative; }
.nav-menu-btn { font-size: 0.85rem; }
.nav-menu-panel {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 190px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    z-index: 50;
}
.nav-menu-panel[hidden] {
    display: none;
}
.nav-menu-panel a,
.nav-menu-panel button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--ink);
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
}
.nav-menu-panel a:hover,
.nav-menu-panel button:hover { background: var(--bg); }

.page { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem 110px; }
.page label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 1rem 0 0.35rem;
    color: var(--ink);
}
.page input[type="text"],
.page input[type="number"],
.page select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
}
.page input:focus, .page select:focus {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
    border-color: var(--blue);
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.page-header h1 { margin: 0; font-size: 1.5rem; }

.toggle-inactive {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 1rem;
}

/* ---------- Table ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.data-table th, .data-table td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.data-table th {
    background: var(--bg);
    color: var(--ink-soft);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.row-actions { text-align: right; white-space: nowrap; }

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.status-active { background: var(--green-bg); color: var(--green); }
.status-inactive { background: var(--red-bg); color: var(--red); }

.empty-state {
    text-align: center;
    color: var(--ink-soft);
    padding: 2rem;
}

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 30, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal[hidden] {
    display: none;
}
.modal-card {
    background: var(--white);
    width: 100%;
    max-width: 400px;
    padding: 1.75rem;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.modal-card h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.4rem;
}

/* ---------- Vendor mobile-first additions ---------- */
.brand-logo {
    height: 28px;
    width: 28px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.tenant-picker {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.tenant-picker-item { margin: 0; }
.tenant-picker-btn {
    width: 100%;
    text-align: left;
    background: var(--white);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}
.tenant-picker-btn:hover { border-color: var(--blue); }

.search-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    box-sizing: border-box;
}
.search-input:focus {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
    border-color: var(--blue);
}

.back-link {
    display: inline-block;
    color: var(--blue);
    text-decoration: none;
    font-size: 0.88rem;
    margin-bottom: 0.75rem;
}
.back-link:hover { text-decoration: underline; }

.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    min-height: 44px; /* touch target */
    overflow: hidden;
}
.list-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.list-card-static { cursor: default; }
.card-clickable { cursor: pointer; }
.card-clickable:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.list-card-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.list-card-wrap .list-card { flex: 1; }
.list-card-wrap .edit-shop-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.2rem;
}
.list-card-main { flex: 1; min-width: 0; }
.list-card-title { font-weight: 600; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card-sub { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card-meta {
    font-size: 0.85rem;
    color: var(--ink-soft);
    white-space: nowrap;
    font-weight: 600;
}
.points-positive { color: var(--green); }
.points-negative { color: var(--red); }
.history-reversed { opacity: 0.55; }
.history-undone-tag { font-weight: 400; font-size: 0.82rem; color: var(--ink-soft); font-style: italic; }

.points-preview {
    color: var(--ink-soft);
    text-align: center;
    margin: 0.6rem 0;
    font-size: 0.85rem;
}
.points-preview[hidden] { display: none; }
.points-preview-number {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
}

.customer-header { margin-bottom: 1.2rem; }
.customer-header h1 { margin: 0 0 0.2rem; font-size: 1.4rem; }
.customer-sub { font-size: 0.88rem; color: var(--ink-soft); }

.points-balance {
    background: var(--blue-light);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin: 1.2rem 0;
}
.points-balance-number { font-size: 2.4rem; font-weight: 700; color: var(--navy); line-height: 1; }
.points-balance-label { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.3rem; text-transform: uppercase; letter-spacing: 0.04em; }

.btn-full { width: 100%; padding: 0.85rem; font-size: 1rem; margin-bottom: 1.5rem; }
.btn-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.btn-row .btn-primary, .btn-row .btn-secondary {
    flex: 1;
    padding: 0.85rem;
    font-size: 1rem;
}

.section-heading { font-size: 1.05rem; margin: 1.5rem 0 0.8rem; }

.color-input-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.color-input-row input[type="color"] {
    width: 44px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
}
.color-input-row input[type="text"] { flex: 1; }

.image-preview-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.image-preview-wrap[hidden] {
    display: none;
}
.image-preview {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
}
.upload-status {
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin: 0.4rem 0 0;
    min-height: 1em;
}
.list-card-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    margin-right: 0.2rem;
}
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.gallery-thumb {
    position: relative;
    width: 44px;
    height: 44px;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.gallery-thumb-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--red);
    color: var(--white);
    border: 2px solid var(--white);
    font-size: 0.7rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.list-card-content {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.method-picker {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.method-picker[hidden] {
    display: none;
}
.method-option {
    flex: 1;
    min-width: 150px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem;
    text-align: left;
    cursor: pointer;
}
.method-option:hover { border-color: var(--blue); }
.method-option-selected {
    border-color: var(--blue);
    background: var(--blue-light);
}
.method-option-title { font-weight: 600; font-size: 0.95rem; }
.method-option-sub { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.2rem; }

.radio-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
}
.radio-option input[type="radio"] { margin-top: 0.2rem; }

.day-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}
.day-tab {
    flex: 1;
    min-width: 44px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.55rem 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
}
.day-tab:hover { border-color: var(--blue); }
.day-tab-selected {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}

.route-stop { gap: 0.75rem; }
.route-stop-number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--navy);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.route-stop-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}
.route-stop-actions .btn-link {
    padding: 0.3rem 0.5rem;
    font-size: 1rem;
}
.route-stop-actions .btn-link:disabled { opacity: 0.3; cursor: default; }

.add-to-route-row { margin-top: 1rem; }
#add-shop-select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
}

.swipe-wrap {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}
.swipe-bg {
    position: absolute;
    inset: 0;
    background: var(--green);
    color: var(--white);
    display: flex;
    align-items: center;
    padding-left: 1.1rem;
    font-weight: 600;
    font-size: 0.95rem;
    gap: 0.4rem;
}
.swipe-row {
    position: relative;
    touch-action: pan-y;
    transition: transform 180ms ease;
    cursor: pointer;
}
.swipe-row.swipe-dragging { transition: none; }

/* Larger touch targets on small screens */
@media (max-width: 480px) {
    .page { padding: 0 1rem 110px; margin-top: 1rem; }
    .btn-primary, .btn-secondary, .btn-link { min-height: 40px; }
    .page-header { flex-wrap: wrap; gap: 0.75rem; }
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: 400;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ---------- Business dropdown switcher ---------- */
.section-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--navy, var(--ink));
    margin-bottom: 0.5rem;
}
.biz-dropdown { position: relative; max-width: 420px; }
.biz-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    background: var(--white);
    border: 1.5px solid var(--blue);
    border-radius: 8px;
    cursor: pointer;
}
.biz-dropdown-chevron { color: var(--blue); flex-shrink: 0; transition: transform 0.15s ease; }
.biz-dropdown-toggle[aria-expanded="true"] .biz-dropdown-chevron { transform: rotate(180deg); }
.biz-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    overflow: hidden;
    z-index: 10;
}
.biz-dropdown-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--white);
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
}
.biz-dropdown-option:last-child { border-bottom: none; }
.biz-dropdown-option:hover { background: var(--bg); }
.biz-dropdown-option-active { background: var(--blue-bg, #EAF2FB); }

.biz-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    max-width: 560px;
}
.biz-overview-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem 0.6rem;
    text-align: center;
}
.biz-overview-icon { color: var(--navy, var(--blue)); margin-bottom: 0.5rem; display: flex; justify-content: center; }
.biz-overview-number { font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.biz-overview-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    margin-top: 0.2rem;
}

@media (max-width: 480px) {
    .biz-overview-grid { gap: 0.5rem; }
    .biz-overview-number { font-size: 1.15rem; }
}

/* ---------- Shop list row - icon badge, stats, points, chevron ---------- */
.shop-row { gap: 0.85rem; }
.shop-row .list-card-main { flex: 1; min-width: 0; }
.shop-row-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--navy, var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.shop-row-stat { text-align: center; flex-shrink: 0; min-width: 72px; }
.shop-row-stat-number { font-size: 1.05rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.shop-row-stat-label { font-size: 0.72rem; color: var(--ink-soft); white-space: nowrap; }
.shop-row-pending { font-size: 0.72rem; color: var(--blue); font-weight: 600; white-space: nowrap; margin-top: 0.1rem; }
.shop-row-points {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 78px;
    text-align: right;
}
.shop-row-chevron { color: var(--ink-soft); flex-shrink: 0; }

@media (max-width: 480px) {
    .shop-row { gap: 0.5rem; padding: 0.85rem 0.75rem; }
    .shop-row-icon { width: 36px; height: 36px; }
    .shop-row-stat { min-width: 56px; }
    .shop-row-stat-number { font-size: 0.92rem; }
    .shop-row-stat-label, .shop-row-pending { font-size: 0.64rem; }
    .shop-row-points { font-size: 0.8rem; min-width: 62px; }
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

/* ---------- Customer detail page - profile card & points summary ---------- */
.profile-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
}
.customer-avatar-large { width: 56px; height: 56px; font-size: 1.1rem; }
.profile-card-name { font-weight: 700; font-size: 1.15rem; margin-bottom: 0.15rem; }

.points-summary-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
}
.points-summary-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; color: var(--blue); }
.points-summary-balance { font-size: 2.2rem; font-weight: 800; color: var(--green); margin-top: 0.25rem; }
.points-summary-divider { border-top: 1px solid var(--border); margin: 1rem 0; }
.points-summary-row { display: flex; justify-content: space-around; text-align: center; }
.points-summary-sublabel { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-soft); }
.points-summary-subvalue { font-size: 1rem; font-weight: 700; color: var(--ink); margin-top: 0.2rem; }

.points-summary-card-compact { padding: 0.85rem 1.1rem; margin-bottom: 0.85rem; }
.points-summary-balance-compact { font-size: 1.5rem; margin-top: 0.15rem; }
.points-summary-card-compact .points-summary-divider { margin: 0.65rem 0; }

.edit-icon-btn {
    background: none;
    border: none;
    color: var(--ink-soft);
    padding: 0.15rem;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 0.3rem;
    cursor: pointer;
}
.edit-icon-btn:hover { color: var(--blue); }

/* ---------- Promotions: status tabs ---------- */
.promo-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.7rem;
}
.promo-tab {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}
.promo-tab-active { background: var(--navy, var(--blue)); border-color: var(--navy, var(--blue)); color: var(--white); }

/* ---------- Promotion type badges ---------- */
.promo-type-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.promo-type-featured { background: var(--green-bg); color: var(--green); }
.promo-type-deal { background: #FDE9D0; color: #B5590A; }
.promo-type-special { background: #DCEAFB; color: var(--blue); }

.status-scheduled { background: #DCEAFB; color: var(--blue); }
.status-draft { background: var(--bg); color: var(--ink-soft); }
.status-expired { background: var(--red-bg); color: var(--red); }

/* ---------- Add/Edit promotion modal ---------- */
.promotion-modal-card { max-width: 520px; max-height: 88vh; overflow-y: auto; }
.promotion-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.promotion-modal-head h2 { margin: 0; }
.modal-x-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}
.modal-x-btn:hover { color: var(--ink); }

.promo-schedule-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.5rem;
}
.promo-schedule-grid label { font-size: 0.8rem; }
.promo-schedule-grid input[type="date"],
.promo-schedule-grid input[type="time"] {
    padding: 0.5rem 0.4rem;
    font-size: 0.85rem;
}

/* ---------- Lightweight rich text editor ---------- */
.rte-toolbar { display: flex; gap: 0.3rem; margin-top: 0.4rem; }
.rte-btn {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 32px;
}
.rte-btn:hover { background: var(--bg); }
.rte-editor {
    border: 1px solid var(--border);
    border-radius: 6px;
    min-height: 100px;
    padding: 0.6rem 0.7rem;
    font-size: 0.95rem;
    margin-top: 0.35rem;
    background: var(--white);
}
.rte-editor:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.rte-editor ul, .rte-editor ol { margin: 0.3rem 0 0.3rem 1.2rem; padding: 0; }

/* ---------- Standard bottom nav footer ---------- */
.vendor-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    z-index: 30;
}
.vendor-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.55rem 0 0.5rem;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
}
.vendor-bottom-nav-active { color: var(--navy, var(--blue)); }

/* ---------- More page rows ---------- */
.more-row-icon {
    color: var(--navy, var(--blue));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
}
.more-row .list-card-main { flex: 1; }

.audit-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    text-align: center;
    margin-top: 0.5rem;
}
.audit-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0.85rem 0;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

@media (max-width: 480px) {
    .audit-summary-row { grid-template-columns: 1fr 1fr; row-gap: 1rem; }
}

/* Squared variant of the tab pills, used for Audit History's filters */
.audit-tab {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}
.audit-tab-active { background: var(--navy, var(--blue)); border-color: var(--navy, var(--blue)); color: var(--white); }

.audit-search-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}
.audit-search-row .search-input { flex: 1; margin-bottom: 0; min-width: 0; }
.audit-search-row select { flex-shrink: 0; width: auto; }

/* Tighter transaction rows for the audit history list specifically -
   scoped rather than changing .list-card globally, since that's shared
   across every list in the app. */
.audit-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    font-size: 0.85rem;
}
.audit-table th:nth-child(1), .audit-table td:nth-child(1) { width: 38%; }
.audit-table th:nth-child(2), .audit-table td:nth-child(2) { width: 40%; }
.audit-table th:nth-child(3), .audit-table td:nth-child(3) { width: 22%; }
.audit-table td:nth-child(1), .audit-table td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.audit-table thead th {
    text-align: left;
    padding: 0.7rem 1.1rem;
    background: var(--bg);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ink-soft);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.audit-table thead th:hover { color: var(--ink); }
.sort-arrow { font-size: 0.65rem; color: var(--navy, var(--blue)); }
.audit-row td {
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}
.audit-row:hover td { background: var(--bg); }
.audit-table-points-col { text-align: right; font-weight: 700; white-space: nowrap; }

/* ---------- Settings page: card-based section groups ---------- */
.settings-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
}
.settings-card-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
}
.settings-icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.settings-icon-green { background: var(--green-bg); color: var(--green); }
.settings-icon-blue { background: #DCEAFB; color: var(--blue); }
.settings-icon-purple { background: #EDE4FB; color: #6B3FA0; }
.settings-card-title { font-weight: 700; font-size: 1.02rem; }
.settings-card-sub { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.1rem; }

/* ---------- Pending-item alert badges ---------- */
.pending-badge {
    background: var(--red);
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 0.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 0.4rem;
}
.vendor-bottom-nav-icon-wrap { position: relative; display: inline-flex; }
.vendor-bottom-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--red);
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    padding: 0 0.25rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.promo-engagement-stat {
    font-size: 0.78rem;
    color: var(--blue);
    font-weight: 600;
    margin-top: 0.3rem;
    cursor: pointer;
}
.promo-engagement-stat:hover { text-decoration: underline; }

.requests-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #EAF2FB;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.25rem;
}
.requests-count {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--blue);
    flex-shrink: 0;
    margin-right: 0.5rem;
}


/* ---------- Compact customer rows (customers.php, pending customers) ---------- */
.customer-row { padding: 0.55rem 0.8rem; gap: 0.5rem; }
.customer-row .customer-avatar { width: 34px; height: 34px; font-size: 0.78rem; }
.customer-row .list-card-content { gap: 0.55rem; }
.customer-row .list-card-title,
.customer-row .list-card-sub {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.3;
}
.customer-row .list-card-sub { margin-top: 0.05rem; font-size: 0.82rem; }
.customer-row-num { font-weight: 400; font-size: 0.8rem; color: var(--ink-soft); margin-left: 0.35rem; white-space: nowrap; }

/* Overview card that acts as a button */
a.biz-overview-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-color: var(--blue);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: pointer;
}
a.biz-overview-card-link:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.14); }
a.biz-overview-card-link:active { transform: translateY(1px); }
a.biz-overview-card-link .biz-overview-label { color: var(--blue); }

/* Banner button on the customer page when offers are waiting for pickup */
.pickup-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: var(--white);
    border: 1px solid var(--blue);
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}
.pickup-banner-link { color: var(--blue); font-size: 0.9rem; }
.pickup-banner:disabled {
    border-color: var(--border);
    color: var(--ink-soft);
    font-weight: 400;
    cursor: default;
    opacity: 0.7;
}

/* A badge with the hidden attribute must stay hidden even though the badge rules set display */
.pending-badge[hidden],
.vendor-bottom-nav-badge[hidden] { display: none; }

/* ---------- Header alert bell ---------- */
.bell-btn {
    position: relative;
    color: var(--white);
    display: flex;
    padding: 0.2rem;
    text-decoration: none;
    opacity: 0.95;
}
.bell-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--red);
    color: var(--white);
    font-size: 0.62rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    text-align: center;
    box-sizing: border-box;
}
.bell-badge[hidden] { display: none; }

.topbar a.bell-btn,
.topbar a.bell-btn:visited { color: var(--white); }

/* Today page: mark which tab is the current day of the week. */
.day-tab-today { position: relative; }
.day-tab-today::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
    border-radius: 50%;
    background: var(--blue);
}
.day-tab-selected.day-tab-today::after { background: var(--white); }

/* First-run guide for a vendor with no shops yet. */
.getting-started {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin: 1.2rem 0;
}
.getting-started[hidden] { display: none; }
.getting-started h2 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.getting-started p { margin: 0 0 0.6rem; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.45; }
.getting-started ol { margin: 0 0 0.6rem; padding-left: 1.25rem; font-size: 0.9rem; line-height: 1.45; }
.getting-started li { margin-bottom: 0.5rem; }
.getting-started-note { margin-bottom: 0; }

/* Delete account page */
.delete-account-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); padding: 1rem; margin: 0.8rem 0; }
.delete-account-card[hidden], #plan[hidden], #plan-loading[hidden] { display: none; }
.delete-account-title { font-weight: 700; margin-bottom: 0.4rem; }
.delete-account-list { margin: 0.4rem 0 0; padding-left: 1.2rem; font-size: 0.95rem; }
.delete-account-list li { margin-bottom: 0.35rem; }
.delete-account-note { margin: 0.6rem 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.delete-account-blocked { border-color: var(--red); background: var(--red-bg); }
.delete-account-btn { margin-top: 0.8rem; background: var(--red); }
#delete-account-form[hidden] { display: none; }

/* Centered links under the sign-in form */
.auth-links { margin: 0 0 1.5rem; color: var(--ink-soft); font-size: 0.9rem; text-align: center; }

/* ---------- iPhone safe areas (status bar, notch, home indicator) ---------- */
body:not(:has(.topbar, .app-topbar)) { padding-top: env(safe-area-inset-top, 0px); }
.bottom-nav, .vendor-bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0px); }
.topbar { padding-top: calc(0.85rem + env(safe-area-inset-top, 0px)); }
body:has(.vendor-bottom-nav) { padding-bottom: env(safe-area-inset-bottom, 0px); }
