* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #17202a;
  background: #f5f7fb;
  font-family: Arial, sans-serif;
}

a {
  color: #1f5eff;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #d9e0ec;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 24px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.container {
  margin: 0 auto;
  max-width: 1040px;
  padding: 24px;
}

.panel,
.card,
.message {
  background: #ffffff;
  border: 1px solid #d9e0ec;
  border-radius: 8px;
  padding: 16px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
textarea,
button {
  border: 1px solid #bdc7d8;
  border-radius: 6px;
  font: inherit;
  padding: 10px 12px;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

button,
.button {
  background: #1f5eff;
  border-color: #1f5eff;
  color: #ffffff;
  cursor: pointer;
  display: inline-block;
  font-weight: 700;
}

.button.secondary,
button.secondary {
  background: #ffffff;
  color: #1f5eff;
}

.muted {
  color: #697589;
}

.row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.message.customer {
  border-left: 4px solid #1f5eff;
}

.message.ai {
  border-left: 4px solid #2f9e44;
}

.message.staff {
  border-left: 4px solid #d97706;
}

.message.system {
  border-left: 4px solid #697589;
}

table {
  border-collapse: collapse;
  width: 100%;
}

td,
th {
  border-bottom: 1px solid #d9e0ec;
  padding: 10px;
  text-align: left;
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
