* {
  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,
select,
button {
  border: 1px solid #bdc7d8;
  border-radius: 6px;
  font: inherit;
  padding: 10px 12px;
}

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

pre {
  background: #f5f7fb;
  border: 1px solid #d9e0ec;
  border-radius: 6px;
  overflow-x: auto;
  padding: 10px;
  white-space: pre-wrap;
}

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;
}

button.danger,
.button.danger {
  background: #b42318;
  border-color: #b42318;
  color: #ffffff;
}

.muted {
  color: #697589;
}

.danger-text {
  color: #b42318;
  font-weight: 700;
}

.masked-key {
  user-select: none;
}

.compact {
  gap: 6px;
}

.narrow {
  max-width: 460px;
}

.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%;
}

.sms-shell {
  display: grid;
  min-height: 70vh;
  place-items: center;
}

.sms-login {
  background: #ffffff;
  border: 1px solid #d9e0ec;
  border-radius: 8px;
  max-width: 420px;
  padding: 22px;
  width: 100%;
}

.sms-top {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sms-list {
  display: grid;
  gap: 10px;
}

.sms-thread {
  background: #ffffff;
  border: 1px solid #d9e0ec;
  border-radius: 8px;
  color: #17202a;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.sms-chat {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.sms-bubble {
  border-radius: 8px;
  max-width: 78%;
  padding: 12px;
}

.sms-bubble.customer {
  background: #ffffff;
  border: 1px solid #d9e0ec;
  justify-self: start;
}

.sms-bubble.ai,
.sms-bubble.staff {
  background: #e8f1ff;
  border: 1px solid #b8cdf8;
  justify-self: end;
}

.sms-bubble.system {
  background: #f5f7fb;
  border: 1px solid #d9e0ec;
  justify-self: center;
}

.sms-composer {
  background: #ffffff;
  border: 1px solid #d9e0ec;
  border-radius: 8px;
  bottom: 0;
  display: grid;
  gap: 12px;
  padding: 12px;
  position: sticky;
}

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

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