.app-body { min-height: 100vh; color: var(--pko-text); }
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.35rem 1rem;
  min-height: 52px;
}
.app-header .pko-header__logo { height: 36px; }
.app-header .pko-header__meta {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pko-gold-light);
  white-space: nowrap;
}
.app-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.1rem;
  margin-left: auto;
  padding: 0;
  background: transparent;
  border: 0;
  position: static;
  backdrop-filter: none;
}
.app-nav__link {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--pko-text);
}
.app-nav__link:hover,
.app-nav__link.is-active { background: var(--pko-blue-pale); color: var(--pko-gold-light); }
.app-nav__link--out {
  flex-shrink: 0;
  margin-left: 0.45rem;
  color: #0b1940;
  background: var(--pko-gold);
}
.app-nav__link--out:hover,
.app-nav__link--out.is-active {
  background: var(--pko-gold-light);
  color: #0b1940;
}
.app-main { padding: 1.25rem 1.4rem 2.5rem; max-width: 1100px; margin: 0 auto; }
.app-main--wide { max-width: 1600px; }

.login-wrap { min-height: 60vh; display: grid; place-items: center; }
.login-card { width: min(420px, 100%); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-card { text-decoration: none; color: inherit; }
.stat-card__label { font-size: 0.85rem; font-weight: 600; color: var(--pko-gold); margin: 0; }
.stat-card__value { font-size: 2.2rem; font-weight: 700; color: var(--pko-heading); margin: 0.2rem 0; }
.stat-card__hint { margin: 0; color: var(--pko-text-muted); font-size: 0.88rem; }
.dash-list { padding-left: 1.1rem; }
.dash-list strong { color: var(--pko-gold-light); }
.muted { color: var(--pko-text-muted); font-size: 0.9rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.toolbar .pko-field__input { max-width: 320px; }
.toolbar__filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.toolbar__count { margin: 0 0 0 auto; font-weight: 600; color: var(--pko-gold-light); }
.pko-btn.is-on { background: var(--pko-gold); color: #0b1940; border-color: var(--pko-gold); }

.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th, .data-table td { padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--pko-border); text-align: left; }
.data-table th { background: rgba(5, 10, 22, 0.85); color: var(--pko-gold-light); position: sticky; top: 0; }
.data-table a { text-decoration: none; color: var(--pko-gold-light); }
.chip { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.chip--ok { background: var(--pko-success-bg); color: var(--pko-success-text); }
.chip--warn { background: var(--pko-error-bg); color: var(--pko-error); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.85rem 1.2rem; }
.kv dt { font-size: 0.75rem; color: var(--pko-gold); font-weight: 600; }
.kv dd { margin: 0.15rem 0 0; font-weight: 600; }

.workspace { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: start; }
.pool { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; }
.pool h2 { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.15rem; }
.pool .count { font-size: 0.95rem; color: var(--pko-gold); }
.pool-list { display: grid; gap: 0.45rem; margin-top: 0.75rem; min-height: 80px; }
.person {
  background: rgba(5, 10, 22, 0.72);
  border: 1px solid var(--pko-border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  cursor: grab;
  color: var(--pko-text);
}
.person strong { display: block; font-size: 0.88rem; color: #fff; }
.person__meta, .person__tag { display: block; font-size: 0.72rem; color: var(--pko-text-muted); }
.person__tag--gold { color: var(--pko-gold-light); font-weight: 700; }
.person.is-dragging { opacity: 0.45; }
.is-over { outline: 2px dashed var(--pko-gold); outline-offset: 2px; }

.sala-wrap { overflow: visible; }
.sala-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem 0; flex-wrap: wrap; }
.sala-toolbar__actions { display: flex; align-items: center; gap: 0.55rem; margin-left: auto; }
.sala-admin-tools { display: flex; align-items: center; gap: 0.3rem; }
.sala-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pko-border);
  border-radius: 8px;
  background: rgba(5, 10, 22, 0.45);
  color: var(--pko-gold-light);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}
.sala-icon-btn:hover { border-color: var(--pko-gold); background: var(--pko-blue-pale); }
.sala-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.view-switch {
  display: flex;
  border: 1px solid var(--pko-border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(5, 10, 22, 0.45);
}
.view-switch__btn {
  border: 0;
  background: transparent;
  color: var(--pko-text);
  padding: 0.42rem 0.9rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
.view-switch__btn.is-on {
  background: var(--pko-gold);
  color: #0b1940;
}
.stolik-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
  padding: 0.85rem 1rem 1.1rem;
}
.sala[hidden],
.stolik-cards[hidden] { display: none !important; }
.stolik-card {
  background: rgba(5, 10, 22, 0.88);
  border: 1px solid var(--pko-border);
  border-radius: 12px;
  min-height: 168px;
  overflow: hidden;
}
.stolik-card.is-partial { border-color: rgba(197, 160, 89, 0.55); }
.stolik-card.is-full { border-color: var(--pko-gold); background: rgba(197, 160, 89, 0.12); }
.stolik-card__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  background: rgba(197, 160, 89, 0.18);
  color: var(--pko-gold-light);
}
.stolik-card__label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}
.stolik-card__head strong { font-size: 1.15rem; flex: 1; color: #fff; }
.stolik-card__cap {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(5, 10, 22, 0.4);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}
.stolik-card__list { padding: 0.45rem; display: grid; gap: 0.35rem; min-height: 88px; }
.stolik-card__empty { margin: 0.6rem 0.2rem; text-align: center; }
.stolik-card .person { margin: 0; }
.sala {
  position: relative;
  height: min(72vh, 780px);
  margin: 0.75rem;
  border-radius: 16px;
  background: rgba(11, 25, 64, 0.55);
  border: 1px solid var(--pko-border);
}
.sala__stage,
.sala__foh {
  position: absolute;
  box-sizing: border-box;
  color: var(--pko-gold-light);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  text-transform: uppercase;
  border: 1px solid rgba(197, 160, 89, 0.42);
}
.sala__stage {
  left: 1.1%;
  top: 7%;
  bottom: 7%;
  width: 11%;
  background: rgba(197, 160, 89, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.sala__foh {
  right: 1.3%;
  top: 34%;
  width: 8.5%;
  height: 32%;
  background: rgba(5, 10, 22, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sala__tables {
  position: absolute;
  top: 5%;
  right: 12%;
  bottom: 5%;
  left: 16%;
}
.table-cluster {
  position: absolute;
  width: 0;
  height: 0;
}
.table-dot {
  position: absolute;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  border: 2px solid var(--pko-gold);
  background: rgba(5, 10, 22, 0.88);
  color: var(--pko-gold-light);
  cursor: pointer;
  box-shadow: 0 0 16px rgba(197, 160, 89, 0.22);
  font-family: var(--pko-font);
  z-index: 2;
}
.table-dot__num { display: block; font-size: 1rem; font-weight: 700; }
.table-dot__cap { display: block; font-size: 0.62rem; color: var(--pko-text-muted); }
.table-dot.is-partial { background: rgba(197, 160, 89, 0.22); }
.table-dot.is-full { background: var(--pko-gold); color: #0b1940; border-color: var(--pko-gold-light); }
.table-dot.is-full .table-dot__cap { color: rgba(11, 25, 64, 0.7); }

.seat-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  border: 1px solid var(--pko-gold);
  background: #0b1940;
  color: var(--pko-gold-light);
  font-size: 0.58rem;
  font-weight: 700;
  font-family: var(--pko-font);
  cursor: pointer;
  z-index: 3;
  padding: 0;
  line-height: 1;
  transform: rotate(calc(360deg * var(--i) / var(--n))) translate(42px) rotate(calc(-360deg * var(--i) / var(--n)));
}
.seat-dot:hover,
.seat-dot:focus {
  background: var(--pko-gold);
  color: #0b1940;
  z-index: 5;
}
.seat-tip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 160px;
  padding: 0.4rem 0.55rem;
  background: #050a16;
  border: 1px solid var(--pko-border);
  border-radius: 8px;
  color: #fff;
  text-align: left;
  pointer-events: none;
  box-shadow: var(--pko-shadow-sm);
  z-index: 8;
}
.seat-tip strong { display: block; font-size: 0.78rem; }
.seat-tip em { display: block; font-style: normal; font-size: 0.68rem; color: var(--pko-text-muted); font-weight: 400; }
.seat-dot:hover .seat-tip,
.seat-dot:focus .seat-tip { display: block; }

.drawer {
  position: fixed;
  right: 0;
  top: 0;
  width: min(380px, 100%);
  height: 100vh;
  background: #0b1940;
  border-left: 1px solid var(--pko-border);
  box-shadow: var(--pko-shadow);
  z-index: 40;
  padding: 1rem;
  overflow: auto;
  color: var(--pko-text);
}
.drawer__head { display: flex; justify-content: space-between; align-items: center; }
.drawer__close { border: 0; background: none; font-size: 1.8rem; cursor: pointer; color: var(--pko-gold-light); }
.drawer-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.drawer-row .person { flex: 1; }

.room-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0.85rem; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.65rem; }
.room-card {
  background: rgba(5, 10, 22, 0.88);
  border: 1px solid var(--pko-border);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  min-height: 92px;
  color: var(--pko-text);
}
.room-card header { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.35rem; color: var(--pko-gold-light); }
.room-card--joker { border-color: var(--pko-gold); background: rgba(197, 160, 89, 0.16); box-shadow: 0 0 18px rgba(197, 160, 89, 0.18); }
.room-card--terrace { border-color: var(--pko-gold-dim); background: rgba(141, 112, 64, 0.18); }
.room-card.is-full { opacity: 0.72; }
.room-guest { display: flex; justify-content: space-between; gap: 0.35rem; font-size: 0.78rem; padding: 0.15rem 0; }
.room-guest button { border: 0; background: none; cursor: pointer; color: var(--pko-error); font-size: 1rem; }

.ws-page { max-width: 1600px; }
.ws-heading { margin: 0 0 0.65rem; font-size: 1.15rem; color: var(--pko-gold-light); }
.ws-stats { display: grid; gap: 0.45rem; margin: 0 0 1rem; }
.ws-stats__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.ws-stats__label {
  width: 4.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pko-gold);
}
.ws-stat {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-width: 5.4rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--pko-border);
  border-radius: 10px;
  background: rgba(5, 10, 22, 0.55);
  color: var(--pko-text);
  cursor: pointer;
  font-family: inherit;
}
.ws-stat strong { font-size: 0.78rem; color: #fff; }
.ws-stat span { font-size: 0.72rem; color: var(--pko-gold-light); }
.ws-stat.is-on { background: var(--pko-gold); color: #0b1940; border-color: var(--pko-gold); }
.ws-stat.is-on strong, .ws-stat.is-on span { color: #0b1940; }
.ws-stat.is-full { border-color: var(--pko-gold); }
.ws-stat--gap { border-style: dashed; }
.ws-stat--gap span { color: var(--pko-error); }
.ws-table .ws-select {
  width: 100%;
  min-width: 11.5rem;
  padding: 0.35rem 0.5rem;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--pko-text);
  background: rgba(5, 10, 22, 0.85);
  border: 1px solid var(--pko-border);
  border-radius: 8px;
}
.ws-table .ws-select:disabled { opacity: 0.65; }
.ws-cell { display: flex; align-items: center; gap: 0.3rem; }
.ws-clear {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--pko-error);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.ws-clear:hover { background: var(--pko-error-bg); }
.ws-table tr.is-gap td:first-child strong { color: var(--pko-gold-light); }

.reception { max-width: 560px; margin: 0 auto; }
.rec-results { display: grid; gap: 0.85rem; margin-top: 1rem; }
.rec-card { border: 1px solid var(--pko-border); border-radius: 14px; padding: 1rem; background: rgba(5, 10, 22, 0.45); }
.rec-card h2 { margin: 0; font-size: 1.6rem; color: #fff; }
.rec-first { margin: 0 0 0.6rem; color: var(--pko-text-muted); }
.rec-badge {
  display: inline-block;
  background: var(--pko-gold);
  color: #0b1940;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0.35rem 0.8rem;
  border-radius: 10px;
  margin-bottom: 0.6rem;
}
.rec-badge.is-warn { background: var(--pko-red); color: #fff; }
.rec-line { margin: 0.2rem 0; font-size: 0.92rem; }
.rec-card .pko-btn, .rec-card select { margin-top: 0.65rem; }

.board-page {
  margin: 0;
  background: #050a16 url("../img/kv_bg_final.jpg") center center / cover no-repeat;
  color: #fff;
}
.board-frame { min-height: 100vh; padding: 1.2rem 1.4rem; box-sizing: border-box; background: rgba(5, 10, 22, 0.55); }
.board-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.board-head h1 { color: #fff; margin: 0; font-size: 1.4rem; }
.board-head p { margin: 0.2rem 0 0; color: var(--pko-gold-light); }
.board-head img { height: 48px; }
.board-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; }
.board-col { width: 100%; border-collapse: collapse; font-size: 0.68rem; background: rgba(11, 25, 64, 0.82); color: #f3f1ea; }
.board-col th, .board-col td { border: 1px solid var(--pko-border); padding: 0.18rem 0.28rem; text-align: left; }
.board-col th { background: rgba(197, 160, 89, 0.22); color: var(--pko-gold-light); }

.toast {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pko-gold);
  color: #0b1940;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  z-index: 80;
  font-weight: 600;
}
.toast--err { background: var(--pko-error); color: #fff; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .app-header { flex-wrap: wrap; }
  .app-nav { margin-left: 0; width: 100%; justify-content: flex-end; }
  .pool { position: static; max-height: none; }
  .sala { height: 70vh; }
  .table-dot { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  .seat-dot { transform: rotate(calc(360deg * var(--i) / var(--n))) translate(36px) rotate(calc(-360deg * var(--i) / var(--n))); }
}
