/* RoamDesk — reseller portal
   Concept: departure-board navy + runway amber; eSIMs as boarding passes. */
:root {
  --canvas: #EDF1F5;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;
  --ink: #15233A;
  --ink-2: #44526A;
  --muted: #7A879B;
  --line: #DDE3EB;
  --line-2: #E9EDF2;
  --navy: #12233D;
  --navy-2: #1C3354;
  --navy-ink: #A9B7CC;
  --blue: #2557E6;
  --blue-ink: #1A43BB;
  --blue-tint: #E8EEFD;
  --amber: #F2AE35;
  --amber-ink: #8A5A00;
  --amber-tint: #FDF2DC;
  --green: #148A5C;
  --green-tint: #E1F3EA;
  --red: #CF3F3B;
  --red-tint: #FBE8E7;
  --violet: #6B4EDB;
  --violet-tint: #EEEAFC;

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(18, 35, 61, .06), 0 1px 1px rgba(18, 35, 61, .04);
  --shadow-lift: 0 10px 30px -12px rgba(18, 35, 61, .28);
  --side-w: 252px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 15px/1.5 var(--font); font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: .92em; letter-spacing: -0.01em; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.block { display: block; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.pre { white-space: pre-line; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.boot { min-height: 100vh; }
.app { min-height: 100vh; display: grid; grid-template-columns: var(--side-w) 1fr; }
.side {
  position: sticky; top: 0; height: 100vh; background: var(--navy); color: #fff;
  display: flex; flex-direction: column; padding: 20px 14px 14px; gap: 18px; overflow-y: auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 800; font-size: 18px; letter-spacing: -0.03em; padding: 0 6px; }
.logo { width: 30px; height: 30px; color: var(--blue); }
.wallet-card {
  display: grid; gap: 2px; padding: 16px; border-radius: var(--r-md); color: #fff;
  background: var(--navy-2); border: 1px solid rgba(255, 255, 255, .06); position: relative; overflow: hidden;
}
.wallet-card::after { content: ''; position: absolute; inset: auto -30px -40px auto; width: 120px; height: 120px; border-radius: 50%; border: 18px solid rgba(242, 174, 53, .12); }
.wc-label { font-size: 12px; color: var(--navy-ink); }
.wc-amount { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; color: var(--amber); line-height: 1.1; }
.wc-amount .cur, .big-money .cur { font-size: .55em; vertical-align: .55em; margin-right: 2px; font-weight: 700; }
.wc-amount .dec, .big-money .dec { font-size: .55em; opacity: .75; }
.wc-foot { font-size: 11px; color: var(--navy-ink); }
.nav { display: grid; gap: 2px; }
.nav-group { font-size: 12px; color: var(--navy-ink); opacity: .7; padding: 14px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #D5DEEA; font-weight: 600; font-size: 14px; }
.nav-link .ic { color: var(--navy-ink); }
.nav-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-link.active { background: #fff; color: var(--navy); }
.nav-link.active .ic { color: var(--blue); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: #fff; padding: 6px; border-radius: 10px; }
.me:hover { background: rgba(255, 255, 255, .05); }
.me-text { display: grid; min-width: 0; }
.me-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 12px; color: var(--navy-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--amber); color: var(--navy); display: grid; place-items: center; font-weight: 800; flex: none; }
.avatar.lg { width: 48px; height: 48px; font-size: 20px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; display: grid; place-items: center; color: inherit; flex: none; }
.icon-btn:hover { background: rgba(127, 140, 160, .14); }
.side .icon-btn { color: var(--navy-ink); }
.mode-pill { align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--amber); border: 1px solid rgba(242, 174, 53, .4); border-radius: 999px; padding: 2px 10px; margin-left: 6px; }
.main { min-width: 0; }
.mtop, .tabbar { display: none; }
#view { outline: none; }

/* ---------- page ---------- */
.page { max-width: 1180px; padding: 32px 36px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; max-width: 62ch; }
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); display: grid; gap: 14px; align-content: start; }
.panel.flat { background: transparent; box-shadow: none; padding: 0; }
.panel.flush { padding: 0; overflow: hidden; gap: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-head.pad { padding: 18px 22px 10px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; }
.link { font-weight: 600; font-size: 14px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kpis.four { grid-template-columns: repeat(4, 1fr); }
.kpi { background: var(--surface); border-radius: var(--r-lg); padding: 18px 20px; display: grid; gap: 4px; box-shadow: var(--shadow); color: inherit; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-val { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-link { border: 1.5px dashed transparent; }
.kpi-link .kpi-val { color: var(--blue); }
.kpi-link:hover { border-color: var(--blue); }
.kpi.accent { background: var(--navy); color: #fff; }
.kpi.accent .kpi-label, .kpi.accent .kpi-sub { color: var(--navy-ink); }
.kpi.accent .kpi-val { color: var(--amber); }

/* ---------- chart ---------- */
.chart { margin: 0; }
.chart svg { width: 100%; height: 170px; display: block; }
.chart .bar { fill: var(--blue); }
.chart .bar2 { fill: var(--amber); opacity: .9; }
.chart .bar-empty { fill: var(--line); }
.chart g:hover .bar { fill: var(--blue-ink); }
.chart figcaption { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.legend .lg1 { background: var(--blue); } .legend .lg2 { background: var(--amber); }
.toplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: top; }
.toplist li { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); align-items: center; font-size: 14px; counter-increment: top; }
.toplist li::before { content: counter(top); font-weight: 800; color: var(--muted); font-size: 12px; }
.toplist li:last-child { border-bottom: 0; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.mini-stats a { display: grid; gap: 2px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-2); font-size: 13px; }
.mini-stats strong { font-size: 22px; color: var(--ink); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 650; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: #C5CEDA; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-ghost { color: var(--red); border-color: #F0C7C5; }
.btn.danger-ghost:hover { background: var(--red-tint); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(127, 140, 160, .12); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 50px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-color: var(--muted) var(--muted) var(--muted) transparent; animation: spin .7s linear infinite; }
.btn.primary.is-busy::after, .btn.danger.is-busy::after { border-color: #fff #fff #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-weight: 500; }
.input {
  height: 42px; width: 100%; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); font-size: 15px; font-weight: 500; color: var(--ink);
}
select.input { appearance: auto; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .input { flex: 1; }
.suffix { color: var(--muted); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.form-error { color: var(--red); background: var(--red-tint); padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--blue); }
.check span { display: grid; gap: 2px; }
.warn-text { color: var(--amber-ink); font-weight: 500; display: inline-flex; gap: 4px; align-items: center; }
.warn-text .ic { width: 14px; height: 14px; }
.range { width: 100%; accent-color: var(--blue); }

.search { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); flex: 1; min-width: 220px; max-width: 420px; color: var(--muted); }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.search input { border: 0; outline: none; background: none; flex: 1; height: 100%; font-size: 15px; color: var(--ink); min-width: 0; }
.search.big { height: 54px; max-width: 560px; border-radius: 14px; font-size: 16px; }
.search.big .ic { width: 22px; height: 22px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: #E1E7EE; border-radius: 11px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 650; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg.sm button { padding: 4px 10px; font-size: 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 15px; font-weight: 650; font-size: 13.5px; white-space: nowrap; color: var(--ink-2); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- badges & tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-ready { background: var(--amber-tint); color: var(--amber-ink); }
.b-delivered, .b-active { background: var(--green-tint); color: var(--green); }
.b-refunding, .b-pending, .b-partial_refund { background: var(--violet-tint); color: var(--violet); }
.b-refunded, .b-cancelled, .b-ended { background: #EEF1F5; color: var(--muted); }
.b-failed { background: var(--red-tint); color: var(--red); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--blue-tint); color: var(--blue-ink); }
.tag.outline { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.tag.amber { background: var(--amber-tint); color: var(--amber-ink); }
.tag.green { background: var(--green-tint); color: var(--green); }

/* ---------- flags ---------- */
.flag { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); flex: none; box-shadow: inset 0 0 0 1px rgba(18, 35, 61, .08); }
.flag img { width: 100%; height: 100%; object-fit: cover; }
.flag-lg { width: 52px; height: 52px; }
.flag-region { background: var(--blue-tint); color: var(--blue); }
.flag-text { font-weight: 800; font-size: 12px; color: var(--ink-2); background: var(--line-2); }
.flag-lg.flag-text { font-size: 16px; }
.flag-lg .ic { width: 26px; height: 26px; }

/* ---------- store ---------- */
.store-bar { display: grid; gap: 14px; }
.dest-group { display: grid; gap: 12px; }
.group-title { font-size: 14px; color: var(--ink-2); display: flex; gap: 8px; align-items: baseline; }
.group-title span { color: var(--muted); font-weight: 600; font-size: 12px; }
.dest-group + .dest-group { margin-top: 14px; }
.dest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.dest {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid transparent; box-shadow: var(--shadow); min-height: 64px;
}
.dest:hover { border-color: var(--blue); }
.dest-text { display: grid; flex: 1; min-width: 0; }
.dest-text strong { font-size: 15px; }
.dest-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dest-go { color: var(--muted); width: 18px; height: 18px; }
.empty-line { color: var(--muted); padding: 24px 0; }

.sub-title { font-size: 13px; color: var(--muted); font-weight: 700; }
.plans { display: grid; gap: 8px; }
.plan {
  display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer; background: var(--surface); position: relative;
}
.plan:hover { border-color: #B9C5D6; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan:has(input:checked) { border-color: var(--blue); background: #F7F9FF; box-shadow: 0 0 0 3px var(--blue-tint); }
.plan:has(input:focus-visible) { outline: 2.5px solid var(--blue); outline-offset: 2px; }
.plan-data { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.plan-data small { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.plan-days { display: grid; gap: 3px; font-weight: 650; font-size: 14px; }
.plan-days small { color: var(--muted); font-weight: 500; font-size: 12px; }
.plan-price { text-align: right; font-weight: 800; font-size: 17px; display: grid; }
.plan-price small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.plans.compact .plan { grid-template-columns: 76px 1fr auto; padding: 10px 14px; }
.plans.compact .plan-data { font-size: 20px; }
.checkout { display: grid; gap: 14px; padding-top: 6px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); height: 42px; width: max-content; background: var(--surface); }
.stepper button { width: 42px; height: 100%; border: 0; background: none; display: grid; place-items: center; color: var(--ink-2); }
.stepper button:hover { background: var(--surface-2); }
.stepper output { min-width: 40px; text-align: center; font-weight: 800; font-size: 16px; color: var(--ink); }
.notes { border-top: 1px solid var(--line-2); padding-top: 12px; font-size: 13.5px; color: var(--ink-2); }
.notes summary { cursor: pointer; font-weight: 650; color: var(--ink); }
.notes p { margin-top: 8px; }

/* ---------- eSIM boarding pass ---------- */
.pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.pass {
  --notch: 11px;
  display: grid; grid-template-columns: 1fr 104px; color: inherit; min-height: 132px; position: relative;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow);
  -webkit-mask: radial-gradient(circle var(--notch) at calc(100% - 104px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at calc(100% - 104px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at calc(100% - 104px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at calc(100% - 104px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  transition: transform .15s ease;
}
.pass:hover { transform: translateY(-2px); }
.pass-main { padding: 16px 18px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.pass-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pass-head .flag { width: 28px; height: 28px; }
.pass-head .flag .ic { width: 16px; height: 16px; }
.pass-dest { font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-plan { font-size: 24px; font-weight: 800; letter-spacing: -0.04em; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pass-plan span { font-size: 13.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.pass-plan .tag { font-size: 11px; height: 20px; color: var(--green); background: var(--green-tint); }
.pass-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.iccid b { color: var(--ink); font-weight: 600; }
.who { color: var(--ink-2); font-weight: 600; background: var(--surface-2); padding: 1px 8px; border-radius: 6px; }
.pass-stub {
  border-left: 2px dashed var(--line); margin: 14px 0; padding: 0 12px; display: grid; place-items: center; align-content: center; gap: 2px; text-align: center;
}
.stub-val { font-weight: 800; font-size: 14px; }
.stub-sub { font-size: 11.5px; color: var(--muted); }
.stub-ready { width: 44px; height: 44px; border-radius: 12px; background: var(--amber); color: var(--navy); font-weight: 800; display: grid; place-items: center; font-size: 13px; letter-spacing: .02em; }
.st-ready .pass-main { background: linear-gradient(90deg, var(--amber) 0 4px, transparent 4px); }
.st-refunded, .st-cancelled, .st-ended { opacity: .62; }
.ring { display: block; }
.ring-bg { fill: none; stroke: var(--line-2); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--blue); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.pass.skeleton, .skeleton-hero { background: linear-gradient(90deg, #E6EBF1, #F2F5F8, #E6EBF1); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton-hero { height: 180px; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- eSIM detail ---------- */
.install { display: grid; grid-template-columns: 210px 1fr; gap: 20px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); align-items: start; }
.qr-box { background: #fff; border-radius: var(--r-md); padding: 8px; box-shadow: var(--shadow); }
.qr-box svg { width: 100%; display: block; }
.locked-art { aspect-ratio: 1; border-radius: var(--r-md); border: 2px dashed #C9D2DE; display: grid; place-items: center; color: #B4C0CF; background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(18, 35, 61, .025) 10px 20px); }
.locked-art .ic { width: 64px; height: 64px; stroke-width: 1.2; }
.install-info { display: grid; gap: 10px; min-width: 0; align-content: start; }
.copy-row { display: grid; gap: 2px; }
.copy { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; text-align: left; max-width: 100%; font-size: 13px; }
.copy span { overflow-wrap: anywhere; }
.copy .ic { width: 15px; height: 15px; color: var(--muted); }
.copy:hover { border-color: var(--blue); }
.howto { font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-md); padding: 12px 16px; }
.howto summary { cursor: pointer; font-weight: 650; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.howto p { margin-top: 8px; }
.usage { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.usage > div { display: grid; flex: 1; }
.usage strong { font-size: 18px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.grid { padding: 4px 0; }
.sblock { display: grid; gap: 10px; padding: 18px 0 4px; border-top: 1px solid var(--line-2); }
.block-head { display: flex; justify-content: space-between; align-items: center; }
.mini-title { font-size: 13px; color: var(--muted); margin-top: 8px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; }
.history li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.history li > span:first-child { display: grid; }
.history .amt { font-weight: 700; }
.esim-detail { gap: 16px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-row], .table tbody tr[data-id] { cursor: pointer; }
.table tbody tr:hover { background: #FAFBFD; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lt { font-weight: 650; font-size: 13px; }
.lt-deposit, .lt-refund, .lt-reversal { color: var(--green); }
.lt-purchase, .lt-topup, .lt-withdraw { color: var(--ink-2); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 12px 16px; font-size: 13px; color: var(--muted); }
.pager span { margin-right: 8px; }

/* ---------- wallet ---------- */
.balance-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 26px 28px; }
.balance-hero .muted { color: var(--navy-ink); }
.big-money { font-size: 52px; font-weight: 800; letter-spacing: -0.05em; color: var(--amber); line-height: 1.05; margin-top: 4px; }
.big-money .ccy { font-size: 14px; letter-spacing: 0; color: var(--navy-ink); margin-left: 10px; font-weight: 700; }
.big-money.sm { font-size: 32px; }
.balance-hero.compact { padding: 18px 20px; }
.balance-hero .btn.ghost { color: #fff; background: rgba(255, 255, 255, .1); }
.balance-hero .btn.ghost:hover { background: rgba(255, 255, 255, .18); }

/* ---------- drawer & modal ---------- */
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(12, 22, 38, .42); opacity: 0; transition: opacity .2s; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(540px, 100%); background: var(--surface);
  display: flex; flex-direction: column; transform: translateX(24px); opacity: 0; transition: transform .22s ease, opacity .22s ease; outline: none;
  box-shadow: -20px 0 60px -30px rgba(12, 22, 38, .5);
}
.drawer.wide { width: min(680px, 100%); }
.drawer-wrap.open .drawer-scrim { opacity: 1; }
.drawer-wrap.open .drawer { transform: none; opacity: 1; }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.drawer-head > div { flex: 1; min-width: 0; }
.drawer-head h2 { font-size: 20px; font-weight: 800; }
.drawer-head p { margin-top: 3px; }
.drawer-body { padding: 20px 22px 28px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.foot-sum { display: grid; }
.foot-total { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.modal-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(12, 22, 38, .5); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--r-lg); padding: 24px; width: min(440px, 100%); display: grid; gap: 14px; box-shadow: var(--shadow-lift); }
.modal h2 { font-size: 19px; }
.modal p { color: var(--ink-2); font-size: 14.5px; }
.modal p:empty { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

#toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); background: var(--navy); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lift); animation: toastIn .2s ease; }
.toast .ic { color: #6EE7B0; }
.toast-err { background: #5C1714; }
.toast-err .ic { color: #FFB4AE; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.notice { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); font-size: 14px; font-weight: 600; }
.notice.warn { background: var(--amber-tint); color: var(--amber-ink); }

/* ---------- empty ---------- */
.empty { display: grid; justify-items: center; gap: 14px; padding: 48px 20px; text-align: center; color: var(--ink-2); }
.empty p { max-width: 42ch; }
.empty-art svg { width: 140px; }
.ea1 { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.ea2 { stroke: var(--line); stroke-width: 2; }
.ea3 { fill: var(--line); } .ea4 { fill: var(--line-2); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--navy); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 56px; gap: 48px; }
.login-art::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 22px 22px; }
.pass-stack { position: relative; height: 380px; max-width: 460px; }
.mini-pass {
  position: absolute; width: 360px; height: 120px; border-radius: 18px; background: #fff; display: grid; grid-template-columns: 1fr 96px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
  -webkit-mask: radial-gradient(circle 11px at calc(100% - 96px) 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 11px at calc(100% - 96px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 11px at calc(100% - 96px) 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 11px at calc(100% - 96px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  animation: passIn .7s cubic-bezier(.2, .8, .2, 1) both;
}
.mp-0 { top: 0; left: 0; transform: rotate(-4deg); animation-delay: .05s; }
.mp-1 { top: 128px; left: 70px; transform: rotate(3deg); animation-delay: .18s; }
.mp-2 { top: 256px; left: 20px; transform: rotate(-1.5deg); animation-delay: .31s; }
@keyframes passIn { from { opacity: 0; translate: 0 30px; } }
.mp-main { padding: 18px 22px; display: grid; align-content: center; gap: 2px; }
.mp-main small { color: var(--muted); font-size: 12px; font-weight: 700; }
.mp-main strong { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.mp-main span { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.mp-stub { border-left: 2px dashed var(--line); margin: 16px 0; display: grid; place-items: center; color: var(--blue); }
.mp-1 .mp-stub { color: var(--amber); }
.mp-stub .ic { width: 30px; height: 30px; }
.login-quote { position: relative; color: #fff; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; max-width: 16ch; }
.login-form-wrap { display: flex; flex-direction: column; padding: 32px 48px; background: var(--surface); }
.login-top { display: flex; justify-content: space-between; align-items: center; }
.login-top .brand { padding: 0; }
.login-form { margin: auto 0; display: grid; gap: 16px; max-width: 400px; width: 100%; align-self: center; }
.login-form h1 { font-size: 30px; }
.login-form .muted { margin-top: -6px; margin-bottom: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis.four { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .side { display: none; }
  .mtop { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
  .mtop .brand { font-size: 17px; padding: 0; }
  .mtop .logo { width: 26px; height: 26px; }
  .mwallet { color: var(--amber); font-weight: 800; font-size: 18px; letter-spacing: -0.03em; background: var(--navy-2); padding: 4px 12px; border-radius: 999px; }
  .mwallet .cur, .mwallet .dec { font-size: .7em; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 650; color: var(--muted); padding: 4px 0; border-radius: 10px; }
  .tabbar a.active { color: var(--blue); }
  .tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .page { padding: 20px 16px 40px; gap: 18px; }
  h1 { font-size: 24px; }
  .page-head .btn.primary { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { padding: 14px 16px; }
  .kpi-val { font-size: 24px; }
  .pass-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .drawer, .drawer.wide { width: 100%; top: 6vh; border-radius: 18px 18px 0 0; transform: translateY(30px); }
  .install { grid-template-columns: 1fr; justify-items: center; }
  .install .qr-box, .install .locked-art { width: min(240px, 70vw); }
  .install-info { width: 100%; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-form-wrap { padding: 24px 20px; min-height: 100vh; }
  .balance-hero { padding: 20px; }
  .big-money { font-size: 40px; }
  .history li { grid-template-columns: 1fr auto; }
  .table th, .table td { padding: 10px 12px; }
}
@media (max-width: 420px) {
  .plan { grid-template-columns: 70px 1fr auto; gap: 10px; padding: 12px; }
  .plan-data { font-size: 21px; }
  .drawer-foot { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
