:root {
  --accent: #cea36d;
  --dark: #222429;
  --light: #f7f7f7;
  --muted: #7a8087;
  --line: #e7e7e7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Rubik", sans-serif;
  color: var(--dark);
  background: linear-gradient(140deg, #f6f8fa 0%, #eef2f6 65%, #ebedf0 100%);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px 1fr;
}

.sidebar {
  background: radial-gradient(circle at top, #2d3036 0%, #1f2228 60%, #17191e 100%);
  color: #fff;
  padding: 28px 18px;
  border-right: 1px solid #323640;
}

.sidebar-header h1 {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 30px;
}

.sidebar-header p {
  margin-top: 6px;
  color: #b9bec6;
}

.bot-nav {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-btn {
  border: 1px solid #3b414c;
  background: #252932;
  color: #f2f4f6;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.bot-btn strong {
  display: block;
  margin-bottom: 4px;
}

.bot-btn.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(206, 163, 109, 0.4);
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #4a505c;
  color: #d6dbe2;
}

.badge.live {
  color: #182014;
  border-color: #8ae178;
  background: #9ef68c;
}

.main-content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.toolbar h2 {
  margin: 0;
  font-family: "Poppins", sans-serif;
}

.toolbar-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.api-label {
  min-width: 320px;
}

.api-label input {
  width: 100%;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(20, 25, 32, 0.06);
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

input,
select,
textarea {
  border: 1px solid #d8dce2;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 14px;
  font-family: inherit;
}

.grid-two {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.conversation-list {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
}

.conversation-row {
  padding: 12px;
  border-bottom: 1px solid #f2f2f2;
  cursor: pointer;
}

.conversation-row:hover {
  background: #faf8f3;
}

.conversation-row.active {
  background: #f8f2e8;
}

.conversation-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.transcript-view {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px;
}

.transcript-view.empty {
  color: var(--muted);
}

.msg {
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  white-space: pre-wrap;
  line-height: 1.45;
}

.msg.user {
  background: #f3f5f8;
}

.msg.assistant {
  background: #f8f2e8;
}

.msg .meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.settings-grid {
  align-items: start;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions.wrap {
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #1e2024;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}

.btn.ghost {
  background: transparent;
  border-color: #cbd0d8;
  color: #20252b;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #20242a;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #3b4048;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #313743;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .grid-two {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .api-label {
    min-width: 100%;
  }
}
