:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --line: #d9e2ef;
  --text: #182230;
  --muted: #667085;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --info-bg: #eff6ff;
  --info-text: #175cd3;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --err-bg: #fee2e2;
  --err-text: #991b1b;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.55; }
.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; box-shadow: 0 4px 16px rgba(16,24,40,.05); min-width: 0; }
.hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; border-top: 4px solid var(--primary); }
.hero h1, .hero h2 { margin: 0 0 4px; font-size: 1.25rem; }
.muted { color: var(--muted); font-size: 0.9rem; }
.btn { background: var(--primary); color: #fff; border: 0; padding: 10px 16px; border-radius: 10px; font-size: 0.95rem; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #e2e8f0; color: var(--text); }
.btn.danger { background: #dc2626; color: #fff; }
.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.92rem; }
.field input, .field select { width: 100%; max-width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 0.95rem; background: #fff; }
.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-weight: 600; font-size: 0.92rem; }
.banner.info { background: var(--info-bg); color: var(--info-text); border: 1px solid #bfdbfe; }
.banner.warn { background: var(--warn-bg); color: var(--warn-text); }
.banner.err { background: var(--err-bg); color: var(--err-text); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab-btn { background: #fff; border: 1px solid var(--line); color: var(--text); padding: 8px 12px; border-radius: 10px; cursor: pointer; font-size: 0.9rem; font-weight: 600; }
.tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric { background: #f9fbff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.metric span { display: block; color: var(--muted); font-size: 0.85rem; }
.metric strong { display: block; font-size: 1.25rem; color: var(--primary-dark); margin-top: 2px; word-break: break-word; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); word-break: break-word; }
th { background: #f8fafc; font-weight: 700; }
.item-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; background: var(--info-bg); color: var(--info-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.prefs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 10px 0; }
@media (max-width: 480px) {
  .wrap { padding: 10px; }
  .card { padding: 12px; }
  .metrics { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}
