/* Moon Clinic — one stylesheet for every screen.
   Layout: a top bar with the user's sections, then a working area of cards.
   List-with-editor pages put the list in a wide column and the form beside it. */

@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/IBMPlexSansArabic-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/IBMPlexSansArabic-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/IBMPlexSansArabic-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/IBMPlexSansArabic-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F4F6F5; --surface: #FFFFFF; --surface-2: #EEF2F0; --line: #DDE3E0; --line-strong: #C9D2CE;
  --fg: #16211D; --muted: #4F5C57; --accent: #0F6B5C; --accent-ink: #FFFFFF; --accent-soft: #E3F0EC; --accent-strong: #0A4D42;
  --warn-soft: #FBEBDD; --warn: #8A4510; --danger-soft: #FDECEC; --danger: #8F1D1D;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { direction: rtl; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; }
h1 { font-size: 22px; } h2 { font-size: 18px; }
a { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ltr { direction: ltr; text-align: right; unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--fg); text-decoration: none; min-width: 0; }
.mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 20px; font-weight: 700; flex: none; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tabgroup { display: flex; flex-wrap: wrap; gap: 4px; }
.tabgroup + .tabgroup { border-inline-start: 1px solid var(--line); padding-inline-start: 8px; margin-inline-start: 4px; }
.tab { padding: 9px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.tab:hover { background: var(--surface-2); color: var(--fg); }
.tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.who form { margin: 0; }

main { max-width: 1320px; margin: 0 auto; padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.side { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.wide { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.count { color: var(--muted); font-size: 15px; font-weight: 500; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; }
.field .help { font-weight: 400; font-size: 12px; color: var(--muted); }
.field .errors { list-style: none; margin: 0; padding: 0; color: var(--danger); font-weight: 500; font-size: 13px; }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=tel], input[type=search], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 400; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.has-error input, .has-error select { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* weekday chips (CheckboxSelectMultiple renders a <div> of <div><label><input> …) */
.days > div { display: flex; flex-wrap: wrap; gap: 6px; }
.days label { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-weight: 500; cursor: pointer; }
.days input { margin: 0; accent-color: var(--accent); }
.days label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }

/* buttons */
.btn { border: 1px solid var(--line-strong); background: var(--surface); padding: 10px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--fg); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; padding: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .grow { flex: 1; }

/* tables */
.tablebox { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 10px; background: var(--surface-2); white-space: nowrap; }
td { padding: 10px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.dim td { opacity: .6; }
tr.current td { background: var(--accent-soft); }
.empty { padding: 26px 10px; text-align: center; color: var(--muted); }

/* pills & notes */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.p-on { background: var(--accent-soft); color: var(--accent-strong); }
.p-off { background: var(--surface-2); color: var(--muted); }
.p-warn { background: var(--warn-soft); color: var(--warn); }
.note { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; color: var(--muted); }
.note.ok { background: var(--accent-soft); color: var(--accent-strong); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.error { background: var(--danger-soft); color: var(--danger); }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.actions form { margin: 0; }

/* temporary password after a reset */
.reset-card { border-color: var(--accent); }
.reset-pass { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.reset-pass > div { display: flex; flex-direction: column; gap: 2px; }
.reset-pass b { font-size: 18px; }
.reset-pass b.big { font-size: 30px; letter-spacing: .06em; color: var(--accent-strong); }

/* login & setup */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-art { flex: 1 1 380px; background: var(--accent); color: var(--accent-ink); padding: 48px 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-art .brand { color: var(--accent-ink); }
.login-art .mark { background: var(--accent-ink); color: var(--accent); width: 48px; height: 48px; font-size: 26px; }
.login-art h1 { font-size: 36px; }
.login-art p { font-size: 17px; opacity: .92; max-width: 34ch; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4); font-size: 13px; }
.login-form { flex: 1 1 380px; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-form .card { width: 100%; max-width: 420px; }

/* reception */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.hl { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.warn-text { color: var(--warn); }
.at-doctors { gap: 4px; }
.at-row { display: flex; align-items: baseline; gap: 8px; }
.at-row .at-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.at-row b { font-size: 20px; }
.fee { display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.fee b { font-size: 18px; }
td.qn { font-weight: 700; font-size: 17px; }
a.plain { color: inherit; text-decoration: none; font-weight: 600; }
a.plain:hover { color: var(--accent); text-decoration: underline; }
.st-waiting { background: var(--warn-soft); color: var(--warn); }
.st-with_doctor { background: var(--accent-soft); color: var(--accent-strong); }
.st-done { background: var(--surface-2); color: var(--muted); }
.st-cancelled { background: var(--danger-soft); color: var(--danger); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.inline { display: flex; gap: 8px; align-items: stretch; margin: 0; }
.inline input { min-width: 0; }

/* duplicate-file warning */
.dup { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--warn); border-radius: 12px; background: var(--warn-soft); }
.dup table td { border-color: rgba(138, 69, 16, .2); }
#phone-matches:empty, #find-results:empty { display: none; }

/* bookings */
.done-card { border-color: var(--accent); }
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.day-title { text-align: center; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line-strong); text-decoration: none; color: var(--fg); min-height: 58px; justify-content: center; }
.slot b { font-size: 16px; }
.slot span { font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.slot.free:hover { border-color: var(--accent); background: var(--accent-soft); }
a.slot.sel, a.slot.sel:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
a.slot.sel span { color: var(--accent-ink); }
.slot.taken { background: var(--warn-soft); border-color: var(--warn-soft); color: var(--warn); }
.slot.taken span { color: var(--warn); font-weight: 600; }
.slot.past { background: var(--surface-2); border-color: var(--line); color: var(--muted); opacity: .7; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line-strong); }
.sw.taken { background: var(--warn-soft); border-color: var(--warn-soft); }
.sw.sel { background: var(--accent); border-color: var(--accent); }
.bk-booked { background: var(--warn-soft); color: var(--warn); }
.bk-arrived { background: var(--accent-soft); color: var(--accent-strong); }
.bk-cancelled, .bk-missed { background: var(--danger-soft); color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* backups */
.status-card.ok { border-color: var(--accent); }
.status-card.warn { border-color: var(--warn); }
.card > form { margin: 0; }
input[type=file] { width: 100%; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2); }

/* invoice: on screen a sheet of paper, on print the only thing printed (A5) */
.invoice { background: #FFFFFF; color: #16211D; border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 18px; font-size: 14px; max-width: 720px; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 14px; border-bottom: 3px solid #0F6B5C; }
.inv-brand { display: flex; gap: 12px; align-items: center; }
.inv-brand .mark { background: #0F6B5C; color: #FFFFFF; }
.inv-name { font-size: 18px; font-weight: 700; }
.inv-sub { color: #4F5C57; font-size: 13px; }
.inv-title { display: flex; flex-direction: column; align-items: flex-end; text-align: left; }
.inv-title b { color: #0F6B5C; font-size: 22px; }
.inv-title span { color: #4F5C57; font-size: 13px; }
.inv-top { display: flex; gap: 16px; align-items: stretch; }
.inv-meta { flex: 1; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; background: #F4F6F5; border-radius: 10px; padding: 14px; }
.inv-meta dt { color: #4F5C57; font-size: 12px; }
.inv-meta dd { margin: 0; font-weight: 600; }
.ticket { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed #0F6B5C; border-radius: 10px; padding: 8px 18px; color: #0F6B5C; }
.ticket span { font-size: 12px; }
.ticket b { font-size: 46px; line-height: 1; }
.inv-table th { background: #F4F6F5; color: #3E4B46; }
.inv-table td { border-top: 1px solid #E6EBE9; }
.inv-table .end { text-align: left; }
.inv-sum { margin-inline-start: auto; width: min(300px, 100%); display: flex; flex-direction: column; gap: 6px; }
.inv-sum > div { display: flex; justify-content: space-between; gap: 12px; }
.inv-sum > div span:first-child { color: #4F5C57; }
.inv-sum .inv-total { background: #0F6B5C; color: #FFFFFF; padding: 10px 12px; border-radius: 8px; font-weight: 700; font-size: 16px; }
.inv-sum .inv-total span:first-child { color: #FFFFFF; }
.inv-foot { display: flex; flex-direction: column; gap: 10px; }
.inv-sign { display: flex; justify-content: space-between; align-items: flex-end; color: #4F5C57; }
.inv-foot p { margin: 0; text-align: center; color: #4F5C57; font-size: 12px; border-top: 1px solid #E6EBE9; padding-top: 10px; }
.stamp { border: 2px solid #0A4D42; color: #0A4D42; border-radius: 6px; padding: 4px 12px; font-weight: 700; }
.stamp.due { border-color: #8A4510; color: #8A4510; }

@media print {
  /* @page size is set per invoice (paper setting) */
  body { background: #FFFFFF; }
  .topbar, .no-print, .toasts { display: none !important; }
  main { padding: 0; max-width: none; }
  .row, .wide { display: block; }
  .invoice { border: 0; padding: 0; max-width: none; font-size: 12px; }
}

/* ---------------- phones ----------------
   Top bar: clinic name + user on one line, the sections as one swipeable row.
   Tables marked .cards become one card per row, each value under its label. */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand { font-size: 15px; flex: 1; }
  .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mark { width: 32px; height: 32px; font-size: 18px; }
  .who { gap: 6px; }
  .who > span { display: none; }
  .tabs { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -12px; padding-inline: 12px; width: calc(100% + 24px); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabgroup { flex-wrap: nowrap; }
  .tab { white-space: nowrap; padding: 8px 12px; }
  main { padding: 14px 12px 32px; gap: 14px; }
  .card { padding: 16px; border-radius: 12px; }
  .stat { padding: 12px; }
  .stat b { font-size: 22px; }
  h1 { font-size: 20px; }
  .btn.sm { padding: 8px 12px; }  /* bigger touch targets */

  table.cards thead { display: none; }
  table.cards, table.cards tbody { display: block; }
  table.cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 2px; border-top: 1px solid var(--line); }
  table.cards tbody tr:first-child { border-top: 0; }
  table.cards td { display: block; border: 0; padding: 0; min-width: 0; text-align: start; }
  table.cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
  table.cards td.cell-actions, table.cards td.empty { grid-column: 1 / -1; }
  table.cards td.qn { font-size: 22px; }
  table.cards tr.current td { background: none; }
  table.cards tr.current { background: var(--accent-soft); border-radius: 10px; padding-inline: 8px; }

  .day-nav .btn { padding: 8px 10px; }
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inline { flex-wrap: wrap; }
  .card-head > form.actions { width: 100%; }
  .card-head > form.actions > * { flex: 1; }

  .invoice { padding: 16px; font-size: 13px; }
  .inv-head { flex-wrap: wrap; }
  .inv-title { align-items: flex-start; }
  .inv-top { flex-direction: column-reverse; }
  .ticket { flex-direction: row; gap: 12px; padding: 8px 12px; }
  .ticket b { font-size: 32px; }
  .inv-sum { width: 100%; }
}

/* flash messages */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 30; width: max-content; max-width: calc(100% - 32px); }
.toast { background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.toast.error { background: var(--danger); color: #FFFFFF; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: toast-in .2s ease-out, toast-out .3s ease-in 4s forwards; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }

/* age number + unit side by side */
.age-pair { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 6px; }

/* radio choices (paper size, queue numbering) */
.choices > div { display: flex; flex-direction: column; gap: 6px; }
.choices label { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-weight: 500; cursor: pointer; }
.choices input { margin: 0; accent-color: var(--accent); }
.choices label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }

/* paper size picker on the invoice page */
.paper-pick .choice { display: block; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; text-decoration: none; color: var(--fg); font-weight: 500; }
.paper-pick .choice.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }

/* thermal receipts: narrow, one column, black only */
.invoice.receipt { width: 76mm; max-width: 100%; padding: 10px; gap: 8px; font-size: 11px; border-radius: 4px; }
.invoice.paper-58mm { width: 54mm; font-size: 10px; }
.invoice.receipt, .invoice.receipt * { color: #000 !important; }
.invoice.receipt .inv-head { flex-direction: column; align-items: center; text-align: center; gap: 4px; border-bottom: 1px dashed #000; padding-bottom: 6px; }
.invoice.receipt .inv-brand { flex-direction: column; gap: 4px; }
.invoice.receipt .inv-brand .mark { display: none; }
.invoice.receipt .inv-name { font-size: 14px; }
.invoice.receipt .inv-title { align-items: center; text-align: center; }
.invoice.receipt .inv-title b { font-size: 14px; }
.invoice.receipt .inv-top { flex-direction: column-reverse; gap: 6px; }
.invoice.receipt .inv-meta { grid-template-columns: minmax(0, 1fr); background: none; padding: 0; gap: 2px; }
.invoice.receipt .inv-meta > div { display: flex; justify-content: space-between; gap: 6px; }
.invoice.receipt .inv-meta dt { font-size: inherit; }
.invoice.receipt .ticket { border: 2px solid #000; flex-direction: row; justify-content: center; gap: 8px; padding: 4px; }
.invoice.receipt .ticket b { font-size: 30px; }
.invoice.receipt .inv-table th { background: none; border-bottom: 1px solid #000; padding: 3px; font-size: inherit; }
.invoice.receipt .inv-table td { padding: 3px; border-top: 0; }
.invoice.receipt .inv-sum { width: 100%; gap: 3px; }
.invoice.receipt .inv-sum .inv-total { background: none; border-top: 1px dashed #000; border-bottom: 1px dashed #000; border-radius: 0; padding: 4px 0; font-size: 13px; }
.invoice.receipt .inv-sign { flex-direction: column; align-items: center; gap: 4px; }
.invoice.receipt .stamp { border-width: 1px; padding: 2px 8px; }
.invoice.receipt .inv-foot p { border-top: 1px dashed #000; font-size: 10px; }
@media print {
  .invoice.receipt { width: 72mm; padding: 0; border: 0; }
  .invoice.paper-58mm { width: 50mm; }
}

/* daily report */
.report h3 { margin: 6px 0 0; font-size: 16px; }
.sign-row { display: flex; justify-content: space-between; gap: 40px; padding-top: 30px; }
.sign-row > div { flex: 1; max-width: 220px; border-top: 1px solid var(--fg); padding-top: 6px; text-align: center; color: var(--muted); font-size: 13px; }
@media print {
  .report { border: 0; padding: 0; }
  .report .stat.hl { background: none; color: #000; border: 2px solid #000; }
  .report .stat.hl span { color: #000; }
}

/* patient address (السكن) */
fieldset.addr { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 12px; background: #FAFCFB; min-width: 0; }
fieldset.addr legend { font-weight: 700; padding: 0 6px; font-size: 15px; }
fieldset.addr legend .opt { font-weight: 500; font-size: 12px; color: var(--muted); }
.area-wrap { position: relative; }
.suggest-box:empty { display: none; }
.suggest-box { position: absolute; top: calc(100% + 4px); inset-inline: 0; z-index: 10; }
.suggest { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .14); padding: 4px; max-height: 320px; overflow-y: auto; }
.suggest .grp { font-size: 11px; color: var(--muted); padding: 6px 10px 2px; font-weight: 600; }
.suggest .opt { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 7px; text-align: right; cursor: pointer; font-size: 14px; }
.suggest .opt:hover, .suggest .opt:focus-visible { background: var(--surface-2); }
.suggest .add { border-top: 1px solid var(--line); margin-top: 4px; padding: 8px 10px; color: var(--accent-strong); font-size: 13px; font-weight: 600; }
.tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.t-village { background: var(--warn-soft); color: var(--warn); }
.t-hood { background: var(--accent-soft); color: var(--accent-strong); }
.area-new { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 10px; background: var(--warn-soft); }
.area-new[hidden] { display: none; }
.inline-choices > div { flex-direction: row; flex-wrap: wrap; }
.addr-view { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #FAFCFB; display: flex; flex-direction: column; gap: 2px; }
.addr-view b { font-size: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters input[type=search] { flex: 2 1 220px; width: auto; }
.filters select { flex: 1 1 160px; width: auto; }
.loc-list { display: flex; flex-direction: column; gap: 4px; }
.loc-list a { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--fg); border: 1px solid var(--line); }
.loc-list a:hover { background: var(--surface-2); }
.loc-list a[aria-current] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 700; }
.area-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.area-form.editing { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
tr.similar td { background: var(--warn-soft); }
form.merge select { width: auto; padding: 5px 8px; font-size: 13px; }
td.pick-cell { width: 1%; }
td.pick-cell .actions { flex-direction: column; align-items: stretch; gap: 6px; }
.suggest .opt.on { background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
details.addr-more summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent-strong); padding: 4px 0; }
details.addr-more summary .opt { font-weight: 500; font-size: 12px; color: var(--muted); }
details.addr-more[open] summary { margin-bottom: 10px; }

/* bank transfers */
.bank-box { border: 2px solid var(--accent); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--accent-soft); }
.bank-box[hidden] { display: none; }
.bank-box .inline-choices > div { flex-direction: column; }
@media (min-width: 900px) { .bank-box .inline-choices > div { flex-direction: row; } }
.pending-card { border-color: var(--warn); }
.stamp.wait { color: var(--warn); border-color: var(--warn); }
.inv-sum .failed { text-decoration: line-through; opacity: .6; }
.pay-ref { font-size: 12px; color: var(--muted); }
.slip-amount { display: flex; flex-direction: column; gap: 2px; }
.slip-amount b { font-size: 26px; }
.slip-accounts { border: 2px dashed #0F6B5C; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.slip-acc { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.slip-acc > b { font-size: 18px; letter-spacing: .04em; }
.slip-steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.bank-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #FAFCFB; }
.bank-row.off { opacity: .6; }
.bank-row .acc { font-weight: 700; letter-spacing: .04em; }
.acc-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.acc-form.editing { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.demo-login { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
