/* Оформление «Светлая, мягкая»: белый фон, серые поля, чёрные кнопки, скруглённые углы. */
:root {
  --ink: #1d1d1f;
  --paper: #fff;
  --red: #d1242f;
  --grey: #6b6e75;
  --line: #e3e5e9;
  --line-strong: #d0d4da;
  --field: #f5f6f8;
  --radius: 10px;
  --radius-card: 12px;
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--ink); text-underline-offset: 2px; }
a:hover { color: var(--red); }
img { max-width: 100%; }

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

/* шапка */
.top { border-bottom: 1px solid var(--line); }
.top-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 8px 24px; padding-top: 16px; padding-bottom: 14px;
}
.brand { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.brand:hover { color: var(--ink); }
nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; font-size: 0.95rem; }
nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
nav a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
nav a[aria-current="page"] { border-bottom-color: var(--red); font-weight: 700; }

/* заголовки */
h1 { font-size: 2rem; line-height: 1.1; letter-spacing: -0.02em; margin: 1.5rem 0 0.6rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
h3 { font-size: 1rem; margin: 1.2rem 0 0.6rem; }
.lead { font-size: 1.1rem; max-width: 40rem; margin: 0 0 1.4rem; }
.crumb { margin: 1.2rem 0 0; font-size: 0.9rem; }
.muted { color: var(--grey); }

/* кнопки */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0.5rem 1.2rem; border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
}
button:hover, .btn:hover { background: #3a3a3d; border-color: #3a3a3d; color: var(--paper); }
button.secondary, .btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
button.secondary:hover, .btn.secondary:hover { background: var(--field); border-color: var(--ink); color: var(--ink); }
button.danger { background: var(--paper); color: var(--red); border-color: #f0b8bc; }
button.danger:hover { background: #fdecee; border-color: var(--red); color: var(--red); }
button.link {
  background: none; border: 0; padding: 0; min-height: 0; font-weight: 400; color: var(--ink);
  text-decoration: underline; text-underline-offset: 2px;
}
button.link:hover { background: none; color: var(--red); }
form.inline { display: inline; }

/* формы */
.field { margin: 0 0 1rem; max-width: 34rem; }
label { display: block; font-size: 0.85rem; font-weight: 600; color: #3d4046; margin-bottom: 0.3rem; }
input[type="text"], input[type="date"], input[type="time"], input[type="file"], select, textarea {
  font: inherit; width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--field); color: var(--ink);
}
input[type="text"], input[type="date"], input[type="time"], select { height: 42px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(29, 29, 31, 0.25); outline-offset: 1px; background: var(--paper);
}
.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; font-size: 0.95rem; }
.check input { width: auto; }
.hint { font-size: 0.85rem; color: var(--grey); margin-top: 0.3rem; }

/* строка фильтра: поля в один ряд одной высоты */
.filters { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; margin: 1rem 0 0.4rem; }
.filters .field { max-width: 14rem; }
.filter-group { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.filter-group .field { max-width: 14rem; }
.step { margin: 1.4rem 0 0.4rem; padding: 1rem 1.1rem 0.2rem; background: var(--field); border-radius: var(--radius-card); }
.step h2 { margin: 0 0 0.8rem; padding: 0; border: 0; font-size: 1rem; }
.step input, .step select { background: var(--paper); }

/* сообщения */
.notice { border: 1px solid #f0b8bc; background: #fdf3f4; border-radius: var(--radius); padding: 0.8rem 1rem; margin: 1rem 0; max-width: 40rem; }

/* карточки списка */
.items { margin: 0; padding: 0; list-style: none; }
.item {
  display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 0 1rem;
  padding: 1rem 1.1rem; margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius-card);
}
.num { font-size: 0.85rem; font-weight: 400; color: var(--grey); line-height: 1.6; }
.num::before { content: "№ "; }
.item .title { font-weight: 700; font-size: 1.1rem; }
.item p { margin: 0.2rem 0; }
.status { font-weight: 700; }
.status-new { color: var(--red); }
.status-done, .status-cancelled { color: var(--grey); }
.free-time strong { background: var(--field); border-radius: 8px; padding: 2px 8px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.7rem; }
.photo { display: block; width: 100%; max-width: 220px; aspect-ratio: 4 / 3; object-fit: cover; margin-top: 0.5rem; border-radius: 8px; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius-card); padding: 1.2rem; color: var(--grey); }

/* выбор роли */
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 12px; max-width: 40rem; }
.choice button { padding: 1.2rem 1rem; justify-content: flex-start; text-align: left; font-size: 1.05rem; }

/* код входа */
.code { font-size: 3rem; font-weight: 700; letter-spacing: 0.14em; line-height: 1; margin: 0.4rem 0 1rem; }

/* таблицы админки */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; background: var(--field); border-bottom: 1px solid var(--line-strong); padding: 0.6rem 0.8rem; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: 0.6rem 0.8rem; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td select { width: auto; height: 36px; padding: 0.3rem 0.6rem; }
td button { min-height: 36px; padding: 0.3rem 0.8rem; font-size: 0.9rem; }

/* разделы на главной */
.sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 16px; margin-top: 1.5rem; }
.sections section { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 0 1.2rem 1.2rem; }
.sections h2 { border: 0; padding-top: 0; margin-top: 1.1rem; }

/* вкладки раздела аренды */
.tabs { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 1.2rem 0 0; font-size: 0.95rem; border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
.tabs a { text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a:hover { border-bottom-color: var(--line-strong); color: var(--ink); }
.tabs a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--red); }
.photo.big { max-width: 100%; aspect-ratio: 16 / 10; margin: 0.6rem 0; border-radius: var(--radius-card); }
ul.plain { margin: 0; padding-left: 1.1rem; }

/* подвал */
.foot { margin-top: 3rem; padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid var(--line); color: var(--grey); font-size: 0.85rem; }

@media (max-width: 520px) {
  h1 { font-size: 1.7rem; }
  .item { grid-template-columns: 1fr; gap: 0.2rem; }
  .code { font-size: 2.4rem; }
  .choice button { width: 100%; }
  .filters .field, .filter-group .field { max-width: none; flex: 1 1 100%; }
  .filter-group { flex: 1 1 100%; }
}
