* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f0;
  color: #222;
}
.hidden { display: none !important; }
.screen { min-height: 100vh; }

.login-form {
  max-width: 320px;
  margin: 15vh auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
}
.login-form h1 { margin: 0; color: #2e7d32; }
.login-form .subtitle { margin: 0 0 8px; color: #777; }
.login-form input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}
/* оченце в полето за парола — показва/скрива написаното */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; width: 100%; box-sizing: border-box; padding-right: 44px; }
.login-form .pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; padding: 0; background: none; border: none;
  font-size: 18px; line-height: 1; opacity: 0.45; cursor: pointer;
}
.login-form .pw-toggle.on { opacity: 1; }
.login-form button {
  padding: 12px;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}
.error { color: #c62828; min-height: 1.2em; margin: 0; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 16px;
  background: #1565c0;
  color: #fff;
}
.top-sticky { position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); }
header h1 { margin: 0; font-size: 1.2rem; }
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-title { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-logo { height: 26px; width: 26px; display: block; filter: brightness(0) invert(1); }
.link-btn { background: none; border: none; color: #fff; text-decoration: underline; font-size: 0.9rem; }
.header-right { display: flex; align-items: center; gap: 14px; }
#notify-btn { font-size: 1.3rem; text-decoration: none; }
#notify-btn.subscribed { opacity: 1; }
#notify-btn.not-subscribed { opacity: 0.5; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.toolbar input, .toolbar button {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 16px;
}
.toolbar button { background: #2e7d32; color: #fff; border: none; }
.toolbar { flex-direction: column; align-items: stretch; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.toolbar-right { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.toolbar button.icon-btn { background: #fff; color: #1565c0; border: 1px solid #ddd; padding: 8px 12px; font-size: 22px; font-weight: 900; -webkit-text-stroke: 1px #1565c0; line-height: 1; }
.toolbar button.primary { width: 100%; font-size: 14px; padding: 9px 10px; }
.toolbar button.primary .plus-icon { font-size: 14px; font-weight: 400; margin-right: 6px; color: #fff; line-height: 1; }
.toolbar button.trash-btn { background: #fff; color: #444; border: 1px solid #ddd; padding: 8px 11px; font-size: 16px; line-height: 1; }
.calendar-modal { max-width: 380px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav button { padding: 6px 14px; font-size: 20px; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays span { text-align: center; font-size: 0.75rem; color: #888; padding: 4px 0; }
.cal-day { border: 1px solid #e3e3e3; border-radius: 8px; background: #fff; padding: 6px 2px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; cursor: pointer; font-size: 0.95rem; color: #222; }
.cal-day.empty-cell { border: none; background: none; cursor: default; }
.cal-day.today { border-color: #1565c0; }
.cal-day.selected { background: #1565c0; color: #fff; }
.cal-count { font-size: 0.7rem; background: #2e7d32; color: #fff; border-radius: 999px; padding: 0 6px; }
.cal-count.has-pending { background: #f9a825; }
/* „Днес" в календара — синьо, за да се намира веднага */
#cal-today { background: #1565c0; color: #fff; border-color: #1565c0; }
#cal-today:active { background: #0d47a1; }
.cal-day.past { color: #9e9e9e; }
.cal-day.past .cal-count { background: #bdbdbd; }
.cal-day.past.selected { color: #fff; }
.rejected-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; margin: 8px 0; }
.rejected-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid #ddd; border-radius: 8px; background: #fafafa; }
.rejected-row .rr-info { font-size: 0.9rem; }
.rejected-row .rr-info strong { display: block; }
.rejected-row button { background: #2e7d32; color: #fff; border: none; border-radius: 8px; padding: 8px 12px; white-space: nowrap; }
.rejected-row .rr-info { flex: 1; }
/* голяма мишена за пръст — редът се маркира с палец на телефон */
.rejected-row .rr-pick { width: 22px; height: 22px; flex: 0 0 auto; margin: 0; }

/* Окончателното изтриване стои отделено от „Върни" и е в друг цвят, за да не се
   натисне вместо него — оттам няма връщане назад. */
.rejected-admin { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid #ddd; }
.rejected-admin .rr-all { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; color: #555; margin-right: auto; }
.rejected-admin .rr-all input { width: 20px; height: 20px; }
.rejected-admin .danger { background: #c62828; color: #fff; border: none; border-radius: 8px; padding: 10px 14px; font-size: 0.9rem; cursor: pointer; }
.rejected-admin .danger:active { background: #a11b1b; }

.view-toggle { display: flex; gap: 4px; padding: 0 16px 2px; background: #fff; border-bottom: 1px solid #ccc; }
.view-tab {
  flex: 1;
  padding: 4px 8px;
  border: none;
  background: none;
  color: #777;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.view-tab.active { color: #1565c0; border-bottom-color: #1565c0; font-weight: 600; }

.list { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }

.zone-block { margin-bottom: 16px; }
.zone-block-heading { font-weight: 600; color: #1565c0; margin: 0 0 8px; font-size: 1rem; }
/* етажите са <details>: заглавието е лента за палец със стрелка ▸/▾ */
/* свитите етажи стоят плътно един под друг: без отстъп под блока, а 12px gap на
   .list се свива до 4px между два съседни етажа */
details.zone-block { margin-bottom: 0; }
details.zone-block + details.zone-block { margin-top: -8px; }
details.zone-block[open] { margin-bottom: 8px; }
details.zone-block > summary.zone-block-heading {
  margin: 0;
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  background: #e8eef7;
  border-radius: 8px;
}
details.zone-block > summary.zone-block-heading::-webkit-details-marker { display: none; }
details.zone-block > summary.zone-block-heading::before { content: "▸"; display: inline-block; width: 1.1em; }
details.zone-block[open] > summary.zone-block-heading::before { content: "▾"; }
details.zone-block[open] > summary.zone-block-heading { margin-bottom: 8px; }
details.zone-block.no-zone-block > summary.zone-block-heading { background: #fff3cd; color: #8a6d00; }
.zone-sum { font-weight: 400; color: #555; font-size: 0.85rem; }
.zone-inner .hour-block:last-child { margin-bottom: 0; }

/* ---- „Свободни" ---- */
.free-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.free-toolbar + .free-toolbar { margin-top: -6px; }
.free-select { font-size: 16px; padding: 8px; border: 1px solid #ddd; border-radius: 8px; background: #fff; }
.free-step, .free-now { font-size: 1rem; padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; background: #fff; cursor: pointer; }
.free-now.active { background: #1565c0; color: #fff; border-color: #1565c0; }
.free-for { color: #666; }
.free-summary { font-size: 1rem; color: #333; }
.free-summary b { color: #2e7d32; }
.free-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.8rem; color: #666; }
.free-legend + .free-legend { margin-top: -8px; }
.free-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.lg-free { background: #2e7d32; }
.lg-soon { background: #ef8f00; }
.lg-busy { background: #c62828; }
.free-unassigned { color: #8a6d00; font-weight: 600; font-size: 0.9rem; }
.free-zone { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 4px 12px 8px; }
.fr-axis { position: relative; height: 16px; margin-left: 12px; /* = border-left 4px + padding-left 8px на .free-row, за да съвпада с лентите */ font-size: 0.7rem; color: #999; }
.fr-axis span { position: absolute; transform: translateX(-50%); top: 2px; }
.fr-axis .fr-half { position: absolute; bottom: 0; width: 1px; height: 6px; margin-left: -0.5px; background: #9aa3ab; }
.free-row { padding: 6px 0 6px 8px; border-top: 1px solid #f2f2f2; border-left: 4px solid transparent; }
.free-row.st-free { border-left-color: #2e7d32; }
.free-row.st-soon { border-left-color: #ef8f00; }
.free-row.st-busy { border-left-color: #c62828; background: #fdf3f3; }
.fr-head { display: flex; align-items: baseline; gap: 8px; font-size: 0.9rem; }
.fr-name { font-weight: 700; min-width: 2.6em; }
.fr-cap { color: #888; font-size: 0.8rem; white-space: nowrap; }
.fr-state { margin-left: auto; font-weight: 600; text-align: right; }
.st-free .fr-state { color: #2e7d32; }
.st-soon .fr-state { color: #b56a00; }
.st-busy .fr-state { color: #c62828; }
.fr-later { margin-top: 2px; font-size: 0.8rem; color: #37474f; }
.fr-later-item { cursor: pointer; white-space: nowrap; }
body.viewer .fr-later-item { cursor: default; }
.fr-bar { position: relative; height: 22px; margin-top: 4px; background: #f1f3f4; border-radius: 4px; overflow: hidden; }
.fr-past { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, #e6e6e6 0 4px, #f1f3f4 4px 8px); }
.fr-window { position: absolute; top: 0; bottom: 0; background: rgba(21, 101, 192, 0.12); }
.fr-seg {
  position: absolute; top: 2px; bottom: 2px;
  border-radius: 3px; color: #fff; font-size: 0.68rem; line-height: 18px;
  padding-left: 3px; overflow: hidden; white-space: nowrap; cursor: pointer;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.6);
}
.seg-confirmed { background: #2e7d32; }
.seg-pending { background: #f9a825; }
.seg-seated { background: #1565c0; }
.seg-finished { background: #bdbdbd; }
/* 22 половинки (10:30–21:30): бледа линия на всеки 30 мин, по-тъмна на кръглия час.
   Кръглите часове са в средата на всеки 60-минутен период (10:30 + 30 мин). */
.fr-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(to right, transparent 0 calc(100% / 22 - 1px), #9aa3ab calc(100% / 22 - 1px) calc(100% / 22), transparent calc(100% / 22) calc(100% / 11)),
    repeating-linear-gradient(to right, transparent 0 calc(100% / 22 - 1px), #d3d7db calc(100% / 22 - 1px) calc(100% / 22));
}
.fr-seg { z-index: 1; }
.st-busy .fr-state.holder-seated { color: #1565c0; }
.st-busy .fr-state.holder-confirmed { color: #2e7d32; }
.st-busy .fr-state.holder-pending { color: #b56a00; }
.fr-marker { z-index: 2; position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #c62828; }
body.viewer .fr-seg { cursor: default; }
.table-block {
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #eee;
}
.table-block-name { font-weight: 600; margin-bottom: 4px; }
.table-block-empty { color: #999; font-size: 0.85rem; }
.table-block-res {
  padding: 8px 0;
  border-top: 1px solid #f2f2f2;
  font-size: 0.9rem;
  cursor: pointer;
}
.table-block-res:first-of-type { border-top: none; }
.table-block-res:active { background: #f7f7f2; }
.tbr-header { display: flex; justify-content: space-between; align-items: center; }
.tbr-name { margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.table-block.occupied { background: #e3f2fd; }
.tbr-time-seated { color: #c62828; }
.table-now { font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.table-now.free-label { color: #2e7d32; }
.table-now.busy-label { color: #c62828; }
.admin-setting-row { display: flex; gap: 8px; align-items: center; }
/* сгъваемите секции в ⚙️ — същият вид като етажите */
.settings-section { margin: 0 0 6px; }
.settings-section > summary {
  list-style: none; cursor: pointer; padding: 10px 12px; background: #e8eef7;
  border-radius: 8px; font-weight: 600; color: #1565c0;
}
.settings-section > summary::-webkit-details-marker { display: none; }
.settings-section > summary::before { content: "▸"; display: inline-block; width: 1.1em; }
.settings-section[open] > summary::before { content: "▾"; }
.settings-section[open] > summary { margin-bottom: 8px; }
.settings-section > :not(summary) { margin-left: 4px; margin-right: 4px; }
.settings-flag { font-weight: 400; font-size: 0.85rem; }
.settings-version { text-align: center; color: #999; font-size: 0.8rem; margin: 8px 0 0; }
.settings-flag.warn { color: #c62828; }
.settings-flag.new { color: #2e7d32; }
.vs-row { display: grid; grid-template-columns: 7.5em 1fr auto; align-items: center; gap: 8px; margin: 4px 0; font-size: 0.9rem; }
.vs-bar { background: #eef1f4; border-radius: 4px; height: 10px; overflow: hidden; }
.vs-bar i { display: block; height: 100%; background: #1565c0; }
.vs-num { white-space: nowrap; }
.vs-num small { color: #888; }
.vs-unused .vs-label, .vs-unused .vs-num, .vs-unused-text { color: #c62828; }
.vs-people { margin: 4px 0 8px; padding-left: 18px; font-size: 0.9rem; }
.sysupd-row { font-size: 0.9rem; margin: 2px 0; }
.sysupd-row span { color: #777; }
.sysupd-ok { color: #2e7d32; font-size: 0.9rem; }
.sysupd-notes { white-space: pre-wrap; background: #f3f6fb; border-left: 3px solid #1565c0; padding: 6px 10px; margin: 6px 0; font-size: 0.9rem; border-radius: 4px; }
.sysupd-blocked { color: #b71c1c; font-size: 0.9rem; }
.sysupd-blocked ul { margin: 4px 0; padding-left: 18px; }
.sysupd-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sysupd-actions button { padding: 8px 10px; font-size: 0.85rem; }
.sysupd-actions button:disabled { opacity: 0.4; }
.sysupd-status { font-size: 0.85rem; color: #555; min-height: 1.2em; }
.sysupd-status.error { color: #c62828; font-weight: 600; }
.sysupd-log { font-size: 0.8rem; color: #666; }
.sysupd-log ul { padding-left: 16px; margin: 4px 0; }
.admin-tables-zone { font-weight: 600; color: #1565c0; margin: 10px 0 4px; }
.admin-table-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.admin-table-row input { flex: 1; min-width: 0; margin: 0; }
.admin-table-cap { color: #888; font-size: 0.85rem; white-space: nowrap; }
.admin-table-row button { padding: 8px 12px; }
.admin-table-row button:disabled { opacity: 0.4; }
.admin-setting-row input { flex: 1; }
.admin-setting-status { color: #2e7d32; font-size: 0.85rem; min-height: 1.2em; margin-bottom: 8px; }
.admin-setting-hint { font-size: 0.85rem; opacity: 0.75; margin: 0 0 8px; }
.sign-rem-check { display: flex; align-items: center; gap: 8px; }
.sign-rem-check input { width: 20px; height: 20px; margin: 0; }
.badge-finished { background: #e0e0e0; color: #555; cursor: pointer; }
.left-early { font-size: 0.8rem; color: #555; }
.no-zone-block .table-block-res { border-left: 4px solid #f9a825; padding-left: 8px; }
.empty { text-align: center; color: #888; margin-top: 40px; }

.card {
  position: relative; /* заради въртележката при заета карта */
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border-left: 5px solid #bbb;
}
.card.clickable { cursor: pointer; }
.card.clickable:active { background: #f7f7f2; }
.card.status-pending { border-left-color: #f9a825; }
.card.status-confirmed { border-left-color: #2e7d32; }
.card.status-rejected { border-left-color: #c62828; }
.card.status-seated { border-left-color: #1565c0; }
.card.status-no_show { border-left-color: #c62828; }
.card.status-cancelled { border-left-color: #9e9e9e; }
.card.no-table { background: #fff59d; border-left-color: #f9a825; }
.card.no-table.clickable:active { background: #ffee85; }
.card.large-group { background: #bbdefb; border-left-color: #1565c0; }
.card.large-group.clickable:active { background: #a6d1f7; }

/* Неуспешно писмо до госта. Стои СЛЕД жълтото и синьото, за да ги надделее — гост,
   който не знае, че е потвърден, е по-спешен от „без маса" или „голяма група". */
.card.mail-alert { background: #ffcdd2; border-left-color: #c62828; }
.card.mail-alert.clickable:active { background: #f5b7bc; }

/* Потвърждаването праща писмо до госта и известие до телефоните, преди сървърът
   да отговори — това трае секунди. Дотогава картата се заключва и се върти, за да
   не изглежда, че натискането не е минало, и да не се натисне втори път. */
.card.busy { pointer-events: none; opacity: 0.5; }
.card.busy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid rgba(0, 0, 0, 0.15);
  border-top-color: #2e7d32;
  border-radius: 50%;
  animation: card-spin 0.8s linear infinite;
}
@keyframes card-spin { to { transform: rotate(360deg); } }

/* Някои телефони са с изключени анимации — тогава поне да личи, че нещо тече */
@media (prefers-reduced-motion: reduce) {
  .card.busy::after { animation: none; border-top-color: rgba(0, 0, 0, 0.15); }
}

.card-header { display: flex; justify-content: space-between; align-items: center; font-size: 1rem; }
.badge { font-size: 0.75rem; background: #eee; padding: 2px 8px; border-radius: 999px; }
.badge-pending { background: #f9a825; color: #fff; }
.badge-confirmed { background: #2e7d32; color: #fff; cursor: pointer; }
.badge-seated { background: #1565c0; color: #fff; cursor: pointer; }
.badge-no_show { background: #c62828; color: #fff; cursor: pointer; }
.badge-cancelled { background: #9e9e9e; color: #fff; cursor: pointer; }
.customer-name { display: flex; align-items: center; gap: 8px; }
.card-place { color: #1565c0; }
.sign-check { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; cursor: pointer; flex: 0 0 auto; }
.sign-check input { width: 20px; height: 20px; margin: 0; accent-color: #2e7d32; }
.sign-check .sign-icon { font-size: 1.1rem; opacity: 0.35; filter: grayscale(1); }
.sign-check.on .sign-icon { opacity: 1; filter: none; }
.incident-count { display: inline-block; min-width: 18px; margin-left: 2px; padding: 0 5px; border-radius: 9px; background: #fff; color: #6a1b1b; font-size: 0.75rem; font-weight: 700; line-height: 18px; text-align: center; vertical-align: top; }
.incident-customer { border: 1px solid #e6c4c4; border-left: 4px solid #6a1b1b; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; background: #fdf6f6; }
.incident-customer-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.incident-email { color: #555; font-size: 0.85rem; }
.incident-n { margin-left: auto; color: #6a1b1b; font-size: 0.8rem; font-weight: 600; }
.problem-mark { font-size: 0.95em; }
.problem-flag { color: #fff; background: #6a1b1b; display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 0.85rem; margin: 2px 0; }
.incident-warn { margin: 4px 0 10px; padding: 10px 12px; background: #f8e5e5; border: 1px solid #d9a3a3; border-left: 4px solid #6a1b1b; border-radius: 8px; font-size: 0.9rem; }
.incident-warn .incident-title { font-weight: 700; color: #6a1b1b; }
.incident-warn ul, .incident-list { margin: 6px 0 0; padding: 0; list-style: none; }
.incident-item { padding: 6px 0; border-top: 1px solid rgba(0, 0, 0, 0.08); }
.incident-item:first-child { border-top: none; }
.incident-note { white-space: pre-wrap; }
.incident-meta { color: #777; font-size: 0.8rem; margin-top: 2px; }
.incident-remove { margin-left: 8px; padding: 2px 8px; font-size: 0.8rem; border: 1px solid #6a1b1b; background: #fff; color: #6a1b1b; border-radius: 6px; cursor: pointer; }
/* семпло — рядко се ползва, не бива да изпъква в редакцията */
.incident-btn { display: block; margin: 4px 0 4px auto; padding: 4px 8px; border: none; background: none; color: #888; font-size: 0.8rem; text-decoration: underline; cursor: pointer; }
.incident-btn:active { color: #6a1b1b; }
.incident-hint { color: #888; font-size: 0.8rem; margin: 6px 0; }
.incident-save { background: #6a1b1b; color: #fff; border: none; }
body.viewer .incident-btn, body.viewer .incident-remove { display: none !important; }
.noshow-flag { color: #c62828; font-weight: 600; font-size: 0.85rem; }
.noshow-warn { margin: 4px 0 10px; padding: 10px 12px; background: #fdecea; border: 1px solid #f5c2c0; border-left: 4px solid #c62828; border-radius: 8px; font-size: 0.9rem; }
.noshow-warn .noshow-title { font-weight: 700; color: #b71c1c; }
.noshow-warn .noshow-sub { color: #777; font-size: 0.8rem; }
.noshow-warn ul { margin: 6px 0 0; padding-left: 18px; }
.admin-sub { margin: 16px 0 6px; font-size: 1rem; color: #333; border-bottom: 1px solid #ddd; padding-bottom: 4px; }
.noshow-warn .noshow-reset, #admin-noshows-list .noshow-reset { margin-top: 8px; padding: 6px 10px; font-size: 0.85rem; border: 1px solid #c62828; background: #fff; color: #c62828; border-radius: 6px; cursor: pointer; }
.noshow-choices { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 4px; }
.noshow-choices button { text-align: left; padding: 14px; border: none; border-radius: 10px; color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; }
.noshow-choices button small { display: block; font-weight: 400; font-size: 0.8rem; opacity: 0.9; margin-top: 2px; }
.noshow-silent { background: #c62828; }
.noshow-called { background: #607d8b; }
.badge-rejected { background: #757575; color: #fff; cursor: pointer; }
.card-body { margin-top: 6px; font-size: 0.9rem; color: #444; display: flex; flex-direction: column; gap: 2px; }
.customer-name { font-weight: 600; color: #222; }
.phone-link { color: #1565c0; text-decoration: none; }
.phone-link:active { text-decoration: underline; }
.notes { font-style: italic; white-space: pre-line; }
.handled-by { font-size: 0.8rem; color: #999; }
.oversized-hint { color: #e65100; font-size: 0.8rem; font-weight: 600; }
/* Неуспешно писмо до госта. Досега се виждаше само в базата — тоест никога, а
   персоналът смяташе госта за уведомен. Тук стои видимо, защото иска обаждане. */
.mail-failed { color: #b71c1c; font-size: 0.85rem; font-weight: 700; }
.card-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.card-actions button {
  flex: 1;
  min-width: 90px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #c8c8c2;
  background: #e8e8e2;
  font-size: 0.9rem;
  cursor: pointer;
}
.seated-controls { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.seated-controls button {
  flex: 1;
  min-width: 70px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #90caf9;
  background: #fff;
  color: #1565c0;
  font-size: 0.85rem;
  cursor: pointer;
}
.seated-controls .release { background: #757575; color: #fff; border-color: #757575; }
.card-actions .confirm { background: #2e7d32; color: #fff; border: none; }
.card-actions .reject { background: #c62828; color: #fff; border: none; flex: 0 0 auto; min-width: 44px; font-size: 1.1rem; }
.card-actions [data-outcome="seated"] { background: #1565c0; color: #fff; border: none; }
.card-actions [data-outcome="no_show"] { background: #c62828; color: #fff; border: none; }
.outcome-bar { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; padding: 8px 10px; background: #f1f8f1; border-radius: 8px; }
.outcome-bar .badge { margin-right: auto; }
.outcome-bar button { padding: 10px 16px; border: none; border-radius: 8px; color: #fff; font-size: 0.95rem; cursor: pointer; }
.outcome-bar [data-modal-outcome="seated"] { background: #1565c0; }
.outcome-bar [data-modal-outcome="no_show"] { background: #c62828; }
body.viewer .outcome-bar { display: none !important; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}
@media (min-width: 480px) {
  .modal-overlay { align-items: center; }
}
.modal {
  background: #fff;
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (min-width: 480px) {
  .modal { border-radius: 16px; }
}
.modal { max-width: 560px; }
.modal textarea#r-notes, .modal textarea#s-notes { min-height: 200px; flex-shrink: 0; line-height: 1.4; resize: vertical; }
.modal h2 { margin: 0 0 8px; color: #2e7d32; }
.modal label { font-size: 0.85rem; color: #555; margin-top: 4px; }
.modal input, .modal select, .modal textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  width: 100%;
}
.confirm-save { background: #2e7d32; color: #fff; border: none; }
.review-hint { font-size: 0.85rem; color: #8d6100; margin-top: 4px; }
.seating-pref { font-weight: 600; }
.pending-inbox { background: #fff8e1; border: 2px solid #f9a825; border-radius: 10px; padding: 10px 12px; margin: 10px 0 14px; }
.pending-inbox h3 { margin: 0 0 8px; font-size: 1rem; color: #8d6100; }
.sign-banner { background: #fdecea; border: 2px solid #d84315; border-radius: 10px; padding: 10px 12px; margin: 10px 0 14px; }
.sign-banner h3 { margin: 0 0 6px; font-size: 1rem; color: #b23c17; }
.sign-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid rgba(216, 67, 21, 0.18); }
.sign-row:first-child { border-top: none; }
.sign-row-text { flex: 1; min-width: 0; }
.sign-row-time { font-weight: 700; }
.sign-row .sign-check { margin-left: 0; }
.time-wrap { position: relative; }
.time-display {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
  min-height: 42px;
  box-sizing: border-box;
}
.modal .time-wrap input[type="time"], .modal .time-wrap input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; }
.toolbar .time-wrap input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; }
.toolbar .time-wrap .time-display { padding: 10px; min-height: 0; font-size: 16px; border: 1px solid #ddd; border-radius: 8px; background: #fff; }
.modal .row { display: flex; gap: 10px; }
.modal .row > div { flex: 1; }

.table-toggle-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.table-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #c8c8c2;
  background: #e8e8e2;
  font-size: 0.85rem;
  cursor: pointer;
}
.table-chip.selected { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.table-chip.identity-chip { padding: 14px 18px; font-size: 1rem; }

.staff-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.staff-row button { background: none; border: none; color: #c62828; font-size: 1.1rem; cursor: pointer; }
.modal-actions { display: flex; gap: 10px; margin-top: 12px; }
.modal-actions button { flex: 1; padding: 12px; border-radius: 8px; font-size: 1rem; cursor: pointer; }
/* докато заявката пътува — да личи, че натискането е прието и втори път не трябва */
.modal-actions button:disabled { opacity: 0.6; cursor: progress; }
.modal-actions button[type="submit"] { background: #2e7d32; color: #fff; border: none; }
.modal-actions .secondary { background: #e8e8e2; border: 1px solid #c8c8c2; }
.modal-actions button:not([type="submit"]):not(.secondary) { background: #2e7d32; color: #fff; border: none; }

.search-summary { color: #555; font-size: 0.9rem; margin: 0 0 8px; }

.availability-list { padding: 0; max-height: 50vh; overflow-y: auto; }
.zone-heading { font-weight: 600; color: #2e7d32; margin: 12px 0 6px; font-size: 0.9rem; }
.zone-heading:first-child { margin-top: 0; }

.table-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #eee;
  margin-bottom: 8px;
  background: #fff;
}
.table-card.free {
  border-left: 4px solid #2e7d32;
  cursor: pointer;
}
.table-card.free:active { background: #f0f7f0; }
.table-card.free.selected { background: #e8f5e9; border-left-width: 6px; }
.table-card.busy {
  border-left: 4px solid #c62828;
  opacity: 0.7;
  cursor: pointer;
}
/* „Провери маси“: зона + превключвател „Списък | Лента“ */
.avail-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.avail-bar #zone-filter { flex: 1; min-width: 140px; }
.avail-mode { display: flex; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.avail-mode button { padding: 8px 12px; font-size: 0.9rem; border: none; background: #fff; cursor: pointer; }
.avail-mode button + button { border-left: 1px solid #ddd; }
.avail-mode button.active { background: #1565c0; color: #fff; }
.avail-row { cursor: pointer; }
.avail-row.st-busy .fr-state { font-size: 0.8rem; font-weight: 500; }
.avail-row.selected { background: #e8f5e9; border-left-width: 6px; }
.avail-row.st-busy.selected { background: #fff4e5; border-left-color: #ef8f00; }
/* заета, но избрана въпреки застъпването */
.table-card.busy.selected { opacity: 1; background: #fff4e5; border-left: 6px solid #ef8f00; }
.table-card .busy-item { text-align: right; }
.table-card .busy-item + .busy-item { margin-top: 2px; }
.table-card .table-status { text-align: right; }
.table-card .later-item { color: #555; margin-top: 2px; }
.table-card .table-name { font-weight: 600; }
.table-card .table-capacity { color: #777; font-size: 0.85rem; }
.table-card .table-status { font-size: 0.8rem; }
.table-card .table-status.free-label { color: #2e7d32; }
.table-card .table-status.busy-label { color: #c62828; }

.menu-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.menu-tools button { flex: 1; padding: 9px; border-radius: 8px; border: 1px solid #c8c8c2; background: #e8e8e2; font-size: 0.9rem; cursor: pointer; }
.menu-preview { background: #f5f5f0; border: 1px solid #ddd; border-radius: 8px; padding: 10px; margin-bottom: 8px; font-size: 0.85rem; }
.menu-preview .menu-preview-err { color: #c62828; }
.menu-preview ul { margin: 4px 0 8px; padding-left: 18px; }
.menu-preview .modal-actions { margin-top: 6px; }
.menu-cat { font-weight: 600; color: #2e7d32; margin: 12px 0 2px; font-size: 0.9rem; }
.menu-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #eee; font-size: 0.92rem; }
.menu-row.inactive .menu-name { color: #999; text-decoration: line-through; }
.menu-row .menu-name { flex: 1; }
.menu-row button { background: none; border: none; font-size: 1rem; cursor: pointer; padding: 2px 6px; }
.menu-cat { display: flex; align-items: center; gap: 4px; }
.menu-cat button { background: none; border: none; font-size: 0.9rem; cursor: pointer; padding: 2px 6px; margin-left: auto; }
.menu-en { display: block; color: #888; font-size: 0.8rem; font-weight: 400; }
.menu-cat .menu-en { display: inline; }
.menu-col { flex: 0 0 46px; display: flex; justify-content: center; }
.menu-row .menu-col .menu-check { margin: 0; }
.menu-web-check { width: 20px; height: 20px; margin: 0; padding: 0; accent-color: #1565c0; }
.menu-head { position: sticky; top: 0; z-index: 1; background: #fff; font-size: 0.75rem; font-weight: 700; color: #555; text-transform: uppercase; border-bottom: 2px solid #ccc; }
.menu-head .menu-col:nth-child(1) { color: #2e7d32; }
.menu-head .menu-col:nth-child(2) { color: #1565c0; }
.menu-legend { color: #666; font-size: 0.8rem; margin: 4px 0 8px; }
.menu-edit { background: #f5f8f5; border: 1px solid #cfe0cf; border-radius: 8px; padding: 10px; margin: 4px 0 8px; }
.menu-edit label { display: block; font-size: 0.8rem; color: #555; margin: 0 0 8px; }
.menu-edit input { width: 100%; box-sizing: border-box; margin-top: 2px; }
.menu-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.menu-edit-err:empty { display: none; }
.menu-edit .menu-del { margin-right: auto; background: #fff; color: #c62828; border: 1px solid #c62828; }
.menu-edit .menu-del.armed { background: #c62828; color: #fff; }

.user-label { color: #fff; font-size: 0.85rem; opacity: 0.9; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-row .menu-check { width: 20px; height: 20px; flex: 0 0 auto; margin: 0 8px 0 0; padding: 0; accent-color: #2e7d32; }

.notes-head { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.notes-head label { margin: 0; }
.menu-pick-btn { padding: 6px 12px; border-radius: 8px; border: 1px solid #2e7d32; background: #fff; color: #2e7d32; font-size: 0.85rem; cursor: pointer; }
.picker-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; }
.picker-chips .table-chip { flex: 0 0 auto; white-space: nowrap; }
.picker-list { max-height: 45vh; overflow-y: auto; }
.pick-cat { font-weight: 600; color: #2e7d32; margin: 10px 0 2px; font-size: 0.9rem; }
.pick-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #eee; font-size: 0.92rem; }
.pick-row .pick-name { flex: 1; }
.pick-qty { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pick-qty button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #c8c8c2; background: #e8e8e2; font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0; }
.pick-qty button.plus { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.pick-qty .pick-n { min-width: 18px; text-align: center; font-weight: 600; }
.pick-row.has-qty .pick-name { font-weight: 600; }

/* „По часове": блок за всеки час, кратки редове „час · маса · име · хора" */
.hour-block { background: #fff; border-radius: 10px; border: 1px solid #eee; padding: 8px 12px; margin-bottom: 10px; }
.hour-block-heading { font-weight: 600; color: #1565c0; font-size: 0.8rem; padding-bottom: 4px; }
.hour-block-sum { font-weight: 400; color: #666; }
.hour-row {
  display: grid;
  grid-template-columns: 3.2em minmax(3.5em, auto) 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid #f2f2f2;
  font-size: 0.9rem;
  cursor: pointer;
}
.hour-row:active { background: #f7f7f2; }
.hour-row.no-table { background: #fff8e1; }
.hr-time { font-weight: 600; }
.hr-table { color: #444; }
.hr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hr-party { color: #444; white-space: nowrap; }

/* Профил „само за гледане" (роля viewer): без бутони и без кликаеми значки.
   Само подсказка — сървърът сам отказва всяка промяна от такъв профил. */
body.viewer .card-actions,
body.viewer .seated-controls,
body.viewer #check-tables-btn,
body.viewer #rejected-btn { display: none !important; }
body.viewer .badge,
body.viewer .card,
body.viewer .table-block-res,
body.viewer .hour-row { cursor: default; }
/* „Седнали и приключили" — сгънати най-долу в „Списък" */
.done-box { border: 1px solid #ccc; border-radius: 10px; background: #f5f5f5; }
.done-box > summary { padding: 12px 14px; font-weight: 600; color: #555; cursor: pointer; }
.done-box > .list { padding: 0 10px 10px; }

/* клавиатура за час (24 ч.), вместо колелото на телефона */
.time-key { cursor: pointer; caret-color: transparent; }
.tp-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.tp-overlay.hidden { display: none; }
.tp-sheet { width: 100%; max-width: 420px; background: #f3f1ec; border-radius: 16px 16px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.tp-title { text-align: center; font-size: 0.9rem; color: #555; }
.tp-hint { text-align: center; font-size: 0.85rem; color: #8d6100; margin-top: 4px; }
.tp-display { text-align: center; font-size: 44px; font-weight: 700; letter-spacing: 2px; margin: 6px 0 2px; font-variant-numeric: tabular-nums; color: #222; }
.tp-msg { display: table; margin: 0 auto 10px; padding: 3px 12px; border-radius: 12px; background: #e6e2d9; font-size: 0.85rem; color: #555; }
.tp-msg.err { background: #fde7e7; color: #c62828; font-weight: 600; }
.tp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tp-mins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.tp-sheet button { height: 54px; border-radius: 12px; border: 1px solid #e2ded5; background: #fff; font-size: 24px; color: #222; cursor: pointer; }
.tp-sheet button:active { background: #e8e4da; }
.tp-sheet .tp-soft { background: #ebe8e1; }
.tp-sheet .tp-wide { grid-column: 2; }
.tp-mins button { background: #fff8e1; border-color: #f0dca0; font-size: 20px; font-weight: 600; color: #6d4c00; }
.tp-sheet .tp-ok { width: 100%; margin-top: 10px; background: #2e7d32; border-color: #2e7d32; color: #fff; font-size: 18px; font-weight: 600; }

/* Общ екран за вход на Veda House — същият блок стои в резервациите, OMS и ревизията. Пипаш ли го, смени го и в трите. */
html:has(.vh-login), body:has(.vh-login) { background: #F7F7F2; }
.login-form.vh-login { box-sizing: border-box; width: calc(100% - 32px); max-width: 320px; margin: 14vh auto; padding: 24px;
  display: flex; flex-direction: column; gap: 12px; background: #fff; border-radius: 16px; box-shadow: 0 2px 16px rgba(0,0,0,.08);
  text-align: center; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-feature-settings: normal; }
.vh-login h1 { margin: 0 0 4px; color: #1B472E; font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: normal; }
.vh-login input { box-sizing: border-box; width: 100%; height: auto; margin: 0; padding: 12px; border: 1px solid #DEE2DA; border-radius: 10px;
  background: #fff; color: #1D2420; font: inherit; font-size: 16px; }
.vh-login input:focus { outline: none; border-color: #1B472E; }
.vh-login .pw-wrap { display: block; }
.vh-login .pw-toggle { display: none; }
.vh-login button[type=submit] { width: 100%; height: auto; margin: 0; padding: 12px; background: #1B472E; color: #fff; border: none;
  border-radius: 10px; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.vh-login .error, .vh-login .err { color: #B41B2C; min-height: 1.2em; margin: 0; font-size: 14px; font-weight: 600; }
