:root {
  --bg: #f7f3f0;
  --surface: #ffffff;
  --ink: #231a1a;
  --ink-soft: #7a6a66;
  --line: #e8ded8;
  --brand: #9c1f3d;
  --brand-dark: #7d1730;
  --brand-soft: #fbeef1;
  --brand-glow: 156, 31, 61;      /* rgb акцента для теней и подсветки фокуса */
  --grad-a: #3d0f1c;              /* шапка и билет: тёмный край градиента */
  --grad-b: #7d1730;
  --grad-c: #a82445;              /* светлый край */
  --ok: #15803d;
  --ok-soft: #eaf6ee;
  --warn: #b45309;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(35, 26, 26, .05), 0 8px 24px rgba(35, 26, 26, .06);
  --shadow-lift: 0 2px 4px rgba(35, 26, 26, .06), 0 14px 34px rgba(var(--brand-glow), .16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px 64px; }
.wrap-wide { max-width: 1180px; }

/* ---------------------------------------------------------------- шапка */

.topbar {
  background: linear-gradient(135deg, var(--grad-a) 0%, var(--grad-b) 55%, var(--grad-c) 100%);
  color: #fff;
  padding: 22px 0 26px;
  margin-bottom: 24px;
}
.topbar .wrap { padding-bottom: 0; }
.topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -.2px; margin: 0; }
.topbar-sub { margin: 4px 0 0; opacity: .75; font-size: 14px; }
.topbar a { color: #fff; }

.admin-nav {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.admin-nav a {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: background .15s ease;
}
.admin-nav a:hover { background: rgba(255,255,255,.26); text-decoration: none; }
.admin-nav a.active { background: #fff; color: var(--brand-dark); border-color: #fff; }

/* --------------------------------------------------------------- блоки */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-tight { padding: 14px 16px; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.4px; margin: 0 0 8px; }
h2 { font-size: 19px; margin: 0 0 12px; letter-spacing: -.2px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.mono { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- афиша событий */

.poster-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.event-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease;
}
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); text-decoration: none; }
.event-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #f0eae6; }
.event-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.event-card .title { font-weight: 650; color: var(--ink); font-size: 17px; line-height: 1.3; }
.event-card .dates { font-size: 14px; color: var(--ink-soft); }

.hero { display: flex; gap: 20px; align-items: flex-start; }
.hero img { width: 200px; border-radius: 12px; flex: none; box-shadow: var(--shadow); }
@media (max-width: 560px) {
  .hero { flex-direction: column; }
  .hero img { width: 100%; max-width: 320px; align-self: center; }
}

/* --------------------------------------------------------------- слоты */

.day-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; }
.day-tab {
  flex: none; min-width: 92px; text-align: center;
  padding: 10px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-weight: 600; font-size: 15px;
  transition: all .15s ease;
}
.day-tab span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.day-tab:hover { border-color: var(--brand); text-decoration: none; }
.day-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-lift); }
.day-tab.active span { color: rgba(255,255,255,.8); }

.slot-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.slot {
  display: block; text-align: center; padding: 12px 6px 10px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-weight: 650; font-size: 16px;
  font-variant-numeric: tabular-nums;
  transition: all .13s ease;
}
.slot small { display: block; font-size: 11px; font-weight: 500; color: var(--ok); margin-top: 2px; }
.slot:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; transform: translateY(-1px); }
.slot.full { background: #f1ece9; color: #b5a9a4; border-color: transparent; cursor: not-allowed; pointer-events: none; }
.slot.full small { color: #b5a9a4; }

/* --------------------------------------------------------------- формы */

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=tel], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 12px 14px; font-size: 16px; font-family: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; outline: none;
  transition: border-color .13s ease, box-shadow .13s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-glow), .12);
}
textarea { min-height: 96px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 150px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 12px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font: inherit; font-weight: 650; font-size: 16px;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 2px rgba(22,20,28,.08), 0 6px 16px rgba(var(--brand-glow), .24);
  transition: background .14s ease, transform .1s ease, box-shadow .14s ease;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(22,20,28,.12); }
.btn-block { width: 100%; }
.btn-ghost {
  background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow);
}
.btn-ghost:hover { background: #fbf8f6; color: var(--ink); border-color: #ddd2cc; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
/* Отмена нейтральна, пока на неё не навели: иначе сливается с бордовым акцентом */
.btn-danger { background: #fff; color: var(--ink-soft); border-color: var(--line); box-shadow: none; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #eec9c9; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }

/* ------------------------------------------------------------- статусы */

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 15px; }
.alert-error { background: var(--danger-soft); color: #8a1f1d; border: 1px solid #f3c9c6; }
.alert-ok { background: var(--ok-soft); color: #15803d; border: 1px solid #bfe8cf; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #ddd0ff; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 650; background: var(--brand-soft); color: var(--brand-dark);
}
.badge-ok { background: var(--ok-soft); color: #15803d; }
.badge-off { background: #f1ece9; color: var(--ink-soft); }
.badge-danger { background: #f1ece9; color: #8a7a75; }

.ticket {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  color: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-lift);
}
.ticket .when { font-size: 30px; font-weight: 700; letter-spacing: -.6px; margin: 6px 0 2px; }
.ticket .who { opacity: .82; }
.ticket hr { border: none; border-top: 1px dashed rgba(255,255,255,.3); margin: 16px 0; }

/* -------------------------------------------------------------- таблицы */

.table-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); font-weight: 700; }
tbody tr:hover { background: #fbf8f6; }
tr.slot-row td { background: #f9f4f1; font-weight: 650; }
td.wrap-cell { white-space: normal; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat {
  flex: 1 1 130px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 26px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-soft); }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-soft); }

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  .card { padding: 16px; border-radius: 14px; }
  .wrap { padding: 0 12px 48px; }
  .slot-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
  .table-scroll { margin: 0 -16px; padding: 0 16px; }
}
