:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e3e6ea;
  --text: #1c2330;
  --muted: #6b7484;
  --accent: #3b6fe0;
  --accent-dark: #2f5bbf;
  --danger: #d64545;
  --ok: #2e9e5b;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }

/* Шапка */
.topbar { background: var(--card); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; }
.nav .user { color: var(--muted); font-size: 14px; }

main.wrap { padding-top: 24px; padding-bottom: 48px; }

/* Кнопки и формы */
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 15px; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: #f0f2f5; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-outline { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.linkbtn { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 14px; text-decoration: underline; }
.linkbtn.danger { color: var(--danger); }

label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; margin-top: 4px; color: var(--text); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { resize: vertical; }
small { color: var(--muted); }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.inline { display: inline; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; margin: 0; }

/* Карточки и сетка */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.list-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); }
.list-card:hover { border-color: var(--accent); }

/* Алерты */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fdecec; color: #a33; border: 1px solid #f5c6c6; }
.alert-ok { background: #eaf7ef; color: #1d7a41; border: 1px solid #bfe6cc; }

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

/* Герой на главной */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: 28px; margin-bottom: 12px; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 20px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.feature h3 { margin: 0 0 8px; font-size: 16px; }
.feature p { color: var(--muted); margin: 0; font-size: 14px; }

/* Позиции списка */
.items { margin-top: 18px; }
.item { display: flex; flex-direction: column; overflow: hidden; }
.item.reserved { opacity: 0.55; }
.item-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; }
.item-body { padding-top: 10px; }
.item-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-title h3 { margin: 0; font-size: 17px; }
.price { font-weight: 700; font-size: 16px; color: var(--accent); margin: 4px 0; }
.item-link { color: var(--accent); text-decoration: none; font-size: 14px; }
.item-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.reserve-form { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.reserve-form .email-input { flex: 1; min-width: 180px; margin: 0; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-reserved { background: #eef2fb; color: var(--accent); }

.list-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.list-actions { display: flex; gap: 8px; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; }

/* Уведомления */
.notifications { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.notif-head { display: flex; justify-content: space-between; align-items: center; }
.notifications ul { list-style: none; margin: 8px 0 0; padding: 0; }
.notifications li { padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; }
.notifications li.unread { font-weight: 600; }

/* Друзья */
.friend-list { list-style: none; padding: 0; margin: 0; }
.friend-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }

/* Таблицы */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
.row-actions { display: flex; gap: 10px; white-space: nowrap; }

/* Футер */
.footer { padding: 20px 16px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 32px; }

.auth-card { max-width: 460px; margin: 20px auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.auth-card h1 { margin-top: 0; font-size: 22px; }

@media (max-width: 480px) {
  .topbar-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 6px; }
  .nav { gap: 10px; }
  .hero h1 { font-size: 24px; }
}
