/* ==========================================================
   PrintNUB — Minimal theme
   White, hairline borders, one accent colour, no shadows.
   ========================================================== */
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --surface: #fafafa;
  --surface-2: #f3f4f6;
  --text: #111111;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, .08);
  --danger: #dc2626;
  --success: #15803d;
  --warn: #b45309;
  --radius: 10px;
  --radius-sm: 6px;
  --float: 0 8px 24px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  --bar-h: 64px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* footer sits at the bottom of the screen even on short pages */
  min-height: 100vh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 1.5rem; font-weight: 600; margin: 0 0 1.2rem; letter-spacing: -.02em; }
h2 { font-size: 1.08rem; font-weight: 600; margin: 0 0 .9rem; letter-spacing: -.01em; }
h3 { font-size: .98rem; font-weight: 600; margin: .3rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-word; max-width: 320px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.5rem; min-height: 56px;
  /* solid, no backdrop-filter: a filter here would trap the fixed phone menu inside the bar */
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 600; font-size: 1.05rem; color: var(--text); white-space: nowrap; letter-spacing: -.01em; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand small {
  font-weight: 500; font-size: .7rem; padding: 1px 8px; border-radius: 999px; margin-left: .35rem;
  color: var(--muted); border: 1px solid var(--border); vertical-align: middle;
}
.menu { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; align-self: stretch; }
.nav-item {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: 0 .7rem; color: var(--muted); font-weight: 500; font-size: .92rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px; min-height: 56px;
  transition: color .15s, border-color .15s;
}
.nav-item .ico {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.nav-item:hover { color: var(--text); text-decoration: none; }
.nav-item.active { color: var(--text); border-bottom-color: var(--text); }

.account { position: relative; margin-left: auto; }
.account summary {
  list-style: none; cursor: pointer; display: flex; gap: .5rem; align-items: center;
  padding: .35rem .8rem; border-radius: 999px; font-size: .88rem;
  border: 1px solid var(--border); transition: background .15s, border-color .15s;
}
.account summary::-webkit-details-marker { display: none; }
.account summary:hover { border-color: var(--border-strong); }
.account details[open] summary { background: var(--surface-2); border-color: var(--border-strong); }
.account .uid { color: var(--muted); }
.account .bal { font-weight: 600; color: var(--success); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 30;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--float);
  padding: .4rem; display: flex; flex-direction: column; gap: 1px;
}
.dropdown .who { padding: .5rem .7rem .7rem; margin-bottom: .3rem; border-bottom: 1px solid var(--border); word-break: break-word; font-weight: 500; }
.dropdown .who small { font-weight: 400; color: var(--muted); }
.dropdown a, .dropdown .linklike { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: var(--radius-sm); color: var(--text); text-align: left; font-size: .92rem; }
.dropdown .ico {
  width: 16px; height: 16px; flex: none; color: var(--muted);
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.dropdown a:hover, .dropdown .linklike:hover, .dropdown a.active { background: var(--surface-2); color: var(--text); text-decoration: none; }
.dropdown a.active .ico { color: var(--text); }
.dropdown .logout:hover, .dropdown .logout:hover .ico { color: var(--danger); }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; width: 100%; }

/* ---------- Layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 2.5rem 1.5rem 3rem; }
.guest { min-height: calc(100vh - 64px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1.5rem;
}
.card.auth { width: 100%; max-width: 400px; padding: 2.2rem 1.8rem; }
.card.auth h1 { text-align: center; }
.card.auth > .muted { text-align: center; margin-top: -.6rem; }
ol.steps { padding-left: 1.3rem; margin: 0 0 1rem; }
ol.steps li { margin-bottom: .6rem; }
.back-link { display: inline-block; margin-bottom: .8rem; font-weight: 500; font-size: .9rem; color: var(--muted); }
.back-link:hover { color: var(--text); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 1.5rem; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; }
.stat .n { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }

/* ---------- Forms ---------- */
label { display: block; margin-bottom: 1rem; font-weight: 500; font-size: .9rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .35rem; padding: .6rem .8rem;
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #9ca3af; }
input:hover, select:hover, textarea:hover { border-color: #9ca3af; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: auto; border: 0; box-shadow: none; margin: 0 .4rem 0 0; accent-color: var(--primary); }
input[type="file"] { padding: .5rem; background: var(--surface); }
.form-narrow { max-width: 440px; }
.form-row { display: grid; gap: 0 1.2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.search { display: flex; gap: .6rem; }
.search input { margin: 0; min-width: 0; }
.inline { display: inline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; font: inherit; font-weight: 500; font-size: .92rem; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.btn:active { background: var(--border); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--bg); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-primary:active { background: #1e40af; }
.btn-primary:disabled:hover { background: var(--primary); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { color: var(--danger); background: #fef2f2; border-color: #fecaca; }
.btn-block { width: 100%; }
.btn-lg { padding: .85rem 1.2rem; font-size: 1.02rem; border-radius: 8px; }
.btn-small { padding: .3rem .7rem; font-size: .84rem; }
.btn-tiny { padding: .1rem .45rem; font-size: .75rem; border-radius: 4px; }
.btn-google {
  gap: .75rem; padding: .8rem 1.2rem; font-size: 1rem; font-weight: 500;
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: var(--radius-sm);
}
.btn-google:hover { color: #1f1f1f; background: #f8faff; border-color: #c6dafc; }
.btn-google:active { background: #eef3fd; }
.btn-google .g-logo { flex: none; width: 22px; height: 22px; }
.or { text-align: center; margin: 1.4rem 0; border-top: 1px solid var(--border); line-height: 0; }
.or span { background: var(--bg); padding: 0 .7rem; color: var(--muted); font-size: .82rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
td.actions { display: table-cell; white-space: nowrap; }
td.actions > * { display: inline-block; margin: 3px 2px; vertical-align: middle; }

.alert {
  padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.2rem; width: 100%; max-width: 1080px;
  border: 1px solid; border-left-width: 3px; font-size: .92rem;
}
.guest .alert { max-width: 400px; }
.alert-error { color: #991b1b; background: #fef2f2; border-color: #fecaca; border-left-color: var(--danger); }
.alert-success { color: #14532d; background: #f0fdf4; border-color: #bbf7d0; border-left-color: var(--success); }
.alert-info { color: #1e3a8a; background: #eff6ff; border-color: #bfdbfe; border-left-color: var(--primary); }
.alert-warn { color: #78350f; background: #fffbeb; border-color: #fde68a; border-left-color: var(--warn); }
.alert a { color: inherit; text-decoration: underline; }
.error-msg { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; padding: .65rem .85rem; border-radius: var(--radius-sm); margin: .9rem 0; font-size: .92rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -.3rem; padding: 0 .3rem; }
table { width: 100%; border-collapse: collapse; border-spacing: 0; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
thead th {
  color: var(--muted); font-weight: 500; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
tbody tr:hover td { background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.bkash { color: #e2136e; }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border);
  font-size: .74rem; font-weight: 500; color: var(--muted);
}
.tag-color { color: var(--primary); border-color: #bfdbfe; background: #eff6ff; }
.tag-missing { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.status { display: inline-block; font-size: .75rem; font-weight: 500; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; }
.status-ready { color: var(--primary); }
.status-printed { color: var(--success); }
.status-cancelled { color: var(--muted); }
.role-admin { color: var(--danger); }
.role-treasurer { color: var(--warn); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; word-break: break-word; }

/* ---------- Codes ---------- */
.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .08em; white-space: nowrap; }
.code.big { font-size: 2.8rem; font-weight: 800; letter-spacing: .14em; color: var(--primary-dark); }
.code-box {
  display: inline-flex; align-items: center; gap: .8rem; padding: .7rem 1.4rem;
  border-radius: var(--radius); background: #eff6ff; border: 2px solid #93c5fd; font-size: 1.3rem; margin: .3rem 0 1rem;
}

/* ---------- Upload & print card ---------- */
.print-card { max-width: 540px; margin: 0 auto 1.5rem; }
.upload-zone {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: 2.2rem 1rem; cursor: pointer; font: inherit; color: var(--text);
  border: 1.5px dashed #93c5fd; border-radius: var(--radius); background: #f0f7ff;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover { border-color: var(--primary); background: #e3efff; }
.upload-zone:active { background: rgba(37, 99, 235, .12); }
.upload-zone .icon {
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; margin-bottom: .5rem;
  border-radius: 50%; background: #dbeafe; font-size: 1.5rem; color: var(--primary);
}
.upload-zone strong { font-size: 1.05rem; font-weight: 600; }
.upload-zone small { color: var(--muted); }
.progress { padding: 1.5rem; text-align: center; color: var(--muted); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid var(--border); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: .3rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.chosen { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.chosen .icon { font-size: 1.6rem; }
.chosen > div { flex: 1; min-width: 0; }
.chosen strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chosen small { color: var(--muted); }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 1.5rem 0; }
.mode { margin: 0; cursor: pointer; position: relative; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode > span {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center;
  padding: 1.1rem .5rem; border-radius: var(--radius); font-weight: 600;
  background: var(--bg); border: 1px solid var(--border-strong);
  transition: border-color .15s, color .15s, background .15s;
}
.mode:hover > span { border-color: #9ca3af; }
.mode small { font-weight: 400; color: var(--muted); }
/* Selected print type: solid fill, white text, check badge */
.mode input:checked + span { color: #fff; }
.mode-bw input:checked + span { background: #111; border-color: #111; }
.mode-color input:checked + span { background: var(--primary); border-color: var(--primary); }
.mode input:checked + span small { color: rgba(255, 255, 255, .8); }
.mode input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.mode .check {
  position: absolute; top: .45rem; right: .5rem; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700;
  background: #fff; color: var(--text); opacity: 0; transform: scale(.6);
  transition: opacity .15s, transform .15s;
}
.mode input:checked + span .check { opacity: 1; transform: scale(1); }
.mode input:checked + span .swatch { border-color: rgba(255, 255, 255, .7); }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong); }
.swatch.bw { background: linear-gradient(135deg, #111 50%, #fff 50%); }
.swatch.color { background: conic-gradient(#f44336, #ffeb3b, #4caf50, #2196f3, #9c27b0, #f44336); }

.copies { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; font-weight: 600; }
.stepper { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button {
  width: 40px; height: 38px; border: 0; background: var(--bg);
  font-size: 1.2rem; cursor: pointer; color: var(--text); transition: background .15s;
}
.stepper button:hover { background: var(--surface-2); }
.stepper button:active { background: var(--border); }
.stepper input {
  width: 56px; margin: 0; padding: .3rem; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  border-radius: 0; background: transparent; text-align: center; font-weight: 600; -moz-appearance: textfield;
}
.stepper input:focus { box-shadow: none; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }

.summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.5rem; }
.summary > div { display: flex; justify-content: space-between; gap: 1rem; }
.summary .total { font-size: 1.15rem; font-weight: 600; margin: .4rem 0; }

/* ---------- Modals ---------- */
dialog.modal {
  border: 1px solid var(--border); border-radius: 12px; padding: 1.8rem 1.6rem 1.5rem; width: min(92vw, 380px); text-align: center;
  background: var(--bg); color: var(--text); box-shadow: 0 20px 40px rgba(0, 0, 0, .12);
}
dialog.modal::backdrop { background: rgba(17, 17, 17, .35); }
dialog.modal h2 { margin: .8rem 0 .5rem; }
.modal-icon {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; background: var(--surface-2);
}
.modal-icon.ok { color: var(--success); background: #f0fdf4; }
.modal-icon.warn { color: var(--warn); background: #fffbeb; }
.file-name { font-weight: 600; word-break: break-word; margin: .3rem 0; }

/* ---------- Misc ---------- */
.balance-card { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.balance-big { font-size: 2.3rem; font-weight: 600; letter-spacing: -.03em; color: var(--text); }
.doc { display: flex; flex-direction: column; }
.doc .doc-icon {
  font-size: 1.5rem; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); background: var(--surface-2); margin-bottom: .6rem;
}
.doc .actions { margin-top: auto; padding-top: .8rem; }
.apikey { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; word-break: break-all; background: var(--surface); border: 1px solid var(--border); padding: .65rem .85rem; border-radius: var(--radius-sm); }
code { overflow-wrap: anywhere; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
pre code { overflow-wrap: normal; }
pre { background: #111; color: #e5e7eb; padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .84rem; }
.pagination { display: flex; gap: .5rem; margin-top: 1.2rem; flex-wrap: wrap; }

/* ---------- Password fields ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 3rem; }
.pw-eye {
  position: absolute; right: .35rem; bottom: .3rem; width: 36px; height: 32px; padding: 6px 8px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
}
.pw-eye:hover, .pw-eye:focus-visible { color: var(--text); background: var(--surface-2); outline: none; }
.pw-eye svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pw-rules { list-style: none; margin: .45rem 0 0; padding: 0; font-size: .8rem; font-weight: 400; color: var(--muted); }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--success); }
.pw-rules li.ok::before { content: "✓ "; font-weight: 700; }

/* ---------- Add Money dialog ---------- */
#money-dialog {
  --bkash: #e2136e; --bkash-dark: #c40e5d;
  padding: 0; width: min(94vw, 440px); background: #fff; color: #111827; border-radius: 0; overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .1);
}
.bk-head { padding: 1.5rem 1.5rem .6rem; text-align: center; }
.bk-head img { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; }
.bk-phone { display: flex; align-items: center; gap: .85rem; padding: .9rem 1.5rem 1.1rem; text-align: left; }
.bk-phone-icon {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(226, 19, 110, .1); color: var(--bkash);
}
.bk-phone-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bk-phone-text { flex: 1; min-width: 0; }
.bk-number { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; color: #111827; }
.bk-caption { font-size: .82rem; font-weight: 500; color: #6b7280; margin-top: .15rem; }
.bk-copy {
  flex-shrink: 0; padding: .4rem .95rem; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
  border: 2px solid var(--bkash); border-radius: 999px; background: #fff; color: var(--bkash); transition: background .2s, color .2s;
}
.bk-copy:hover, .bk-copy:focus-visible { background: var(--bkash); color: #fff; outline: none; }
.bk-panel {
  position: relative; overflow: hidden; padding: 1.6rem 1.5rem; text-align: center;
  background: radial-gradient(at 90% 10%, rgba(255,255,255,.2) 0, transparent 50%),
              radial-gradient(at 10% 90%, rgba(0,0,0,.15) 0, transparent 50%),
              linear-gradient(135deg, var(--bkash) 0%, var(--bkash-dark) 100%);
}
.bk-shape { position: absolute; pointer-events: none; }
.bk-shape-1 { top: -20px; right: -30px; width: 140px; height: 140px; background: rgba(255,255,255,.08); clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); transform: rotate(25deg); }
.bk-shape-2 { bottom: -30px; left: -20px; width: 120px; height: 120px; background: rgba(0,0,0,.08); clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); transform: rotate(-15deg); }
.bk-label { position: relative; display: block; margin: 0 0 .9rem; color: #fff; font-size: 1.15rem; font-weight: 700; letter-spacing: .02em; }
#money-dialog .bk-input {
  position: relative; width: 100%; padding: .85rem 1rem; border: 0; border-radius: 12px; background: #fff; color: #111827;
  font-size: 1.2rem; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .1em;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.08); transition: box-shadow .2s;
}
#money-dialog .bk-input::placeholder { color: #9ca3af; text-transform: none; letter-spacing: .04em; }
#money-dialog .bk-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,.45); }
#money-dialog .money-msg { position: relative; margin: .9rem 0 0; background: #fff; text-align: left; font-size: .9rem; }
.bk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.2rem 1.5rem; }
.bk-btn {
  padding: .75rem 1rem; font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; border-radius: 999px;
  transition: background .2s, transform .1s;
}
.bk-btn:active { transform: scale(.98); }
.bk-close { border: 2px solid #d1d5db; background: #fff; color: #374151; }
.bk-close:hover { background: #f9fafb; }
.bk-confirm { border: 2px solid var(--bkash); background: var(--bkash); color: #fff; box-shadow: 0 4px 10px rgba(226, 19, 110, .3); }
.bk-confirm:hover { background: var(--bkash-dark); border-color: var(--bkash-dark); }
.bk-confirm:disabled { opacity: .6; cursor: not-allowed; }
@media (min-width: 761px) {
  #money-dialog { width: min(92vw, 520px); }
  .bk-head { padding: 1.9rem 2rem .8rem; }
  .bk-head img { max-width: 400px; }
  .bk-phone { padding: 1.1rem 2rem 1.3rem; gap: 1rem; }
  .bk-phone-icon { width: 54px; height: 54px; }
  .bk-number { font-size: 1.45rem; }
  .bk-caption { font-size: .9rem; }
  .bk-panel { padding: 2rem; }
  .bk-label { font-size: 1.25rem; }
  #money-dialog .bk-input { padding: 1rem; font-size: 1.3rem; }
  .bk-actions { padding: 1.5rem 2rem; }
  .bk-btn { padding: .9rem 1rem; font-size: 1.05rem; }
}
@media (max-width: 380px) {
  .bk-phone { padding-left: 1rem; padding-right: 1rem; gap: .6rem; }
  .bk-phone-icon { width: 40px; height: 40px; }
  .bk-number { font-size: 1.1rem; }
}
.trx-input { text-transform: uppercase; letter-spacing: .08em; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1.2rem; }


/* ---------- Issues, manual, footer ---------- */
.code-mid { font-size: 1.1rem; color: var(--text); }
.issue { padding: .9rem 0; border-bottom: 1px solid var(--border); }
.issue:last-child { border-bottom: 0; }
.card.issue { padding: 1.3rem 1.5rem; border-bottom: 1px solid var(--border); }
.issue-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.issue-body { white-space: normal; word-break: break-word; margin: .6rem 0; }
.issue-reply { padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--surface); border-left: 2px solid var(--border-strong); font-size: .92rem; }
.manual ol { padding-left: 1.2rem; margin: 0; }
.manual li { margin-bottom: .45rem; }
.manual p:last-child { margin-bottom: 0; }
.site-footer { width: 100%; text-align: center; margin-top: auto; padding: 1.4rem 1rem 1.6rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--border); }
.site-footer strong { color: var(--text); font-weight: 500; }

/* ==========================================================
   Phone: icon menu in a bottom bar
   ========================================================== */
@media (max-width: 760px) {
  body:not(.layout-guest) { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 1rem; gap: .6rem; min-height: 52px; }
  .brand { font-size: 1rem; }
  .account summary { padding: .3rem .7rem; font-size: .84rem; }
  .dropdown { position: fixed; right: .75rem; left: auto; top: 56px; max-width: calc(100vw - 1.5rem); }

  .menu {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; align-self: auto;
    flex-wrap: nowrap; justify-content: space-around; gap: 0;
    height: calc(var(--bar-h) + env(safe-area-inset-bottom));
    padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); backdrop-filter: saturate(180%) blur(8px);
    border-top: 1px solid var(--border);
  }
  .menu-wide { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .menu-wide::-webkit-scrollbar { display: none; }
  .nav-item {
    flex: 1 1 0; min-width: 0; min-height: 0; flex-direction: column; justify-content: center; gap: .2rem;
    padding: .2rem .15rem; margin: 0; border: 0; font-size: .68rem; font-weight: 500; text-align: center;
  }
  .menu-wide .nav-item { flex: 0 0 auto; min-width: 68px; }
  .nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav-item .ico { width: 22px; height: 22px; }
  .nav-item.active { color: var(--primary); }

  .container { padding: 1.4rem 1rem 1.5rem; }
  h1 { font-size: 1.3rem; }
  .card { padding: 1.15rem; margin-bottom: 1rem; }
  .card.auth { padding: 1.6rem 1.2rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .stat { padding: .85rem 1rem; }
  .stat .n { font-size: 1.2rem; word-break: break-word; }
  .grid { gap: .8rem; }
  .page-head { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
  .modes { gap: .7rem; margin: 1.2rem 0; }
  .upload-zone { padding: 1.7rem .8rem; }
  .code.big { font-size: 2.2rem; letter-spacing: .08em; }
  .balance-big { font-size: 1.9rem; }
  .wrap { max-width: 220px; }
  td.wrap { min-width: 130px; }
  /* dates may break onto two lines so money columns stay on screen */
  td.nowrap { white-space: normal; min-width: 5.6rem; }
  th, td { padding: .55rem .55rem; }
  table { font-size: .86rem; }
  /* tables run to the card edge so a cut-off column reads as "scroll sideways" */
  .card .table-wrap { margin: 0 -1.15rem; padding: 0 .6rem; }
  dl.facts { grid-template-columns: 1fr; gap: .1rem; }
  dl.facts dd { margin-bottom: .5rem; }

  /* Lists (tables with a header row, see app.js): one card per row, every column visible as "Label  value". */
  .card .table-wrap:has(> table.stack) { margin: 0; padding: 0; overflow: visible; }
  table.stack, table.stack tbody, table.stack tfoot, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack { font-size: 1rem; }
  table.stack thead { display: none; }
  table.stack tr {
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
    padding: .3rem .85rem; margin-bottom: .75rem;
  }
  table.stack tr:last-child { margin-bottom: 0; }
  table.stack tbody tr:hover td { background: transparent; }
  table.stack td {
    position: relative; padding: .55rem 0 .55rem 42%; min-height: 2.4rem; min-width: 0; max-width: none;
    text-align: right; white-space: normal; word-break: break-word; border-bottom: 1px solid var(--border);
  }
  table.stack tr td:last-child { border-bottom: 0; }
  table.stack tr td:empty, table.stack tr td.cell-empty { display: none; }
  table.stack td.cell-input { padding-left: 0; padding-top: 2.1rem; text-align: left; }
  table.stack td.cell-input form { display: flex; gap: .5rem; width: 100%; }
  table.stack td.cell-input form input:not([type=hidden]), table.stack td.cell-input form select { flex: 1 1 auto; min-width: 0; width: auto; }
  table.stack td::before {
    content: attr(data-label); position: absolute; left: 0; top: .55rem; width: 40%;
    text-align: left; color: var(--muted); font-size: .9rem; font-weight: 500; white-space: normal;
  }
  /* Cells without a column name (buttons, wide content) use the full width */
  table.stack td:not([data-label]) { padding-left: 0; }
  table.stack td:not([data-label])::before { content: none; }
  table.stack td.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; white-space: normal; }
  table.stack td.actions > * { margin: 0; }
  table.stack .btn-tiny { font-size: .9rem; padding: .4rem .85rem; }
  table.stack .code-mid { font-size: 1.15rem; }
  table.stack small { font-size: .85rem; }
  table.stack td form.search { justify-content: flex-end; }
}
@media (max-width: 360px) {
  .account .uid { display: none; }
  .stats { grid-template-columns: 1fr; }
}

/* ---------- Print list (waiting jobs) ---------- */
.job-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.job { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; background: var(--bg); }
.job + .job { border-top: 1px solid var(--border); }
.job:hover { background: var(--surface); }
.job-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.job-line1 { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.job-code {
  flex: none; font-size: 1.2rem; font-weight: 700; line-height: 1.2; color: var(--primary-dark); padding: .2rem .6rem;
  background: #eff6ff; border: 1.5px solid #93c5fd; border-radius: var(--radius-sm);
}
.job-name { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; font-size: .82rem; color: var(--muted); }
.job-meta .tag { font-size: .7rem; }
.job-cost { color: var(--text); font-weight: 600; }
.job form { flex: none; margin: 0; }
@media (max-width: 480px) {
  .job { gap: .7rem; padding: .7rem .8rem; }
  .job-code { font-size: 1.1rem; }
}

/* ---------- Confirm dialog ---------- */
.confirm-modal .confirm-msg { margin: 0; }
.btn-solid-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-solid-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

/* ---------- Lists (history, balance, profile): two lines + a right-hand side ---------- */
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; background: var(--bg); transition: background .15s; }
.list-item + .list-item { border-top: 1px solid var(--border); }
.list-item:hover, .job:hover { background: #f7faff; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.li-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-title .code { font-size: .95rem; }
.li-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; font-size: .82rem; color: var(--muted); }
.li-meta .tag { font-size: .7rem; }
.li-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; text-align: right; }
.li-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.li-sub { font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.status-rejected { color: var(--danger); }
.card .list + p, .card .job-list + p { margin-top: .9rem; }
@media (max-width: 480px) {
  .list-item { gap: .7rem; padding: .7rem .8rem; }
}
