:root {
  color-scheme: light;
  --bg: #f4f0ea;
  --panel: #fffdf9;
  --panel-border: #dfd6cb;
  --text: #1f1a17;
  --muted: #76685d;
  --accent: #7a4d2b;
  --accent-dark: #5f3a1f;
  --success: #1f7a4d;
  --danger: #a33a2a;
  --shadow: 0 18px 40px rgba(63, 34, 14, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #efe5d8 0%, var(--bg) 220px);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 28px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 34px;
}

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

.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.panel {
  padding: 22px;
}

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

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8b9aa;
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
}

button[type="submit"] {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

button[type="submit"]:hover {
  background: var(--accent-dark);
}

.secondary-button,
.ghost-button {
  background: transparent;
  border: 1px solid #ccb8a5;
}

.secondary-button:hover,
.ghost-button:hover {
  background: #f6efe8;
}

.actions {
  padding-top: 6px;
}

.filter-label {
  min-width: 160px;
}

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

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

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid #eadfd3;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #efe3d6;
  color: #6b4325;
}

.status-replied {
  background: #dcf3e6;
  color: var(--success);
}

.status-closed {
  background: #ebebeb;
  color: #555;
}

.status-follow_up {
  background: #fff1cc;
  color: #8a6400;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions button {
  padding: 8px 10px;
  font-size: 13px;
}

.link-like {
  color: var(--accent);
  text-decoration: none;
}

.feedback {
  margin-bottom: 14px;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

.feedback-success {
  background: #e3f4ea;
  color: #155435;
}

.feedback-error {
  background: #fae6e3;
  color: #7f241a;
}

.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px;
  }

  .hero {
    padding: 20px;
    flex-direction: column;
  }

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

  h1 {
    font-size: 28px;
  }
}
