:root {
  --bg: #0b1220;
  --card: #121c31;
  --text: #eef4ff;
  --muted: #9fb0cf;
  --line: #334155;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #050914, #0f172a);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, 94vw); margin: 0 auto; }
.topbar {
  background: rgba(5, 9, 20, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
}
.brand { font-weight: 700; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  padding: 9px 12px;
  border-radius: 999px;
  background: #18233b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 0 16px;
}
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.card {
  background: rgba(18, 28, 49, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
}
.auth-card { max-width: 520px; margin: 40px auto; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
label { color: #dbe7ff; }
input, select, textarea, button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0b1220;
  color: var(--text);
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.btn-secondary {
  background: #18233b;
  border: 1px solid var(--line);
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}
.flash {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0;
  background: #0b1220;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.note {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}
.empty {
  padding: 26px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
}
.muted { color: var(--muted); }
.stat { font-size: 1.85rem; font-weight: 700; margin-top: 8px; }
.kvs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kv {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.kv small {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}
.button-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }


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

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.chat-shell {
  max-width: 900px;
}

.chat-messages {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.chat-row {
  display: flex;
}

.chat-row.bot {
  justify-content: flex-start;
}

.chat-row.client {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(680px, 90%);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
}

.chat-bubble.bot {
  background: rgba(255,255,255,0.04);
}

.chat-bubble.client {
  background: rgba(34,197,94,0.18);
}

.chat-sender {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.chat-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-options form,
.chat-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-input-row input {
  flex: 1 1 300px;
}
