:root {
  --bg: #eef2fb;
  --ink: #071633;
  --muted: #3d4d6e;
  --blue: #0b63f6;
  --navy: #071633;
  --line: rgba(7, 22, 51, 0.1);
  --white: #fff;
  --paper: #f7f9ff;
  --ok: #14663a;
  --warn: #8a5a00;
  --bad: #9b1c2c;
  --font: "Vazirmatn", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
[hidden], .is-off { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.35; letter-spacing: -0.02em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 10px; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: 12px; font-weight: 800; }
.lead, .muted { color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); }

.btn, .btn-quiet, .btn-text, .btn-ok, .btn-bad {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.btn { background: var(--blue); color: #fff; box-shadow: 0 10px 22px rgba(11, 99, 246, 0.22); }
.btn-quiet { background: #fff; color: var(--blue); box-shadow: inset 0 0 0 1.5px rgba(11, 99, 246, 0.35); }
.btn-text { background: none; color: var(--muted); }
.btn-ok { background: #14663a; color: #fff; }
.btn-bad { background: #fff; color: var(--bad); box-shadow: inset 0 0 0 1.5px rgba(155, 28, 44, 0.3); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.help {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #e8f0ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  margin-right: 6px;
  flex: 0 0 auto;
}
.tip {
  position: fixed;
  z-index: 50;
  max-width: 300px;
  background: var(--navy);
  color: #fff;
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.65;
  box-shadow: 0 16px 40px rgba(7, 22, 51, 0.28);
}

.field, .grow { width: 100%; }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"], input[type="search"], textarea, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  background: var(--paper);
}
textarea { min-height: 88px; resize: vertical; }
label { display: flex; align-items: center; font-weight: 700; margin: 14px 0 6px; }

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    radial-gradient(720px 340px at 100% 0, rgba(11, 99, 246, 0.16), transparent 60%),
    radial-gradient(500px 240px at 0 100%, rgba(7, 22, 51, 0.08), transparent 55%),
    var(--bg);
}
.back {
  position: fixed;
  top: 18px;
  right: 18px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.auth-card {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 28px;
  padding: 28px 24px 26px;
  box-shadow: 0 22px 50px rgba(16, 48, 120, 0.1);
}
.auth-card img { width: 108px; height: 108px; object-fit: contain; margin: 0 auto 8px; }
.auth-card .btn { width: 100%; margin-top: 16px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--paper);
  border-radius: 999px;
  padding: 4px;
  margin: 8px 0 18px;
}
.auth-tabs button {
  border: 0;
  background: none;
  border-radius: 999px;
  min-height: 40px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.auth-tabs button.is-on { background: #fff; color: var(--ink); box-shadow: 0 6px 16px rgba(16, 48, 120, 0.08); }
.otp { display: flex; gap: 8px; direction: ltr; justify-content: center; }
.otp input {
  width: 46px;
  height: 54px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.sent { color: var(--muted); font-size: 14px; }
.goal-pick { display: grid; gap: 10px; margin-top: 14px; }
.goal-pick button {
  text-align: right;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
}
.goal-pick button.is-on {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 99, 246, 0.12);
}
.goal-pick strong { display: block; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}
.cmd {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    radial-gradient(180px 120px at 50% 0, rgba(11, 99, 246, 0.28), transparent 70%),
    var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 16px;
  z-index: 8;
  overflow: auto;
}
.cmd-brand {
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.cmd-brand img { width: 78px; height: 78px; object-fit: contain; filter: brightness(1.12); }
.cmd-kicker {
  margin: 0 0 12px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #8aa0c8;
  font-weight: 800;
}
.stations { position: relative; display: grid; gap: 6px; }
.stations::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  right: 27px;
  width: 2px;
  background: linear-gradient(#2a4a8a, #0b63f6, #2a4a8a);
  opacity: 0.5;
}
.station { position: relative; z-index: 1; }
.hub {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: #c9d4ea;
  cursor: pointer;
  padding: 8px 8px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 13px;
  text-align: right;
}
.hub b {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #12305f;
  color: #9ab0d6;
  font-size: 10px;
}
.station.is-open .hub, .hub:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.station.is-open .hub b { background: var(--blue); color: #fff; }
.tray { display: none; padding: 0 4px 8px 8px; }
.station.is-open .tray { display: grid; gap: 2px; }
.tray a {
  color: #9eb0d0;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
}
.tray a.is-on, .tray a:hover { background: #0b63f6; color: #fff; }
.cmd-out {
  margin-top: auto;
  color: #9aabc8;
  text-decoration: none;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 8px 4px;
}

.desk { min-width: 0; padding: 0 0 48px; }
.pulse {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}
.pulse span, .pulse a {
  background: var(--paper);
  border-radius: 999px;
  padding: 5px 11px;
  color: inherit;
  text-decoration: none;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.dot.ok { background: #22a35a; }
.dot.warn { background: #e0a100; }
.dot.off { background: #b7c0d4; }
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 0;
}
.who { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.chip {
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 800;
  color: var(--blue);
  font-size: 12px;
}
.view { display: none; padding: 16px 22px 0; }
.view.is-on { display: block; animation: in 320ms ease; }
@keyframes in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.grid { display: grid; gap: 12px; }
.cols-2 { grid-template-columns: 1.15fr 0.85fr; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: #fff;
  border-radius: 22px;
  padding: 16px 16px 15px;
  box-shadow: 0 12px 30px rgba(16, 48, 120, 0.06);
}
.card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.kpi b { display: block; font-size: 1.55rem; letter-spacing: -0.03em; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 700; }
.kpi em { color: var(--ok); font-style: normal; font-size: 12px; font-weight: 800; }
.warn, .ok, .bad, .note {
  border-radius: 16px;
  padding: 12px 14px;
}
.warn { background: #fff7e8; color: var(--warn); }
.ok { background: #e7f8ee; color: var(--ok); }
.bad { background: #fdecee; color: var(--bad); }
.note { background: var(--paper); color: var(--muted); }

.list { display: grid; gap: 8px; }
.row, .job, .msg, .deal, .file, .device {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0 0;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.row strong, .job strong { display: block; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filters button {
  border: 0;
  background: var(--paper);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}
.filters button.is-on { background: #e8f0ff; color: var(--blue); }

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.cal i {
  display: block;
  min-height: 92px;
  border-radius: 14px;
  background: var(--paper);
  padding: 8px;
  font-size: 12px;
  font-style: normal;
}
.cal b { display: block; margin-top: 8px; }
.st { display: inline-block; margin-top: 6px; border-radius: 999px; padding: 1px 7px; font-size: 10px; font-weight: 800; }
.st-wait { background: #fff3cc; color: #8a5a00; }
.st-ok { background: #d9f5e4; color: #14663a; }
.st-run { background: #dce8ff; color: #0b63f6; }
.st-off { background: #fdecee; color: #9b1c2c; }
.st-draft { background: #eceff6; color: #3d4d6e; }

.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pipe section {
  background: var(--paper);
  border-radius: 16px;
  padding: 10px;
  min-height: 180px;
}
.pipe h3 { font-size: 13px; }
.lead-card {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  margin-top: 8px;
  box-shadow: 0 6px 16px rgba(16, 48, 120, 0.05);
}
.lead-card b { display: block; }
.timeline { display: grid; gap: 0; }
.timeline li {
  list-style: none;
  position: relative;
  padding: 0 18px 16px 0;
  margin: 0;
}
.timeline { padding: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
}
.timeline li::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 18px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.channel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.tones { display: flex; flex-wrap: wrap; gap: 6px; }
.tones button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 700;
}
.tones button.is-on { border-color: var(--blue); color: var(--blue); background: #eef4ff; }
.ask {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  background: var(--paper);
  border-radius: 18px;
  padding: 8px;
}
.ask input { background: #fff; }
.slider {
  display: grid;
  gap: 10px;
}
.slider label { margin: 0; font-weight: 600; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 22, 51, 0.45);
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 16px;
}
.sheet {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 20px 18px;
}

@media (max-width: 980px) {
  .cols-2, .cols-3, .cols-4, .pipe { grid-template-columns: 1fr; }
  .cal { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; padding-bottom: 88px; }
  .cmd {
    position: fixed;
    inset: auto 0 0 0;
    height: auto;
    max-height: 42vh;
    width: 100%;
    padding: 8px 8px 10px;
  }
  .cmd-brand, .cmd-kicker, .stations::before, .cmd-out { display: none; }
  .stations { display: flex; overflow-x: auto; gap: 8px; }
  .station { min-width: 150px; }
  .hub b { display: none; }
  .pulse, .topbar, .view { padding-right: 14px; padding-left: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .view.is-on { animation: none; }
}
