/* ─────────────────────────────────────────────
   二狗制图 · Mobile-First Design System
   Palette: Warm Paper + Terracotta + Deep Ink
   ───────────────────────────────────────────── */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden 属性必须永远生效:#authSection 等设了 display:flex 会盖过 UA 的 [hidden]{display:none},
   导致登录成功后表单仍不消失(看起来像"点登录没反应")。这条全局兜底强制隐藏。 */
[hidden] { display: none !important; }

/* ── Design tokens ── */
:root {
  --ink:        #1A120B;
  --ink-mid:    #4A3728;
  --ink-soft:   #7A6455;
  --ink-faint:  #B8A898;
  --paper:      #FAF6F0;
  --paper-warm: #F3EDE3;
  --paper-deep: #EAE0D2;
  --accent:     #D4622A;
  --accent-h:   #C0501E;
  --accent-bg:  #FCF0EA;
  --accent-bg2: #F9E4D8;
  --green:      #2E7D52;
  --green-bg:   #E6F4ED;
  --red:        #C0392B;
  --red-bg:     #FDF0EE;
  --white:      #FFFFFF;
  --shadow-sm:  0 1px 4px rgba(26,18,11,0.06), 0 2px 8px rgba(26,18,11,0.04);
  --shadow-md:  0 4px 16px rgba(26,18,11,0.09), 0 1px 4px rgba(26,18,11,0.05);
  --shadow-lg:  0 8px 32px rgba(26,18,11,0.12), 0 2px 8px rgba(26,18,11,0.06);
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  22px;
  --radius-xl:  28px;
  --font:       -apple-system, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

/* ── Base ── */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Subtle warm grain texture via CSS */
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(212,98,42,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(212,98,42,0.04) 0%, transparent 60%);
}

/* ── Page-load reveal ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.13s; }
.reveal-3 { animation-delay: 0.21s; }
.reveal-4 { animation-delay: 0.29s; }
.reveal-5 { animation-delay: 0.37s; }

/* ── Layout ── */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ────────────────────────
   TOAST
   ──────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,18,11,0.55);
  backdrop-filter: blur(4px);
  z-index: 1000; display: flex;
  align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px 24px 28px;
  width: 100%; max-width: 320px;
  text-align: center; position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* 宽弹框(订阅套餐+流量包),内容较多时可滚动 */
.modal-box-wide { max-width: 380px; text-align: left; max-height: 86vh; overflow-y: auto; }
.modal-sub-title { font-size: 14px; font-weight: 700; color: var(--ink-mid); margin: 18px 0 10px; }
.modal-box-wide .modal-title { text-align: center; }
.modal-box-wide .sub-status { justify-content: center; }
/* 顶栏右侧按钮组 */
.top-actions { display: flex; gap: 8px; align-items: center; }
.modal-box h3 {
  font-size: 18px; font-weight: 800;
  color: var(--ink); margin-bottom: 6px;
}
.modal-box p {
  font-size: 13px; color: var(--ink-soft);
  margin-bottom: 16px; line-height: 1.5;
}
.modal-title {
  font-size: 18px; font-weight: 800;
  color: var(--ink); margin-bottom: 16px;
}
.qr-img {
  width: 196px; height: 196px;
  border-radius: var(--radius-sm);
  border: 3px solid var(--paper-deep);
  display: block; margin: 0 auto;
}
.qr-amount {
  font-size: 14px; font-weight: 700;
  color: var(--accent); margin: 12px 0 18px;
}
.qr-hint {
  font-size: 12px; line-height: 1.5;
  color: var(--ink-soft); background: var(--paper-warm);
  border-radius: var(--radius-sm); padding: 8px 12px;
  margin: 12px auto 0; max-width: 260px; text-align: center;
}
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.modal-close {
  position: absolute; top: 14px; right: 16px;
  background: var(--paper-warm); border: none;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 14px; color: var(--ink-soft);
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--paper-deep); color: var(--ink); }

#toast {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 9999; min-width: 200px; max-width: 88vw;
  padding: 11px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  text-align: center; pointer-events: none;
  opacity: 0; transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: var(--shadow-lg);
  letter-spacing: 0.01em;
}
#toast.show {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
#toast.ok  { background: var(--green); color: #fff; }
#toast.err { background: var(--red);   color: #fff; }
#toast.info { background: var(--ink);  color: #fff; }

/* ────────────────────────
   BRAND / AUTH SECTION
   ──────────────────────── */
#authSection {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 40px 0 32px;
}

.brand {
  text-align: center;
  padding: 0 0 28px;
}

/* Shiba mascot accent — CSS-only paw print motif */
.brand-mascot {
  font-size: 44px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 8px rgba(212,98,42,0.25));
  animation: bouncePaw 2.4s ease-in-out infinite;
}
@keyframes bouncePaw {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%       { transform: translateY(-5px) rotate(4deg); }
}

.brand-name {
  font-size: 34px; font-weight: 900;
  color: var(--ink); letter-spacing: -1px;
  line-height: 1;
  /* Accent underline via gradient */
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 14px; font-weight: 500;
  color: var(--ink-soft); margin-top: 8px;
  letter-spacing: 0.02em;
}

/* ────────────────────────
   CARD BASE
   ──────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(26,18,11,0.05);
}

.section-card { margin-bottom: 14px; }

.section-title {
  font-size: 16px; font-weight: 800;
  color: var(--ink); margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--paper-deep);
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block; width: 4px; height: 16px;
  background: var(--accent); border-radius: 2px;
}

.section-hint {
  font-size: 13px; color: var(--ink-soft);
  margin-bottom: 14px; line-height: 1.5;
}

/* ────────────────────────
   TOP BAR (logged-in header)
   ──────────────────────── */
.top-bar {
  display: flex; align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin: 16px 0 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(26,18,11,0.05);
}
.user-info {
  display: flex; flex-direction: column; gap: 2px;
}
.user-info span:first-child {
  font-size: 14px; font-weight: 700; color: var(--ink);
}
.credits-badge {
  font-size: 12px; font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  display: inline-flex; align-items: center;
  gap: 3px; padding: 3px 8px;
  border-radius: 20px;
  width: fit-content;
}

/* ────────────────────────
   INPUTS
   ──────────────────────── */
input[type="text"],
input[type="tel"] {
  width: 100%; padding: 14px 16px;
  margin-bottom: 12px;
  border: 1.5px solid var(--paper-deep);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 15px; color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
}
input:focus {
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(212,98,42,0.10);
}
input::placeholder { color: var(--ink-faint); }

.input-row {
  display: flex; gap: 8px;
  align-items: flex-start; margin-bottom: 12px;
}
.input-row input { flex: 1; margin-bottom: 0; }
.send-btn {
  flex-shrink: 0; white-space: nowrap;
  padding: 14px 14px; font-size: 13px;
  min-width: 88px;
}

/* ────────────────────────
   BUTTONS
   ──────────────────────── */
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost,
.btn-ghost-sm,
.btn-danger {
  border: none; cursor: pointer;
  font-family: var(--font);
  font-size: 15px; font-weight: 700;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  line-height: 1;
  transition: opacity 0.15s, transform 0.12s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(212,98,42,0.30);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-h);
  box-shadow: 0 4px 16px rgba(212,98,42,0.38);
}

.btn-secondary {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1.5px solid var(--accent-bg2);
}

.btn-outline {
  background: var(--white);
  color: var(--accent);
  border: 1.5px solid var(--paper-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--paper-deep);
}

.btn-ghost-sm {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--paper-deep);
  padding: 9px 14px;
  font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm);
  min-height: 38px;
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1.5px solid rgba(192,57,43,0.18);
}

button:hover:not(:disabled) { opacity: 0.88; }
button:active:not(:disabled) { transform: scale(0.96); }
button:disabled { opacity: 0.40; cursor: default; transform: none; }

.full-width { width: 100%; }

.btn-row {
  display: flex; gap: 10px; margin-top: 8px;
}
.btn-row .btn-primary { flex: 1; }
.btn-row .btn-secondary { flex: 1; }

/* ────────────────────────
   AUTH ACTIONS (login / register toggle)
   ──────────────────────── */
.auth-actions {
  display: flex; flex-direction: column;
  align-items: stretch; gap: 6px; margin-top: 10px;
}
.auth-big { order: 0; }
/* 小按钮:右下角、文字链接样式,不抢焦点 */
.auth-small {
  order: 1; align-self: flex-end;
  background: transparent; border: none;
  color: var(--ink-soft); font-family: var(--font);
  font-size: 13px; font-weight: 600;
  padding: 6px 4px; min-height: auto; line-height: 1;
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
.auth-small:hover { color: var(--accent); opacity: 1; }
.auth-small:active { transform: none; }

/* 切到注册模式时按钮的高亮脉冲 */
.highlight-btn { animation: pulse-ring 0.9s ease-in-out 1; }

/* ── Agreement / consent ── */
.agree-row {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 4px 2px 4px; padding: 4px 2px;
  font-size: 12.5px; color: var(--ink-soft);
  line-height: 1.5; cursor: pointer; border-radius: var(--radius-sm);
}
.agree-row input[type="checkbox"] {
  width: 16px; height: 16px; margin: 2px 0 0;
  flex-shrink: 0; accent-color: var(--accent); cursor: pointer;
}
.agree-row a { color: var(--accent); font-weight: 600; text-decoration: none; }
.agree-row a:hover { text-decoration: underline; }
.agree-row.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ────────────────────────
   PLAN / PACK CARDS
   ──────────────────────── */
.plan-grid {
  display: flex; flex-direction: column; gap: 10px;
}

.plan-card {
  border: 2px solid var(--paper-deep);
  border-radius: var(--radius-md);
  padding: 16px 18px; cursor: pointer;
  display: flex; justify-content: space-between;
  align-items: center;
  background: var(--white);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.plan-card:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 2px 12px rgba(212,98,42,0.12);
}
.plan-card:active { transform: scale(0.98); }
.plan-card.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.plan-label {
  font-weight: 700; font-size: 15px;
  color: var(--ink);
}
.plan-meta {
  font-size: 12px; color: var(--ink-soft);
  margin-top: 3px; font-weight: 500;
}
.plan-price {
  font-size: 22px; font-weight: 900;
  color: var(--accent); letter-spacing: -0.5px;
}
.plan-price span { font-size: 13px; font-weight: 500; }

/* ────────────────────────
   REPLICA CARD
   ──────────────────────── */
.replica-info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.replica-info-grid .label {
  color: var(--ink-soft); font-weight: 500;
}
.replica-info-grid .value {
  color: var(--ink); font-weight: 700;
}

.replica-actions {
  display: flex; gap: 8px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.replica-actions button { flex: 1; min-width: 72px; }

.status-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.03em;
}
.status-provisioned { background: var(--green-bg); color: var(--green); }
.status-running     { background: var(--green-bg); color: var(--green); }
.status-stopped     { background: var(--paper-deep); color: var(--ink-soft); }
.status-deleting    { background: var(--red-bg); color: var(--red); }

/* ────────────────────────
   CREDITS SECTION
   ──────────────────────── */
.credits-summary {
  display: flex; align-items: baseline;
  gap: 8px; margin-bottom: 18px;
}
.credits-big {
  font-size: 48px; font-weight: 900;
  color: var(--accent); letter-spacing: -2px;
  line-height: 1;
}
.credits-label {
  font-size: 15px; color: var(--ink-soft);
  font-weight: 600;
}

.sub-status {
  font-size: 13px; color: var(--ink-soft);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}
.sub-status .active {
  color: var(--green); font-weight: 700;
  background: var(--green-bg);
  padding: 2px 8px; border-radius: 20px;
}
.sub-status .inactive {
  color: var(--ink-faint);
  background: var(--paper-warm);
  padding: 2px 8px; border-radius: 20px;
}

/* ────────────────────────
   TRANSACTION LIST
   ──────────────────────── */
.tx-list { font-size: 13px; }
.tx-item {
  display: flex; justify-content: space-between;
  align-items: center; padding: 11px 0;
  border-bottom: 1px solid var(--paper-deep);
}
.tx-item:last-child { border-bottom: none; }
.tx-amount-pos { color: var(--green); font-weight: 700; }
.tx-amount-neg { color: var(--red); font-weight: 700; }
.tx-type { color: var(--ink-mid); font-weight: 500; }
.tx-date { color: var(--ink-faint); font-size: 12px; }

/* ────────────────────────
   HIGHLIGHT PULSE
   ──────────────────────── */
.highlight-section {
  animation: pulse-ring 0.9s ease-in-out 2;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(212,98,42,0.45); }
  50%  { box-shadow: 0 0 0 10px rgba(212,98,42,0.08); }
  100% { box-shadow: 0 0 0 0 rgba(212,98,42,0); }
}

/* ────────────────────────
   LEGAL DOC PAGES (agreement / privacy)
   ──────────────────────── */
.doc {
  max-width: 720px; margin: 0 auto; padding: 28px 18px 60px;
}
.doc-back {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  text-decoration: none; margin-bottom: 18px;
}
.doc-back:hover { color: var(--accent); }
.doc h1 {
  font-size: 24px; font-weight: 900; color: var(--ink);
  letter-spacing: -0.5px; margin-bottom: 6px;
}
.doc .doc-updated { font-size: 12px; color: var(--ink-faint); margin-bottom: 22px; }
.doc h2 {
  font-size: 16px; font-weight: 800; color: var(--ink);
  margin: 26px 0 10px; padding-left: 10px;
  border-left: 3px solid var(--accent);
}
.doc p, .doc li {
  font-size: 14px; color: var(--ink-mid); line-height: 1.75;
}
.doc p { margin-bottom: 10px; }
.doc ul { margin: 0 0 10px; padding-left: 22px; }
.doc li { margin-bottom: 5px; }
.doc .doc-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 24px 22px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(26,18,11,0.05);
}

/* ────────────────────────
   ADMIN PANEL
   ──────────────────────── */
.admin-wrap { max-width: 920px; margin: 0 auto; padding: 0 16px 60px; }
.admin-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0 10px; gap: 12px; flex-wrap: wrap;
}
.admin-title { font-size: 22px; font-weight: 900; color: var(--ink); letter-spacing: -0.5px; }
.admin-title .tag {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--accent-bg); padding: 2px 8px; border-radius: 20px;
  margin-left: 8px; vertical-align: middle;
}
.admin-subtitle { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.admin-tabs {
  display: flex; gap: 8px; margin: 4px 0 16px;
  padding: 5px; background: var(--paper-warm);
  border-radius: var(--radius-md);
  border: 1px solid var(--paper-deep);
  width: fit-content; max-width: 100%;
}
.admin-tab {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 700;
  color: var(--ink-soft); padding: 9px 18px;
  border-radius: 12px; display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.active {
  background: var(--white); color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.tab-online-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  color: var(--green); background: var(--green-bg);
  padding: 2px 9px; border-radius: 999px;
}
.tab-online-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); display: inline-block;
}
.visit-live-bar {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--green);
  background: var(--green-bg); border: 1px solid rgba(46,125,82,0.18);
  padding: 8px 14px; border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.visit-live-bar .live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); display: inline-block;
  box-shadow: 0 0 0 3px rgba(46,125,82,0.18);
}
.visit-updated-at { margin-left: auto; color: var(--ink-soft); font-weight: 500; }
.stat-card-live {
  border: 1.5px solid rgba(46,125,82,0.22);
  background: linear-gradient(180deg, #FFFFFF 0%, #F5FBF7 100%);
}
.stat-card-live .stat-num { color: var(--green); }
.stat-sub {
  font-size: 11px; color: var(--ink-soft); margin-top: 6px;
  padding-top: 6px; border-top: 1px dashed var(--paper-deep);
  display: flex; justify-content: space-between; gap: 6px;
}
.stat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--white); border-radius: var(--radius-md);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(26,18,11,0.05);
}
.stat-num { font-size: 28px; font-weight: 900; color: var(--accent); line-height: 1.1; letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard-grid-secondary { align-items: start; }
.dashboard-panel { min-width: 0; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.users-heading { margin-bottom: 14px; }
.panel-heading .section-title { margin-bottom: 0; }
.panel-caption { color: var(--ink-soft); font-size: 12px; margin-top: 3px; }
.panel-chip { color: var(--ink-soft); background: var(--paper-warm); border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.panel-chip-warm { color: var(--accent); background: var(--accent-bg); }
.trend-chart { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; height: 162px; align-items: end; border-bottom: 1px solid var(--paper-deep); padding: 0 2px; }
.trend-item { min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.trend-bar-wrap { width: 100%; height: calc(100% - 21px); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.trend-bar { display: block; width: min(22px, 74%); min-height: 3px; border-radius: 5px 5px 0 0; background: var(--accent); opacity: .84; transition: height .2s ease; }
.trend-item:nth-child(even) .trend-bar { background: var(--ink-mid); opacity: .72; }
.trend-value { color: var(--ink-soft); font-size: 10px; line-height: 1; min-height: 10px; white-space: nowrap; }
.trend-label { color: var(--ink-faint); font-size: 10px; white-space: nowrap; transform: rotate(-38deg); transform-origin: top center; margin-top: 4px; }
.empty-state { align-self: center; grid-column: 1 / -1; color: var(--ink-faint); font-size: 13px; text-align: center; }
.dashboard-table { font-size: 12px; }
.dashboard-table th { padding: 7px 8px; }
.dashboard-table td { padding: 8px; }
.dashboard-table td:first-child { min-width: 118px; }
.dashboard-table td small { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 1px; }
.num-emphasis { color: var(--accent) !important; font-weight: 800; }
.muted-cell { color: var(--ink-soft) !important; white-space: nowrap; }
.empty-cell { color: var(--ink-faint) !important; text-align: center; padding: 22px 8px !important; }
.pill-warn { background: #FFF5DD; color: #9A6B00; }
.usage-log-filters { margin-bottom: 12px; }
.usage-log-filters select {
  min-width: 150px; margin-bottom: 0; padding: 10px 12px;
  border: 1px solid var(--paper-deep); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink); font: inherit;
}
.usage-identity small { display: block; color: var(--ink-soft); font-size: 11px; }
.usage-log-filters .admin-field { min-width: 0; }
#usageLogHint { white-space: normal; text-align: right; }
.usage-log-pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px; color: var(--ink-soft); font-size: 12px;
}
.usage-log-pagination > div { display: flex; gap: 6px; }

.admin-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.admin-field { display: flex; flex-direction: column; gap: 4px; }
.admin-field label { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.admin-field input {
  width: 120px; margin-bottom: 0; padding: 10px 12px; font-size: 14px;
}
.admin-field.grow { flex: 1; min-width: 160px; }
.admin-field.grow input { width: 100%; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-soft);
  padding: 8px 10px; border-bottom: 2px solid var(--paper-deep); white-space: nowrap;
}
.data-table td {
  padding: 10px; border-bottom: 1px solid var(--paper-deep);
  color: var(--ink-mid); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-weight: 700; color: var(--ink); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table th, .data-table td { white-space: nowrap; }
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.pill-admin { background: var(--accent-bg); color: var(--accent); }
.pill-active { background: var(--green-bg); color: var(--green); }
.pill-frozen { background: var(--red-bg); color: var(--red); }
.pill-used { background: var(--paper-deep); color: var(--ink-soft); }
.btn-mini {
  border: none; cursor: pointer; font-family: var(--font);
  font-size: 12px; font-weight: 700; border-radius: var(--radius-sm);
  padding: 6px 12px; min-height: 32px;
  -webkit-tap-highlight-color: transparent;
}
.btn-mini.freeze { background: var(--red-bg); color: var(--red); }
.btn-mini.unfreeze { background: var(--green-bg); color: var(--green); }
.btn-mini.promote { background: var(--accent-bg); color: var(--accent); }
.btn-mini.demote { background: var(--paper-deep); color: var(--ink-mid); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.code-just-made { background: var(--accent-bg2) !important; }

/* ────────────────────────
   RESPONSIVE (desktop)
   ──────────────────────── */
@media (min-width: 520px) {
  #app { padding: 0 24px 60px; }
  body { padding-top: 0; }
  #authSection { padding: 60px 0 40px; }
  .brand { padding-bottom: 36px; }
  .brand-mascot { font-size: 52px; }
  .brand-name { font-size: 40px; }
  .plan-grid { flex-direction: row; flex-wrap: wrap; }
  .plan-card { flex: 1; min-width: 130px; }
  .credits-big { font-size: 56px; }
}

@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .admin-wrap { max-width: 1180px; }
}

@media (max-width: 767px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .trend-chart { height: 148px; }
  .trend-value { display: none; }
  .admin-top { align-items: flex-start; }
  .top-actions { width: 100%; }
  .top-actions .btn-ghost-sm { flex: 1; text-align: center; }
}

@media (min-width: 768px) {
  #app { padding-top: 0; }
  .top-bar { border-radius: var(--radius-xl); }
}







