/* v6 admin extensions */

.sidebar-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.07); }
.sidebar-section-title { font-size: 11px; opacity: 0.55; letter-spacing: 0.08em; padding: 4px 16px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.page-head h3 { margin: 0; }

.form-grid { display: grid; gap: 12px; max-width: 560px; }
.form-grid .fg { display: flex; flex-direction: column; gap: 4px; }
.form-grid label { font-size: 12px; opacity: 0.75; }

.card {
  background: var(--card-bg, #1c1d22); border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
}

.location-editor {
  display: grid; grid-template-columns: 1fr 240px; gap: 16px; height: 70vh; min-height: 480px;
}
.location-canvas {
  position: relative; background: #14151a;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid #2a2c34; border-radius: 12px; overflow: hidden;
  touch-action: none;
}
.loc-dot {
  position: absolute; width: 56px; height: 56px;
  border-radius: 12px; background: #2e7d32; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; cursor: grab; user-select: none;
  border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  transition: transform 0.1s;
}
.loc-dot.dragging { transform: scale(1.07); cursor: grabbing; z-index: 10; }
.loc-dot.busy { background: #f57c00; }
.loc-dot.call { background: #d32f2f; animation: pulse 1s infinite; }
.loc-dot.inactive { background: #555; opacity: 0.5; }
.loc-dot[data-type="lounger"] { border-radius: 28px; }
.loc-dot[data-type="room"]    { border-radius: 4px; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.location-side ul { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow: auto; }
.location-side li {
  padding: 6px 8px; border-bottom: 1px solid #2a2c34;
  display: flex; justify-content: space-between; align-items: center; font-size: 13px;
}
.location-side li button { background: none; border: none; color: #aaa; cursor: pointer; }

.theme-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}
.theme-card { background: #1c1d22; border-radius: 12px; padding: 12px; text-align: center; }
.theme-preview { width: 100%; height: 120px; border-radius: 8px; margin-bottom: 8px; }
.theme-preview-telegram { background: linear-gradient(180deg, #2AABEE, #229ED9); }
.theme-preview-apple    { background: linear-gradient(180deg, #f7f7f7, #d9d9d9); }
.theme-preview-material { background: linear-gradient(135deg, #1976D2, #F50057); }
.theme-preview-bold     { background: linear-gradient(135deg, #0d0d0d, #ff0080); }

.features-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px;
  margin-top: 16px;
}
.features-grid label { display: flex; gap: 8px; align-items: center; padding: 8px; background: #1c1d22; border-radius: 8px; }

/* Training overlay */
.training-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 9999;
  display: none; align-items: flex-end; justify-content: center; padding: 24px;
}
.training-overlay.active { display: flex; }
.training-card {
  background: #fff; color: #222; max-width: 460px; width: 100%;
  border-radius: 16px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
[data-theme="dark"] .training-card { background: #1c1d22; color: #eee; }
.training-card h3 { margin: 0 0 6px; }
.training-card p  { margin: 0 0 16px; opacity: 0.85; }
.training-actions { display: flex; justify-content: space-between; gap: 8px; }
.training-progress { font-size: 12px; opacity: 0.55; margin-top: 8px; }
.training-spot {
  position: fixed; border: 3px solid #2AABEE; border-radius: 12px; z-index: 9998;
  pointer-events: none; box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  transition: all 0.25s ease-out;
}

/* Staff visual board */
.board-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 8px; background: #1c1d22; border-radius: 10px;
}
.staff-board-select {
  background: #14151a; color: #eee; border: 1px solid #2a2c34;
  border-radius: 8px; padding: 6px 10px;
}
.staff-board {
  display: grid; grid-template-columns: 1fr 320px; gap: 16px;
  min-height: calc(100vh - 160px);
}
@media (max-width: 720px) { .staff-board { grid-template-columns: 1fr; } }
.staff-board .board-canvas { position: relative; background: #14151a; border-radius: 12px; overflow: hidden;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  min-height: 480px;
}
.staff-board .board-side { background: #1c1d22; padding: 12px; border-radius: 12px; overflow: auto; }
.staff-board .loc-dot { cursor: pointer; }
.staff-board .loc-dot:hover { transform: scale(1.08); box-shadow: 0 6px 16px rgba(0,0,0,0.55); }
.board-loc-card {
  padding: 10px; border-radius: 10px; background: #14151a;
  margin-bottom: 8px; border: 1px solid #2a2c34; cursor: pointer;
}
.board-loc-card:hover { border-color: #00b4d8; }
.board-loc-card h5 { margin: 0 0 4px; font-size: 14px; }
.board-loc-card small { opacity: .7; }

/* Location detail drawer (staff) */
.loc-drawer {
  position: fixed; top: 0; right: -460px; bottom: 0; width: 440px; max-width: 96vw;
  background: #1c1d22; color: #eee; box-shadow: -8px 0 30px rgba(0,0,0,0.4);
  transition: right 0.2s ease-out; z-index: 9990; display: flex; flex-direction: column;
}
.loc-drawer.open { right: 0; }
.loc-drawer-head {
  padding: 14px 16px; border-bottom: 1px solid #2a2c34;
  display: flex; align-items: center; justify-content: space-between;
}
.loc-drawer-body { padding: 14px 16px; overflow: auto; flex: 1; }
.loc-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 9985; display: none;
}
.loc-drawer-backdrop.open { display: block; }
.loc-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.loc-stat { background: #14151a; border-radius: 10px; padding: 10px; }
.loc-stat .v { font-size: 20px; font-weight: 700; }
.loc-stat .l { font-size: 11px; opacity: .65; letter-spacing: .04em; text-transform: uppercase; }
.loc-order-card { background: #14151a; border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.loc-order-card .h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.loc-order-card .h .num { font-weight: 700; }
.loc-order-card .it { font-size: 13px; opacity: .85; }
.loc-order-card .t { margin-top: 6px; font-weight: 700; }

/* Venue picker buttons (staff login flow) */
#venueChoices .venue-choice {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; background: #14151a; border: 1px solid #2a2c34;
  border-radius: 10px; cursor: pointer;
}
#venueChoices .venue-choice:hover { border-color: #00b4d8; }
#venueChoices .venue-choice .name { font-weight: 600; }
#venueChoices .venue-choice .meta { font-size: 12px; opacity: .65; }

/* Guest theme overrides (loaded by app.js) */
[data-menu-theme="apple"] {
  --tg-bg-color: #ffffff; --tg-text-color: #1c1c1e; --tg-hint-color: #8e8e93;
  --tg-button-color: #007aff; --tg-button-text-color: #fff;
  --tg-secondary-bg-color: #f2f2f7;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
[data-menu-theme="material"] {
  --tg-bg-color: #fafafa; --tg-text-color: #212121; --tg-hint-color: #757575;
  --tg-button-color: #1976D2; --tg-button-text-color: #fff;
  --tg-secondary-bg-color: #ffffff;
  font-family: Roboto, sans-serif;
}
[data-menu-theme="bold"] {
  --tg-bg-color: #0a0a0a; --tg-text-color: #fff; --tg-hint-color: #9aa0a6;
  --tg-button-color: #ff0080; --tg-button-text-color: #fff;
  --tg-secondary-bg-color: #181818;
}

/* ── Faithful top-view floor plan for the waiter board (mirrors guest plan) ── */
.staff-board .board-canvas { display: flex; align-items: center; justify-content: center; padding: 10px; }
.board-room { position: relative; width: 100%; max-width: 100%; max-height: 70vh; border-radius: 14px;
  border: 3px solid var(--wall, #cdb892);
  background: linear-gradient(160deg,#141b29,#0a0f18);
  background-image: repeating-linear-gradient(0deg,rgba(255,255,255,.045) 0 1px,transparent 1px 9%), repeating-linear-gradient(90deg,rgba(255,255,255,.045) 0 1px,transparent 1px 9%);
  box-shadow: inset 0 0 60px rgba(0,0,0,.55); overflow: hidden; }
.board-room .floor-sea { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 11px;
  letter-spacing: 3px; color: rgba(120,190,230,.65); padding: 3px 0;
  background: linear-gradient(0deg,rgba(30,90,140,.35),transparent); pointer-events: none; }
.board-room .tnode { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; background: linear-gradient(160deg,#3a4256,#222a3a); border: 2px solid rgba(120,200,120,.65);
  border-radius: 8px; color: #e7eefc; font-weight: 700; cursor: pointer; box-shadow: 0 6px 12px rgba(0,0,0,.5);
  transition: .12s; overflow: visible; }
.board-room .tnode.round { border-radius: 50%; }
.board-room .tnode.k-sunbed { background: linear-gradient(160deg,#e7d6b4,#c9b288); color: #4a3a1c; }
.board-room .tnode.k-sofa { background: linear-gradient(160deg,#4a3a5c,#2e2440); border-radius: 10px; }
.board-room .tnode.busy { border-color: #f5a623; box-shadow: 0 0 0 2px rgba(245,166,35,.4), 0 6px 12px rgba(0,0,0,.5); }
.board-room .tnode.call { border-color: #ff4d4d; animation: pulse 1s infinite; }
.board-room .tnode:hover { filter: brightness(1.15); }
.board-room .tnode .tnode-code { font-size: clamp(12px, 2.4vw, 17px); line-height: 1; }
.board-room .tnode .tnode-seats { font-size: 9px; font-weight: 600; opacity: .75; }
.board-room .tnode .tnode-badge { position: absolute; top: -7px; right: -7px; background: #fff; color: #000;
  border-radius: 50%; font-size: 10px; padding: 1px 6px; }
.board-room .tnode .tnode-bell { position: absolute; top: -9px; left: -7px; font-size: 12px; }
@media (max-width: 600px) { .board-room { max-height: 60vh; } .board-room .tnode .tnode-seats { display: none; } }
