:root{--bg:#F4F6F7;--panel:#fff;--ink:#2B3238;--muted:#6B7378;--faint:#8C959B;--line:#D9DEE2;--line2:#EDF0F2;--teal:#0A7F9E;--teal-d:#086A85;--teal-soft:#E3F5FA;--teal-bg:#EEF8FB;--cyan:#11C0EE;--slate:#2F3A44;--slate2:#38434D;--ok:#1E7A4A;--ok-bg:#E4F3EA;--warn:#7A4F00;--warn-bg:#FBEED3;--bad:#B3261E;--bad-bg:#F8E1E2;--r:10px}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:'Montserrat',system-ui,-apple-system,'Segoe UI',sans-serif;font-size:14.5px;line-height:1.45;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}
a{color:var(--teal)}a:hover{color:var(--teal-d)}a.plain{color:inherit;text-decoration:none}a.plain:hover{text-decoration:underline}
h1,h2,h3{margin:0 0 6px;font-weight:600;letter-spacing:-.01em;text-wrap:balance}h1{font-size:26px}h2{font-size:16px;margin:26px 0 10px}
p{margin:0 0 10px}hr{border:0;border-top:1px solid var(--line);margin:14px 0}
.muted{color:var(--muted)}.faint{color:var(--faint)}.small{font-size:12.5px}.tiny{font-size:11.5px}.center{text-align:center}.bad{color:var(--bad)}.warn{color:var(--warn)}.ok{color:var(--ok)}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.93em}td .mono,td.num{white-space:nowrap}.break{word-break:break-all}
.num{text-align:right;font-variant-numeric:tabular-nums}
.logo{height:28px;width:auto;display:block}
.eyebrow{display:block;font-size:11.5px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;color:var(--muted)}
.eyebrow-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:4px}.eyebrow-row .eyebrow{display:inline}
.pill{display:inline-flex;align-items:center;padding:2px 9px;border-radius:999px;font-size:12px;font-weight:600;background:var(--line2);color:var(--muted)}
.pill.warn{background:var(--warn-bg);color:var(--warn)}.pill.bad{background:var(--bad-bg);color:var(--bad)}.pill.ok{background:var(--ok-bg);color:var(--ok)}.pill.muted{background:var(--line2);color:var(--muted)}
.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:20px 22px;margin-bottom:16px}
.card .eyebrow{margin-bottom:8px}.table-card{padding:0;overflow:hidden}
table{width:100%;border-collapse:collapse;font-size:14px}th{font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:600;text-align:left;padding:11px 16px;border-bottom:1px solid var(--line)}
td{padding:13px 16px;border-bottom:1px solid var(--line2);vertical-align:top;font-variant-numeric:tabular-nums}tbody tr:last-child td{border-bottom:0}
tfoot td{background:#F7F9FA;padding:8px 16px;border:0}tfoot tr.total td{font-weight:700;font-size:15px;border-top:1px solid var(--line);padding-top:12px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:0 18px;border-radius:8px;border:1px solid var(--line);background:#fff;color:var(--ink);font:inherit;font-weight:600;font-size:14px;text-decoration:none;cursor:pointer}
.btn:hover{border-color:#B8C0C6;color:var(--ink)}.btn.primary{background:var(--teal);border-color:var(--teal);color:#fff}.btn.primary:hover{background:var(--teal-d);border-color:var(--teal-d);color:#fff}
.btn.ghost{background:transparent}.btn.small{min-height:34px;padding:0 12px;font-size:13px}.btn.block{width:100%}.btn.large{min-height:54px;font-size:16px;border-radius:10px}.btn.danger{color:var(--bad)}.btn[disabled]{opacity:.5;cursor:not-allowed}
.btn:focus-visible,input:focus-visible,a:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
label{display:block;font-size:12.5px;font-weight:600;color:var(--muted);margin:12px 0 6px}label.check{display:flex;align-items:center;gap:8px;font-weight:500;color:var(--ink)}
input,textarea,select{width:100%;font:inherit;font-size:15px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);min-height:44px}textarea{min-height:80px;resize:vertical}input[type=checkbox]{width:18px;height:18px;min-height:0;accent-color:var(--teal);margin:0}input[type=date]{width:auto;min-height:36px;padding:6px 8px;font-size:13px}
.code-input{font-size:28px;letter-spacing:.35em;text-align:center;font-weight:700}
.alert{padding:10px 14px;border-radius:8px;font-size:13.5px;margin:10px 0}.alert.bad{background:var(--bad-bg);color:var(--bad)}
.narrow{max-width:560px;margin:0 auto;padding:24px 16px}.narrow.center{text-align:center}
.card.auth{text-align:left;padding:32px}.card.auth .logo{margin:0 auto 18px}.card.auth h1{text-align:center}.card.auth p{text-align:center}.card.auth .btn{margin-top:16px}
.site-foot{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;padding:16px clamp(16px,4vw,48px);color:var(--faint);font-size:12px;border-top:1px solid var(--line);margin-top:24px}

/* client */
.client-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 clamp(16px,4vw,48px);height:64px;background:#fff;border-bottom:1px solid var(--line)}
.pay-layout{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:32px;max-width:1180px;margin:0 auto;padding:36px clamp(16px,4vw,48px) 24px}
@media (max-width:860px){.pay-layout{grid-template-columns:1fr;gap:20px;padding-top:22px}.pay-side{order:-1}}
.amount{font-size:42px;font-weight:600;margin:2px 0 4px;font-variant-numeric:tabular-nums}
.pay-card{box-shadow:0 4px 16px rgba(43,50,56,.06);padding:26px}.pay-card .big{font-size:32px;font-weight:700;font-variant-numeric:tabular-nums;margin:2px 0 4px}.pay-card .btn.large{margin:14px 0 10px}
.note{display:flex;gap:10px;align-items:flex-start;font-size:13px;color:var(--muted);padding:14px 16px}.note svg{flex-shrink:0;margin-top:1px}
.confirm .checkmark{width:64px;height:64px;border-radius:50%;background:var(--teal-soft);display:flex;align-items:center;justify-content:center;margin:24px auto 14px}
.timeline-card{text-align:left;margin-top:20px}.timeline{list-style:none;margin:0 0 16px;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.timeline li{position:relative;padding:22px 8px 0 0;display:flex;flex-direction:column;gap:2px}.timeline li .dot{position:absolute;top:0;left:0;width:22px;height:22px;border-radius:50%;border:3px solid var(--line);background:#fff}
.timeline li::after{content:"";position:absolute;top:10px;left:26px;right:0;height:3px;background:var(--line)}.timeline li:last-child::after{display:none}
.timeline li.done .dot{background:var(--teal);border-color:var(--teal)}.timeline li.done::after{background:var(--teal)}.timeline li.now .dot{border-color:var(--teal)}.timeline li.fail .dot{border-color:var(--bad)}
.kv{display:grid;grid-template-columns:auto 1fr;gap:8px 18px;margin:0;padding-top:14px;border-top:1px solid var(--line);font-size:14px}.kv dt{color:var(--muted)}.kv dd{margin:0}
.link{font-weight:500}

/* staff */
.admin{display:flex;min-height:100vh}
.side{width:224px;flex-shrink:0;background:var(--slate);color:#C9D1D8;display:flex;flex-direction:column;padding:20px 14px;gap:6px;position:sticky;top:0;height:100vh}
.side-brand{padding:4px 8px 16px}.side-brand img{height:28px;width:auto;display:block;margin-bottom:6px}.side-brand span{font-size:11.5px;color:#8FA3B0}
.side nav{display:flex;flex-direction:column;gap:4px}.side nav a{color:#C9D1D8;text-decoration:none;padding:10px 12px;border-radius:8px;font-size:14px}.side nav a:hover{background:var(--slate2);color:#fff}.side nav a.on{background:var(--teal);color:#fff;font-weight:600}
.side-foot{margin-top:auto;padding:12px 8px 0;font-size:12.5px;display:flex;flex-direction:column;gap:8px}.side-foot .who{color:#fff}.side-foot .btn{color:#C9D1D8;border-color:#4A5661;width:100%}.side-foot .btn:hover{color:#fff;border-color:#8FA3B0}
.main{flex:1;min-width:0;padding:30px clamp(16px,3vw,40px) 40px}
@media (max-width:820px){.admin{flex-direction:column}.side{width:auto;height:auto;position:static;flex-direction:row;flex-wrap:wrap;align-items:center}.side nav{flex-direction:row;flex-wrap:wrap}.side-foot{margin:0 0 0 auto;padding:0;flex-direction:row;align-items:center}.side-foot .btn{width:auto}}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;flex-wrap:wrap;margin-bottom:20px}.page-head p{margin:0}.actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.actions form{margin:0}.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.row form{margin:0}
.crumbs{font-size:13px;color:var(--muted);margin-bottom:6px}
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px;margin-bottom:16px}.tile{background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px 16px;display:flex;flex-direction:column;gap:2px}.tile strong{font-size:24px;font-weight:600;font-variant-numeric:tabular-nums}
.health{display:flex;flex-wrap:wrap;gap:10px 24px;font-size:13px;margin-bottom:16px}.health>span{display:inline-flex;align-items:center;gap:6px;font-weight:600}.health .dot{width:8px;height:8px;border-radius:50%;background:currentColor;display:inline-block}.health .muted{font-weight:400}
.filters{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:14px}.filters input{max-width:320px;min-height:38px;font-size:14px}.chip{display:inline-flex;align-items:center;min-height:34px;padding:0 13px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--ink);font-size:13px;font-weight:600;text-decoration:none}.chip.on{background:var(--teal);border-color:var(--teal);color:#fff}
.status{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:600;background:var(--line2);color:#3D4A43;text-transform:capitalize}.status .dot{width:7px;height:7px;border-radius:50%;background:#8C959B}
.status.ok{background:var(--ok-bg);color:var(--ok)}.status.ok .dot{background:var(--ok)}.status.warn{background:var(--warn-bg);color:var(--warn)}.status.warn .dot{background:#B8862B}.status.bad{background:var(--bad-bg);color:#8C1D18}.status.bad .dot{background:var(--bad)}.status.new{background:var(--teal-soft);color:var(--teal)}.status.new .dot{background:var(--teal)}.status.sent{background:var(--line2);color:#3D4A43}
.two-col{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:20px;align-items:start}@media (max-width:1000px){.two-col{grid-template-columns:1fr}}
.two-col h2:first-child{margin-top:0}
.plain-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;font-size:13.5px}

/* system page */
.sync-controls{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;flex-wrap:wrap;margin-bottom:24px}
.sync-controls p{margin:6px 0}
.flash{padding:10px 14px;border-radius:8px;background:#E8F6EA;color:#1F6B2F;margin:0 0 16px}
form.inline{display:inline}
.btn.tiny{min-height:26px;padding:0 8px;font-size:12px;margin-left:6px}.btn.quiet{background:transparent;border-color:transparent;color:var(--muted)}
.btn.tiny.primary{background:var(--teal);border-color:var(--teal);color:#fff}
.flash.bad{background:#FBECEC;color:#8A2626}
.send-card textarea{width:100%;box-sizing:border-box;margin:4px 0 10px}
.row.between{justify-content:space-between;align-items:flex-start}
.send-card .status{text-transform:none;letter-spacing:0}
.ageing{margin-bottom:16px}.ageing-row{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-top:8px}.ageing-cell{display:flex;flex-direction:column;gap:2px}.ageing-cell strong{font-size:18px;font-variant-numeric:tabular-nums}
.bar{height:6px;background:var(--line2);border-radius:3px;overflow:hidden;margin-top:4px}.bar i{display:block;height:100%;background:var(--teal)}.bar i.warn{background:#B8862B}.bar i.bar-bad,.bar i.bad{background:var(--bad)}
@media (max-width:700px){.ageing-row{grid-template-columns:repeat(2,1fr)}.tiles{grid-template-columns:1fr 1fr}.page-head{flex-direction:column;align-items:flex-start;gap:10px}.actions{flex-wrap:wrap}.table-card{overflow-x:auto}.grid{min-width:640px}}
.pager{display:flex;gap:16px;align-items:center;margin-top:12px}.bulk{margin:0 0 12px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
@media (max-width:700px){.grid td,.grid th{white-space:nowrap}.grid td:nth-child(2),.grid td:last-child{white-space:normal;min-width:170px}}
