:root {
  --ink: #17233d;
  --muted: #65708a;
  --line: #dfe6f3;
  --surface: #ffffff;
  --canvas: #f4f7fc;
  --accent: #2962ff;
  --accent-dark: #1747c7;
  --accent-soft: #eaf0ff;
  --success: #15805d;
  --warning: #a6600d;
  --danger: #b42318;
  --shadow: 0 12px 36px rgba(23, 35, 61, .08);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top right, #dfe9ff 0, transparent 38%), var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(760px, 100%); min-height: 100vh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom)); }
.topbar { display: grid; grid-template-columns: 48px 1fr 42px; gap: 12px; align-items: center; margin-bottom: 20px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #316bff, #6b45e8); font-weight: 800; letter-spacing: -.04em; box-shadow: 0 10px 26px rgba(41, 98, 255, .24); }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: 24px; line-height: 1.1; letter-spacing: -.03em; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 17px; }
p { line-height: 1.5; }
.icon-button { border: 1px solid var(--line); background: rgba(255,255,255,.8); border-radius: 14px; width: 42px; height: 42px; color: var(--accent); font-size: 23px; }
.card, .loading-card { background: rgba(255,255,255,.94); border: 1px solid rgba(223,230,243,.9); border-radius: 22px; box-shadow: var(--shadow); }
.card { padding: 20px; margin-bottom: 16px; }
.loading-card { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero { background: linear-gradient(145deg, #1d55e8, #6547dd); color: #fff; overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%; right: -80px; top: -105px; background: rgba(255,255,255,.12); }
.hero p { margin: 8px 0 0; color: rgba(255,255,255,.82); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.pill { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 12px 4px 2px; }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 20px; background: var(--accent-soft); font-size: 27px; }
.form-grid { display: grid; gap: 14px; }
.field { position: relative; display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 750; color: #3c4862; }
.field input, .field select { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #ccd6e8; border-radius: 14px; background: #fff; color: var(--ink); outline: none; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(41,98,255,.11); }
.suggestions { position: absolute; z-index: 10; left: 0; right: 0; top: 76px; max-height: 250px; overflow: auto; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 32px rgba(23,35,61,.16); }
.suggestion { width: 100%; padding: 10px; text-align: left; border: 0; background: transparent; border-radius: 10px; color: var(--ink); }
.suggestion:hover, .suggestion:focus { background: var(--accent-soft); outline: none; }
.suggestion small { display: block; margin-top: 3px; color: var(--muted); }
.primary, .secondary, .danger-button { min-height: 46px; padding: 11px 16px; border-radius: 14px; font-weight: 750; border: 0; }
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.primary:disabled { opacity: .55; cursor: wait; }
.secondary { color: var(--accent-dark); background: var(--accent-soft); }
.danger-button { color: var(--danger); background: #fff0ef; }
.order-card { padding: 0; overflow: hidden; }
.order-summary { padding: 20px; border-bottom: 1px solid var(--line); }
.order-address { margin: 6px 0 0; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.fact { padding: 11px 12px; border-radius: 13px; background: #f7f9fd; }
.fact span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.fact strong { font-size: 14px; }
.timeline { list-style: none; margin: 0; padding: 18px 20px 20px; }
.timeline li { position: relative; display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; }
.timeline li::before { content: ""; width: 11px; height: 11px; border: 3px solid #fff; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px #bde6d8; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 25px; bottom: -7px; width: 2px; background: #d8ebe5; }
.stage-label { font-size: 14px; font-weight: 700; }
.stage-value { font-size: 13px; color: var(--muted); text-align: right; }
.pending-list { display: grid; gap: 10px; }
.pending-item { padding: 13px; border-radius: 14px; background: #fff8eb; border: 1px solid #f4dfb9; }
.pending-item strong { display: block; }
.pending-item span { color: var(--warning); font-size: 13px; }
.admin-card { border-color: #cdd9ff; }
.admin-item { padding: 14px 0; border-top: 1px solid var(--line); }
.admin-item:first-of-type { border-top: 0; }
.admin-meta { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.admin-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 120px); opacity: 0; width: min(520px, calc(100% - 32px)); padding: 13px 16px; color: #fff; background: #17233d; border-radius: 14px; box-shadow: var(--shadow); transition: .25s ease; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.error-card { border-color: #f2c8c4; background: #fff8f7; }
.error-card h2 { color: var(--danger); }
.error-card code { font-size: 12px; word-break: break-word; }
.hidden { display: none !important; }

@media (max-width: 480px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .card { padding: 17px; border-radius: 19px; }
  .order-card { padding: 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .timeline li { grid-template-columns: 18px 1fr; }
  .stage-value { grid-column: 2; text-align: left; margin-top: -5px; }
  .admin-actions { grid-template-columns: 1fr; }
}
