@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #e7e7e4;
  --bg-2: #efefec;
  --ink: #111113;
  --muted: #7c7d80;
  --muted-strong: #5f6166;
  --card: rgba(247, 247, 244, 0.8);
  --card-strong: rgba(252, 252, 249, 0.88);
  --border: rgba(20, 20, 20, 0.06);
  --line: rgba(20, 20, 20, 0.09);
  --shadow: 0 24px 55px rgba(0, 0, 0, 0.12);
  --soft-shadow: 12px 18px 40px rgba(0, 0, 0, 0.08), -12px -18px 40px rgba(255, 255, 255, 0.5);
  --green: #3ba96b;
  --red: #b44444;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 50% 20%, #f6f6f4 0, #e7e7e4 42%, #dcdcd9 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  position: relative;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: 74px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(239, 239, 236, 0.86), rgba(239, 239, 236, 0.28));
  backdrop-filter: blur(20px);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
}

.icon-btn svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #111;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notify {
  position: relative;
}

.notify::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #111;
}

.sidebar {
  position: fixed;
  top: 92px;
  left: 30px;
  bottom: 28px;
  width: 70px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: rgba(248, 248, 245, 0.66);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 18px;
  gap: 18px;
}

.sidebar.hidden {
  display: none;
}

.mini-logo,
.gem-logo {
  display: grid;
  place-items: center;
  color: #ececec;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  background: conic-gradient(from 30deg, #0a0b0d, #4a4c4d, #d6d7d6, #66686a, #0f1011, #2d2e31, #0a0b0d);
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.22), inset 12px 10px 28px rgba(255, 255, 255, 0.16), inset -18px -12px 24px rgba(0, 0, 0, 0.35);
}

.mini-logo {
  width: 38px;
  height: 38px;
  font-size: 20px;
}

.hero-logo {
  width: 150px;
  height: 150px;
  font-size: 90px;
  margin-top: 76px;
}

.laptop-logo {
  width: 56px;
  height: 56px;
  font-size: 30px;
}

.screen {
  min-height: 100vh;
  display: none;
  padding: 98px 38px 58px;
}

.screen.active {
  display: block;
}

.screen.with-sidebar {
  padding-left: 128px;
}

.login-screen {
  place-items: center;
}

.login-screen.active {
  display: grid;
}

.login-stage {
  width: min(640px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

.login-copy h1 {
  margin: 0 0 8px;
  font-size: 25px;
  letter-spacing: 0.26em;
}

.login-copy p,
.auth-label,
.tiny-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.tiny-note {
  letter-spacing: 0.08em;
  font-size: 12px;
}

.laptop {
  width: 300px;
  height: 170px;
  position: relative;
}

.laptop-screen {
  height: 155px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(145deg, rgba(247, 247, 245, 0.92), rgba(220, 220, 218, 0.68));
  box-shadow: var(--soft-shadow);
  display: grid;
  place-items: center;
}

.laptop-base {
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 116%;
  height: 18px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #d3d3d1, #bfc0be);
  border-radius: 0 0 38px 38px;
  box-shadow: 0 18px 26px rgba(0, 0, 0, 0.1);
}

.telegram-btn,
.dark-btn,
.pill {
  border: 0;
}

.telegram-btn,
.dark-btn {
  min-height: 54px;
  padding: 0 24px;
  border-radius: 999px;
  background: #111214;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.telegram-mark {
  font-size: 14px;
}

footer {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: #9b9b9b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

nav {
  display: grid;
  gap: 12px;
}

.nav-item {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 0;
  background: transparent;
  color: #323438;
  font-size: 18px;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.logout {
  margin-top: auto;
}

.dashboard-layout {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 28px;
}

.dashboard-head h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.dashboard-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #222;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
}

.workspace,
.metrics-grid,
.dashboard-grid,
.knowledge-layout {
  display: grid;
  gap: 18px;
}

.metrics-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-grid {
  margin-top: 18px;
  grid-template-columns: 1.55fr 1fr;
}

.soft-card,
.section-card,
.modal-card,
.bot-row,
.client-tile,
.table-row,
.knowledge-row,
.featured-client-block {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
}

.soft-card,
.section-card {
  border-radius: 28px;
}

.metric-card,
.chart-card,
.top-bots-card,
.activity-card,
.map-card,
.status-card,
.section-card {
  padding: 24px;
}

.metric-card {
  min-height: 168px;
  position: relative;
  overflow: hidden;
}

.metric-card p,
.card-top h3,
.section-card h3,
.table-row p,
.knowledge-row p,
.world-map,
.modal-error {
  margin: 0;
}

.metric-card p,
.table-row p,
.knowledge-row p,
.bot-row p,
.client-tile p,
.featured-client-block p,
.empty-copy,
.world-map {
  color: var(--muted-strong);
  line-height: 1.55;
}

.metric-card h2,
.featured-client-block h2 {
  margin: 14px 0 10px;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.mini-gem {
  position: absolute;
  right: 24px;
  bottom: 22px;
  width: 54px;
  height: 54px;
  font-size: 28px;
}

.green,
.ok-dot {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.spark {
  width: 100%;
  height: 48px;
  margin-top: 18px;
}

.spark path {
  fill: none;
  stroke: #121316;
  stroke-width: 2;
  opacity: 0.72;
}

.donut {
  position: absolute;
  right: 24px;
  bottom: 22px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid rgba(17, 17, 19, 0.18);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.big-chart {
  width: 100%;
  height: 250px;
}

.big-chart path {
  fill: none;
  stroke: #111214;
  stroke-width: 3;
}

.big-chart line {
  stroke: rgba(17, 18, 20, 0.2);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
}

.big-chart circle {
  fill: #111214;
}

.big-chart text {
  fill: #7b7c80;
  font-size: 12px;
}

.top-bot-row,
.table-row,
.bot-row,
.privacy-row,
.settings-row,
.knowledge-row,
.topic-row {
  display: grid;
  gap: 14px;
  align-items: center;
}

.top-bot-row,
.bot-row {
  grid-template-columns: 54px 1fr auto;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.top-bot-row:first-child,
.bot-row:first-child,
.table-row:first-child,
.knowledge-row:first-child,
.privacy-row:first-child,
.settings-row:first-child {
  border-top: 0;
}

.top-bot-row .gem-logo,
.bot-row .gem-logo {
  width: 50px;
  height: 50px;
  font-size: 26px;
}

.top-bot-row b,
.bot-row h3,
.table-row strong,
.client-tile strong,
.knowledge-row strong,
.featured-client-block h2,
.featured-meta,
.status-list b {
  display: block;
  font-size: 16px;
}

.bar {
  margin-top: 10px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 17, 19, 0.08);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #111214;
}

.activity-list,
.table-list,
.knowledge-list,
.status-list,
.client-grid,
.privacy-grid,
.settings-list {
  display: grid;
}

.activity-list p,
.status-list p {
  min-height: 52px;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.activity-list p:first-child,
.status-list p:first-child {
  border-top: 0;
}

.activity-list small,
.top-bot-row small,
.bot-row small,
.table-row small,
.featured-meta,
.status-list b {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.map-card {
  display: grid;
  gap: 16px;
}

.world-map {
  min-height: 150px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px dashed rgba(17, 17, 19, 0.12);
}

.map-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.map-stats b span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.section-card {
  min-height: 220px;
}

.live-list p {
  min-height: 70px;
}

.table-row {
  grid-template-columns: minmax(180px, 1.3fr) repeat(4, minmax(70px, auto));
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.clients-card,
.privacy-card,
.settings-card,
.bots-card {
  display: grid;
  gap: 18px;
}

.featured-client-block {
  border-radius: 24px;
  padding: 22px;
}

.featured-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.client-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.client-tile {
  border-radius: 20px;
  padding: 18px;
}

.client-tile small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

.knowledge-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.knowledge-row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.compact-files .knowledge-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.privacy-grid,
.settings-list {
  gap: 4px;
}

.privacy-row,
.settings-row {
  grid-template-columns: 1fr auto;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.bot-profile-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 18px;
  align-items: center;
}

.bot-profile-row .gem-logo {
  width: 60px;
  height: 60px;
  font-size: 30px;
}

.bot-profile-row h2 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.bot-profile-row p {
  margin: 0;
  color: var(--muted);
}

.bot-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.bot-stats-grid div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.bot-stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.bot-stats-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
}

.empty-copy {
  color: var(--muted-strong);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 15, 15, 0.22);
  backdrop-filter: blur(10px);
  z-index: 80;
}

.modal.open {
  display: grid;
}

.modal-card {
  width: min(460px, 100%);
  border-radius: 28px;
  padding: 28px;
  background: rgba(249, 249, 246, 0.96);
}

.modal-card h2 {
  margin: 0 0 18px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.modal-card label {
  display: block;
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.modal-card input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.wide {
  width: 100%;
  margin-top: 20px;
}

.close {
  position: absolute;
  margin-left: calc(100% - 36px);
  margin-top: -10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  font-size: 24px;
}

.modal-error {
  margin-top: 14px;
  color: var(--red);
  font-size: 13px;
}

@media (max-width: 1320px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .knowledge-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1120px) {
  .dashboard-grid,
  .knowledge-layout,
  .client-grid,
  .bot-stats-grid {
    grid-template-columns: 1fr;
  }

  .table-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 16px;
  }

  .brand-title {
    font-size: 13px;
  }

  .screen {
    padding: 88px 16px 58px;
  }

  .screen.with-sidebar {
    padding-left: 16px;
  }

  .sidebar {
    display: none !important;
  }

  .dashboard-head,
  .head-actions,
  .metrics-grid,
  .table-row,
  .bot-profile-row,
  .map-stats {
    grid-template-columns: 1fr;
    display: grid;
  }

  .head-actions {
    justify-items: start;
  }

  .hero-logo {
    width: 120px;
    height: 120px;
    font-size: 72px;
  }

  .laptop {
    width: 260px;
  }

  .bot-row,
  .top-bot-row {
    grid-template-columns: 50px 1fr;
  }

  .bot-row small,
  .top-bot-row small {
    display: none;
  }
}
