:root {
  --cream: #F2EFE8;
  --cream-2: #FAF8F4;
  --white: #FFFFFF;
  --ink: #1B1F2E;
  --cream-text: #F5F3EC;
  --muted: #6E6A60;
  --muted-2: #8B8578;
  --muted-on-dark: #9096AC;
  --border: #E3DED2;
  --border-2: #DCD1C2;
  --accent: #9FB0D9;
  --danger: #E2725B;
  --danger-ink: #2A1712;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "PT Sans", -apple-system, "Segoe UI", sans-serif; }
a { color: var(--ink); }
a:hover { color: #3A4160; }

/* ---------- Публичная страница ---------- */
.page {
  background: var(--cream);
  min-height: 100vh;
  color: var(--ink);
  padding: clamp(40px, 7vw, 72px) clamp(16px, 5vw, 24px) 96px;
}
.container { max-width: 980px; margin: 0 auto; }
header { text-align: left; margin-bottom: 56px; }
header h1 {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.16;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
header p { font-size: 16px; color: var(--muted); max-width: 560px; margin: 0; line-height: 1.5; }
.cards { display: flex; flex-direction: column; gap: 100px; }
.card {
  display: flex;
  background: var(--ink);
  border-radius: 28px 84px 28px 28px;
  overflow: hidden;
  box-shadow: 0 24px 48px -20px rgba(27,31,46,0.32);
}
.card-left { flex: 0 0 587px; min-width: 0; padding: 44px; }
.card-right {
  flex: 0 0 393px;
  min-width: 0;
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(255,255,255,0.14);
}
@media (max-width: 900px) {
  .card { border-radius: 24px 56px 24px 24px; flex-direction: column; }
  .card-left, .card-right { flex: 1 1 auto; padding: 34px 30px; }
  .card-right { border-left: none; border-top: 1px solid rgba(255,255,255,0.14); }
}
@media (max-width: 480px) {
  .page { padding-bottom: 64px; }
  header { margin-bottom: 40px; }
  .cards { gap: 72px; }
  .card-left, .card-right { padding: 26px 22px; }
  .card-title { font-size: 20px; }
  .stat-number { font-size: 28px; }
  .date-badge { font-size: 12px; padding: 6px 14px; }
  .modal-card { padding: 32px 24px; }
  .header-break { display: none; }
  .empty-state { padding: 48px 26px; border-radius: 24px 56px 24px 24px; }
  .empty-state h2 { font-size: 19px; }
}
.date-badge {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 12.5px;
  font-weight: 600;
  color: #C7CCDC;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}
.card-title {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 23px;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--cream-text);
  margin: 0 0 26px;
}
.stat-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.stat-label { font-size: 13px; color: var(--muted-on-dark); font-weight: 600; }
.stat-number {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  color: var(--accent);
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  color: #8991A6;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
}
.description { font-size: 14.5px; line-height: 1.6; color: var(--muted-on-dark); margin: 0 0 24px; max-width: 46ch; }
.meta-list { display: flex; flex-direction: column; gap: 12px; }
.meta-row { display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px; line-height: 1.5; color: var(--muted-on-dark); }
.meta-icon { flex: 0 0 auto; margin-top: 1px; }
.meta-value { color: #D8DBE6; font-weight: 600; }
.invite-text { font-size: 14px; line-height: 1.55; color: var(--muted-on-dark); margin: 0 0 20px; }

.field { display: block; margin-bottom: 14px; }
.field span {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #B7BCCC;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.card-right .field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--cream-text);
  background: rgba(255,255,255,0.06);
  outline: none;
  transition: border-color 0.15s ease;
}
.card-right .field input::placeholder { color: #7C82A0; }
.card-right .field input:focus { border-color: var(--accent); }

.consent { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 16px; }
.consent-item { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.consent-item input[type="checkbox"] { flex: 0 0 auto; width: 15px; height: 15px; margin: 1px 0 0; cursor: pointer; accent-color: var(--accent); }
.consent-item span { font-size: 12px; line-height: 1.45; color: #7C82A0; }
.consent a { text-decoration: underline; text-underline-offset: 2px; color: var(--accent); }
.consent a:hover { opacity: 0.85; }

.btn-primary {
  width: 100%;
  margin-top: 6px;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: var(--cream-text);
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(0.94); }
.btn-primary:active { filter: brightness(0.88); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.sold-out { text-align: center; color: var(--muted-on-dark); }
.sold-out svg { margin-bottom: 14px; color: #8991A6; }
.sold-out-title { font-weight: 700; font-size: 16px; color: var(--cream-text); margin: 0 0 8px; }
.sold-out-sub { font-size: 13.5px; line-height: 1.5; margin: 0; }

.empty-state {
  background: var(--ink);
  border-radius: 28px 84px 28px 28px;
  padding: 72px 40px;
  text-align: center;
  box-shadow: 0 24px 48px -20px rgba(27,31,46,0.32);
}
.empty-state svg { margin-bottom: 22px; }
.empty-state h2 { font-family: "Manrope", sans-serif; font-weight: 700; font-size: 22px; color: var(--cream-text); margin: 0 0 12px; }
.empty-state p { font-size: 14px; line-height: 1.6; color: var(--muted-on-dark); max-width: 440px; margin: 0 auto; }

footer {
  max-width: 980px;
  margin: 72px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 640px) {
  footer { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
}
.copyright { font-size: 13px; color: var(--muted-2); margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { font-size: 13px; color: var(--muted-2); text-decoration: underline; text-underline-offset: 2px; }
.footer-links a:hover { color: var(--ink); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,22,32,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: #262c41;
  border-radius: 24px 72px 24px 24px;
  padding: 40px 36px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,0.4);
}
.modal-card h3 { font-family: "Manrope", sans-serif; font-size: 20px; color: var(--cream-text); margin: 18px 0 10px; }
.modal-card p { font-size: 14.5px; line-height: 1.55; color: var(--muted-on-dark); margin: 0 0 26px; }
.modal-card button {
  padding: 12px 30px; border: none; border-radius: 999px; background: var(--cream-text); color: #262c41;
  font-family: inherit; font-size: 14px; font-weight: 700; text-transform: uppercase; cursor: pointer;
}
.modal-card button:hover { filter: brightness(0.94); }

.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  max-width: 900px;
  width: calc(100% - 48px);
  display: flex;
  align-items: center;
  gap: 28px;
  background: #262c41;
  border-radius: 20px 48px 20px 20px;
  padding: 22px 30px;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,0.4);
  z-index: 90;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { font-size: 10px; line-height: 1.55; color: #C7CCDC; margin: 0; flex: 1 1 auto; }
.cookie-banner button {
  flex: 0 0 auto; white-space: nowrap; padding: 12px 30px; border: none; border-radius: 999px;
  background: var(--cream-text); color: #262c41; font-family: inherit; font-size: 13.5px; font-weight: 700;
  text-transform: uppercase; cursor: pointer;
}
@media (max-width: 700px) {
  .cookie-banner { flex-direction: column; align-items: stretch; bottom: 20px; width: calc(100% - 32px); padding: 22px 20px 20px; gap: 18px; }
  .cookie-banner button { width: 100%; }
}

/* ---------- Админка ---------- */
.admin { min-height: 100vh; background: var(--cream); color: var(--ink); }
.content { max-width: 900px; margin: 0 auto; padding: 56px 24px 64px; }
.content-header { margin-bottom: 28px; }
.content-header-main { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.content-header-sub { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 10px; }
.content-header h1 { font-family: "Manrope", sans-serif; font-size: 25px; margin: 0; }
.content-header p { font-size: 13.5px; color: var(--muted); max-width: 440px; margin: 0; line-height: 1.5; }
.admin-session { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-user { font-size: 13px; color: var(--muted); }
.btn-logout {
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink);
  background: none; border: none; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.btn-logout:hover { color: #3A4160; }
.btn-add {
  flex: 0 0 auto; white-space: nowrap; padding: 13px 22px; border: none; border-radius: 999px;
  background: var(--ink); color: var(--cream-text); font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.btn-add:hover { filter: brightness(1.15); }

.table-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; overflow-x: auto; }
.table-row {
  display: grid; grid-template-columns: 1.4fr 0.8fr 0.5fr 0.6fr 1.4fr 84px; gap: 16px; align-items: center;
  padding: 16px 22px; border-bottom: 1px solid #EFEAE0; font-size: 13.5px; min-width: 740px;
}
.table-row:last-child { border-bottom: none; }
.table-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-2); background: var(--cream-2); }
.cell-title { font-weight: 700; }
.cell-muted { color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--white);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); padding: 0;
}
.icon-btn:hover { background: var(--cream); }
.table-empty { padding: 44px; text-align: center; color: var(--muted-2); font-size: 14px; }

.modal-overlay-admin {
  position: fixed; inset: 0; background: rgba(20,22,32,0.5);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 200;
}
.modal-overlay-admin[hidden] { display: none; }

.event-modal-card {
  background: var(--white); border-radius: 24px 64px 24px 24px; padding: 36px 34px 30px;
  max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 60px -16px rgba(0,0,0,0.4);
}
.event-modal-card h2 { font-family: "Manrope", sans-serif; font-size: 20px; margin: 0 0 22px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-bottom: 22px; }
.field-full { grid-column: 1 / -1; }
.event-modal-card input, .event-modal-card textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-2); border-radius: 10px; font-size: 14.5px;
  font-family: inherit; color: var(--ink); background: var(--cream-2); outline: none;
}
.event-modal-card textarea { resize: vertical; min-height: 76px; }
.event-modal-card input:focus, .event-modal-card textarea:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 12px; margin-top: 22px; }
.btn-secondary {
  flex: 1 1 auto; padding: 13px 18px; border: 1px solid var(--border-2); border-radius: 999px; background: var(--white);
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-secondary:hover { background: var(--cream); }
.btn-primary-admin {
  flex: 1 1 auto; padding: 13px 18px; border: none; border-radius: 999px; background: var(--ink); color: var(--cream-text);
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-primary-admin:hover { filter: brightness(1.15); }

.confirm-card {
  background: var(--ink); border-radius: 24px 64px 24px 24px; padding: 34px 30px; max-width: 360px; width: 100%;
  text-align: center; box-shadow: 0 24px 60px -16px rgba(0,0,0,0.4);
}
.confirm-card h3 { font-family: "Manrope", sans-serif; font-size: 18px; color: var(--cream-text); margin: 0 0 10px; }
.confirm-card p { font-size: 13.5px; line-height: 1.55; color: var(--muted-on-dark); margin: 0 0 22px; }
.confirm-actions { display: flex; gap: 12px; }
.btn-ghost {
  flex: 1 1 auto; padding: 12px 16px; border: 1px solid rgba(255,255,255,0.22); border-radius: 999px; background: transparent;
  color: var(--cream-text); font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-danger {
  flex: 1 1 auto; padding: 12px 16px; border: none; border-radius: 999px; background: var(--danger); color: var(--danger-ink);
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.btn-danger:hover { filter: brightness(1.08); }
@media (max-width: 640px) { .content { padding: 32px 16px 48px; } }
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; } }

/* ---------- Вход ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--cream); color: var(--ink); padding: 24px; }
.auth-card { background: var(--white); border: 1px solid var(--border); border-radius: 24px 64px 24px 24px; padding: 40px 36px; max-width: 400px; width: 100%; box-shadow: 0 24px 48px -20px rgba(27,31,46,0.2); }
.auth-card h1 { font-family: "Manrope", sans-serif; font-size: 21px; margin: 0 0 8px; }
.auth-sub { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 0 0 26px; }
.auth-error { font-size: 13px; color: var(--danger); background: rgba(226,114,91,0.12); border: 1px solid rgba(226,114,91,0.3); border-radius: 10px; padding: 10px 14px; margin: 0 0 18px; }
.auth-card .field input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: 10px; font-size: 14.5px;
  font-family: inherit; color: var(--ink); background: var(--cream-2); outline: none;
}
.auth-card .field input:focus { border-color: var(--accent); }
.password-field-wrap { position: relative; margin-bottom: 16px; }
.password-field-wrap input { padding-right: 42px; }
.password-toggle {
  position: absolute; right: 6px; top: 30px; width: 30px; height: 30px; border: none; background: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted-2); cursor: pointer; padding: 0;
}
.password-toggle:hover { color: var(--ink); }
.password-toggle svg[hidden] { display: none; }
.btn-auth {
  width: 100%; margin-top: 10px; padding: 14px 20px; border: none; border-radius: 999px; background: var(--ink);
  color: var(--cream-text); font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: 0.01em;
  text-transform: uppercase; cursor: pointer;
}
.btn-auth:hover { filter: brightness(1.15); }
