:root {
  --bg: #fff8f4;
  --card: #ffffff;
  --text: #2b2523;
  --muted: #7a6d68;
  --accent: #b85c70;
  --accent-dark: #94465a;
  --border: #eadbd5;
  --danger: #a83232;
  --success: #2d7a4b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 5vw;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text);
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent);
}

.logout-form {
  margin: 0;
}

.container {
  width: min(900px, 90vw);
  margin: 2rem auto;
}

.hero,
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
}

.hero {
  text-align: center;
  padding: 3rem 2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2 {
  line-height: 1.2;
}

.button,
button {
  display: inline-block;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
button:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: #6f6a86;
}

button.danger {
  background: var(--danger);
  padding: 0.45rem 0.8rem;
}

.form {
  display: grid;
  gap: 0.8rem;
  max-width: 520px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  font: inherit;
}

textarea {
  resize: vertical;
}

.alert {
  color: var(--danger);
  font-weight: 700;
}

.success {
  color: var(--success);
  font-weight: 700;
}

.text-content {
  white-space: pre-wrap;
}

.stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.stats div {
  flex: 1;
  min-width: 160px;
  background: var(--bg);
  border-radius: 14px;
  padding: 1rem;
}

.stats strong {
  display: block;
  font-size: 2rem;
}

.stats span {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-wrapper {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.message {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

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

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .card {
    padding: 1.3rem;
  }
}

.large-form {
  max-width: 100%;
}

.preview-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.secondary-small {
  background: #6f6a86;
  padding: 0.45rem 0.8rem;
}

.conversation {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.chat-message {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  max-width: 75%;
}

.from-admin {
  margin-left: auto;
  background: #f3eef8;
}

.from-guest {
  margin-right: auto;
  background: var(--bg);
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0;
}

.small-button {
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .chat-message {
    max-width: 100%;
  }

  .chat-meta {
    flex-direction: column;
    gap: 0.2rem;
  }
}

.user-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.logged-user {
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 700px) {
  .user-menu {
    align-items: flex-start;
  }
}