
:root {
  --bg: #070b14;
  --card: #0f172a;
  --line: rgba(201,162,39,.28);
  --gold: #e8c547;
  --gold2: #c9a227;
  --text: #e8eef7;
  --muted: #94a3b8;
  --ok: #34d399;
  --bad: #f87171;
  --nav: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body { padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom)); min-height: 100dvh; }
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: rgba(7,11,20,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #f0d060, #c9a227); color: #0a1628;
  font-weight: 900; display: grid; place-items: center; font-size: 12px;
}
.brand h1 { margin: 0; font-size: 15px; color: var(--gold); }
.brand p { margin: 0; font-size: 11px; color: var(--muted); }
.badge {
  font-size: 10px; padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--gold);
}
.wrap { max-width: 920px; margin: 0 auto; padding: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 12px;
}
.card h2 { margin: 0 0 8px; font-size: 15px; color: var(--gold); }
.card h3 { margin: 0 0 8px; font-size: 13px; color: var(--text); }
.muted { color: var(--muted); font-size: 12px; line-height: 1.45; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
input, select, textarea {
  width: 100%; background: #0a1222; border: 1px solid rgba(148,163,184,.25);
  color: var(--text); border-radius: 10px; padding: 11px 12px; font-size: 14px;
}
textarea { min-height: 88px; resize: vertical; }
.btn {
  border: 1px solid var(--line); background: #111827; color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-weight: 700; cursor: pointer; font-size: 13px;
}
.btn-gold { background: linear-gradient(135deg, #f0d060, #c9a227); color: #0a1628; border: 0; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 10px; font-size: 12px; }
.btn-danger { border-color: rgba(248,113,113,.4); color: #fecaca; }
.check {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 0;
  border-bottom: 1px solid rgba(148,163,184,.12);
}
.check input { width: auto; margin-top: 3px; }
.check.done span { text-decoration: line-through; color: var(--muted); }
.chip {
  display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); color: var(--gold); margin: 2px;
}
.lead {
  padding: 10px; border-radius: 12px; border: 1px solid rgba(148,163,184,.15);
  margin-bottom: 8px; background: #0a1222;
}
.lead .meta { font-size: 11px; color: var(--muted); }
.msg { margin-bottom: 10px; }
.msg .who { font-size: 11px; color: var(--gold); margin-bottom: 4px; }
.msg .bubble {
  background: #0a1222; border: 1px solid rgba(148,163,184,.15);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.45; white-space: pre-wrap;
}
.msg.user .bubble { border-color: rgba(201,162,39,.35); }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; }
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav) + 16px); transform: translateX(-50%);
  background: #111827; border: 1px solid var(--line); color: var(--text);
  padding: 10px 14px; border-radius: 999px; font-size: 13px; z-index: 50;
  opacity: 0; pointer-events: none; transition: .2s;
}
#toast.show { opacity: 1; }
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: rgba(7,11,20,.96); border-top: 1px solid var(--line);
}
.bottom button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  font-size: 10px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; cursor: pointer;
}
.bottom button.on { color: var(--gold); }
.bottom .ico { font-size: 18px; }
.hidden { display: none !important; }
.kpi {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px;
}
.kpi div {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px; text-align: center;
}
.kpi b { display: block; font-size: 18px; color: var(--gold); }
.kpi span { font-size: 10px; color: var(--muted); }
@media (min-width: 901px) {
  body { display: grid; grid-template-columns: 220px 1fr; }
  .top { grid-column: 1 / -1; }
  .bottom { 
    position: sticky; top: 60px; left: 0; flex-direction: column; height: auto;
    width: 220px; border-top: 0; border-right: 1px solid var(--line); padding: 12px;
  }
  .bottom button { flex-direction: row; justify-content: flex-start; gap: 10px; font-size: 13px; padding: 10px; }
  .wrap { padding: 20px 24px; }
  body { padding-bottom: 0; }
}
