/*
 * Owner console components (2026-11-13). Uses the staff theme tokens from ui.css (dark navy, cyan accent).
 * Mobile first: everything stacks at phone width; two columns from 900px.
 */
.a-page { display: grid; gap: 14px; }
.a-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 18px; box-shadow: var(--surface-shadow); padding: 16px; }
.a-card > h2, .a-card > header h2 { font-size: 15px; margin: 0; letter-spacing: .01em; }
.a-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.a-muted { color: var(--muted); font-size: 13px; }

/* Profile header */
.a-hero { display: grid; gap: 14px; }
.a-who { display: flex; gap: 14px; align-items: center; min-width: 0; }
.a-avatar { flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-weight: 700; font-size: 20px; color: #fff; background: var(--gradient-brand); position: relative; }
.a-avatar[data-online="1"]::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); border: 3px solid var(--bg-elev); }
.a-name { font-size: 20px; font-weight: 700; margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
.a-contact { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.a-contact button { all: unset; cursor: pointer; color: var(--muted); }
.a-contact button:hover, .a-contact button:focus-visible { color: var(--accent); }
.a-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.a-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--neutral-bg); color: var(--muted); }
.a-chip[data-tone="ok"] { background: var(--ok-bg); color: var(--ok); }
.a-chip[data-tone="warn"] { background: var(--warn-bg); color: var(--warn); }
.a-chip[data-tone="bad"] { background: var(--danger-bg); color: var(--danger); }
.a-chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.a-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.a-kpi { background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); border-radius: 14px; padding: 10px 12px; }
.a-kpi span { display: block; font-size: 12px; color: var(--muted); }
.a-kpi b { display: block; font-size: 18px; margin-top: 2px; font-variant-numeric: tabular-nums; }
@media (min-width: 700px) { .a-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.a-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.a-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--surface-border); background: rgba(255, 255, 255, .04); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.a-btn:hover { border-color: var(--accent); }
.a-btn.primary { background: var(--gradient-cyan); color: var(--accent-ink); border: 0; }
.a-btn.danger { color: var(--danger); border-color: rgba(255, 84, 112, .35); }
.a-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Tabs */
.a-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none; }
.a-tabs button { all: unset; flex: 1 0 auto; text-align: center; padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.a-tabs button[aria-selected="true"] { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--surface-border); }
.a-tabs button:focus-visible { outline: 2px solid var(--focus); }
[data-tabpanel][hidden] { display: none !important; }

/* Timeline */
.a-timeline { list-style: none; margin: 0; padding: 0; }
.a-timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 10px 0; position: relative; }
.a-timeline li + li { border-top: 1px solid rgba(255, 255, 255, .04); }
.a-dot { width: 10px; height: 10px; border-radius: 50%; margin: 5px 0 0 6px; background: var(--muted); box-shadow: 0 0 0 4px rgba(169, 185, 212, .12); }
.a-dot[data-tone="ok"] { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.a-dot[data-tone="warn"] { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.a-dot[data-tone="bad"] { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.a-ev-title { font-size: 14px; font-weight: 600; }
.a-ev-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.a-ev-time { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Simple rows */
.a-rows { display: grid; }
.a-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .05); font-size: 14px; }
.a-row:first-child { border-top: 0; }
.a-row small { display: block; color: var(--muted); font-size: 12px; }
.a-num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* Bottom sheet / dialog (composer, hold) */
.a-sheet { border: 0; padding: 0; background: transparent; width: min(560px, 100vw); max-width: 100vw; color: var(--ink); }
.a-sheet::backdrop { background: rgba(2, 6, 18, .66); backdrop-filter: blur(4px); }
.a-sheet > form { background: var(--bg-elev); border: 1px solid var(--surface-border); border-radius: 22px; padding: 18px; display: grid; gap: 12px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); }
@media (max-width: 600px) {
  .a-sheet { margin: auto 0 0; width: 100vw; }
  .a-sheet > form { border-radius: 22px 22px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
.a-sheet h3 { margin: 0; font-size: 17px; }
.a-sheet .a-close { all: unset; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.a-sheet .a-close:focus-visible { outline: 2px solid var(--focus); }
.a-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.a-field { display: grid; gap: 6px; }
.a-field > span { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; }
.a-field input, .a-field textarea, .a-field select { width: 100%; box-sizing: border-box; background: rgba(255, 255, 255, .04); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font: inherit; font-size: 15px; resize: vertical; }
.a-field input:focus, .a-field textarea:focus, .a-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 229, 255, .15); }
.a-templates { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.a-templates button { all: unset; flex: none; cursor: pointer; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft); }
.a-templates button:hover, .a-templates button:focus-visible { border-color: var(--accent); color: var(--accent); }
.a-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.a-switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
.a-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.a-switch input:checked { background: var(--ok); }
.a-switch input:checked::after { transform: translateX(18px); }
.a-preview { border-radius: 14px; padding: 12px; background: rgba(0, 229, 255, .05); border: 1px dashed var(--surface-border); }
.a-preview small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.a-preview strong { display: block; font-size: 14px; }
.a-preview p { margin: 3px 0 0; font-size: 13px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Customer list as cards on phones */
.a-list { display: grid; gap: 8px; }
.a-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--surface-border); color: inherit; text-decoration: none; }
.a-item:hover { border-color: var(--accent); }
.a-item .a-avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
.a-item-main { flex: 1; min-width: 0; }
.a-item-main strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-item-main small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-item-side { text-align: right; font-size: 12px; color: var(--muted); flex: none; }
.a-search { display: flex; gap: 8px; flex-wrap: wrap; }
.a-search input, .a-search select { flex: 1; min-width: 180px; background: rgba(255, 255, 255, .04); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font: inherit; }
.a-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; padding: 10px 16px; border-radius: 12px; background: var(--bg-elev-2); border: 1px solid var(--surface-border); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .a-switch input, .a-switch input::after { transition: none; } }

/* Phone-width guards (no horizontal scrolling anywhere) */
.a-page, .a-page > * { min-width: 0; }
.a-sheet > form { box-sizing: border-box; width: 100%; }
.a-sheet { box-sizing: border-box; }
.a-item, .a-item-main { min-width: 0; }
@media (max-width: 600px) {
  .a-sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-height: 92vh; }
  .a-sheet > form { max-height: 92vh; overflow-y: auto; }
  .a-search input { flex: 1 1 100%; min-width: 0; }
  .a-search select { flex: 1 1 auto; min-width: 0; }
  .a-page .pulse { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .a-page .pulse > a { min-width: 0; }
}

dialog.a-sheet > form { padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)) !important; margin: 0 !important; }
dialog.a-sheet > form { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
dialog.a-sheet > form > * { min-width: 0; }

/* View-only accounts (investor): nothing that changes data is shown */
[data-viewonly] form[method="post"]:not(.logout-form), [data-viewonly] [data-open-sheet], [data-viewonly] .a-sheet { display: none !important; }
[data-viewonly] .staff-shell::before { content: "View only"; position: fixed; right: 14px; bottom: 14px; z-index: 40; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--warn-bg); color: var(--warn); }

/* Customer search (2026-11-13): one quiet search bar, filter pills, a small action on the right */
.a-findbar { display: grid; gap: 10px; }
.a-searchbar { position: relative; display: flex; align-items: center; margin: 0; }
.a-searchbar svg { position: absolute; left: 14px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.a-searchbar input { width: 100%; box-sizing: border-box; height: 46px; padding: 0 42px 0 42px; border-radius: 14px; border: 1px solid var(--surface-border); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
.a-searchbar input::placeholder { color: var(--muted); opacity: .8; }
.a-searchbar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 229, 255, .14); }
.a-searchbar input::-webkit-search-cancel-button { display: none; }
.a-searchbar__clear { position: absolute; right: 10px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); text-decoration: none; font-size: 18px; }
.a-searchbar__clear:hover { background: var(--neutral-bg); color: var(--ink); }
.a-findbar__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.a-pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.a-pills::-webkit-scrollbar { display: none; }
.a-pills a { flex: none; padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid transparent; }
.a-pills a:hover { color: var(--ink); background: var(--neutral-bg); }
.a-pills a[aria-current="true"] { color: var(--ink); background: var(--raised); border-color: var(--surface-border); }
.a-linkbtn { all: unset; flex: none; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent); padding: 7px 4px; border-radius: 8px; white-space: nowrap; }
.a-linkbtn:hover { text-decoration: underline; }
.a-linkbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ===== Payment methods (owner, 2026-11-13): one card per method, a switch, plain status ===== */
.pm { gap: 22px; }
.pm-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pm-intro h1 { margin: 0 0 4px; font-size: clamp(20px, 3.2vw, 26px); letter-spacing: -.01em; }
.pm-intro p { margin: 0; }
.pm-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--surface-border); font-size: 14px; }
.pm-h { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--muted); }
.pm-h-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pm-h-row .pm-h { margin: 0; }
.pm-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.pm-card { display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--surface-border); min-width: 0; transition: border-color .15s; }
.pm-card[data-live="1"] { border-color: color-mix(in srgb, var(--ok) 45%, var(--surface-border)); }
.pm-card__top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pm-card__name { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.pm-card__name h3 { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pm-logo { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; background: #5b6b8c; }
.pm-logo[data-brand="bkash"] { background: #E2136E; }
.pm-logo[data-brand="nagad"] { background: #F6921E; }
.pm-logo[data-brand="rocket"] { background: #8C3494; }
.pm-logo[data-brand="upay"] { background: #1F4AA8; }
.pm-logo[data-brand="bank"] { background: #0E7C66; }
.pm-toggle { margin: 0; }
.pm-why { margin: 0; font-size: 13.5px; color: var(--muted); }
.pm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-tags span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--neutral-bg, rgba(127,127,127,.1)); color: var(--ink); }
.pm-number { margin: 0; font-size: 13.5px; }
.pm-number b { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.pm-more { justify-self: start; font-size: 12.5px; color: var(--muted); }
.pm-card--wide { gap: 12px; }
.pm-banks { display: grid; gap: 8px; }
.pm-bank { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--surface-border); background: var(--bg-elev); }
.pm-bank[data-live="1"] { border-color: color-mix(in srgb, var(--ok) 40%, var(--surface-border)); }
.pm-bank form { margin: 0; }
.pm-bank__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pm-bank__main small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.pm-later summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 6px 0; }
.pm-two { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.pm-error { margin: 0; color: var(--danger); font-size: 13.5px; }
.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; }
.a-switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pm-lead { margin: 0; font-size: 15px; color: var(--muted); max-width: 62ch; }
.pm-tags span { display: inline-flex; align-items: center; line-height: 1.4; }
.pm-card { align-content: start; }
