* {
  box-sizing: border-box;
}
:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #263044;
  background: #f4f5f8;
  font-size: 14px;
  --muted: #7b8394;
  --border: #e5e8ef;
  --accent: #5765d9;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #aeb7ff;
  outline-offset: 2px;
}
button,
.card,
input,
textarea,
select {
  border-radius: 9px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #dce0e9;
  background: #fff;
  padding: 11px 12px;
  color: #263044;
}
textarea {
  resize: vertical;
  line-height: 1.65;
  min-height: 90px;
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}
label {
  display: grid;
  gap: 7px;
  color: #4d5669;
  font-size: 13px;
  margin-bottom: 15px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.9px;
  font-weight: 650;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 15px;
  font-weight: 650;
}
p {
  line-height: 1.7;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 12px;
}
a {
  color: var(--accent);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.7 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  background: #f4f5f8;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 8px;
  max-height: 460px;
  overflow: auto;
}
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.primary {
  background: var(--accent);
  color: #fff;
  padding: 11px 16px;
  font-weight: 550;
}
.secondary {
  background: #fff;
  border: 1px solid var(--border);
  padding: 10px 14px;
}
.danger {
  color: #bf4851;
}
.icon-button {
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 18px;
}
.spread {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.card {
  border: 1px solid var(--border);
  background: #fff;
  padding: 22px;
}
.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  background: #f0f1f8;
  color: #637091;
  white-space: nowrap;
}
.avatar {
  height: 34px;
  width: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #eceefa;
  color: #6270ba;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
}
.avatar.human {
  border-radius: 50%;
  background: #e7f0ed;
  color: #578274;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #9299aa;
  text-transform: uppercase;
}
.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.7px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  height: 29px;
  width: 29px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 500;
}
.shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: 70px minmax(0, 1fr);
}
.topbar {
  grid-column: 1/-1;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.topbar .brand {
  width: 230px;
}
.top-tabs {
  display: flex;
  gap: 5px;
  background: #f3f4f8;
  border: 1px solid #eceef3;
  padding: 4px;
  border-radius: 10px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.top-tabs button {
  padding: 8px 21px;
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 13px;
  color: #7c8392;
}
.top-tabs button.active {
  background: #fff;
  box-shadow: 0 1px 4px #1720330c;
  color: #343e58;
  font-weight: 600;
}
.top-user {
  display: flex;
  align-items: center;
  gap: 14px;
}
.server-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6fa589;
}
.sidebar {
  background: #fcfcfd;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 25px;
  overflow: auto;
}
.sidebar button.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  color: #798093;
  text-align: left;
  margin-bottom: 4px;
}
.sidebar button.nav:hover {
  background: #f0f1f7;
}
.sidebar button.nav.active {
  background: #eaeefa;
  color: #5562b3;
  font-weight: 600;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  margin-bottom: 9px;
}
.agent-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  width: 100%;
  text-align: left;
  margin: 3px 0;
}
.agent-nav.active {
  background: #f0f1f8;
}
.agent-nav .avatar {
  height: 26px;
  width: 26px;
  border-radius: 7px;
  font-size: 10px;
}
.agent-nav span.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 17px 10px 0;
}
.files {
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
.file-entry {
  display: flex;
  gap: 9px;
  width: 100%;
  text-align: left;
  align-items: center;
  padding: 7px 10px;
  font-size: 12px;
  color: #727b8c;
}
.file-entry svg {
  width: 14px;
  height: 14px;
}
.file-path {
  font:
    10px/1.5 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
  padding: 0 10px;
  margin: 12px 0;
  color: #999fae;
}
.workspace {
  overflow: auto;
  min-height: 0;
}
.content {
  padding: 38px 42px;
  max-width: 1200px;
  margin: auto;
}
.page-heading {
  margin-bottom: 30px;
}
.page-heading p {
  margin-top: 9px;
  color: #7b8394;
  font-size: 13px;
}
.dashboard-hero {
  padding: 32px;
  background: linear-gradient(120deg, #fafaff, #f0f1fb);
  border-color: #e5e7f4;
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: center;
}
.dashboard-hero p {
  max-width: 540px;
  margin-top: 12px;
  color: #81879b;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 22px 0 32px;
}
.stat {
  padding: 19px 23px;
}
.stat strong {
  display: block;
  font-size: 25px;
  font-weight: 600;
  margin-top: 9px;
}
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.agent-card {
  text-align: left;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
  cursor: pointer;
}
.agent-card:hover {
  box-shadow: 0 8px 25px #2934570a;
  transform: translateY(-2px);
}
.agent-card p {
  font-size: 12px;
  color: #9399a8;
  margin: 17px 0;
  min-height: 38px;
}
.agent-card .row h3 {
  margin-bottom: 5px;
}
.card-bottom {
  border-top: 1px solid #f0f1f5;
  padding-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #a1a7b3;
}
.empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding: 50px 25px;
  color: #9299a7;
}
.empty .empty-icon {
  display: grid;
  place-items: center;
  background: #edf0fa;
  color: #8290c3;
  border-radius: 16px;
  width: 55px;
  height: 55px;
}
.empty .empty-icon svg {
  width: 26px;
  height: 26px;
}
.empty p {
  max-width: 410px;
  font-size: 13px;
}
.empty h3 {
  color: #56617a;
  font-size: 16px;
}
.agent-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  min-height: 100%;
  height: 100%;
}
.agent-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
.agent-header {
  padding: 23px 30px;
  border-bottom: 1px solid var(--border);
}
.mini-tabs {
  display: flex;
  gap: 24px;
  margin-top: 22px;
}
.mini-tabs button {
  padding: 0 0 13px;
  font-size: 12px;
  border-radius: 0;
  color: #969ca9;
  border-bottom: 2px solid transparent;
}
.mini-tabs button.active {
  color: #515ec6;
  border-color: #6d79da;
}
.agent-header .mini-tabs {
  margin-bottom: -23px;
}
.messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px 32px;
}
.message {
  display: flex;
  gap: 13px;
  margin: 0 0 27px;
}
.message-body {
  max-width: 90%;
  min-width: 0;
}
.message-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 1px 0 9px;
  font-size: 12px;
}
.message-meta strong {
  font-weight: 650;
}
.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.85;
  color: #4a556b;
}
.composer {
  margin: 0 30px 22px;
  border: 1px solid #dfe3ec;
  border-radius: 13px;
  padding: 12px 15px;
  background: #fff;
  box-shadow: 0 3px 15px #28304505;
}
.composer textarea {
  border: 0;
  min-height: 55px;
  padding: 3px;
  font-size: 13px;
  resize: none;
  outline: none;
}
.composer .row {
  padding-top: 8px;
  border-top: 1px solid #f2f3f7;
}
.composer small {
  font-size: 10px;
}
.composer .primary {
  padding: 8px 13px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.context {
  background: #fafbfc;
  border-left: 1px solid var(--border);
  padding: 28px 20px;
  overflow: auto;
}
.context section {
  margin-bottom: 30px;
}
.context h3 {
  font-size: 12px;
  margin-bottom: 15px;
}
.context .badge {
  display: block;
  width: fit-content;
  margin: 7px 0;
}
.context p {
  font-size: 11px;
  color: #969dab;
  line-height: 1.8;
}
.agent-panel {
  padding: 28px 32px;
  overflow: auto;
  flex: 1;
}
.agent-panel .card {
  margin-bottom: 16px;
}
.notice {
  border: 1px solid #ece7d9;
  background: #fffcf4;
  color: #958469;
  font-size: 12px;
  padding: 13px 16px;
  border-radius: 9px;
  margin-bottom: 18px;
  line-height: 1.8;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-help {
  font-size: 11px;
  color: #949ba9;
  line-height: 1.7;
  margin: -7px 0 16px;
}
.code-input {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  min-height: 150px;
}
.catalog-row {
  padding: 17px 0;
  border-bottom: 1px solid var(--border);
}
.catalog-row:last-child {
  border: 0;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 12px;
}
.connection-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.connection-row:last-child {
  border: 0;
}
.connection-row .spread {
  justify-content: flex-end;
}
.connection-row h3 {
  margin-bottom: 6px;
}
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 25% 10%, #eaeefa 0%, #f4f5f8 65%);
  padding: 30px;
}
.login-card {
  width: min(420px, 100%);
  padding: 38px;
  box-shadow: 0 20px 70px #3b466210;
}
.login-card .brand {
  margin-bottom: 35px;
}
.login-card h1 {
  font-size: 25px;
}
.login-card p {
  color: #959ba9;
  font-size: 12px;
  margin: 12px 0 26px;
}
.login-card .primary {
  width: 100%;
  margin-top: 5px;
}
.login-foot {
  margin-top: 22px;
  font-size: 10px;
  color: #a1a8b7;
  line-height: 1.7;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 28px;
  width: min(620px, 90vw);
  max-height: 90dvh;
  box-shadow: 0 25px 90px #19274625;
  color: inherit;
}
dialog::backdrop {
  background: #26314955;
  backdrop-filter: blur(3px);
}
dialog h2 {
  margin-bottom: 20px;
}
dialog .actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
#notifications {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  display: grid;
  gap: 8px;
  max-width: min(440px, 90vw);
}
.toast {
  background: #fff;
  border: 1px solid #e0e3ee;
  box-shadow: 0 8px 35px #24304820;
  padding: 15px 19px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.6;
}
.toast.error {
  border-color: #ecc8ce;
  color: #af4d59;
}
.collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}
.collapsed .sidebar {
  padding: 24px 11px;
}
.collapsed .sidebar .label,
.collapsed .sidebar .section-content,
.collapsed .sidebar .section-title,
.collapsed .files,
.collapsed .sidebar-footer {
  display: none;
}
.collapsed .sidebar .nav {
  justify-content: center;
}
.chat-channel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
}
.chat-channel .agent-header {
  padding-bottom: 22px;
}
.loading {
  padding: 50px;
  color: #969daa;
}
.connection-tools {
  font-size: 11px;
  color: #8d95a5;
  margin-top: 6px;
}
.section-gap {
  margin-top: 25px;
}
@media (max-width: 1000px) {
  .agent-layout {
    grid-template-columns: 1fr;
  }
  .context {
    display: none;
  }
  .content {
    padding: 30px;
  }
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .topbar .brand {
    width: auto;
  }
  .top-user small {
    display: none;
  }
}
@media (max-width: 700px) {
  .shell {
    grid-template-columns: 65px minmax(0, 1fr);
    grid-template-rows: 62px minmax(0, 1fr);
  }
  .sidebar {
    padding: 20px 8px;
  }
  .sidebar .label,
  .sidebar .section-content,
  .sidebar .section-title,
  .files,
  .sidebar-footer {
    display: none;
  }
  .sidebar .nav {
    justify-content: center;
  }
  .topbar {
    padding: 0 12px;
  }
  .topbar .brand {
    font-size: 0;
    gap: 0;
  }
  .top-tabs button {
    padding: 7px 12px;
  }
  .top-tabs {
    position: static;
    transform: none;
  }
  .top-user .icon-button,
  .top-user small {
    display: none;
  }
  .content {
    padding: 24px 20px;
  }
  .dashboard-hero {
    padding: 22px;
    display: block;
  }
  .dashboard-hero .primary {
    margin-top: 20px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 14px;
  }
  .agent-header {
    padding: 20px;
  }
  .messages {
    padding: 22px 18px;
  }
  .composer {
    margin: 0 15px 15px;
  }
  .agent-panel {
    padding: 22px 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .connection-row {
    display: block;
  }
  .connection-row .spread {
    justify-content: flex-start;
    margin-top: 12px;
  }
  h1 {
    font-size: 24px;
  }
}
