:root {
  --bg: #f3f5f7;
  --card: #fff;
  --ink: #1c2430;
  --muted: #5b6b7c;
  --line: #d7dee7;
  --accent: #1f6feb;
  --danger: #b42318;
  --drawer: #1c2430;
  --drawer-width: 260px;
  --drawer-width-expanded: 260px;
  --drawer-width-collapsed: 72px;
  --appbar-h: 56px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #e8eef8, transparent 40%),
    linear-gradient(180deg, #eef2f6, var(--bg));
  min-height: 100vh;
}

/* —— Drawer (Flutter-style) —— */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: var(--drawer-width);
  height: 100vh;
  background: var(--drawer);
  color: #f5f7fa;
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.22s ease, width 0.22s ease;
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.drawer-open .drawer { transform: translateX(0); }
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(15, 23, 32, 0.45);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 3.5rem;
}
.drawer-header .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 1;
}
.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-close,
.drawer-collapse {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c9d4e3;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.drawer-close {
  font-size: 1.5rem;
  line-height: 1;
}
.drawer-collapse svg,
.nav-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}
.drawer-collapse:hover,
.drawer-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  color: inherit;
}
.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.65rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: #c9d4e3;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.drawer-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.drawer-nav a.active {
  background: rgba(31, 111, 235, 0.28);
  color: #fff;
}
.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-footer {
  padding: 0.9rem 0.75rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.drawer-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
  font-size: 0.86rem;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
}
.drawer-user-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.drawer-user:hover,
.drawer-user.active {
  background: rgba(255, 255, 255, 0.08);
}
.drawer-user strong { color: #fff; }
.drawer-user span { color: #9aabbd; }
.drawer-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: transparent;
  border: 1px solid #7a8798;
  color: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font: inherit;
}
.drawer-logout:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Collapsed (icon-only) — desktop */
body.drawer-collapsed {
  --drawer-width: var(--drawer-width-collapsed);
}
body.drawer-collapsed .brand-text,
body.drawer-collapsed .nav-label,
body.drawer-collapsed .drawer-user-text {
  display: none;
}
body.drawer-collapsed .drawer-header {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
body.drawer-collapsed .drawer-header .brand {
  display: none;
}
body.drawer-collapsed .drawer-collapse {
  display: inline-flex;
  margin: 0 auto;
}
body.drawer-collapsed .drawer-collapse svg {
  transform: rotate(180deg);
}
body.drawer-collapsed .drawer-nav {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  align-items: center;
}
body.drawer-collapsed .drawer-nav a {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  gap: 0;
}
body.drawer-collapsed .drawer-footer {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
body.drawer-collapsed .drawer-user {
  justify-content: center;
  margin-bottom: 0.5rem;
}
body.drawer-collapsed .drawer-logout {
  padding: 0.55rem 0.4rem;
}

/* —— App shell / app bar —— */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s ease;
}
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--appbar-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  background: rgba(28, 36, 48, 0.94);
  color: #f5f7fa;
  backdrop-filter: blur(6px);
}
.appbar-title {
  font-weight: 600;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.appbar-subnav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
  min-width: 0;
  overflow-x: auto;
}
.appbar-subnav a {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: #c9d4e3;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}
.appbar-subnav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.appbar-subnav a.active {
  background: rgba(31, 111, 235, 0.35);
  color: #fff;
}
.drawer-toggle {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  cursor: pointer;
}
.drawer-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* Desktop: persistent drawer */
@media (min-width: 960px) {
  .has-drawer .drawer {
    transform: translateX(0);
  }
  .has-drawer .drawer-toggle,
  .has-drawer .drawer-close,
  .has-drawer .drawer-scrim {
    display: none !important;
  }
  .has-drawer .drawer-collapse {
    display: inline-flex;
  }
  .has-drawer .app-shell {
    margin-left: var(--drawer-width);
  }
  .has-drawer .drawer-header {
    position: relative;
  }
}

/* Mobile: hamburger opens temporary drawer */
@media (max-width: 959px) {
  .drawer-close { display: inline-flex; align-items: center; justify-content: center; }
  /* Collapse is desktop-only; ignore persisted state on small screens */
  body.drawer-collapsed {
    --drawer-width: var(--drawer-width-expanded);
  }
  body.drawer-collapsed .drawer-header .brand,
  body.drawer-collapsed .brand-text,
  body.drawer-collapsed .nav-label,
  body.drawer-collapsed .drawer-user-text {
    display: revert;
  }
  body.drawer-collapsed .drawer-user-text {
    display: flex;
  }
  body.drawer-collapsed .drawer-nav a {
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
  }
  body.drawer-collapsed .drawer-user,
  body.drawer-collapsed .drawer-logout {
    justify-content: flex-start;
  }
  body.drawer-collapsed .drawer-collapse {
    display: none !important;
  }
  body.drawer-collapsed .drawer-collapse svg {
    transform: none;
  }
}

.wrap {
  width: 100%;
  max-width: 1100px;
  margin: 1.25rem auto;
  padding: 0 1rem 2rem;
}
.auth-layout .wrap { margin-top: 2rem; }
.login-shell .django-form {
  border-top: 0;
  margin-top: 0.5rem;
}
.login-shell .django-form .form-row > label {
  flex: 0 0 7.5rem;
  max-width: 7.5rem;
}
.login-shell .django-form .form-controls {
  flex: 1 1 12rem;
  max-width: none;
}
.login-shell .django-form .form-controls input {
  width: 100%;
  max-width: 100%;
}
.login-shell .login-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.login-shell .login-actions .panel-btn.secondary,
.login-shell .login-actions a.panel-btn.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  line-height: 1.2;
}
.login-shell .login-actions .panel-btn.secondary:hover,
.login-shell .login-actions a.panel-btn.secondary:hover {
  background: #f8fafc;
}
.login-shell .muted {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 10px 30px rgba(28, 36, 48, 0.06);
}
.card.narrow { max-width: 420px; margin: 3rem auto; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.search { display: flex; gap: 0.5rem; margin: 1rem 0; }
.search input, label input {
  flex: 1;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
button[type=submit] {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}
.panel-btn {
  margin: 0;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}
.panel-btn:disabled,
.panel-btn.btn-dim {
  opacity: 0.45;
  cursor: not-allowed;
}
.panel-btn--danger {
  background: var(--danger);
}
button.panel-btn--danger[type="submit"] {
  background: var(--danger);
}
.panel-btn--danger:not(:disabled):not(.btn-dim):hover {
  filter: brightness(0.95);
}
label { display: block; margin-bottom: 0.75rem; }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.92rem; }
th, td { border-bottom: 1px solid var(--line); padding: 0.55rem 0.4rem; text-align: left; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
th a.sort-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
th a.sort-link:hover { text-decoration: underline; }
th a.sort-link .sort-indicator { font-size: 0.75em; opacity: 0.35; }
th a.sort-link.active .sort-indicator { opacity: 1; }
th.col-points, td.col-points {
  width: 4.5rem;
  max-width: 5.5rem;
  white-space: nowrap;
}
th.col-mm, td.col-mm {
  width: 7rem;
  white-space: nowrap;
}
.mm-badge {
  display: inline-block;
  margin-right: 0.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #fff4e5;
  color: #b54708;
  border: 1px solid #f7c58b;
}
th.col-saletype, td.col-saletype {
  width: 5rem;
  max-width: 6rem;
  white-space: nowrap;
}
td.col-actions {
  width: 5.5rem;
  white-space: nowrap;
  text-align: right;
}
td.col-notify {
  width: 4.5rem;
  text-align: center;
  white-space: nowrap;
}
label.checkbox-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
form.inline-form {
  display: inline;
  margin: 0;
}
.receipt-email-card {
  width: min(26rem, calc(100vw - 2rem));
  text-align: left;
}
.receipt-email-card .search-loading-text { margin-bottom: 0.9rem; }
.receipt-email-card label { display: block; margin: 0 0 0.3rem; font-weight: 600; }
.receipt-email-card input[type="email"] { width: 100%; box-sizing: border-box; }
.receipt-email-from { margin: 0.4rem 0 0; font-size: 0.85rem; }
.receipt-email-error { margin: 0.6rem 0 0; font-size: 0.9rem; }
.receipt-email-error[hidden] { display: none; }
.receipt-email-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.result-count { margin: 0.75rem 0 0; font-size: 0.9rem; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin: 0.75rem 0 0.25rem;
}
.report-filters {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}
.txn-search .result-count {
  margin-top: 0;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 180px;
  margin-bottom: 0;
}
.filter-field select,
.filter-field input {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.filter-presets .tabs {
  margin: 0;
  flex-wrap: wrap;
}
/* button.tab-btn outranks button[type=submit] (range presets submit the filter form). */
.tab-btn,
button.tab-btn {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
.tab-btn.active,
button.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.custom-range {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem 1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
  background: #f8fafc;
}
.custom-range legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.custom-range-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}
.custom-range-main .primary {
  margin-left: auto;
}
.custom-range-inline {
  align-items: center;
}
.range-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  flex: 1;
  min-width: min(100%, 28rem);
}
.range-inline-label {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.range-inline-row input[type="time"],
.range-inline-row .iso-time-input,
.range-inline-row select {
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: inherit;
}
.range-date-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.range-date-wrap .iso-date-input {
  box-sizing: border-box;
  width: calc(10ch + 0.55rem + 2rem);
  min-width: 0;
  padding: 0.45rem 2rem 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: inherit;
  font-variant-numeric: tabular-nums;
}
.range-date-wrap .iso-date-cal {
  right: 0.2rem;
  width: 1.5rem;
  height: 1.5rem;
}
.iso-date-picker,
.birth-date-picker {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  border: 0;
  padding: 0;
}
.time-input-wrap input[type="time"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}
.time-input-wrap input[type="time"]::-webkit-inner-spin-button {
  display: none;
}
.time-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
}
.time-input-wrap .iso-time-input,
.time-input-wrap input[type="time"] {
  box-sizing: border-box;
  width: calc(8ch + 1.1rem);
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: inherit;
  font-variant-numeric: tabular-nums;
}
.time-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.time-picker-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: #eef4ff;
}
.clock-popover {
  position: fixed;
  z-index: 80;
  width: 260px;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}
.clock-popover-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  margin-bottom: 0.75rem;
}
.clock-digit {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  border-radius: 6px;
}
.clock-digit[aria-pressed="true"] {
  color: var(--accent);
  background: #eef4ff;
  font-weight: 700;
}
.clock-colon {
  font-size: 1.5rem;
  color: var(--muted);
}
.clock-face {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid var(--line);
}
.clock-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  z-index: 2;
}
.clock-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  height: 2px;
  margin-top: -1px;
  background: var(--accent);
  transform-origin: left center;
  transform: rotate(-90deg);
  z-index: 1;
  border-radius: 2px;
}
.clock-num {
  position: absolute;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  z-index: 3;
}
.clock-num-inner {
  font-size: 0.7rem;
  color: var(--muted);
}
.clock-num:hover,
.clock-num.active {
  background: var(--accent);
  color: #fff;
}
.clock-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.result-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.result-toolbar .result-count,
.result-toolbar .result-total-amount {
  margin: 0;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.2;
}
.result-toolbar-start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-self: start;
}
.result-selection {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.result-selection .selection-btn {
  padding: 0.2rem 0.55rem;
  font-size: 0.82rem;
  line-height: 1.2;
}
.result-selection .selection-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: #eef4ff;
}
.result-selection .selection-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.result-selection .selection-btn.primary:hover {
  filter: brightness(0.95);
}
.result-selection .selection-status {
  font-size: 0.82rem;
  color: var(--muted);
  margin-left: 0.15rem;
}
.point-changes-email-actions {
  margin: 0.35rem 0 0.65rem;
}
.selectable-table .col-select {
  width: 2.25rem;
  min-width: 2.25rem;
  text-align: center;
  vertical-align: middle;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}
.selectable-table .col-select input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
  cursor: pointer;
}
.selectable-table tr.selectable-row:has(input.row-select:checked) {
  background: #f0f5ff;
}
.result-toolbar-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
}
.result-toolbar .pagination-inline {
  justify-self: center;
}
.toolbar-limit {
  min-width: 0;
  margin: 0;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}
.toolbar-limit select {
  min-width: 4.5rem;
}
.search-loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
}
.search-loading[hidden] {
  display: none !important;
}
.search-loading-card {
  width: min(22rem, calc(100vw - 2rem));
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  text-align: center;
}
.search-loading-spinner {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.85rem;
  border: 3px solid #e2e8f0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: search-spin 0.8s linear infinite;
}
.search-loading-title {
  margin: 0 0 0.35rem;
  font-weight: 650;
}
.search-loading-text {
  margin: 0;
  font-size: 0.9rem;
}
@keyframes search-spin {
  to { transform: rotate(360deg); }
}
.pagination-inline {
  margin: 0;
  padding: 0;
  border: none;
  justify-content: flex-end;
}
.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  line-height: 1;
}
.page-jump-label,
.page-jump-of {
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1;
}
.page-jump select {
  min-width: 3.6rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: center;
}
.page-jump select:disabled {
  opacity: 0.45;
  cursor: default;
}
.custom-range-presets .tabs {
  margin: 0;
  flex-wrap: wrap;
}
.range-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}
.filter-member {
  flex: 0 0 auto;
  min-width: 8rem;
  max-width: 11rem;
}
.filter-member input {
  width: 100%;
}
.filter-search-by {
  flex: 0 0 auto;
  min-width: 8.5rem;
}
.filter-search-by select {
  min-width: 8.5rem;
}
.filter-branch {
  flex: 0 1 auto;
  min-width: 10rem;
  max-width: 14rem;
}
.filter-branch select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.filter-actions {
  display: flex;
  align-items: end;
}
.filter-keyword {
  min-width: 8rem;
  flex: 1 1 8rem;
  max-width: 18rem;
}
.filter-keyword input {
  width: 100%;
}
.filter-limit {
  flex: 0 0 auto;
  min-width: 5.5rem;
}
.filter-limit select {
  min-width: 5.5rem;
}
.search-bar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}
.search-bar-row-facet {
  align-items: center;
  flex-wrap: nowrap;
}
.search-bar-row-facet .filter-branch {
  flex: 0 0 12rem;
  max-width: 14rem;
  padding: 0.35rem 0.45rem;
}
.search-bar-row-facet .filter-extra {
  flex: 0 0 auto;
  padding: 0.35rem 0.45rem;
}
.search-bar-row-facet .filter-extra select {
  width: 100%;
}
.search-bar-row-facet .filter-search-by {
  flex: 0 0 9.5rem;
  max-width: 11rem;
  padding: 0.35rem 0.45rem;
}
.search-bar-row-facet .filter-keyword {
  flex: 1 1 auto;
  max-width: none;
  min-width: 12rem;
  padding: 0.35rem 0.45rem;
}
.facet-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 16rem;
}
.facet-search-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.6rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: text;
}
.facet-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}
.facet-chips {
  display: contents;
}
.facet-chip {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border-radius: 4px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.3;
}
.facet-chip-label {
  padding: 0.2rem 0.45rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.facet-chip-value {
  padding: 0.2rem 0.35rem 0.2rem 0.45rem;
  color: var(--ink);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.facet-chip-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 0.4rem;
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
}
.facet-chip-remove:hover {
  color: var(--ink);
  background: #e2e8f0;
}
.facet-input {
  flex: 1 1 8rem;
  min-width: 6rem;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 0.25rem 0.2rem;
}
.facet-clear-all {
  position: static;
  flex-shrink: 0;
  transform: none;
  margin-left: 0.15rem;
}
.facet-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  max-height: 16rem;
  overflow: auto;
}
.facet-menu-item {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.92rem;
}
.facet-menu-item em {
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
}
.facet-menu-item strong {
  font-weight: 600;
}
.facet-menu-item.active,
.facet-menu-item:hover {
  background: color-mix(in srgb, var(--accent) 14%, #fff);
}
.search-bar-row .filter-field,
.search-bar-row .search-widget {
  min-width: 0;
  gap: 0;
}
.search-widget {
  margin: 0;
  padding: 0.35rem 0.45rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-inline-size: 0;
}
.search-widget legend {
  padding: 0 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.2;
}
.search-widget select,
.search-widget input {
  border: 0;
  background: transparent;
  padding: 0.35rem 0.4rem;
  font: inherit;
  color: var(--ink);
  min-width: 0;
  width: 100%;
}
.search-widget select:focus,
.search-widget input:focus {
  outline: none;
}
.filter-multi-search .search-input-wrap,
.filter-member .search-input-wrap,
.filter-keyword .search-input-wrap {
  width: 100%;
}
.search-all-clear,
.search-submit,
.search-refresh {
  flex-shrink: 0;
  height: 2.45rem;
  padding: 0 1rem;
  font: inherit;
}
.search-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.search-input-wrap input[type="search"] {
  width: 100%;
  padding-right: 2.25rem;
  box-sizing: border-box;
}
.search-input-wrap input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.search-clear {
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.search-clear:hover {
  background: #e2e8f0;
  color: var(--ink);
}
.input-clear-wrap {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}
.input-clear-wrap > input,
.input-clear-wrap > textarea {
  width: 100%;
  box-sizing: border-box;
  padding-right: 2.25rem;
}
.input-clear {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.input-clear:hover {
  background: #e2e8f0;
  color: var(--ink);
}
.birth-date-wrap {
  padding-right: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.birth-date-actions {
  align-items: center;
}
.birth-age-display {
  flex: 0 0 auto;
  min-width: 4.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.birth-age-display.birth-age--under13 {
  background: #fff4e5;
  color: #9a3412;
}
.birth-date-wrap > input[type="text"] {
  padding-right: 2.5rem;
}
.iso-date-cal,
.birth-date-cal {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}
.birth-date-cal[hidden],
.birth-date-wrap .input-clear[hidden] {
  display: none !important;
}
.iso-date-cal:hover,
.birth-date-cal:hover {
  background: #e2e8f0;
  color: #334155;
}
.tabs { display: flex; gap: 0.5rem; margin: 1rem 0; }
.top-items-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}
.top-items-filters .tabs { margin: 0; }
.top-items-filters { margin-top: 0.75rem; }
.top-items-compare { width: auto; min-width: 36rem; margin-bottom: 1rem; }
.top-items-compare.top-items-compare-centered { width: 90%; margin-left: auto; margin-right: auto; }
tr.more-row[hidden] { display: none; }
.more-toggle { margin: 0.5rem 0 1rem; }
.top-items-bar-chart { height: 800px; }
.top-items-category-chart { height: 480px; }
.top-items-sales-margin-chart { height: 320px; }
.table-scroll { overflow-x: auto; }
.top-items-table td, .top-items-table th { white-space: nowrap; }
.top-items-table td.detail-desc { white-space: normal; min-width: 14rem; }
.top-items-table .detail-col { background: #fbfcfe; }
.top-items-table.details-collapsed .detail-col { display: none; }
.detail-toggle {
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.top-items-table .branch-col { background: #f8fafc; }
.top-items-table th.th-center { text-align: center; }
.top-items-table th.th-center a.sort-link { justify-content: center; }
.top-items-table .sort-label { display: inline-block; }
.idx { font-weight: 600; }
.idx-low { color: #b42318; }
.idx-high { color: #1f8a65; }
.category-summary { margin-top: 1rem; border-top: 1px solid #e8eef4; padding-top: 0.75rem; }
.category-summary h4 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.category-summary ul { margin: 0 0 0.75rem; padding-left: 1.2rem; line-height: 1.6; }
.top-items-compare.category-summary-table { width: 100%; min-width: 0; margin-bottom: 0.4rem; }
.category-summary-table th { text-align: center; vertical-align: middle; line-height: 1.25; }
.idx-missing { color: #b54708; font-weight: 600; }
.idx-new { color: #1f6feb; font-weight: 600; }
.top-items-table .ly-col { background: #f9f7fe; }
.top-items-ly-compare th .muted { font-weight: 400; font-size: 0.8rem; }
.top-items-table tr.row-not-sold > td { background: #fef3f2; }
.top-items-table tr.row-under > td { background: #fff4e5; }
.top-items-table tr.row-not-sold > td:first-child { box-shadow: inset 3px 0 0 #f04438; }
.top-items-table tr.row-under > td:first-child { box-shadow: inset 3px 0 0 #f79009; }
.top-items-table tr.row-over > td { background: #ecfdf3; }
.top-items-table tr.row-over > td:first-child { box-shadow: inset 3px 0 0 #12b76a; }
.legend-swatch {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 2px;
  vertical-align: -0.1rem;
}
.legend-not-sold { background: #fef3f2; border-left: 3px solid #f04438; }
.legend-under { background: #fff4e5; border-left: 3px solid #f79009; }
.legend-over { background: #ecfdf3; border-left: 3px solid #12b76a; }
.tabs a {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.tabs a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
.stats div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  background: #f8fafc;
}
.stats span { display: block; color: var(--muted); font-size: 0.8rem; }
.stats div.warn {
  border-color: #fecdca;
  background: #fef3f2;
}
.stats .stat-sub {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.monitor-alert-form {
  margin: 0 0 1.5rem;
}
.monitor-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.monitor-chart-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 1rem 0.85rem;
  background: #fff;
  min-width: 0;
}
.monitor-chart-card.wide {
  grid-column: 1 / -1;
}
.monitor-activity-hint { grid-column: 1 / -1; margin: -0.5rem 0 0; }
.monitor-pref-tops { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0 0 1rem; }
.monitor-pref-table { width: 100%; font-size: 0.86rem; }
.monitor-pref-table td:nth-child(2) { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-chart-frame.monitor-pref-chart { height: 420px; }
@media (max-width: 960px) { .monitor-pref-tops { grid-template-columns: 1fr; } }
.monitor-chart-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}
.monitor-chart-frame {
  position: relative;
  height: 240px;
}
.monitor-chart-frame.monitor-ethnicity-chart { height: 300px; }
.monitor-chart-frame.monitor-region-chart { height: 420px; }
.monitor-profile { margin-bottom: 1rem; }
.monitor-profile-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.monitor-profile-head h3 { margin: 0; }
.monitor-profile-head .tab-strip { display: flex; gap: 0.35rem; }
.monitor-chart-frame.monitor-profile-chart { height: 340px; }
.monitor-profile-table { margin: 0 0 1.5rem; font-size: 0.88rem; }
.monitor-profile-table th.group-head { text-align: center; border-bottom: 1px solid var(--line); }
.monitor-profile-table thead th { vertical-align: bottom; }
.monitor-profile-table tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.monitor-suburbs-toggle { margin-top: 1rem; }
#join-suburbs-block[hidden] { display: none; }
.monitor-join-contact { margin-bottom: 1rem; }
.monitor-join-contact td.indent { padding-left: 1.5rem; }
.monitor-join-contact tr.subtotal td { font-weight: 600; background: #f8fafc; }
.monitor-join-contact tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.monitor-join-contact tr.warn td { color: #b54708; }
.monitor-txn-totals {
  width: auto;
  min-width: 22rem;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}
.monitor-split {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.1fr);
  gap: 1rem;
  align-items: start;
  margin: 0 0 1.5rem;
}
.monitor-split .monitor-chart-card {
  margin: 0;
}
@media (max-width: 960px) {
  .monitor-charts,
  .monitor-split {
    grid-template-columns: 1fr;
  }
}
.internal-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.5rem 2rem;
}
.internal-forms-group .form-section-title { margin-top: 0.75rem; }
.internal-forms-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.internal-forms-list li {
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}
.internal-forms-list a { color: var(--accent); font-weight: 600; }
.internal-forms-host { font-size: 0.8rem; color: var(--muted); }
.links { padding-left: 1.1rem; }
.links a { color: var(--accent); }
.messages { list-style: none; padding: 0; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.page-head h1 { margin: 0 0 0.35rem; }
.member-points {
  margin-left: 0.5rem;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85em;
}
.member-status {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.01em;
  vertical-align: middle;
  line-height: 1.3;
}
.member-detail-fields .member-status {
  margin-left: 0;
  font-size: 0.85em;
}
.member-status--active {
  color: #0f6b3c;
  background: #e6f6ec;
  border: 1px solid #b7e0c6;
}
.member-status--suspended {
  color: #8a1f1a;
  background: #fdeceb;
  border: 1px solid #f0b8b4;
}
.member-points-link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #e8f1ff;
  border: 1px solid #c5dbff;
}
.member-points-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.member-edit-shell {
  position: relative;
}
.member-edit-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0.25rem 0 1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.member-edit-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.member-edit-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: #f8fbff;
}
.cdc-section-tabs {
  grid-template-columns: 1fr 1fr 1fr;
}
.member-activity-tabs,
.member-edit-section-tabs {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}
.report-section-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cdc-section-tabs .member-edit-tab {
  gap: 0.4rem;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.cdc-section-tabs .health-pill {
  font-size: 0.72rem;
  padding: 0.05rem 0.4rem;
}
.cdc-tab-panel { margin-top: 0.25rem; }
.cdc-tab-panel[hidden] { display: none !important; }
.points-calculator {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}
.points-form .submit-row {
  max-width: none;
}
.points-summary {
  margin: 0 0 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  width: 100%;
  box-sizing: border-box;
}
.points-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.95rem;
}
.points-summary-result {
  border-top: 1px solid var(--line);
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  font-weight: 600;
}
.points-summary-result .is-negative,
#points-result.is-negative {
  color: var(--danger);
}
#points-change.is-deduct {
  color: var(--danger);
}
#points-change.is-add {
  color: var(--accent);
}
.points-mode-row {
  display: flex;
  gap: 0.6rem;
  margin: 0.75rem 0 1rem;
  width: 100%;
}
.points-mode-btn {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.points-mode-btn.active-add {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.points-mode-btn.active-deduct {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
#mode-add:not(.active-add) {
  background: #eff6ff;
  border-color: #dbeafe;
  color: #93c5fd;
}
#mode-add:not(.active-add):hover {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #60a5fa;
}
#mode-deduct:not(.active-deduct) {
  background: #fef2f2;
  border-color: #fee2e2;
  color: #fca5a5;
}
#mode-deduct:not(.active-deduct):hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #f87171;
}
.points-mode-btn.points-clear-btn {
  background: #e2e8f0;
  border-color: #e2e8f0;
  color: #64748b;
  font-weight: 600;
}
.points-mode-btn.points-clear-btn:hover {
  background: #cbd5e1;
  border-color: #cbd5e1;
  color: #475569;
}
.points-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  width: 100%;
  margin-bottom: 0.5rem;
}
.points-numpad button {
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
}
.points-numpad button:hover {
  background: #eef4ff;
}
.points-numpad .points-equals {
  background: #94a3b8;
  border-color: #94a3b8;
  color: #fff;
  font-weight: 700;
}
.points-numpad .points-equals:hover {
  background: #64748b;
  border-color: #64748b;
}
button.btn-dim,
button[disabled].btn-dim {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
button.btn-danger {
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
button.btn-danger:not(.btn-dim):hover {
  filter: brightness(0.95);
}
.member-delete-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.django-form .member-delete-hint {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}
.member-delete-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
  align-self: center;
}
.member-delete-controls .toggle-switch,
.member-delete-controls #delete-member-btn,
.member-delete-controls #delete-user-btn {
  margin: 0;
  align-self: center;
}
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 0.2s ease;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--danger);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.page-actions { display: flex; gap: 0.6rem; align-items: center; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.pagination.pagination-inline {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.pagination-status {
  color: var(--muted);
  min-width: 4.5rem;
  text-align: center;
  white-space: nowrap;
}
.pagination-link {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
}
a.pagination-link:hover {
  background: #eef4ff;
  border-color: var(--accent);
  color: var(--accent);
}
.pagination-link.disabled {
  opacity: 0.4;
  cursor: default;
}
.btn-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-link.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-link.disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem 1.25rem;
  margin: 1.25rem 0 0;
}
.detail-grid dt {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.detail-grid dd { margin: 0; font-weight: 500; }

.member-detail-fields {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin: 1.25rem 0 0;
}
.member-detail-fields .detail-row {
  display: grid;
  gap: 0.9rem 1.25rem;
  margin: 0;
}
.member-detail-fields .detail-row.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.member-detail-fields .detail-row.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.member-detail-fields .detail-row.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.member-detail-fields dt {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.member-detail-fields dd { margin: 0; font-weight: 500; }
.member-detail-fields .note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.member-detail-fields .note-signup { font-size: 0.8rem; font-weight: 400; margin-bottom: 0.2rem; }
.notes-form textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.member-txn-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.member-txn-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}
.member-txn-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.member-txn-limit {
  margin: 0;
}
.member-txn-limit .filter-limit {
  margin: 0;
}
.member-point-changes td.point-delta.is-add {
  color: var(--accent);
  font-weight: 600;
}
.member-point-changes td.point-delta.is-deduct {
  color: var(--danger);
  font-weight: 600;
}

@media (max-width: 800px) {
  .member-detail-fields .detail-row.cols-4,
  .member-detail-fields .detail-row.cols-3,
  .member-detail-fields .detail-row.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .member-detail-fields .detail-row.cols-4,
  .member-detail-fields .detail-row.cols-3,
  .member-detail-fields .detail-row.cols-2 {
    grid-template-columns: 1fr;
  }
}

/* Django admin-style form rows (member register / edit) */
.django-form {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}
.django-form .form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
/* Birth date + parental consent: no divider between the paired rows */
.django-form .form-row:has(+ #parental-consent-row:not([hidden])) {
  border-bottom: none;
  padding-bottom: 0.35rem;
}
.django-form #parental-consent-row:not([hidden]) {
  padding-top: 0.35rem;
}
.django-form .form-row[hidden] {
  display: none !important;
}
.django-form .form-row.field-dim {
  opacity: 0.45;
}
.django-form .form-row.field-dim input,
.django-form .form-row.field-dim select,
.django-form .form-row.field-dim .checkbox-inline {
  pointer-events: none;
  cursor: not-allowed;
}
.django-form .req {
  color: var(--danger);
  font-weight: 700;
}
.django-form .form-row-split {
  align-items: flex-start;
  gap: 1rem 1.5rem;
}
.django-form .form-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  flex: 1 1 280px;
  min-width: 0;
}
.django-form .form-pair-grow {
  flex: 1 1 360px;
}
.django-form .form-pair-mailing {
  flex: 0 1 220px;
}
.django-form .form-pair > label,
.django-form .form-row > label {
  flex: 0 0 160px;
  max-width: 160px;
  margin: 0.55rem 0 0;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
}
.django-form .form-pair .form-controls {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 480px;
}
.django-form .form-controls {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 480px;
}
.django-form .form-controls input,
.django-form .form-controls select,
.django-form .form-controls textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.django-form .form-controls input[type="checkbox"],
.django-form .form-controls input[type="radio"] {
  width: auto;
  min-width: 1rem;
  padding: 0;
  border: initial;
  border-radius: 0;
  background: transparent;
  flex: 0 0 auto;
}
.django-form .form-controls input[readonly],
.django-form .form-controls select:disabled {
  background: #f1f5f9;
  color: var(--muted);
}
.django-form .checkbox-control {
  padding-top: 0.45rem;
}
.django-form .password-confirm-row {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.django-form .password-confirm-row input[type="password"] {
  flex: 1;
  min-width: 12rem;
}
.django-form .password-confirm-row .checkbox-inline {
  flex: 0 1 auto;
  white-space: nowrap;
}

.django-form .checkbox-inline input {
  width: auto;
}
ul.perm-checklist,
.perm-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.perm-checklist li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.perm-checklist label {
  text-align: left;
  margin: 0;
  max-width: none;
  flex: 1;
  font-weight: 400;
  font-size: 0.9rem;
}
.perm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}
.perm-mode-label {
  font-size: 0.88rem;
  color: var(--muted);
  margin-right: auto;
}
.perm-checklist.perm-dim {
  opacity: 0.45;
}
.perm-checklist.perm-dim input {
  pointer-events: none;
  cursor: not-allowed;
}

.form-row-perms {
  align-items: flex-start;
}
.form-row-perms > label {
  margin-top: 0.85rem;
}
.perm-editor {
  max-width: 640px;
}
.django-form .form-controls.perm-editor {
  max-width: 640px;
}
.perm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}
.perm-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
}
.perm-tab:hover {
  color: var(--ink);
  background: #f1f5f9;
}
.perm-tab.active {
  color: var(--ink);
  background: #e8eef5;
  border-color: var(--line);
  font-weight: 600;
}
.perm-tab-count {
  margin-left: 0.2rem;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8rem;
}
.perm-tab-panel {
  min-height: 8rem;
}
.perm-group-title {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.perm-group-title:first-of-type {
  margin-top: 0.25rem;
}
.perm-checklist.perm-group {
  padding-left: 0.75rem;
  border-left: 2px solid var(--line);
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  cursor: pointer;
  margin: 0;
  font-weight: 400;
  text-align: left;
  max-width: none;
  flex: 1 1 auto;
}
.perm-item input[type="checkbox"] {
  width: auto !important;
  min-width: 1rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}
.perm-line {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--ink);
}
.perm-codename {
  font-weight: 600;
  flex: 0 0 auto;
  color: var(--ink);
}
.perm-sep {
  color: var(--muted);
  flex: 0 0 auto;
}
.perm-desc {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.django-form .form-controls input[type="password"],
.django-form .form-controls input[type="text"],
.django-form .form-controls input[type="email"],
.django-form .form-controls input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.django-form .form-controls ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.django-form .submit-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 0 0.25rem;
  margin-top: 0.25rem;
}
button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
.inline-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.smtp-settings-shell .smtp-section-divider {
  border-top: 1px solid var(--line);
  margin: 0.25rem 0 1.25rem;
}
.smtp-settings-shell .smtp-panel + .smtp-panel {
  margin-top: 1.5rem;
}
.smtp-settings-shell .smtp-panel-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.smtp-settings-shell .smtp-connection-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem 1rem;
  align-items: center;
}
.smtp-settings-shell .smtp-connection-hint {
  margin: 0;
  color: #667085;
  font-size: 0.9rem;
  line-height: 1.4;
}
.smtp-settings-shell .smtp-connection-result {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.smtp-settings-shell .smtp-connection-result.is-ok {
  color: var(--ink);
}
.smtp-settings-shell .smtp-connection-result.is-error {
  color: var(--danger);
}
.smtp-settings-shell .smtp-connection-actions,
.smtp-settings-shell .smtp-connection-clear-actions {
  margin: 0;
  justify-self: end;
}
.smtp-settings-shell .smtp-panel-btn {
  margin: 0;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}
.smtp-settings-shell .smtp-panel-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.smtp-settings-shell .smtp-panel-btn--light {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.smtp-settings-shell .smtp-panel-btn--light:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.smtp-settings-shell .smtp-connection-result-placeholder {
  display: block;
  min-height: 0;
}
.smtp-settings-shell .smtp-section-divider--test {
  margin: 1.5rem 0 1.25rem;
}
.smtp-settings-shell .smtp-test-form {
  margin-top: 0;
  border-top: 0;
}
.smtp-settings-shell .smtp-test-email-row {
  align-items: center;
  flex-wrap: nowrap;
  border-bottom: 0;
  padding-bottom: 0.25rem;
}
.smtp-settings-shell .smtp-test-email-row > label {
  margin-top: 0;
  align-self: center;
}
.smtp-settings-shell .smtp-test-email-controls {
  flex: 0 1 480px;
  max-width: 480px;
  align-self: center;
}
.smtp-settings-shell .smtp-test-email-submit {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  align-self: center;
  min-width: 0;
}
.smtp-settings-shell #id_port {
  -moz-appearance: textfield;
  appearance: textfield;
}
.smtp-settings-shell #id_port::-webkit-outer-spin-button,
.smtp-settings-shell #id_port::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.smtp-settings-shell .smtp-row-no-divider {
  border-bottom: 0;
}
.smtp-settings-shell .smtp-checkbox-row {
  align-items: center;
}
.smtp-settings-shell .smtp-checkbox-row > label {
  margin-top: 0;
  align-self: center;
}
.smtp-settings-shell .smtp-checkbox-row .checkbox-control,
.smtp-settings-shell .smtp-checkbox-row > .form-controls {
  padding-top: 0;
  align-self: center;
}
.smtp-settings-shell .smtp-checkbox-inline {
  margin: 0;
}
.smtp-settings-shell .smtp-checkbox-hint {
  color: #667085;
  font-weight: 400;
}
.usage-banner {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid #fecdca;
  background: #fef3f2;
  border-radius: 8px;
  color: #b42318;
}
.usage-banner strong {
  display: block;
  margin-bottom: 0.35rem;
}
.usage-banner p {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: #912018;
}
.row-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.btn-link:disabled,
button.secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.inline-actions input { flex: 1; min-width: 0; }
.django-form .inline-actions button.secondary {
  flex: 0 0 8.75rem;
  width: 8.75rem;
  min-width: 8.75rem;
  box-sizing: border-box;
  text-align: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.django-form .inline-actions button.secondary.btn-compact {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.form-section-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.05rem;
}
.formset-table {
  width: 100%;
  margin-bottom: 1rem;
}
.formset-table th,
.formset-table td {
  vertical-align: top;
  padding: 0.4rem 0.5rem;
}
.formset-table input {
  width: 100%;
  max-width: 16rem;
  box-sizing: border-box;
}
.btn-link.danger {
  color: #b42318;
  border-color: #fecdca;
}
.django-form .hint {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #667085;
}

.health-banner {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid #d0d5dd;
  background: #f8fafc;
}
.health-banner.ok {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}
.health-banner.bad {
  border-color: #fecdca;
  background: #fef3f2;
  color: #b42318;
}
.health-banner strong { display: block; margin-bottom: 0.25rem; }
.health-banner p { margin: 0.15rem 0 0; }
.health-errors {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: #b42318;
}
.health-section-title {
  margin: 1.35rem 0 0.65rem;
  font-size: 1rem;
}
.health-subsection-title {
  margin: 0.85rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #344054;
}
.health-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #d0d5dd;
  background: #f2f4f7;
  color: #344054;
}
.health-pill.ok {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}
.health-pill.bad {
  border-color: #fecdca;
  background: #fef3f2;
  color: #b42318;
}
.health-pill.scheduled {
  border-color: #b2ddff;
  background: #eff8ff;
  color: #175cd3;
}
.health-pill.expired {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #475467;
}
.health-pill.off {
  border-color: #e4e7ec;
  background: #f9fafb;
  color: #667085;
}

.float-settings-table th,
.float-settings-table td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid #e4e7ec;
}
.float-settings-table input.float-qty {
  width: 5.5rem;
  max-width: 100%;
}
.float-settings-table tfoot th {
  border-bottom: none;
  padding-top: 0.75rem;
}

.daily-sales-block {
  margin-top: 1.5rem;
  border: 2px solid #c5ced8;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.daily-sales-block + .daily-sales-block {
  margin-top: 1.75rem;
}
.daily-sales-split {
  margin: 1.75rem 0 0;
  border: 0;
  border-top: 2px dashed #c5ced8;
}
.daily-sales-block-head {
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #c5ced8;
}
.daily-sales-block-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.daily-sales-block--total {
  border-color: #1c2430;
}
.daily-sales-block--total .daily-sales-block-head {
  background: #1c2430;
  border-bottom-color: #1c2430;
  color: #f5f7fa;
}
.daily-sales-block--till {
  border-color: #9aa8b8;
  background: #f8fafc;
}
.daily-sales-block--till .daily-sales-block-head {
  background: #dfe6ee;
  color: var(--ink);
  border-bottom-color: #9aa8b8;
}
.daily-sales-block-body {
  padding: 0.85rem 1rem 1rem;
}
.daily-sales-block-body .float-settings-table {
  margin-top: 0.75rem;
  background: #fff;
}
.daily-sales-till-split {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: 0.75rem;
}
.daily-sales-till-split .float-settings-table {
  flex: 1 1 16rem;
  margin-top: 0;
  min-width: 0;
}
.daily-sales-till-split .daily-sales-zreport {
  flex: 0 1 auto;
  align-self: flex-start;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  min-width: 0;
  max-width: min(100%, 28rem);
}
.daily-sales-zreport {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.daily-sales-zreport--empty .hint {
  margin: 0;
  padding: 0.75rem;
  text-align: center;
  line-height: 1.35;
}
.daily-sales-zreport-frame {
  display: inline-block;
  max-width: 100%;
  max-height: 720px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 0;
  vertical-align: top;
}
.daily-sales-zreport-frame--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 23.5rem;
  max-width: 100%;
  aspect-ratio: 376 / 583;
  max-height: 720px;
  overflow: hidden;
  background: #f3f5f8;
  line-height: normal;
}
.daily-sales-zreport-frame > a {
  display: block;
  line-height: 0;
}
.daily-sales-zreport-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

@media (max-width: 860px) {
  .daily-sales-till-split {
    flex-direction: column;
  }
  .daily-sales-till-split .daily-sales-zreport {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .django-form .form-row > label,
  .django-form .form-pair > label {
    flex-basis: 100%;
    max-width: none;
    text-align: left;
    margin-top: 0;
  }
  .django-form .form-controls,
  .django-form .form-pair .form-controls {
    max-width: none;
  }
  .django-form .form-pair,
  .django-form .form-pair-mailing {
    flex-basis: 100%;
  }
}

/* Loyalty Members — address autocomplete */
.address-lookup-root {
  position: relative;
  width: 100%;
}
.address-lookup-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  background: #fff;
  border: 1px solid var(--border, #d9d9d9);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  max-height: 216px;
  overflow: auto;
}
.address-lookup-dropdown[hidden] {
  display: none !important;
}
.address-lookup-message {
  padding: 0.75rem 0.9rem;
  font-size: 0.8rem;
  color: var(--muted, #666);
  line-height: 1.35;
}
.address-lookup-message.is-error {
  color: var(--danger, #b42318);
}
.address-lookup-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.address-lookup-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border, #eee);
  background: transparent;
  padding: 0.65rem 0.9rem;
  font-size: 0.84rem;
  color: var(--ink, #222);
  cursor: pointer;
}
.address-lookup-item:hover,
.address-lookup-item:focus {
  background: #f5f5f5;
}
.address-lookup-list li:last-child .address-lookup-item {
  border-bottom: 0;
}
.address-lookup-hint {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--muted, #666);
  line-height: 1.35;
}
.field-inline-hint.hint-success {
  color: #2d6a4f;
}
.field-inline-hint.hint-error,
.address-lookup-hint.hint-error {
  color: #b42318;
}

/* —— App dialog (replaces alert / confirm) —— */
body.app-dialog-open {
  overflow: hidden;
}
.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.app-dialog.is-open {
  display: flex;
}
.app-dialog[hidden] {
  display: none !important;
}
.app-dialog-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 32, 0.45);
}
.app-dialog-panel {
  position: relative;
  width: min(100%, 28rem);
  max-height: min(85vh, 32rem);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1.25rem 1rem;
  box-shadow: 0 16px 40px rgba(15, 23, 32, 0.18);
}
.app-dialog-title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}
.app-dialog-title[hidden] {
  display: none;
}
.app-dialog-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-line;
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.app-dialog-cancel {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.app-dialog-cancel:hover {
  background: #f8fafc;
}
