:root {
  --bg: #F6F7F9; --card: #FFFFFF; --line: #E5E7EB; --line-soft: #F1F2F4;
  --text: #111827; --text-2: #374151; --muted: #4B5563; --faint: #6B7280;
  --accent: #1D4ED8; --accent-dark: #1E3A8A; --accent-soft: #EFF4FF;
  --ok-bg: #DCFCE7; --ok: #166534; --warn-bg: #FFEDD5; --warn: #9A3412; --bad-bg: #FEE2E2; --bad: #B91C1C;
  --neutral-bg: #F3F4F6;
  font-family: Inter, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { margin: 0; font-size: 28px; font-weight: 700; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
h3 { margin: 0; font-size: 16px; font-weight: 600; }
p { margin: 0; line-height: 1.5; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { min-height: 100vh; display: flex; flex-wrap: wrap; }
.nav { flex: 1 1 220px; max-width: 100%; background: var(--card); border-right: 1px solid var(--line);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.nav .brand { font-weight: 700; font-size: 18px; padding: 0 12px 20px; }
.nav a { padding: 10px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav .who { margin-top: auto; padding: 16px 12px 0; font-size: 13px; color: var(--faint); display: flex; flex-direction: column; gap: 8px; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 64px; display: flex; flex-direction: column; gap: 24px; max-width: 1160px; }
@media (max-width: 700px) { .main { padding: 24px 16px 48px; } .nav { border-right: 0; border-bottom: 1px solid var(--line); } }

.head { display: flex; flex-direction: column; gap: 8px; }
.head-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.lead { color: var(--muted); font-size: 15px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.subcard { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.soft { background: #F9FAFB; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 800px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.small { font-size: 13px; color: var(--faint); }
.muted { color: var(--muted); font-size: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.strong { font-weight: 600; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { padding: 12px 16px; color: var(--muted); text-decoration: none; margin-bottom: -1px; }
.tabs a.active { color: var(--accent); font-weight: 600; border-bottom: 2px solid var(--accent); }

.btn { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid #D1D5DB; background: var(--card);
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.btn:hover { border-color: #9CA3AF; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; font-weight: 600; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { border-color: #FCA5A5; color: var(--bad); }
.btn.ghost { border: 1px dashed #93A3B8; background: #F9FAFB; color: var(--accent); font-weight: 600; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.input, select.input, textarea.input { min-height: 44px; padding: 0 12px; border: 1px solid #D1D5DB; border-radius: 8px; background: var(--card); font-weight: 400; width: 100%; }
textarea.input { padding: 10px 12px; min-height: 80px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 44px; }
.check input { width: 18px; height: 18px; }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-weight: 500; font-size: 13px; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--accent-soft); color: var(--accent-dark); }
.badge.neutral { background: var(--neutral-bg); color: var(--text-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.note { display: flex; gap: 12px; align-items: flex-start; border-radius: 8px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.note.info { background: var(--accent-soft); color: var(--accent-dark); }
.note.warn { background: #FFF7ED; border: 1px solid #FED7AA; color: #7C2D12; }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.ok { background: var(--ok-bg); color: var(--ok); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #FAFBFC; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-old { color: var(--faint); text-decoration: line-through; }
.up { color: var(--bad); } .down { color: var(--ok); }

.empty { padding: 32px; text-align: center; color: var(--muted); }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 420px; padding: 14px 18px; border-radius: 10px; background: #111827; color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 14px; line-height: 1.4; z-index: 50; }
.toast.bad { background: var(--bad); }

.login { margin: 10vh auto; width: min(440px, calc(100% - 32px)); }
.qr { width: 132px; height: 132px; border: 1px solid var(--line); border-radius: 8px; background: #FFFFFF; flex: 0 0 auto; }
.dialog-backdrop { position: fixed; inset: 0; background: rgba(17,24,39,.4); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.dialog { background: var(--card); border-radius: 12px; padding: 24px; width: min(560px, 100%); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 16px; }

.steps-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.steps-list li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.steps-list li .col { flex: 1; gap: 2px; }
.steps-list li.done { color: var(--faint); background: var(--line-soft); }
.steps-list .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center;
  font-size: 13px; font-weight: 700; margin-top: 1px; }
.steps-list li.done .mark { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
