:root {
  --bg: #0b1020;
  --panel: #11182d;
  --panel-2: #17213b;
  --line: rgba(255,255,255,.08);
  --text: #edf2ff;
  --muted: #94a3b8;
  --accent: #7c9cff;
  --accent-2: #52d3b7;
  --danger: #ff6b81;
  --warn: #ffb454;
  --ok: #54d38a;
  --shadow: 0 20px 60px rgba(0,0,0,.35);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: linear-gradient(180deg, #0b1020, #0d1427 40%, #0a0f1d); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
#app { min-height: 100vh; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 460px; background: rgba(17,24,45,.88); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 28px; }
.brand { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.brand-badge { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; color: white; font-weight: 800; }
.h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.sub { color: var(--muted); line-height: 1.5; }
.input, .select, .textarea { width: 100%; background: #0c1224; color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,156,255,.15); }
.form-grid { display: grid; gap: 12px; margin-top: 18px; }
.btn { background: linear-gradient(135deg, var(--accent), #9b8cff); color: white; border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: #1a2442; border: 1px solid var(--line); }
.btn.ghost { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.btn.ok { background: linear-gradient(135deg, #2f9e6b, var(--ok)); }
.btn.warn { background: linear-gradient(135deg, #df8d2b, var(--warn)); }
.btn.danger { background: linear-gradient(135deg, #d94b6d, var(--danger)); }
.demo-users { margin-top: 16px; display: grid; gap: 10px; }
.demo-user { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #0d1428; cursor: pointer; }
.demo-user strong { display: block; }
.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); background: rgba(10,15,29,.72); padding: 18px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { margin-bottom: 28px; }
.nav { display: grid; gap: 8px; }
.nav button { text-align: left; width: 100%; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.nav button.active, .nav button:hover { background: rgba(124,156,255,.12); border-color: rgba(124,156,255,.2); color: white; }
.user-card { margin-top: 22px; background: #11182d; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.avatar { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #2f3f74, #1d2a4e); display: grid; place-items: center; font-weight: 800; }
.main { padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.topbar h2 { margin: 0; font-size: 28px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: rgba(17,24,45,.84); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.metric { font-size: 30px; font-weight: 800; }
.metric-label { color: var(--muted); margin-top: 6px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.panel-title h3 { margin: 0; font-size: 18px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: rgba(84,211,138,.14); color: #9ff0bd; }
.badge.warn { background: rgba(255,180,84,.14); color: #ffd699; }
.badge.danger { background: rgba(255,107,129,.14); color: #ffb4c0; }
.badge.info { background: rgba(124,156,255,.14); color: #bfd0ff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px; font-size: 14px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search { min-width: 220px; flex: 1; }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.log-list { display: grid; gap: 10px; }
.log-item { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #10172b; }
.log-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.chat-thread { display: grid; gap: 10px; }
.msg { padding: 12px 14px; border-radius: 16px; max-width: 85%; }
.msg.guest { background: #182445; justify-self: start; }
.msg.bot { background: #103027; justify-self: end; }
.msg small { display: block; margin-top: 6px; color: var(--muted); }
.form-inline { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.form-inline-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.notice { padding: 12px 14px; border-radius: 14px; background: rgba(124,156,255,.12); border: 1px solid rgba(124,156,255,.2); color: #dbe4ff; }
.small { font-size: 12px; }
@media (max-width: 1100px) {
  .grid.cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .form-inline, .form-inline-3 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .grid.cards { grid-template-columns: 1fr; }
  .main { padding: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; }
}
