/* PrintBridge account portal + admin — shared design tokens and base components.
   Same arcade look as printbridge-site (sky canvas, signal-orange accent, Jersey 10 titles).
   Light only. */
/* Arcade look (same as printbridge-site): pale "cloud paper" sky, white cards, one loud
   accent (signal orange), pixel display type for page titles and big numbers. Light only. */
:root {
  --bg: #e3f1fe;          /* sky canvas */
  --bg-alt: #ffffff;
  --card: #ffffff;
  --text: #232629;        /* graphite ink */
  --muted: #5c6066;       /* slate pencil */
  --line: #e4edf6;
  --accent: #ff5e24;      /* signal orange */
  --accent-hover: #e84d14;
  --accent-soft: #e3f1fe;
  --on-accent: #ffffff;
  --warn: #9a5800;
  --warn-soft: #fdf1dc;
  --danger: #c0281b;
  --danger-soft: #fde8e6;
  --info: #2b5fb4;
  --info-soft: #e5eefb;
  --series-2: #989ea4;
  --shadow: rgba(15, 34, 52, 0.01) 0 27px 11px 0, rgba(15, 34, 52, 0.02) 0 15px 9px 0,
            rgba(15, 34, 52, 0.04) 0 7px 7px 0, rgba(15, 34, 52, 0.04) 0 2px 4px 0;
  --shadow-lift: rgba(0, 0, 0, 0.01) 0 49px 30px 0, rgba(0, 0, 0, 0.03) 0 22px 22px 0, rgba(0, 0, 0, 0.03) 0 5px 12px 0;
  --ring: rgba(255, 94, 36, 0.17) 0 0.5px 0.5px 0.5px inset, rgba(153, 37, 18, 0.2) 0 -1px 0.5px 0 inset, #ff5e24 0 0 0 1px;
  --radius: 12px;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --font-pixel: "Jersey 10", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-cjk-heavy: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: 1.55rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.strong { color: var(--text); font-weight: 650; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Mock-mode bar (only rendered by shared/mock.js when ?mock=1) */
.mock-bar { background: var(--info-soft); color: var(--info); font-size: .82rem; padding: 6px 16px; display: flex; gap: 8px 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mock-bar b { font-weight: 650; }
.mock-bar select { min-height: 30px; padding: 2px 8px; width: auto; max-width: 100%; font-size: .82rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 9px;
  font: inherit; font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1.5px solid transparent; background: none; color: var(--text); transition: background .15s, border-color .15s, color .15s; }
.btn:disabled, .btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line); background: var(--card); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { border-color: var(--line); background: var(--card); color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn-solid-danger { background: var(--danger); color: #fff; }
.btn-small { min-height: 32px; padding: 0 11px; font-size: .84rem; border-radius: 8px; }
.btn-link { padding: 0; min-height: 0; border: 0; color: var(--accent); font-weight: 600; background: none; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--text); }
.icon-btn svg, .nav-item svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.kv { display: grid; grid-template-columns: minmax(96px, auto) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--accent-soft); color: var(--accent); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }
.badge.plain::before { display: none; }

/* Notices */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--text); }
.notice.warn { background: var(--warn-soft); }
.notice.danger { background: var(--danger-soft); }
.notice.info { background: var(--info-soft); }
.notice .row { margin-top: 10px; }
.notice > div { min-width: 0; }
.form-error { color: var(--danger); font-size: .88rem; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Forms */
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 600; font-size: .88rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg-alt); border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 12px; min-height: 40px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }

/* Segmented control */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; max-width: 100%; }
.seg button { font: inherit; font-size: .85rem; font-weight: 600; border: 0; background: none; color: var(--muted); padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }

/* App shell: sidebar on desktop, top tabs on mobile */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
@media (min-width: 900px) { .shell { grid-template-columns: 236px minmax(0, 1fr); } }
.side { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 12px 16px; position: sticky; top: 0; z-index: 5; min-width: 0; }
@media (min-width: 900px) { .side { border-bottom: 0; border-right: 1px solid var(--line); padding: 20px 14px; height: 100vh; overflow-y: auto; } }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; min-width: 0; }
.brand .logo { width: 32px; height: 32px; flex: none; }
.brand .logo svg { display: block; width: 100%; height: 100%; }
.brand small { font-weight: 500; color: var(--muted); }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nav { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
.nav::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .nav { flex-direction: column; margin: 24px 0 0; padding: 0; overflow: visible; } }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.nav-item:hover { color: var(--text); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.nav-item[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav-item .count { margin-left: auto; font-size: .75rem; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 0 7px; }
.side-foot { display: none; }
@media (min-width: 900px) { .side-foot { display: block; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .85rem; } }
.main { padding: 20px 16px 48px; min-width: 0; }
@media (min-width: 720px) { .main { padding: 28px 32px 64px; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head > div { min-width: 0; }
.page-head p { margin-top: 4px; }
.content { max-width: 1080px; min-width: 0; margin-inline: auto; }

/* Centered single-card screens (sign-in, loading) */
.center-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.center-card { width: min(440px, 100%); }
.center-card .brand { justify-content: center; margin-bottom: 22px; }
.center-card .card { padding: 28px; }
.center-card h1 { font-size: 1.35rem; margin-bottom: 6px; }
.loading { color: var(--muted); padding: 32px 0; text-align: center; }

/* Drawer + modal + toast */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--bg); z-index: 41; overflow-y: auto; box-shadow: var(--shadow); border-left: 1px solid var(--line); }
.drawer-head { position: sticky; top: 0; background: var(--bg); padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; z-index: 1; }
.drawer-head > div { min-width: 0; }
.drawer-body { padding: 20px; display: grid; gap: 16px; }
.modal { position: fixed; z-index: 51; left: 50%; top: 50%; translate: -50% -50%; width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.modal.wide { width: min(720px, calc(100vw - 32px)); }
.modal h2 { margin-bottom: 8px; overflow-wrap: anywhere; }
.modal .modal-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 18px; }
.modal-scrim { z-index: 50; }
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; z-index: 60; max-width: calc(100vw - 32px); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.toast.error { background: var(--danger); color: #fff; }

/* Key display */
.key { font-family: var(--mono); font-size: 1rem; font-weight: 600; letter-spacing: .05em; padding: 8px 12px; border-radius: 9px; background: var(--bg); border: 1px dashed var(--line); display: inline-block; overflow-wrap: anywhere; max-width: 100%; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding: 8px 0; position: relative; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.timeline li.warn::before { background: var(--warn); }
.timeline li.danger::before { background: var(--danger); }
.timeline li.muted::before { background: var(--series-2); }

pre.json { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: .8rem/1.5 var(--mono); overflow: auto; margin: 0; max-height: 60vh; white-space: pre; }

@media (max-width: 520px) {
  h1 { font-size: 1.3rem; }
  .card { padding: 16px; }
  .center-card .card { padding: 22px 18px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
}

/* ---------- Arcade theme ---------- */
body { font-family: var(--font); }
h1 { font: 400 44px/0.92 var(--font-pixel); letter-spacing: -0.025em; }
.center-card h1 { font-size: 40px; margin-bottom: 10px; }
:lang(zh-CN) h1, :lang(zh) h1 { font: 800 1.6rem/1.25 var(--font-cjk-heavy); letter-spacing: -0.01em; }
.modal h2, .drawer-head h2 { font: 400 30px/1 var(--font-pixel); letter-spacing: -0.02em; }
:lang(zh-CN) .modal h2, :lang(zh-CN) .drawer-head h2 { font: 800 1.15rem/1.3 var(--font-cjk-heavy); }

.btn { border-radius: 6px; font-weight: 600; border-width: 1px; }
.btn-small { border-radius: 6px; }
.btn-primary { box-shadow: var(--ring); }
.btn-ghost, .btn-danger { border-color: #d6e6f6; }
.icon-btn { border-radius: 6px; border-color: #d6e6f6; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
input, select, textarea { border-radius: 6px; border: 1px solid #d6e6f6; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 94, 36, 0.15); }

.card { border-color: transparent; box-shadow: var(--shadow); }
.key { background: var(--bg); border: 1.5px dashed var(--accent); border-radius: 6px; }
.badge { border-radius: 6px; }
.badge::before { border-radius: 0; }
.notice { border-radius: 12px; }
.seg { background: var(--bg); border-color: transparent; border-radius: 8px; }
.seg button { border-radius: 6px; }
.seg button[aria-pressed="true"] { color: var(--accent); box-shadow: var(--ring); }

.side { background: rgba(255, 255, 255, 0.9); }
@media (min-width: 900px) { .side { border-right: 0; box-shadow: var(--shadow); } }
.brand { font-weight: 800; letter-spacing: -0.02em; }
.nav-item { border-radius: 6px; }
.nav-item:hover { color: var(--accent); background: transparent; }
.nav-item[aria-current="page"] { color: var(--accent); background: var(--bg); box-shadow: inset 0 0 0 1px rgba(255, 94, 36, 0.35); }
.timeline li::before { border-radius: 0; }
.toast { border-radius: 6px; }
.modal { border: 0; box-shadow: var(--shadow-lift), 0 0 0 1px var(--line); }
.drawer { background: var(--bg); }
.drawer-head { background: rgba(227, 241, 254, 0.92); backdrop-filter: blur(10px); }
/* "Active / OK" states read as healthy green, not as the orange call-to-action colour */
.badge { background: #e3f5ea; color: #1f7a45; }
.notice { background: var(--bg); }
