/* ===== Админка: обзор (дашборд) ===== */
.dash-view { display: none !important; }
body.mode-dash .chat-view, body.mode-dash .kyc-view { display: none !important; }
body.mode-dash .dash-view { display: block !important; }

.dash {
  grid-column: 2 / -1; min-width: 0; overflow-y: auto;
  background:
    radial-gradient(1200px 400px at 100% -10%, rgba(139, 92, 246, .07), transparent 60%),
    radial-gradient(900px 360px at 0% -10%, rgba(59, 91, 253, .07), transparent 60%),
    #f4f5fa;
}
.dash-inner { max-width: 1320px; margin: 0 auto; padding: 26px 28px 40px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.dash-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.dash-head p { margin: 4px 0 0; font-size: 13.5px; color: #6b7280; }

.ds-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.ds-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ds-card {
  background: #fff; border: 1px solid #e8eaf2; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px rgba(17, 24, 39, .04);
}

/* --- Иконки-плашки --- */
.ds-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; flex: none; }
.ds-ic svg { width: 22px; height: 22px; }
.ds-ic.lg { width: 54px; height: 54px; border-radius: 15px; }
.ds-ic.lg svg { width: 26px; height: 26px; }
.ds-ic.blue { background: #eaeeff; color: #3b5bfd; }
.ds-ic.green { background: #e6f7ef; color: #059669; }
.ds-ic.violet { background: #f1eaff; color: #7c3aed; }
.ds-ic.amber { background: #fff4e0; color: #d97706; }
.ds-ic.red { background: #feecec; color: #dc2626; }

/* --- Большие цифры --- */
.ds-card.stat { padding: 22px 22px 20px; }
.ds-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.ds-val { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: #0f172a; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ds-val.sm { font-size: 30px; }
.ds-lbl { margin-top: 6px; font-size: 14px; font-weight: 600; color: #374151; }
.ds-sub { margin-top: 4px; font-size: 12.5px; color: #8b93a7; display: flex; align-items: center; gap: 8px; }
.trend {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 99px; background: #e6f7ef; color: #059669;
  font-size: 12px; font-weight: 700;
}
.trend svg { width: 14px; height: 14px; }
.bar { flex: 1; max-width: 140px; height: 6px; border-radius: 99px; background: #eef0f6; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7c3aed, #a78bfa); }

/* --- Кликабельные карточки-задачи --- */
.ds-card.act {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  font: inherit; text-align: left; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.ds-card.act[data-go=""] { cursor: default; }
.ds-card.act:not([data-go=""]):hover { transform: translateY(-2px); border-color: #d9ddf0; box-shadow: 0 14px 32px rgba(17, 24, 39, .08); }
.act-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.act-mid .ds-lbl { margin-top: 4px; }
.act-go {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  color: #9ca3af; background: #f4f5fa; transition: background .15s, color .15s;
}
.act-go svg { width: 17px; height: 17px; }
.ds-card.act:hover .act-go { background: #3b5bfd; color: #fff; }
.ds-card.act.hot[data-go="kyc"] { border-color: #fde3b5; background: linear-gradient(135deg, #fff, #fffaf0); }
.ds-card.act.hot[data-go="kyc"] .ds-val { color: #b45309; }

/* --- График --- */
.ds-card.chart { padding: 22px 22px 16px; margin-bottom: 16px; }
.ch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ch-title { font-size: 16px; font-weight: 700; color: #0f172a; }
.ch-total { margin-top: 4px; font-size: 13px; color: #8b93a7; }
.ch-total b { color: #0f172a; font-size: 15px; }
.ch-ctrl { display: flex; gap: 10px; flex-wrap: wrap; }
.seg.ch-seg { margin: 0; }
.seg.ch-seg button { flex: none; padding: 6px 12px; font-size: 12.5px; }

.ch-plot { position: relative; height: 240px; padding-left: 34px; }
.ch-grid { position: absolute; inset: 0 0 26px 34px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.ch-grid div { position: relative; border-top: 1px dashed #eceef4; }
.ch-grid div:last-child { border-top: 1px solid #e3e6ee; }
.ch-grid span {
  position: absolute; right: calc(100% + 8px); top: -8px;
  font-size: 11px; color: #a3aab9; font-variant-numeric: tabular-nums;
}
.ch-bars { position: relative; height: 100%; display: flex; gap: 10px; }
.ch-bars.dense { gap: 4px; }
.ch-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-col > .ch-bar { margin-top: auto; }
.ch-bar {
  position: relative; width: 100%; max-width: 64px; align-self: center;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #6d84ff, #3b5bfd);
  box-shadow: 0 6px 16px rgba(59, 91, 253, .22);
  transition: height .35s cubic-bezier(.2, .8, .2, 1), filter .15s;
}
.ch-col { position: relative; padding-bottom: 26px; }
.ch-col .ch-x {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  height: 20px; line-height: 20px; white-space: nowrap; font-size: 11px; color: #a3aab9;
}
.ch-col.today .ch-x { color: #3b5bfd; font-weight: 700; }
.ch-col.today .ch-bar { background: linear-gradient(180deg, #a78bfa, #6d4dff); box-shadow: 0 6px 16px rgba(109, 77, 255, .3); }
.ch-bar.zero { height: 3px !important; background: #e6e9f2; box-shadow: none; }
.ch-col:hover .ch-bar { filter: brightness(1.08); }
.ch-col:hover::before {
  content: ''; position: absolute; inset: 0 -3px 26px; border-radius: 10px; background: rgba(59, 91, 253, .05);
}
.ch-tip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px);
  padding: 6px 10px; border-radius: 9px; white-space: nowrap; pointer-events: none;
  background: #0f172a; color: #cbd5e1; font-size: 11.5px; text-align: center;
  opacity: 0; transition: opacity .12s, transform .12s; z-index: 2;
}
.ch-tip b { display: block; color: #fff; font-size: 14px; }
.ch-col:hover .ch-tip { opacity: 1; transform: translate(-50%, 0); }

/* --- Нижние панели --- */
.panels { align-items: start; }
.ds-card.panel { overflow: hidden; }
.pn-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #f0f1f6; }
.pn-title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; color: #0f172a; }
.pn-title svg { width: 18px; height: 18px; color: #8b93a7; }
.pn-link {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: #3b5bfd; padding: 4px 6px; border-radius: 8px;
}
.pn-link:hover { background: #eef1ff; }
.pn-link svg { width: 14px; height: 14px; }
.pn-body { padding: 6px 8px 8px; }
.pn-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px;
  border: 0; background: none; font: inherit; text-align: left;
}
.pn-row.link { cursor: pointer; transition: background .12s; }
.pn-row.link:hover { background: #f7f8fc; }
.ava.sm { width: 36px; height: 36px; font-size: 12.5px; }
.pn-mid { flex: 1; min-width: 0; }
.pn-name { font-size: 13.5px; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-meta { margin-top: 2px; font-size: 12px; color: #8b93a7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-name:has(.pn-time) { display: flex; align-items: baseline; gap: 8px; }
.pn-time { margin-left: auto; flex: none; font-size: 11.5px; font-weight: 500; color: #a3aab9; }
.pn-noname { color: #9ca3af; font-weight: 500; font-style: italic; }
.pn-empty { padding: 34px 16px; text-align: center; font-size: 13.5px; color: #9ca3af; }
.pn-empty.big { padding: 80px 16px; font-size: 15px; }

.pill { flex: none; padding: 4px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill.ok { background: #e6f7ef; color: #047857; }
.pill.warn { background: #fff4e0; color: #b45309; }
.pill.bad { background: #feecec; color: #b91c1c; }
.pill.muted { background: #f1f2f6; color: #6b7280; }

/* лента журнала */
.tl { position: relative; padding: 4px 0; }
.tl::before { content: ''; position: absolute; left: 19px; top: 18px; bottom: 18px; width: 2px; background: #f0f1f6; }
.tl-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 8px 10px; }
.tl-dot { position: relative; flex: none; width: 10px; height: 10px; margin: 0 4px; border-radius: 50%; box-shadow: 0 0 0 4px #fff; }
.tl-dot.ok { background: #10b981; }
.tl-dot.warn { background: #f59e0b; }
.tl-dot.bad { background: #ef4444; }
.tl-dot.info { background: #3b5bfd; }
.tl-dot.muted { background: #c4c9d6; }

.dash-skel {
  height: 420px; border-radius: 18px;
  background: linear-gradient(90deg, #eceef5 25%, #f6f7fb 50%, #eceef5 75%) 0 0 / 200% 100%;
  animation: ds-shim 1.2s linear infinite;
}
@keyframes ds-shim { to { background-position: -200% 0; } }

/* --- Адаптив --- */
@media (max-width: 1180px) {
  .ds-grid.panels { grid-template-columns: 1fr 1fr; }
  .ds-grid.panels > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .ds-grid.g3 { grid-template-columns: 1fr 1fr; }
  .ds-grid.g3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .dash { grid-column: 1 / -1; }
  .dash-inner { padding: 18px 16px 28px; }
  .dash-head h1 { font-size: 22px; }
  .ds-grid { gap: 12px; margin-bottom: 12px; }
  .ds-grid.g3, .ds-grid.panels { grid-template-columns: 1fr; }
  .ds-grid.g3 > :last-child:nth-child(odd), .ds-grid.panels > :last-child { grid-column: auto; }
  .ds-val { font-size: 28px; }
  .ds-card.stat { padding: 16px 18px; }
  .ds-top { margin-bottom: 10px; }
  .ds-ic { width: 38px; height: 38px; border-radius: 11px; }
  .ds-ic svg { width: 19px; height: 19px; }
  .ds-card.act { padding: 14px 16px; }
  .ds-ic.lg { width: 46px; height: 46px; }
  .ch-plot { height: 200px; }
  .ch-bars { gap: 5px; }
  .ch-bars.dense { gap: 2px; }
  .ch-col .ch-x { font-size: 10px; }
}
