/* Стили модуля «reservations». Грузятся после public/css/base.css
   и до public/css/themes.css — см. public/index.html. */

/* ── Chess table ──────────────────────────────────────────────── */
.chess-table {
  border-collapse: separate;
  border-spacing: 2px;
  white-space: nowrap;
  font-size: var(--chess-font, 12px);
}
.chess-table thead th { position: sticky; top: 0; z-index: 2; background: transparent; }
.chess-room-label {
  position: sticky; left: 0; z-index: 3;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 10px;
  border-right: none;
  border-radius: 7px;
  min-width: 100px; max-width: 140px;
}
thead .chess-room-label { z-index: 4; }
.chess-room-label b { display: block; font-size: var(--chess-font, 12px); }
.chess-room-type { font-size: calc(var(--chess-font, 12px) - 2px); color: var(--text3); }
.chess-th {
  padding: 5px 3px; text-align: center; min-width: var(--chess-cw, 44px);
  border: 1.5px solid rgba(56,140,200,.30);
  border-radius: 6px;
  background: rgba(20,50,90,.35);
  font-weight: 600; color: var(--text2); font-size: var(--chess-font, 12px);
}
.chess-th.chess-wknd  { color: rgba(239,68,68,.9); background: rgba(180,40,40,.18); border-color: rgba(239,68,68,.30); }
.chess-th.chess-today { color: var(--primary); background: rgba(var(--theme-rgb),.18); border-color: rgba(var(--theme-rgb),.50); }
.chess-dow { font-size: calc(var(--chess-font, 12px) - 3px); opacity: .65; display: block; }
.chess-cell {
  padding: 0; height: var(--chess-ch, 38px); min-width: var(--chess-cw, 44px);
  border: 1.5px solid rgba(56,140,200,.35);
  border-radius: 6px;
  background: rgba(16,48,90,.22);
  cursor: pointer; transition: background .15s, border-color .15s; vertical-align: middle;
}
.chess-cell.chess-wknd  { background: rgba(180,30,30,.12); border-color: rgba(239,68,68,.22); }
.chess-cell.chess-today { background: rgba(var(--theme-rgb),.12); border-color: rgba(var(--theme-rgb),.55); box-shadow: inset 0 0 0 1px rgba(var(--theme-rgb),.35); }
.chess-cell.chess-free:hover { background: rgba(56,160,220,.22); border-color: rgba(56,160,220,.60); }
.chess-cell.chess-busy  { padding: 2px 4px; }
.chess-cell.chess-busy:hover, .chess-cell.chess-busy-cont:hover { opacity: .80; }
/* ── Chess booking cell — horizontal adaptive row ──────────── */
td.chess-res { padding: 0 !important; vertical-align: middle; }
.chess-row {
  display: flex; align-items: center; gap: 4px;
  width: 100%; height: 100%; padding: 0 6px 0 4px;
  overflow: hidden; box-sizing: border-box;
}
.chess-name {
  font-size: var(--chess-font, 12px); font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 0 1 auto; max-width: 55%; min-width: 0; line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.chess-avatar {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.chess-nights-pill {
  font-size: calc(var(--chess-font, 12px) - 3px); border-radius: 8px;
  padding: 0 5px; font-weight: 700; white-space: nowrap; flex-shrink: 0; line-height: 1.7;
}
.chess-sep { color: rgba(255,255,255,.2); font-size: 10px; flex-shrink: 0; user-select: none; }
.chess-dates {
  font-size: calc(var(--chess-font, 12px) - 2px); color: rgba(255,255,255,.7);
  white-space: nowrap; flex-shrink: 0;
}
.chess-status-badge {
  font-size: calc(var(--chess-font, 12px) - 3px); border-radius: 3px;
  padding: 0 4px; font-weight: 600; white-space: nowrap; line-height: 1.6; flex-shrink: 0;
}
.chess-pay-dot { font-size: 9px; flex-shrink: 0; }
.chess-debt { font-size: calc(var(--chess-font, 12px) - 3px); font-weight: 700; white-space: nowrap; color: #ef4444; flex-shrink: 0; }
.chess-pay-ok { color: #22c55e; font-size: calc(var(--chess-font, 12px) - 1px); flex-shrink: 0; font-weight: 700; }
.chess-pay-badge { font-size: calc(var(--chess-font, 12px) - 2px); font-weight: 600; white-space: nowrap; }
.chess-zoom-btn {
  width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface2); color: var(--text1); font-size: 17px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.chess-zoom-btn:hover { background: var(--border); }
.chess-zoom-label { font-size: 12px; color: var(--text2); min-width: 34px; text-align: center; }

/* ── Invoice layout ───────────────────────────────────────────────── */
.invoice-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.inv-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.inv-tab-btn {
  padding: 7px 16px; font-size: 13px; font-weight: 500; cursor: pointer;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text2); margin-bottom: -1px; border-radius: 6px 6px 0 0;
  transition: color .15s, border-color .15s;
}
.inv-tab-btn:hover { color: var(--text1); background: var(--bg3); }
.inv-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.inv-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg3); color: var(--text2); border-radius: 10px;
  font-size: 10px; font-weight: 700; padding: 0 6px; min-width: 18px; height: 16px; margin-left: 4px;
}
.inv-tab-btn.active .inv-tab-count { background: rgba(var(--theme-rgb),.2); color: var(--primary); }
.invoice-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.invoice-table th,
.invoice-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.invoice-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); }
.invoice-table tbody tr:last-child td { border-bottom: none; }

.inv-add-row {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.inv-add-row input, .inv-add-row select { padding: 6px 10px; font-size: 12px; }

.invoice-summary {
  background: var(--bg); border-radius: 8px; padding: 12px 16px; margin-top: 4px;
}
.inv-sum-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 13px; color: var(--text2);
}
.inv-sum-total {
  font-size: 15px; font-weight: 700; color: var(--text);
  border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px;
}

/* ── Guest search dropdown ────────────────────────────────────────── */
.guest-dd {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); max-height: 240px; overflow-y: auto; margin-top: 2px;
}
.guest-dd-item {
  padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.guest-dd-item:last-child { border-bottom: none; }
.guest-dd-item:hover { background: var(--bg3); }
.guest-dd-create { border-top: 1px solid var(--border) !important; }
.guest-dd-create:hover { background: rgba(var(--theme-rgb),.08) !important; }
.guest-incomplete-hint {
  margin-top: 6px; padding: 6px 10px; border-radius: 6px;
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.35);
  font-size: 12px; color: #f59e0b; display: flex; align-items: center; gap: 8px;
}

/* ── Chess res cell ───────────────────────────────────────────────── */
