/* NivroBazaar - one stylesheet for the hybrid app and the web app.
   Mobile first: bottom tab bar on phones, sidebar from 900px. */
@import url("themes.css"); /* category themes - generated by tools/themes/build_themes.py */

:root {
  --green-900: #0f3f2d;
  --green-700: #1b6b4c;
  --green-600: #227d59;
  --green-100: #e3f1ea;
  --green-50: #f1f8f4;
  --amber: #f2a93b;
  --amber-100: #fdf1dc;
  --red: #c0392b;
  --red-100: #fbe7e4;
  --ink: #1d2721;
  --ink-2: #4a5650;
  --muted: #6d7872;
  --line: #e2e6e3;
  --bg: #f5f6f3;
  --surface: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 4px 16px rgba(16, 40, 30, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
  --bottom-nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: .35rem 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
.icon { flex-shrink: 0; vertical-align: middle; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
.link { color: var(--green-700); font-weight: 600; }
.link:hover { text-decoration: underline; }
.text-danger { color: var(--red) !important; }
.text-success { color: var(--green-700); }
.row-end { display: flex; justify-content: flex-end; margin: -.25rem 0 .75rem; }
.grow { flex: 1; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .6rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 600; cursor: pointer;
  background: var(--surface); transition: background .15s, border-color .15s, transform .05s;
  text-align: center; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--green-600); }
.btn-outline { border-color: var(--line); background: var(--surface); }
.btn-outline:hover:not(:disabled) { border-color: var(--green-700); color: var(--green-700); }
.btn-ghost { background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--green-50); }
.btn-sm { min-height: 34px; padding: .35rem .75rem; font-size: .85rem; }
.btn-block { display: flex; width: 100%; margin-top: .75rem; }
.btn-row { display: flex; gap: .5rem; align-items: center; }
.btn-row.wrap { flex-wrap: wrap; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--green-50); color: var(--green-700); }
.icon-btn-light { color: #fff; }
.icon-btn-light:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.back-link {
  display: inline-flex; align-items: center; gap: .25rem; margin-bottom: .75rem;
  color: var(--muted); font-size: .9rem; background: none; border: none; padding: 0; cursor: pointer;
}
.back-link:hover { color: var(--green-700); }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 400; }
.input {
  width: 100%; min-height: 44px; padding: .6rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); font: inherit; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: none; border-color: var(--green-700); box-shadow: 0 0 0 3px var(--green-100); }
.input[readonly] { background: var(--bg); }
.input-compact { width: auto; min-height: 36px; padding: .3rem .5rem; }
.inline-form { display: flex; gap: .5rem; align-items: stretch; }
.inline-form .input { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: .55rem; margin: .45rem 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green-700); }
.form-error { color: var(--red); background: var(--red-100); border-radius: var(--radius-sm); padding: .55rem .75rem; font-size: .9rem; }
.color-input { width: 48px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; background: #fff; }
.subsection { border-top: 1px dashed var(--line); margin-top: .5rem; padding-top: .5rem; }
input[type=range] { accent-color: var(--green-700); width: 100%; }

.search-bar {
  display: flex; align-items: center; gap: .5rem; padding: 0 .35rem 0 .8rem; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
}
.search-bar .input { border: none; background: transparent; box-shadow: none; padding-left: 0; }
.search-bar .input-compact { border-left: 1px solid var(--line); border-radius: 0; }

.segmented { display: flex; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; margin-bottom: .85rem; }
.segmented button { flex: 1; border: none; background: transparent; padding: .55rem; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--green-700); box-shadow: var(--shadow); }

.toggle-list { margin: .5rem 0; }
.toggle { display: flex; align-items: center; justify-content: space-between; padding: .6rem 0; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { flex: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; }
.toggle > span:first-child { flex: 1; min-width: 0; margin-right: .75rem; }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.toggle input:checked + .toggle-track { background: var(--green-700); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px var(--green-100); }

/* ---------------------------------------------------------------- splash & auth */
.splash {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  background: radial-gradient(circle at 30% 20%, var(--green-600), var(--green-900) 70%); color: #fff; text-align: center; padding: 2rem;
}
.splash-mark {
  width: 92px; height: 92px; border-radius: 28px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25);
  animation: splash-pop .6s cubic-bezier(.2, .9, .3, 1.3) both;
}
.splash-title { font-size: 1.6rem; margin-top: .6rem; animation: fade-up .5s .15s both; }
.splash-tagline { opacity: .8; margin-bottom: 1.5rem; animation: fade-up .5s .25s both; }
@keyframes splash-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade-up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.auth-shell {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: calc(1.5rem + var(--safe-top)) 1rem 2rem;
  background: linear-gradient(180deg, var(--green-700) 0 220px, var(--bg) 220px);
}
.auth-brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; font-size: 1.1rem; margin-bottom: 1.25rem; }
.auth-brand .brand-mark { background: rgba(255, 255, 255, .16); color: #fff; }
.auth-main { width: 100%; max-width: 440px; }
.auth-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 1.5rem 1.25rem; }
.auth-card-wide { max-width: 560px; }
.auth-main:has(.auth-card-wide) { max-width: 560px; }
.auth-card h1 { margin-bottom: .25rem; }
.auth-card > .muted { margin-bottom: 1.25rem; }
.divider { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0 .25rem; color: var(--muted); font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.choice-card {
  display: flex; align-items: center; gap: .9rem; padding: 1rem; margin-bottom: .75rem;
  border: 1.5px solid var(--line); border-radius: var(--radius); transition: border-color .15s, background .15s;
}
.choice-card:hover { border-color: var(--green-700); background: var(--green-50); }
.choice-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--green-100); color: var(--green-700); }
.choice-text { flex: 1; display: flex; flex-direction: column; gap: .15rem; }

.stepper { display: flex; list-style: none; padding: 0; margin: .75rem 0 1.25rem; gap: .35rem; counter-reset: step; }
.stepper li { flex: 1; font-size: .78rem; color: var(--muted); padding-top: .55rem; border-top: 3px solid var(--line); counter-increment: step; }
.stepper li::before { content: counter(step) ". "; }
.stepper li.current { color: var(--green-700); font-weight: 700; border-color: var(--green-700); }
.stepper li.done { color: var(--ink-2); border-color: var(--green-100); }

.notice { display: flex; gap: .75rem; padding: .9rem; border-radius: var(--radius-sm); margin-bottom: .5rem; }
.notice-success { background: var(--green-50); color: var(--green-900); }
.notice p { margin: .2rem 0 0; font-size: .9rem; }

.status-screen { max-width: 480px; margin: 2rem auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.status-icon { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; background: var(--amber-100); color: #a86b0c; }

/* ---------------------------------------------------------------- shell */
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--green-700); color: #fff; }
.app-shell { min-height: 100vh; }
.sidebar { display: none; }
.main-column { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(.5rem + var(--safe-top)) .75rem .5rem 1rem; background: rgba(245, 246, 243, .92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; min-width: 0; }
.topbar-brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.content { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 1rem 1rem calc(var(--bottom-nav-h) + var(--safe-bottom) + 5.5rem); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom);
}
.bottom-nav::-webkit-scrollbar { display: none; }
.bottom-link {
  flex: 1 0 72px; height: var(--bottom-nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: .7rem; font-weight: 600; color: var(--muted);
}
.bottom-link.active { color: var(--green-700); }
button.bottom-link { background: none; border: none; cursor: pointer; font-family: inherit; }
/* "More" sheet: the menu entries that don't fit in the bottom bar */
.more-backdrop { position: fixed; inset: 0; z-index: 28; background: rgba(0, 0, 0, .25); }
.more-sheet {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom)); z-index: 29;
  background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, .12);
  padding: .5rem .75rem .75rem; max-height: 70vh; overflow-y: auto;
}
.more-head { display: flex; align-items: center; justify-content: space-between; padding: .25rem .25rem .5rem; }
.more-link { display: flex; align-items: center; gap: .75rem; padding: .85rem .5rem; border-radius: 12px; color: var(--ink); font-weight: 600; }
.more-link.active { background: var(--green-50); color: var(--green-700); }
@media (min-width: 900px) { .more-backdrop, .more-sheet { display: none; } }

@media (min-width: 900px) {
  .app-shell { display: grid; grid-template-columns: 250px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 1.25rem .75rem;
    background: var(--green-900); color: #dfeee6;
  }
  .sidebar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: #fff; padding: 0 .5rem 1rem; }
  .sidebar-brand .brand-mark { background: rgba(255, 255, 255, .14); }
  .sidebar-context { display: flex; flex-direction: column; gap: .3rem; padding: 0 .5rem 1rem; }
  .sidebar-context .muted { color: #a7c2b4; }
  /* The menu scrolls inside the sidebar, so every item stays reachable on a short window
     (Host Admin has 9 entries plus Notifications / Account / Sign out). */
  .sidebar { overflow: hidden; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  .sidebar-brand, .sidebar-context, .sidebar-footer { flex-shrink: 0; }
  .side-link {
    display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 10px; color: #cfe3d8; flex-shrink: 0;
    font-weight: 500; background: none; border: none; cursor: pointer; text-align: left; width: 100%;
  }
  .side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
  .side-link.active { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; }
  .sidebar-footer { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: .75rem; }
  .sidebar-footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar, .bottom-nav { display: none; }
  .content { padding: 2rem 2rem 6rem; }
  .sidebar .role-chip { background: rgba(255, 255, 255, .12); color: #fff; }
}

.role-chip { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 99px; background: var(--green-100); color: var(--green-700); width: fit-content; }

/* ---------------------------------------------------------------- page building blocks */
.page-header { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.page-header-text { flex: 1; min-width: 0; }
.page-header-text .muted { margin: .15rem 0 0; font-size: .9rem; }
.page-header-actions { display: flex; gap: .4rem; }
.section-title { font-size: 1rem; margin: 1.25rem 0 .6rem; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: .9rem; }
.card-title { font-size: 1rem; margin-bottom: .75rem; }
.card-list { display: flex; flex-direction: column; gap: .7rem; }
.card-list > .card { margin-bottom: 0; }

.list-row, .line-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.list-row:last-child, .line-item:last-child { border-bottom: none; }
.list-row-button { width: 100%; background: none; border: none; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.list-row-button:hover { background: var(--green-50); }
.line-item { display: grid; grid-template-columns: 1fr auto auto; }
.line-item.total { font-size: 1.05rem; border-top: 2px solid var(--line); }
.line-item.discount { color: var(--green-700); }
.line-item.unavailable, .product-row.unavailable { opacity: .6; }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .3rem; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; margin: 0 -1rem 1rem; padding: 0 1rem; scrollbar-width: none; }
.chip { font-size: .75rem; padding: .2rem .55rem; border-radius: 99px; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.chip-green { background: var(--green-100); color: var(--green-700); }
.chip-button { border: 1px solid var(--line); background: var(--surface); padding: .4rem .85rem; font-size: .85rem; font-weight: 600; cursor: pointer; }
.chip-button.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 6px; white-space: nowrap; }
.badge-success { background: var(--green-100); color: var(--green-700); }
.badge-warning { background: var(--amber-100); color: #8a5a08; }
.badge-danger { background: var(--red-100); color: var(--red); }
.badge-neutral { background: var(--bg); color: var(--ink-2); }

.shop-card { display: flex; align-items: center; gap: .85rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem; color: var(--muted); }
.shop-card:hover { box-shadow: 0 0 0 2px var(--green-100), var(--shadow); }
.shop-info { flex: 1; display: flex; flex-direction: column; gap: .1rem; color: var(--ink); min-width: 0; }
.shop-avatar { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; background: var(--green-100); color: var(--green-700); }
.shop-avatar.small { width: 36px; height: 36px; border-radius: 50%; font-size: .85rem; }
.shop-avatar.large { width: 64px; height: 64px; border-radius: 50%; font-size: 1.3rem; }

.shop-hero {
  --shop-color: var(--green-700);
  position: relative; margin: -1rem -1rem 1rem; padding: 1rem 1rem 1.4rem; color: #fff;
  background: linear-gradient(135deg, var(--shop-color), color-mix(in srgb, var(--shop-color) 60%, #000));
}
.shop-hero-body { display: flex; align-items: center; gap: .9rem; margin-top: .4rem; }
.shop-hero h1 { color: #fff; }
.shop-hero p { margin: .2rem 0 0; opacity: .9; }
.shop-logo { width: 60px; height: 60px; border-radius: 16px; object-fit: cover; background: #fff; }
@media (min-width: 900px) { .shop-hero { margin: -2rem -2rem 1.5rem; padding: 1.5rem 2rem 1.8rem; border-radius: 0 0 var(--radius) var(--radius); } }

.product-row { display: flex; align-items: center; gap: .8rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem .9rem; }
.product-info { flex: 1; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.product-actions { display: flex; flex-direction: column; gap: .35rem; align-items: stretch; }
.price { font-weight: 600; }
.product-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.product-thumb.placeholder { display: grid; place-items: center; background: var(--bg); color: var(--muted); }

.sticky-actions {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom)); z-index: 25;
  display: flex; gap: .6rem; padding: .7rem 1rem; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .sticky-actions { left: 250px; bottom: 0; padding: .8rem 2rem; } }

.order-card { display: flex; flex-direction: column; gap: .3rem; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.order-items { list-style: none; margin: .3rem 0; padding: .4rem 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.order-items li { display: flex; justify-content: space-between; gap: .75rem; padding: .15rem 0; font-size: .9rem; }
.order-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }

.stat-hero { background: linear-gradient(135deg, var(--green-700), var(--green-900)); color: #fff; border-radius: var(--radius); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; }
.stat-hero .stat-label { color: #cfe3d8; }
.stat-hero .stat-value { font-size: 2rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.stat { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .15rem; }
.stat-link:hover { box-shadow: 0 0 0 2px var(--green-100), var(--shadow); }
.stat-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-danger .stat-value { color: var(--red); }
.stat-warning .stat-value { color: #b7770f; }

.date-range { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.date-range .field { flex: 1; min-width: 130px; }
.date-range .btn { margin-bottom: .85rem; }

.bar-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: .6rem; padding: .35rem 0; font-size: .9rem; }
.bar-track { display: block; height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; margin-top: .3rem; }
.bar-fill { display: block; height: 100%; border-radius: 99px; background: var(--green-600); }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.report-row:last-child { border-bottom: none; }
.report-row-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.profile-card { display: flex; align-items: center; gap: 1rem; }

.empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty p { max-width: 320px; }

/* chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 320px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; background: var(--green-50); }
.bubble { max-width: 78%; align-self: flex-start; background: var(--surface); border-radius: 14px 14px 14px 4px; padding: .5rem .75rem; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.bubble-mine { align-self: flex-end; background: var(--green-700); color: #fff; border-radius: 14px 14px 4px 14px; }
.bubble-meta { display: block; font-size: .7rem; opacity: .7; margin-top: .15rem; text-align: right; }
.chat-compose { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--line); }
.chat-compose .input { flex: 1; }

.split { display: grid; gap: 1rem; }
.split-list { display: flex; flex-direction: column; gap: .35rem; }
.thread { display: flex; align-items: center; gap: .7rem; padding: .7rem; border-radius: var(--radius-sm); border: none; background: var(--surface); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.thread.active { box-shadow: 0 0 0 2px var(--green-700); }
.thread-text { flex: 1; display: flex; flex-direction: column; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); }
.show-mobile { display: inline-flex; }
@media (max-width: 899px) { .hide-mobile { display: none !important; } }
@media (min-width: 900px) {
  .split { grid-template-columns: 300px 1fr; align-items: start; }
  .show-mobile { display: none; }
  .chat { height: calc(100vh - 170px); }
}

/* map & photos */
.map { width: 100%; border-radius: var(--radius); overflow: hidden; background: #e8ece9; box-shadow: var(--shadow); z-index: 0; }
.upload-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1.6rem; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-2); cursor: pointer; text-align: center; }
.upload-drop:hover { border-color: var(--green-700); background: var(--green-50); }
.upload-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.crop-preview { position: relative; background: #eee; border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; max-height: 320px; }
.crop-preview img { max-height: 320px; transition: transform .2s; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); pointer-events: none; }

/* ---------------------------------------------------------------- loading, dialogs, toast */
.loading { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 2.5rem 1rem; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--green-100); border-top-color: var(--green-700); animation: spin .8s linear infinite; display: inline-block; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }
.spinner-light { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.dialog-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 30, 22, .45); display: flex; align-items: flex-end; justify-content: center; padding: 1rem; animation: fade .15s; }
.dialog { width: 100%; max-width: 420px; background: var(--surface); border-radius: 18px; padding: 1.25rem; box-shadow: 0 12px 40px rgba(0,0,0,.2); animation: fade-up .2s; margin-bottom: var(--safe-bottom); }
@media (min-width: 600px) { .dialog-backdrop { align-items: center; } }
.dialog-title { font-size: 1.15rem; margin-bottom: .4rem; }
.dialog-message { color: var(--ink-2); white-space: pre-line; }
.dialog .input { margin-top: .6rem; }
.dialog-options { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; }
.dialog-options .btn-block { margin-top: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 5rem); z-index: 1100;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  max-width: calc(100% - 2rem); font-size: .9rem; animation: fade-up .2s;
}
.toast-error { background: var(--red); }
@media (min-width: 900px) { .toast { bottom: 2rem; left: calc(50% + 125px); } }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000; background: #fff3cd; padding: .75rem 1rem; box-shadow: 0 -1px 4px rgba(0,0,0,.15); }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* integrations (Host Admin → Integrations) */
.feature-row, .provider-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.feature-row:last-child, .provider-row:last-child { border-bottom: none; }
.feature-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1; }
.feature-row .toggle, .provider-row .toggle { border: none; padding: 0; }
@media (max-width: 599px) { .provider-row { flex-direction: column; align-items: stretch; } }

/* ================================================================ catalog, shop settings, branches */
.text-warning { color: #b7770f !important; }
.block { display: block; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .75rem; }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
.field-label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: .35rem; }
.icon-btn-sm { width: 30px; height: 30px; min-width: 30px; padding: 0; }
.rot90 { transform: rotate(90deg); }
.spinner-dark { border-color: var(--green-100); border-top-color: var(--green-700); }
.btn-block-sm { width: 100%; }
.dialog-wide { max-width: 640px; max-height: calc(100vh - 2rem); overflow-y: auto; }
.notice-warning { background: var(--amber-100); color: #6b4506; }
.add-row { margin-bottom: .75rem; }
.stat-link { border: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.stat.active { box-shadow: 0 0 0 2px var(--green-700), var(--shadow); }
.stat-inline { display: flex; align-items: baseline; gap: .4rem; margin: .2rem 0 .6rem; font-size: 1.1rem; }
.chip-count { display: inline-block; min-width: 1.3em; margin-left: .25rem; padding: 0 .35rem; border-radius: 99px; background: rgba(0, 0, 0, .08); font-size: .72rem; text-align: center; }
.chip-button.active .chip-count { background: rgba(255, 255, 255, .25); }

/* product photos (1-3) */
.photo-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: .4rem; }
.photo-slot {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; color: var(--muted);
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-slot.empty { border: 2px dashed var(--line); cursor: pointer; color: var(--green-700); background: var(--green-50); }
.photo-slot.empty:hover { border-color: var(--green-600); }
.photo-slot.empty input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-slot.busy { cursor: progress; }
.photo-slot.placeholder { opacity: .45; border: 2px dashed var(--line); }
.photo-badge { position: absolute; top: 6px; left: 6px; font-size: .68rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; background: var(--green-700); color: #fff; }
.photo-actions { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: .25rem; padding: .3rem; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.photo-actions .icon-btn { color: #fff; }
.photo-actions .icon-btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }

/* business product list */
.product-row-link { display: flex; align-items: center; gap: .8rem; flex: 1; min-width: 0; color: inherit; }
.history-list { max-height: 55vh; overflow-y: auto; margin: .5rem 0; }
.history-qty { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* shop settings */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .7rem; }
.hub-card { display: flex; align-items: center; gap: .8rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; color: inherit; }
.hub-card:hover { box-shadow: 0 0 0 2px var(--green-100), var(--shadow); }
.hub-card > span:last-child { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.logo-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .8rem; flex-wrap: wrap; }
.shop-logo.placeholder { display: inline-grid; place-items: center; background: var(--bg); color: var(--muted); }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hours-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.hours-row:last-of-type { border-bottom: none; }
.hours-row .check { margin: 0; }
.hours-day { width: 3.2rem; }
.hours-row .input { width: auto; flex: 0 1 8rem; }
.shop-branch.current { box-shadow: 0 0 0 2px var(--green-700), var(--shadow); }

/* addresses */
.address-picker .map { border-radius: var(--radius-sm); margin: .6rem 0 .3rem; }
.address-options { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .4rem; }
.address-option { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.address-option input { margin-top: .2rem; accent-color: var(--green-700); }
.address-option.selected { border-color: var(--green-700); background: var(--green-50); }
.address-card p { margin: .2rem 0; }

/* customer shop page */
.shop-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: 0 0 .8rem; }
.shop-meta span { display: inline-flex; align-items: center; gap: .25rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .7rem; }
.product-card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.product-card.unavailable { opacity: .65; }
.product-card-img { position: relative; aspect-ratio: 1; border: none; padding: 0; background: var(--bg); cursor: zoom-in; display: block; width: 100%; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card-img .placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }
.discount-tag { position: absolute; top: 8px; left: 8px; font-size: .7rem; font-weight: 700; padding: .12rem .45rem; border-radius: 6px; background: var(--amber); color: #3b2503; }
.product-card-body { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .7rem .3rem; flex: 1; }
.product-name { font-size: .92rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-actions { display: flex; flex-direction: column; gap: .3rem; padding: .3rem .7rem .7rem; }
.stepper-qty { display: flex; align-items: center; justify-content: space-between; border-radius: var(--radius-sm); background: var(--green-700); color: #fff; overflow: hidden; }
.stepper-qty button { border: none; background: transparent; color: #fff; font-size: 1.2rem; font-weight: 700; width: 2.4rem; height: 2.1rem; cursor: pointer; }
.stepper-qty button:disabled { opacity: .45; cursor: default; }
.stepper-qty span { font-weight: 700; font-variant-numeric: tabular-nums; }
.gallery { display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: .6rem 0; }
.gallery img { flex: 0 0 100%; max-height: 60vh; object-fit: contain; border-radius: var(--radius-sm); background: var(--bg); scroll-snap-align: center; }

/* shell: branding, shop switcher, notifications */
.brand-logo { border-radius: 10px; object-fit: cover; background: #fff; display: inline-block; }
.splash-mark img { width: 72px; height: 72px; border-radius: 20px; object-fit: cover; }
/* NivroBazaar logo (LogoMark): its own rounded green tile, so no extra background */
.logo-mark { display: inline-block; flex: none; border-radius: 23%; vertical-align: middle; }
.splash-mark .logo-mark { border-radius: 20px; }
.sidebar-brand .logo-mark, .auth-brand .logo-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); }
.shop-switch {
  display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; padding: .3rem .55rem; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #fff; font: inherit; font-size: .85rem; cursor: pointer;
}
.shop-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-switch:hover { background: rgba(255, 255, 255, .12); }
.topbar-switch { border: none; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; padding: 0; }
.topbar-actions { display: flex; align-items: center; gap: .15rem; }
.bell { position: relative; }
.dot-badge { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }
.count-badge { margin-left: auto; min-width: 1.4rem; padding: 0 .4rem; border-radius: 99px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.4rem; }
.notification { cursor: pointer; }
.notification.unread { border-left: 4px solid var(--green-700); }
.notification.unread strong { color: var(--green-900); }
.notification p { margin: .3rem 0 .4rem; white-space: pre-line; }

/* ================================================================ trust, verification, terms, subscriptions */
button.link { background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.notice-danger { background: var(--red-100); color: #7a1f16; }
.billing-banner { color: inherit; margin-bottom: .9rem; align-items: center; }
.billing-banner:hover { text-decoration: underline; }

/* language + tagline on sign-in screens */
.lang-toggle { margin-left: auto; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff;
  border-radius: 99px; padding: .25rem .75rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.auth-brand { width: 100%; max-width: 440px; }
.auth-shell:has(.auth-card-wide) .auth-brand { max-width: 560px; }
.auth-tagline { color: #e6f3ec; margin: -.7rem 0 1rem; font-size: .92rem; text-align: center; }

/* shop cards with favourite button */
.shop-card { padding: 0; gap: 0; }
.shop-card-main { display: flex; align-items: center; gap: .85rem; flex: 1; min-width: 0; padding: .9rem; color: inherit; }
img.shop-avatar { object-fit: cover; }
.icon-btn.fav { margin-right: .5rem; color: var(--muted); }
.icon-btn.fav.on { color: #d6336c; }
.hero-fav { margin-left: auto; float: right; }
.hero-fav .icon { color: #fff; }
.rating-line { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; }
.stars { color: #e8a317; letter-spacing: 1px; }
.trust-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.trust-badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 600; padding: .15rem .5rem;
  border-radius: 99px; background: var(--bg); color: var(--ink-2); }
.trust-badge.good { background: var(--green-100); color: var(--green-700); }
.trust-badge.info { background: var(--amber-100); color: #8a5a08; }
.shop-hero .trust-badge { background: rgba(255,255,255,.18); color: #fff; }

/* avatars / profile photo */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg); }
.avatar.large { width: 64px; height: 64px; }
.avatar.xlarge { width: 96px; height: 96px; }
.avatar-edit { position: relative; flex-shrink: 0; }
.avatar-camera { position: absolute; right: -4px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green-700); color: #fff; border: 2px solid var(--surface); cursor: pointer; overflow: hidden; }
.avatar-camera input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* business: who ordered */
.customer-chip { display: flex; align-items: center; gap: .6rem; width: 100%; margin: .5rem 0; padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); font: inherit; text-align: left; cursor: pointer; color: inherit; }
.customer-chip > span { flex: 1; min-width: 0; }
.customer-chip:hover { border-color: var(--green-600); }
.delivery-box { background: var(--bg); border-radius: var(--radius-sm); padding: .55rem .7rem; margin: .4rem 0; }
.delivery-box p { margin: .1rem 0; }
.customer-card-head { display: flex; align-items: center; gap: .9rem; margin-bottom: .6rem; }
.customer-card-head .dialog-title { margin-bottom: .15rem; }
.stat-grid.compact { grid-template-columns: repeat(3, 1fr); margin-top: .7rem; }
.stat-grid.compact .stat-value { font-size: 1.1rem; }

/* verification */
.verify-card .code-entry { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; }
.code-input { letter-spacing: .35em; font-size: 1.2rem; font-weight: 700; text-align: center; }
.check-list { display: flex; flex-direction: column; margin: .4rem 0 .8rem; }

/* terms */
.terms-consent { margin: .6rem 0 .9rem; padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--bg); }
.terms-consent .check { align-items: flex-start; margin: 0; }
.terms-consent .check input { margin-top: .15rem; }
.terms-text { white-space: pre-line; font-size: .9rem; line-height: 1.55; color: var(--ink-2); margin: .6rem 0; }
.terms-scroll { max-height: 50vh; overflow-y: auto; padding-right: .3rem; border-bottom: 1px solid var(--line); }
.terms-editor { font-family: inherit; line-height: 1.5; resize: vertical; }
details > summary { cursor: pointer; margin: .3rem 0; }

/* subscriptions */
.billing-status.warning { box-shadow: 0 0 0 2px var(--amber), var(--shadow); }
.billing-status.danger { box-shadow: 0 0 0 2px var(--red), var(--shadow); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; margin-bottom: .6rem; }
.plan-card { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 0; }
.plan-price { font-size: 1.6rem; font-weight: 800; color: var(--green-700); }
/* Discounted plan: list price struck out before the price the shop pays. */
.plan-price-old { font-size: 1rem; font-weight: 600; color: var(--muted, #6b746e); text-decoration: line-through; margin-right: .35rem; }
.plan-offer { align-self: flex-start; }
.shop-billing-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }

/* ================================================================ list orders ("send a list") */
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.list-cta { display: flex; align-items: center; gap: .8rem; margin: 0 0 1rem; padding: .9rem 1rem; border-radius: var(--radius);
  background: var(--amber-100); border: 1px dashed var(--amber); color: var(--ink); }
.list-cta > span:nth-child(2) { flex: 1; min-width: 0; }
.list-cta:hover { box-shadow: var(--shadow); }
.list-intro p { margin: 0; }
.list-add { display: flex; gap: .5rem; align-items: stretch; margin-bottom: .5rem; }
.list-input { flex: 1; font-size: 1.05rem; }
.mic-btn { padding-left: .7rem; padding-right: .7rem; }
.pulse-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); margin-right: .3rem; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.list-rows { list-style: decimal; margin: .6rem 0; padding-left: 1.4rem; }
.list-row-item { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.list-row-item::marker { color: var(--muted); font-weight: 700; }
.list-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qty-edit { display: flex; align-items: center; gap: .2rem; background: var(--bg); border-radius: 99px; padding: .1rem .2rem; }
.qty-text { min-width: 4.5rem; text-align: center; font-weight: 700; font-size: .9rem; }
.list-photo { position: relative; display: inline-block; margin: .5rem 0; }
.list-photo img { max-width: 180px; max-height: 180px; border-radius: var(--radius-sm); display: block; }
.list-photo .icon-btn { position: absolute; top: 4px; right: 4px; background: var(--surface); }
.list-photo-large { width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--radius-sm); background: var(--bg); margin: .5rem 0; }
.list-bill li.unavailable > span:first-child { text-decoration: line-through; color: var(--muted); }
.list-preview { padding-left: 1.3rem; }
.price-line.unavailable { opacity: .7; }
.price-line .order-head strong { font-size: 1rem; }

/* ================================================================ delivery / pickup slots */
.slot-picker { margin: .6rem 0 .9rem; }
.slot-days { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin-bottom: .5rem; }
.slot-days::-webkit-scrollbar { display: none; }
.slot-day { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; min-width: 78px; padding: .45rem .6rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font: inherit; cursor: pointer; color: var(--ink); }
.slot-day small { color: var(--muted); font-size: .72rem; }
.slot-day.active { border-color: var(--green-700); background: var(--green-50); color: var(--green-900); box-shadow: 0 0 0 1px var(--green-700); }
.slot-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .45rem; margin-bottom: .4rem; }
.slot-option { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .6rem .7rem; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font: inherit; cursor: pointer; color: var(--ink); }
.slot-option span { font-size: .85rem; color: var(--ink-2); }
.slot-option.selected { border-color: var(--green-700); background: var(--green-50); box-shadow: 0 0 0 1px var(--green-700); }
.slot-option:disabled { opacity: .5; cursor: not-allowed; background: var(--bg); }
.slot-line { color: var(--green-900); font-weight: 600; }
.slot-day-filter { margin-bottom: .6rem; }
.slot-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.slot-board-row { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); border-left: 4px solid var(--green-700); }
.slot-card.unavailable { opacity: .6; }
.subscribe-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.subscribe-head img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; }
.stepper-qty.big { max-width: 260px; margin: .3rem 0 .5rem; }
.stepper-qty.big button { width: 3rem; height: 2.8rem; font-size: 1.5rem; }
.stepper-qty.big span { font-size: 1.1rem; }

/* input + button on one line (registration "Send code") */
.input-row { display: flex; gap: .5rem; align-items: center; }
.input-row .input { flex: 1; min-width: 0; }
.input-row .btn { flex: none; white-space: nowrap; }

/* unread count on the top-bar bell */
.icon-btn.bell { position: relative; }
.bell-count {
  position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--surface); box-sizing: content-box;
}

/* compact select inside list rows (Host Admin: shop area) */
.input.input-sm { width: auto; min-width: 0; padding: .3rem 1.6rem .3rem .55rem; font-size: .85rem; }

/* ApiImg placeholder while a picture loads (MAUI Debug) */
.img-loading { display: inline-block; background: var(--line); }

/* Crop screen (Components/ImageCropper.razor + Cropper.js) */
.crop-dialog { max-width: 640px; display: flex; flex-direction: column; gap: .6rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.crop-stage { position: relative; height: min(58vh, 440px); background: #1d1d1d; border-radius: var(--radius-sm); overflow: hidden; }
.crop-stage img { display: block; max-width: 100%; max-height: 100%; } /* Cropper.js needs a block image */
.crop-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .6); }
.crop-dialog .chips { justify-content: center; }

/* Customer's location line above the shop list */
.location-bar { display: flex; align-items: center; gap: .4rem; padding: .55rem .75rem; margin: .5rem 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.location-bar .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-info { background: var(--green-50); color: var(--ink-2); padding: .55rem .75rem; }

/* Who is signed in (Components/WhoAmI.razor): shop logo + name, or the customer's photo + name */
.whoami { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.whoami-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.whoami-text strong, .whoami-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami-link { color: inherit; border-radius: 12px; padding: .35rem .25rem; }
.sidebar .whoami-text strong { color: #fff; }
.sidebar .whoami-text span { color: #a7c2b4; }
.whoami-link:hover { background: rgba(255, 255, 255, .07); }
.topbar-me { display: grid; place-items: center; width: 40px; height: 40px; }
.avatar.tiny, .shop-avatar.tiny { width: 30px; height: 30px; font-size: .75rem; border-radius: 50%; }
.topbar-brand .shop-avatar.small { width: 30px; height: 30px; border-radius: 9px; }
.account-shop { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; font-weight: 600; }
.crop-host { position: absolute; inset: 0; }
.crop-host img { display: block; max-width: 100%; max-height: 100%; }

/* Place search results in the address picker */
.place-results { display: flex; flex-direction: column; gap: .25rem; margin: .4rem 0; max-height: 220px; overflow-y: auto; }
.place-result { display: flex; gap: .5rem; align-items: flex-start; text-align: left; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); }
.place-result:hover { background: var(--green-50); }

/* Address picker: a pin fixed in the centre of the map - the spot under its tip is the address */
.map.map-picker { position: relative; }
.map.map-picker::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 36px; height: 48px; z-index: 650; pointer-events: none;
  transform: translate(-50%, -100%); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 48'%3E%3Cpath d='M18 47c0 0-15-17.6-15-29A15 15 0 0 1 33 18c0 11.4-15 29-15 29z' fill='%23d32f2f' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='18' cy='18' r='6' fill='%23fff'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3));
}
.map.map-picker::before { /* shadow dot where the tip touches the ground */
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 4px; margin: -2px 0 0 -5px; z-index: 649;
  border-radius: 50%; background: rgba(0, 0, 0, .35); pointer-events: none;
}

/* ---- subscription deliveries: date bar (shop) and month calendar (customer) ---- */
.date-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .9rem; }
.date-bar-label { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.date-bar-label .input { max-width: 190px; }
.card-muted { opacity: .85; }
.card-subtitle { font-size: .95rem; font-weight: 700; margin: 1rem 0 .4rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding-bottom: .2rem; }
.cal-day { position: relative; aspect-ratio: 1 / 1; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .85rem; color: var(--ink-2); cursor: pointer; padding: 0; }
.cal-day:disabled { cursor: default; color: var(--muted); background: transparent; border-color: transparent; }
.cal-day.cal-today { border-color: var(--green-700); font-weight: 700; }
.cal-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.cal-day.dot-planned .cal-dot, .cal-legend .dot-planned { background: var(--green-700); opacity: .45; }
.cal-day.dot-done .cal-dot, .cal-legend .dot-done { background: var(--green-700); }
.cal-day.dot-done { background: var(--green-100); }
.cal-day.dot-skip .cal-dot, .cal-legend .dot-skip { background: #9aa39d; }
.cal-day.dot-skip { text-decoration: line-through; color: var(--muted); }
.cal-day.dot-wait .cal-dot, .cal-legend .dot-wait { background: var(--amber); }
.cal-day.dot-wait { background: var(--amber-100); }
.cal-day.dot-fail .cal-dot, .cal-legend .dot-fail { background: var(--red); }
.cal-day.dot-fail { background: var(--red-100); }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .6rem; font-size: .75rem; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.quick-actions { margin-bottom: .9rem; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 700; padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
.table td { padding: .45rem .4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- bills & accounts */
.text-right { text-align: right; }
.link-card { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; text-decoration: none; color: inherit;
  font: inherit; cursor: pointer; }
button.link-card { border: 1px solid var(--line); }
.link-card:hover { border-color: var(--green-600); }
.list-row .icon-btn { flex: none; }
.weekday-qty { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; margin: .4rem 0; }
.weekday-qty label { display: flex; flex-direction: column; align-items: center; gap: .2rem; font-size: .8rem; color: var(--muted); }
.weekday-qty .input { width: 100%; padding: .4rem .2rem; text-align: center; }

