/* ==========================================================================
   Cidade da China — design system
   Palette: deep lacquer red (lucky red), imperial gold, ink, porcelain.
   ========================================================================== */
:root {
  --red-900: #6b0f14;
  --red-800: #8a1418;
  --red-700: #a3171c;
  --red-600: #c0272d;
  --red-100: #fdeceb;
  --gold-600: #b8860b;
  --gold-500: #d4a017;
  --gold-400: #e6be4b;
  --gold-100: #fbf3dc;
  --ink-900: #1e1c1a;
  --ink-700: #3b3733;
  --ink-500: #6b6560;
  --ink-300: #a8a29b;
  --line: #e7e1d8;
  --bg: #f7f4ef;
  --card: #ffffff;
  --green: #1f7a4d;
  --green-bg: #e6f4ec;
  --amber: #9a5b00;
  --amber-bg: #fdf0d5;
  --blue: #1d5fa8;
  --blue-bg: #e8f0fa;
  --slate-bg: #efece7;
  --danger: #b42318;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(30, 28, 26, .06), 0 4px 16px rgba(30, 28, 26, .06);
  --shadow-lg: 0 10px 40px rgba(30, 28, 26, .18);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'SF Mono', 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink-900);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--ink-500); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 650; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.nowrap span, .nowrap .mono { white-space: nowrap; }
/* keep stray full-size icons from stretching layout when used inline */
a svg, .tiny svg { flex: none; }
a > svg:only-child { width: 14px; height: 14px; vertical-align: -2px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- app shell */
.app { min-height: 100vh; display: flex; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #240d0c 0%, #3a1210 55%, #4a1612 100%);
  color: #f6e9d9; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  border-right: 1px solid rgba(230, 190, 75, .12);
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; border-bottom: 1px solid rgba(230, 190, 75, .12); }
.brand .logo {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, var(--gold-400), var(--gold-600));
  color: var(--red-900); font-weight: 800; font-size: 18px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15);
}
.brand .name { font-weight: 700; font-size: 14.5px; line-height: 1.2; }
.brand .sub { font-size: 11.5px; color: rgba(246, 233, 217, .62); margin-top: 2px; }
.nav { padding: 10px 10px; overflow-y: auto; flex: 1; }
.nav .group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(246,233,217,.42); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8.5px 10px; border-radius: 8px; color: rgba(246,233,217,.86);
  font-size: 13.5px; margin-bottom: 2px; text-decoration: none; border: 1px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav a.active { background: rgba(230,190,75,.14); border-color: rgba(230,190,75,.28); color: #fff; }
.nav a.active .ico { color: var(--gold-400); }
.nav .ico { width: 18px; height: 18px; flex: 0 0 18px; color: rgba(246,233,217,.6); }
.nav .count { margin-left: auto; background: var(--red-600); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { padding: 12px 14px 14px; border-top: 1px solid rgba(230,190,75,.12); font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px;
  position: sticky; top: 0; z-index: 30;
}
.topbar .crumb { font-size: 13px; color: var(--ink-500); }
.topbar .title { font-weight: 650; font-size: 15px; }
.content { padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ---------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-900); cursor: pointer; font-weight: 550; font-size: 13.5px; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .04s;
}
.btn:hover { background: #fbfaf8; border-color: #d9d2c7; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(180deg, var(--red-600), var(--red-800)); border-color: var(--red-800); color: #fff8ee; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 2px 6px rgba(163,23,28,.25); }
.btn.primary:hover { background: linear-gradient(180deg, #c9313a, var(--red-800)); }
.btn.gold { background: linear-gradient(180deg, var(--gold-400), var(--gold-600)); border-color: var(--gold-600); color: #2b1a05; }
.btn.danger { color: var(--danger); border-color: #f1c6c2; }
.btn.danger:hover { background: #fdf2f1; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--slate-bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-700); }
.btn-icon:hover { background: #fbfaf8; }
.btn-icon svg { width: 17px; height: 17px; }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid #dcd5ca; border-radius: 9px; background: #fff;
  outline: none; transition: border-color .12s, box-shadow .12s; font-size: 13.5px;
}
.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--red-600); box-shadow: 0 0 0 3px rgba(192,39,45,.12); }
.input[type="number"] { font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-700); }
.field .hint { font-size: 11.5px; color: var(--ink-500); }
.field .input-group { display: flex; align-items: center; gap: 0; }
.field .input-group .input { border-radius: 9px 0 0 9px; }
.field .input-group .suffix { height: 36px; display: grid; place-items: center; padding: 0 10px; border: 1px solid #dcd5ca; border-left: 0; border-radius: 0 9px 9px 0; background: #f7f5f1; font-size: 12.5px; color: var(--ink-500); }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 900px) { .row, .row-3 { grid-template-columns: 1fr; } }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--slate-bg); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--ink-500); font-weight: 550; }
.seg button.on { background: #fff; color: var(--ink-900); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--red-700); }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head .title { font-weight: 650; font-size: 15px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid.main-side { grid-template-columns: 1fr; } .grid.cols-3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; } }

.kpi { position: relative; padding: 16px 18px; overflow: hidden; }
.kpi .label { font-size: 12.5px; color: var(--ink-500); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .value .cur { font-size: 13px; font-weight: 600; color: var(--ink-500); margin-left: 4px; letter-spacing: 0; }
.kpi .sub { font-size: 12px; color: var(--ink-500); margin-top: 4px; }
.kpi .spark { position: absolute; right: 12px; bottom: 10px; opacity: .9; }
.kpi.accent::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--gold-400), var(--red-600)); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500);
  font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbf9f6; white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid #f0ece5; vertical-align: middle; }
table.tbl tbody tr:hover { background: #fbf9f6; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tfoot td { padding: 11px 14px; font-weight: 650; border-top: 2px solid var(--line); background: #fbf9f6; }
table.tbl td.right, table.tbl th.right { text-align: right; }
table.tbl .clickable { cursor: pointer; }
.dense td { padding: 8px 12px; }
.dense th { padding: 8px 12px; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.paid { color: var(--green); background: var(--green-bg); border-color: #cbe7d7; }
.badge.open { color: var(--blue); background: var(--blue-bg); border-color: #cfe0f3; }
.badge.overdue, .badge.failed, .badge.reversed { color: var(--danger); background: #fdeeed; border-color: #f3cdc9; }
.badge.partial, .badge.processing, .badge.pending { color: var(--amber); background: var(--amber-bg); border-color: #f2ddb0; }
.badge.void, .badge.cancelled, .badge.ended, .badge.vacant { color: var(--ink-500); background: var(--slate-bg); border-color: #e2ddd5; }
.badge.created, .badge.succeeded { color: var(--green); background: var(--green-bg); border-color: #cbe7d7; }
.badge.paypay { color: #b8141f; background: #fff0f1; border-color: #f7c9cd; }
.badge.chip { background: #fff; border-color: var(--line); color: var(--ink-700); font-family: var(--mono); font-weight: 500; }
.badge.chip::before { display: none; }
.badge.gold { color: #7a5600; background: var(--gold-100); border-color: #efdca6; }

/* ---------------------------------------------------------------- misc */
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: 0 0 30px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; flex-basis: 44px; }
.empty { padding: 36px 16px; text-align: center; color: var(--ink-500); }
.empty svg { width: 34px; height: 34px; opacity: .45; margin-bottom: 8px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-500); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--red-700); border-bottom-color: var(--red-700); }
.notice { border-radius: 10px; padding: 11px 14px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; }
.notice svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.notice.info { background: var(--blue-bg); border-color: #cfe0f3; color: #123f6f; }
.notice.warn { background: var(--amber-bg); border-color: #f2ddb0; color: #5f3800; }
.notice.success { background: var(--green-bg); border-color: #cbe7d7; color: #145c3a; }
.notice.danger { background: #fdeeed; border-color: #f3cdc9; color: #7a1710; }
.notice.gold { background: var(--gold-100); border-color: #efdca6; color: #5c4200; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--slate-bg); font-size: 11.5px; color: var(--ink-700); font-weight: 550; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-500); }
.kv dd { margin: 0; font-weight: 550; }
.bar { height: 8px; border-radius: 99px; background: var(--slate-bg); overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--red-600), var(--gold-500)); }
.skeleton { background: linear-gradient(90deg, #eee9e1 25%, #f6f2ec 37%, #eee9e1 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 12, 10, .45); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 20px; z-index: 100; animation: fade .12s ease; }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; animation: pop .16s ease; }
.modal.wide { width: min(880px, 100%); }
.modal-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { font-size: 16.5px; }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); background: #fcfbf9; border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.toast-stack { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--ink-900); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px; animation: pop .18s ease; display: flex; gap: 10px; align-items: center; }
.toast.success { background: #134e32; }
.toast.error { background: #7a1710; }
.toast svg { width: 17px; height: 17px; flex: 0 0 17px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: #fff; box-shadow: var(--shadow-lg); z-index: 110; display: flex; flex-direction: column; animation: slide .18s ease; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; height: auto; max-height: 260px; overflow: visible; }
.chart text { font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-500); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }

.device-body .brandline, .device-body .steps-card, .device-body .foot-note { display: none; }
.device-body .wrap { padding: 10px; }
.device-body #app .card { border-radius: 12px; }
.device-body .total-line { flex-wrap: wrap; gap: 6px; }
.device-body .total-line .amt { font-size: 22px; }

/* ---------------------------------------------------------------- login */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: var(--bg); }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } }
.auth-hero {
  position: relative; color: #fdf3e3; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(230,190,75,.18), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(192,39,45,.35), transparent 60%),
    linear-gradient(160deg, #240d0c 0%, #3f1210 50%, #5c1914 100%);
  overflow: hidden;
}
.auth-hero::after {
  content: '中國城'; position: absolute; right: -30px; bottom: -40px; font-size: 220px; font-weight: 800;
  color: rgba(230,190,75,.06); letter-spacing: -.05em; pointer-events: none; line-height: 1;
}
.auth-hero .pin svg { width: 15px; height: 15px; flex: none; }
.auth-hero .pin { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: 12.5px; color: rgba(253,243,227,.7); border: 1px solid rgba(230,190,75,.3); padding: 4px 10px; border-radius: 99px; }
.auth-hero h1 { font-size: 40px; line-height: 1.1; margin: 18px 0 14px; color: #fff8ec; letter-spacing: -.02em; }
.auth-hero .lead { font-size: 15.5px; color: rgba(253,243,227,.75); max-width: 460px; }
.auth-hero .feats { display: grid; gap: 10px; margin-top: 28px; }
.auth-hero .feat { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: rgba(253,243,227,.85); }
.auth-hero .feat .dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(230,190,75,.14); color: var(--gold-400); }
.auth-hero .feat svg { width: 15px; height: 15px; }
.auth-card { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-box { width: min(400px, 100%); }
.auth-box .langs { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 24px; }
.auth-demo { display: grid; gap: 6px; margin-top: 18px; }
.auth-demo button { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; padding: 9px 12px; border: 1px dashed #d9d2c7; background: #fbfaf8; border-radius: 9px; cursor: pointer; font-size: 12.5px; }
.auth-demo button:hover { border-color: var(--red-600); background: #fff; }
.auth-demo .who { font-weight: 650; font-size: 13px; }
.auth-demo .mail { color: var(--ink-500); font-family: var(--mono); font-size: 11.5px; }

/* ---------------------------------------------------------------- tenant portal */
.portal-top { background: linear-gradient(160deg, #240d0c 0%, #43110f 60%, #5f1a14 100%); color: #fdf3e3; padding: 20px 0 64px; }
.portal-top .select { background: rgba(255,255,255,.1); color: #fdf3e3; border-color: rgba(253,243,227,.25); }
.portal-top .select option { color: #1e1c1a; }
.portal-top .logo { flex: none; }
.mono.small, .small.mono { white-space: nowrap; }
.portal-wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.portal-hero-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px 24px; margin-top: -34px; position: relative; color: var(--ink-900); }
.balance-hero { font-size: 36px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bill-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; transition: border-color .12s, box-shadow .12s; }
.bill-card:hover { border-color: #e0d4c2; box-shadow: var(--shadow); }
.bill-card.overdue { border-left: 4px solid var(--red-600); }
.phone-frame { width: min(340px, 90%); margin: 0 auto; border-radius: 34px; border: 10px solid #1b1412; background: #fff; box-shadow: var(--shadow-lg); overflow: hidden; }
iframe.phone-frame { width: 100%; height: 620px; border-width: 0; }

/* PayPay style */
.paypay-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.paypay-brand .mark { background: #E50014; color: #fff; border-radius: 9px; padding: 2px 7px; font-size: 15px; font-weight: 800; }
.money-line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #eee; font-size: 13.5px; }
.money-line:last-child { border-bottom: 0; }
.money-line .val { font-variant-numeric: tabular-nums; font-weight: 600; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 2px; }
.total-line .amt { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; place-items: center; }
.qr-box svg { max-width: 100%; height: auto; }
.barcode-box { background: #fff; border: 1px dashed #d9d2c7; border-radius: 8px; padding: 8px 6px; display: grid; place-items: center; }
.reference-mono { font-family: var(--mono); font-size: 22px; letter-spacing: .18em; font-weight: 700; }

/* utilities */
.offline { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; background: var(--red-800); color: #fff; padding: 8px 16px; border-radius: 99px; font-size: 13px; z-index: 300; }
/* ---------------------------------------------------------------- responsive shell */
@media (max-width: 860px) {
  html { font-size: 93.75%; }
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex: none; }
  .brand { padding: 12px 14px; }
  .nav { display: flex; overflow-x: auto; padding: 6px 8px; gap: 4px; }
  .nav .group-label { display: none; }
  .nav a { flex: 0 0 auto; padding: 7px 10px; margin: 0; font-size: 12.5px; white-space: nowrap; }
  .nav a .count { margin-left: 4px; }
  .sidebar-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
  .sidebar-foot .flex-between { flex: 1; }
  .topbar { height: 54px; padding: 0 14px; position: relative; }
  .content { padding: 14px; }
  .modal { border-radius: 12px; }
  .modal-foot { flex-wrap: wrap; }
  .drawer { width: 100%; }
  table.tbl th, table.tbl td { padding: 9px 10px; }
}

@media print {
  .sidebar, .topbar, .no-print, .btn, .btn-icon, .toast-stack { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card, .panel { box-shadow: none; border: 0; }
  .print-area { display: block !important; }
  /* Printing a receipt from its modal: only the receipt is printed (80 mm width) */
  .modal-backdrop { position: static; background: none; padding: 0; display: block; backdrop-filter: none; }
  .modal-backdrop .modal { box-shadow: none; border-radius: 0; max-height: none; width: 80mm; margin: 0 auto; }
  .modal-backdrop .modal-head, .modal-backdrop .modal-foot, .modal-backdrop ~ * { display: none !important; }
  .modal-backdrop .modal-body { padding: 4mm 2mm; }
  @page { size: auto; margin: 6mm; }
}
