/* PrimePay Desk. Brand: Ink #09000D, Yellow #EBCC00, Light #EFEFEF. Staff tool: dense but readable. */
:root { --ink: #09000D; --yellow: #EBCC00; --light: #EFEFEF; --bg: #F6F6F4; --card: #fff; --text: #09000D; --text-2: #5A5560;
        --line: #E3E2DF; --ok: #13805B; --ok-bg: #E2F3EC; --warn: #A65800; --warn-bg: #FFF2DE; --bad: #B8232A; --bad-bg: #FCE8E8;
        --maint: #3B5BDB; --maint-bg: #E7ECFD; --note: #FFF9E0; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.main { padding: 24px 28px 60px; display: flex; flex-direction: column; gap: 18px; min-width: 0; max-width: 1240px; width: 100%; }
.main.narrow { max-width: 440px; margin: 0 auto; padding: 32px 16px 60px; }

/* ---------- shell: ink aside (design: Desk.dc.html) ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; text-decoration: none; color: inherit; }
.mark { width: 26px; height: 26px; border-radius: 7px; background: var(--yellow); color: var(--ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.badge { font-size: 10px; font-weight: 800; background: var(--yellow); color: var(--ink); border-radius: 5px; padding: 2px 5px; letter-spacing: .02em; }
.dside { background: var(--ink); color: var(--light); padding: 18px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.dside .logo { color: #fff; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 18px; }
.dnav { display: flex; flex-direction: column; gap: 2px; }
.dn { display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 9px 10px; border-radius: 9px; color: #C9C4CE; text-decoration: none; font-size: 14px; background: none; border: 0; width: 100%; font: inherit; cursor: pointer; text-align: left; }
.dn:hover { background: #1E1624; color: #fff; }
.dn.on { background: #1E1624; color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--yellow); }
.dn svg { flex: none; }
.dn .cnt { margin-left: auto; background: var(--yellow); color: var(--ink); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid #241B2B; }
.side-foot form { margin: 0; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2A2131; color: var(--yellow); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.who-text { display: flex; flex-direction: column; min-width: 0; }
.who-text b { font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text small { font-size: 12px; color: #8A8490; }
.side-note { padding: 6px 10px 0; font-size: 12px; color: #8A8490; }
.close-btn, .menu-btn { display: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: inherit; cursor: pointer; place-items: center; }
.mtop { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(9, 0, 13, .5); z-index: 40; }
.bare-top { background: var(--ink); color: #fff; padding: 16px; display: flex; justify-content: center; }
@media (max-width: 900px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .mtop { display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; padding: 8px 12px; position: sticky; top: 0; z-index: 30; }
    .menu-btn, .close-btn { display: grid; }
    .dside { position: fixed; inset: 0 auto 0 0; width: min(280px, 85vw); z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
    body.side-open .dside { transform: none; }
    body.side-open { overflow: hidden; }
    .main { padding: 18px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { .dside { transition: none; } }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 13px; margin: 0; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--text-2); } .small { font-size: 12px; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
@media (max-width: 1280px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.flash { padding: 12px 14px; border-radius: 10px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); } .flash.bad { background: var(--bad-bg); color: var(--bad); }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); }
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: #EEEDEA; color: var(--text-2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.maint { background: var(--maint-bg); color: var(--maint); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--text-2); }
.btn.primary { background: var(--ink); color: var(--light); border-color: var(--ink); }
.btn.yellow { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
label { font-weight: 600; font-size: 13px; display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
    width: 100%; min-height: 40px; border: 1px solid #CFCDC8; border-radius: 9px; padding: 8px 10px; font: inherit; background: #fff; color: var(--text); }
textarea { min-height: 96px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 2px; }
.field small { color: var(--text-2); font-size: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > .field { flex: 1 1 180px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-2); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.list-item { display: flex; gap: 10px 14px; align-items: baseline; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item a.title { font-weight: 600; text-decoration: none; } .list-item a.title:hover { text-decoration: underline; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.timeline.internal { border-left-color: #E5D27A; }
.timeline li small { display: block; color: var(--text-2); font-size: 12px; }
.timeline p { margin: 2px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.note-card { background: var(--note); }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.comp-grid .field { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--ok); }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.maint { background: var(--maint); }
.linkbox { word-break: break-all; padding: 10px 12px; border-radius: 9px; background: var(--note); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.qr { width: 200px; height: 200px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.inline { display: inline; margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fail { color: var(--bad); font-weight: 600; }

/* ---------- responsive ---------- */
html, body { max-width: 100%; overflow-x: clip; }
.shell > .main { min-width: 0; }
.card, .callout, .flash { overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; }
td, th { overflow-wrap: anywhere; }
.head > div { min-width: 0; }
@media (max-width: 640px) {
    h1 { font-size: 20px; }
    .card { padding: 14px; }
    .head { align-items: stretch; flex-direction: column; }
    .head .btn { width: 100%; }
    .row > .field { flex-basis: 100%; }
    .timeline { padding-left: 10px; }
    /* small tables become one block per row, with the column name before each value */
    table.stack thead { position: absolute; left: -9999px; }
    table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
    table.stack tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
    table.stack tr:last-child { border-bottom: 0; }
    table.stack td { border: 0; padding: 2px 0; }
    table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--text-2); font-size: 12px; }
    .comp-grid { grid-template-columns: 1fr; }
    .btn { min-height: 44px; }
    .btn.sm { min-height: 40px; }
}

.tabs { display: flex; gap: 4px; background: #EEEDEA; border-radius: 12px; padding: 4px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: 9px; color: var(--text-2); font-weight: 600; text-decoration: none; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a[aria-current="page"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(9, 0, 13, .1); }
.tabs .cnt { font-size: 11px; background: var(--ink); color: var(--light); border-radius: 999px; padding: 1px 7px; }
.timeline li.note-line { background: var(--note); border-radius: 8px; padding: 8px 10px; }
