/* LonvPay — strictly monochrome UI. Only black, white and grays; status is
   communicated by weight/icon/border, never by color. */

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --line: #dcdcdc;
  --line-soft: #ececec;
  --mut: #6b6b6b;
  --mut-2: #9a9a9a;
  --surface: #fafafa;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.icon { width: 16px; height: 16px; stroke-width: 1.75; vertical-align: -3px; flex: none; }
.icon-lg { width: 22px; height: 22px; stroke-width: 1.5; }
/* A few pictograms (door+arrow, arrows) read backwards in RTL unless mirrored. */
.icon-flip { transform: scaleX(-1); }

/* ---- shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex: none; border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 0;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 20px 20px; font-weight: 700; letter-spacing: .02em; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand .dot { width: 8px; height: 8px; background: var(--ink); border-radius: 50%; }
.nav { display: flex; flex-direction: column; gap: 1px; padding: 0 10px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px;
  text-decoration: none; color: var(--mut); font-weight: 500;
}
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a.active { background: var(--ink); color: var(--paper); }
.sidebar-foot { margin-top: auto; padding: 12px 20px 0; border-top: 1px solid var(--line); }
.mode-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 20px; border: 1px solid var(--ink); margin: 10px 20px 0; }
.mode-pill.test { border-style: dashed; color: var(--mut); }
.logout-link { display: flex; align-items: center; gap: 8px; padding: 10px 10px 0; color: var(--mut); text-decoration: none; font-size: 13px; }

.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.content { padding: 24px 28px 60px; max-width: 1100px; }

/* ---- primitives ---- */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.card + .card { margin-top: 16px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head h2 { font-size: 14px; margin: 0; font-weight: 700; }
.card-body { padding: 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; border-radius: 6px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); font: inherit; font-weight: 600; padding: 8px 14px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { opacity: .85; }
.btn.secondary { background: var(--paper); color: var(--ink); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--mut); }
.btn.danger { background: var(--paper); color: var(--ink); border-style: dashed; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

label.field-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); font-weight: 700; margin: 0 0 6px; }
input, select, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; width: 100%;
  background: var(--paper); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }
.hint { color: var(--mut-2); font-size: 12px; margin-top: 5px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: start; color: var(--mut); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--surface); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--mut); }

/* status badges — differentiated by fill/border/icon, not color */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 20px; border: 1px solid var(--ink); white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.badge-completed { background: var(--ink); color: var(--paper); }
.badge-under_review { background: var(--paper); color: var(--ink); }
.badge-cancelled { background: var(--paper); color: var(--mut-2); border-color: var(--line); border-style: dashed; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); align-items: end; }
.filters .field { margin-bottom: 0; min-width: 150px; }
.filters form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; width: 100%; }

.empty { padding: 40px 18px; text-align: center; color: var(--mut); }
.empty .icon-lg { display: block; margin: 0 auto 10px; color: var(--mut-2); }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; font-size: 13px; color: var(--mut); }
.pagination .links { display: flex; gap: 6px; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 6px; background: var(--surface); font-size: 13px; margin-bottom: 16px; }
.banner .icon { margin-top: 1px; }
.error-banner { border-style: solid; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; unicode-bidi: isolate; }
pre { background: var(--ink); color: #f2f2f2; padding: 14px; border-radius: 8px; overflow: auto; font-size: 12.5px; text-align: left; }
.doc-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.doc-block h3 { font-size: 14px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.doc-block p { color: var(--mut); }
.doc-block table { margin-top: 10px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; }
.toggle input { width: 40px; height: 22px; -webkit-appearance: none; appearance: none; background: var(--paper); border: 1px solid var(--ink); border-radius: 20px; position: relative; cursor: pointer; }
.toggle input::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: inset-inline-start .12s; }
.toggle input:checked { background: var(--ink); }
.toggle input:checked::after { inset-inline-start: 20px; background: var(--paper); }

.secret-reveal { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px dashed var(--line); border-radius: 6px; padding: 12px 14px; margin: 10px 0; }
.secret-reveal .mono { flex: 1; word-break: break-all; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 20px; padding: 5px 11px; font-size: 12px; font-family: ui-monospace, monospace; background: var(--surface); }

/* ---- public payment page ---- */
.pay-wrap { max-width: 460px; margin: 8vh auto 0; padding: 0 20px; }
.pay-card { border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.pay-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; margin-bottom: 22px; }
.pay-amount { font-size: 34px; font-weight: 800; margin: 0 0 4px; }
.pay-desc { color: var(--mut); margin: 0 0 22px; }
.result-icon { width: 46px; height: 46px; stroke-width: 1.25; margin: 0 auto 14px; display: block; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; border-inline-end: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; padding: 12px 16px; overflow-x: auto; }
  .brand { border-bottom: 0; padding: 0; padding-inline-end: 14px; margin: 0; }
  .nav { flex-direction: row; padding: 0; }
  .sidebar-foot { display: none; }
  .content { padding: 18px; }
  .field-row { flex-direction: column; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  td { border-bottom: 0; padding: 3px 0; }
  td::before { content: attr(data-label); display: block; font-size: 10px; text-transform: uppercase; color: var(--mut-2); font-weight: 700; }
}
