/* Полноэкранная публичная страница «График свободных мест»
 * (repost.team/schedule). Компактная: 13 площадок влезают на 1 экран. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a;
  background: #f4f7fb;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

/* ── Единое публичное меню/подвал (копия public_nav.NAV_CSS) ──
   При изменениях правьте синхронно app/sections/lk/public_nav.py. */
.pnav {
  background: #4779af; position: sticky; top: 0; z-index: 30;
  box-shadow: 0 2px 12px rgba(2, 6, 23, 0.16);
}
.pnav__inner {
  max-width: 1040px; margin: 0 auto; padding: 11px 16px;
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.pnav__btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  background: #fff; color: #1c5a9e;
  border: 1.5px solid transparent; border-radius: 10px; padding: 10px 18px;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.15);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.pnav__btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(2, 6, 23, 0.22); }
.pnav__btn--active {
  background: transparent; color: #fff; cursor: default;
  border-color: rgba(255, 255, 255, 0.6); box-shadow: none;
}
.pnav__btn--active:hover { transform: none; box-shadow: none; }
.pfoot { background: #4779af; padding: 18px; margin-top: 30px; }
.pfoot__inner { max-width: 980px; margin: 0 auto; padding: 0 18px; }
.pfoot__text { color: #e8f0f8; font-size: 13px; line-height: 1.6; margin-bottom: 14px; word-wrap: break-word; }
.pfoot__text a { color: #fff; text-decoration: underline; }
.pfoot__text a:hover { text-decoration: none; }
.pfoot__text > :first-child { margin-top: 0; }
.pfoot__text > :last-child { margin-bottom: 0; }
.pfoot__brand { text-align: center; }
.pfoot__logo { height: 24px; width: auto; opacity: 0.95; vertical-align: middle; }
.pfoot a:hover .pfoot__logo { opacity: 1; }
@media (max-width: 520px) {
  .pnav__inner { gap: 7px; padding: 9px 10px; }
  .pnav__btn { padding: 9px 12px; font-size: 12.5px; }
}

/* ── Топбар ── */
.aps-topbar {
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 12px rgba(2, 6, 23, 0.16);
}
.aps-topbar__inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.aps-back {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  opacity: 0.9;
  white-space: nowrap;
}
.aps-back:hover { opacity: 1; }
.aps-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  flex: 1;
  text-align: center;
}
.aps-order {
  background: #fff;
  color: #1e3a8a;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  border-radius: 9px;
  padding: 7px 15px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.2);
}
.aps-order:hover { transform: translateY(-1px); }

/* ── Основной контейнер ── */
.aps-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 18px 28px;
}
.aps-loading, .aps-error, .aps-empty {
  text-align: center;
  color: #64748b;
  padding: 40px 16px;
  font-size: 15px;
}
.aps-error { color: #b91c1c; }

/* ── Навигация по дням ── */
.aps-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.aps-week-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  border-radius: 9px;
  font-size: 18px;
  line-height: 1;
  color: #1e3a8a;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.aps-week-btn:hover:not(:disabled) { background: #eff6ff; border-color: rgba(37, 99, 235, 0.4); }
.aps-week-btn:disabled { opacity: 0.35; cursor: default; }
.aps-days {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.aps-day {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 6px 0;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: #fff;
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.aps-day:hover { border-color: rgba(37, 99, 235, 0.45); }
.aps-day.is-active {
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 5px 14px rgba(30, 58, 138, 0.26);
}
.aps-day__dow { font-size: 12px; text-transform: lowercase; opacity: 0.75; }
.aps-day__num { font-size: 16px; font-weight: 700; }

/* ── Заголовок выбранной даты ── */
.aps-date {
  font-size: 17px;
  font-weight: 800;
  margin: 2px 0 10px;
  text-transform: capitalize;
}

/* ── Список групп (компактные однострочные ряды) ── */
.aps-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aps-row {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.aps-row.is-busy { background: #fafbfc; }
.aps-row__head {
  flex: 0 0 auto;
  width: 46%;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.aps-row__name {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.aps-row__name { border-bottom: 1px dashed rgba(37, 99, 235, 0.45); }
a.aps-row__name:hover { border-bottom-style: solid; }

.aps-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 4px;
  white-space: nowrap;
}
.aps-badge--text { padding: 3px 9px; border-radius: 999px; }
.aps-badge__img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; display: block; }
.aps-badge--vk { color: #2787f5; }
.aps-badge--tg { color: #229ed9; }
.aps-badge--ok { color: #ee8208; }
.aps-badge--max { color: #6d28d9; }

.aps-row__slots {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}
.aps-slot {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 7px;
  padding: 3px 9px;
  white-space: nowrap;
}
.aps-row__busy {
  flex: 1;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

/* ── Подвал-пояснение ── */
.aps-foot {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.5;
  color: #94a3b8;
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Мобильная вёрстка ── */
@media (max-width: 640px) {
  .aps-topbar__inner { padding: 9px 12px; gap: 8px; }
  .aps-title { font-size: 15px; }
  .aps-back { font-size: 12px; }
  .aps-order { padding: 6px 12px; font-size: 12px; }
  .aps-main { padding: 12px 12px 32px; }
  .aps-nav { gap: 5px; }
  .aps-week-btn { width: 30px; height: 30px; font-size: 16px; }
  .aps-days { gap: 4px; }
  .aps-day { flex-direction: column; gap: 1px; padding: 5px 0; border-radius: 8px; }
  .aps-day__num { font-size: 15px; }
  .aps-date { font-size: 16px; }
  /* На узких экранах ряд переносит слоты под название. */
  .aps-row { flex-direction: column; align-items: stretch; gap: 6px; padding: 9px 11px; }
  .aps-row__head { width: auto; max-width: none; }
  .aps-row__name { white-space: normal; }
}
