:root {
  --bg: #f6f3ee;
  --card: #fffaf4;
  --text: #1e1b18;
  --muted: #786f65;
  --border: #e6ddd0;
  --accent: #111111;
  --soft: #eee4d8;
  --danger: #b42318;
  --success: #067647;
}

* { 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);
}
a { color: inherit; }
.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 54px clamp(18px, 5vw, 72px);
  background: linear-gradient(135deg, #fff7ec, #eadbc8);
  border-bottom: 1px solid var(--border);
}
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: var(--muted); font-weight: 800; }
h1 { font-size: clamp(32px, 6vw, 64px); line-height: .95; margin: 0; max-width: 780px; }
.subtitle { max-width: 600px; color: var(--muted); font-size: 18px; }
.container { width: min(1180px, calc(100% - 32px)); margin: 28px auto 80px; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.panel, .contact-card, .toolbar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(56, 42, 24, .06);
}
.panel { padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel h2 { margin: 0; font-size: 18px; }
.panel-head span { background: var(--soft); border-radius: 999px; padding: 6px 10px; font-weight: 800; }
.mini-card { padding: 14px; margin-top: 12px; border-radius: 16px; background: #fff; border: 1px solid var(--border); }
.mini-card p { margin: 5px 0 0; color: var(--muted); }
.toolbar { padding: 14px; margin-bottom: 20px; }
.search-form { display: grid; grid-template-columns: 1fr 220px auto; gap: 10px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 12px 13px;
  font: inherit;
  outline: none;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #1e1b18; }
button { cursor: pointer; border: 0; font-weight: 800; border-radius: 999px; padding: 12px 18px; }
.primary { background: var(--accent); color: white; }
.secondary { background: var(--soft); color: var(--text); }
.ghost { background: transparent; border: 1px solid var(--border); }
.danger { color: white; background: var(--danger); }
.small { padding: 8px 12px; font-size: 13px; }
.full { width: 100%; margin-top: 8px; }
.contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.contact-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.contact-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
h3 { margin: 0; font-size: 22px; }
.contact-top p { margin: 5px 0 0; color: var(--muted); }
.badge { white-space: nowrap; background: var(--soft); border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 800; }
.details { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.details a, .details span { border: 1px solid var(--border); border-radius: 999px; padding: 7px 10px; text-decoration: none; background: #fff; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meta-grid p { margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 10px; font-size: 14px; color: var(--muted); }
.meta-grid strong { color: var(--text); }
.notes p { margin: 9px 0; color: var(--muted); }
.notes strong { color: var(--text); }
.interactions { border-top: 1px solid var(--border); padding-top: 12px; }
.interactions summary { cursor: pointer; font-weight: 800; }
.interaction-form { display: grid; gap: 9px; margin: 12px 0; }
.timeline-item { padding: 12px; border-left: 3px solid var(--accent); background: #fff; border-radius: 12px; margin-top: 10px; }
.timeline-item p { margin: 6px 0; color: var(--muted); }
.empty { color: var(--muted); }
.empty.big { grid-column: 1 / -1; text-align: center; padding: 40px; background: var(--card); border: 1px dashed var(--border); border-radius: 22px; }
.alert { padding: 14px 16px; border-radius: 16px; margin-bottom: 18px; font-weight: 700; }
.alert.success { background: #dcfae6; color: var(--success); }
.alert.error { background: #fee4e2; color: var(--danger); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.46); display: none; align-items: center; justify-content: center; padding: 18px; z-index: 10; }
.modal.open { display: flex; }
.modal-card { background: var(--card); width: min(900px, 100%); max-height: 92vh; overflow: auto; border-radius: 24px; padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.icon { background: var(--soft); font-size: 28px; width: 44px; height: 44px; padding: 0; }
.contact-form { display: grid; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { font-weight: 750; font-size: 14px; display: grid; gap: 6px; }
@media (max-width: 800px) {
  .hero { flex-direction: column; align-items: stretch; }
  .grid.two, .search-form, .form-grid { grid-template-columns: 1fr; }
  .contacts { grid-template-columns: 1fr; }
}
