:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --text: #1b1b1d;
  --muted: #667085;
  --primary: #6c4b2a;
  --primary-dark: #4a321c;
  --border: #e6e8ef;
  --danger: #b42318;
  --success-bg: #ecfdf3;
  --success-text: #027a48;
  --error-bg: #fef3f2;
  --error-text: #b42318;
  --shadow: 0 20px 60px rgba(45, 32, 18, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
label { display: grid; gap: 8px; font-weight: 700; color: #2c2520; }
input, textarea, select {
  width: 100%; border: 1px solid #e4d7c6; background: #fff; color: #111827;
  border-radius: 14px; padding: 12px 13px; font: inherit; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108,75,42,.14); }
textarea { resize: vertical; min-height: 120px; }
.clean-select { background-color: #fff !important; color: #111827 !important; appearance: auto; -webkit-appearance: menulist; }
.clean-select option { background-color: #fff; color: #111827; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 800; cursor: pointer; transition: transform .2s, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #efe5d7; color: var(--primary-dark); }
.btn-danger { background: #fee4e2; color: var(--danger); }
.btn-full { width: 100%; }
.flash { padding: 14px 16px; border-radius: 16px; margin-bottom: 16px; font-weight: 700; }
.flash-success { background: var(--success-bg); color: var(--success-text); }
.flash-error { background: var(--error-bg); color: var(--error-text); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.eyebrow { color: var(--primary); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); display: grid; gap: 16px; }
.login-card h1 { text-align: center; margin: 0; }
.brand { font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; color: var(--primary); }
.brand.center { display: block; text-align: center; margin-bottom: 4px; }
.member-empty { min-height: 100vh; background: #fff; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px clamp(16px, 4vw, 44px); background: #fff; border-bottom: 1px solid #e6e8ef; }
.panel-header h1 { margin: 4px 0 0; letter-spacing: -.04em; }
.panel-layout { width: min(1280px, calc(100% - 32px)); margin: 28px auto 64px; display: grid; gap: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stat { display: grid; gap: 8px; }
.stat span { color: var(--muted); font-weight: 700; }
.stat strong { font-size: 2.2rem; line-height: 1; }
.panel-section { display: grid; gap: 18px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0f5; padding-bottom: 14px; }
.section-title h2 { margin: 0; letter-spacing: -.03em; }
.section-title span { color: var(--muted); font-weight: 700; font-size: .92rem; }
.message-list { display: grid; gap: 12px; }
.message-item { border: 1px solid #eceff5; border-radius: 18px; padding: 16px; background: #fff; }
.message-item.is-unread { border-color: #d6a45f; background: #fffaf2; }
.message-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.message-head div { display: grid; }
.message-head span, .message-head em { color: var(--muted); font-size: .92rem; }
.row-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.link-button { background: transparent; border: 0; padding: 0; cursor: pointer; color: var(--primary); font-weight: 800; }
.link-button.danger { color: var(--danger); }
.grid-form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: end; }
.grid-form label:nth-of-type(1), .grid-form label:nth-of-type(2) { grid-column: span 2; }
.grid-form label:nth-of-type(3), .grid-form label:nth-of-type(4), .grid-form label:nth-of-type(5) { grid-column: span 1; }
.users-table { display: grid; gap: 14px; }
.user-row { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr .75fr .75fr auto auto; gap: 10px; align-items: end; border: 1px solid #eceff5; border-radius: 18px; padding: 14px; background: #fff; }
.user-row label { font-size: .86rem; }
@media (max-width: 900px) {
  .stats-grid, .grid-form, .user-row { grid-template-columns: 1fr; }
  .grid-form label:nth-of-type(n) { grid-column: auto; }
  .message-head, .section-title, .panel-header { align-items: flex-start; flex-direction: column; }
}
