/* Карамановите къщи · Резервации. Цветовете и шрифтовете са от сайта (здрач, вар, марена, жар, орех). */

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/onest-cyrillic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/onest-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Old Standard TT';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('fonts/old-standard-tt-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Old Standard TT';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('fonts/old-standard-tt-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --night: #141c24;
  --night-2: #222e3a;
  --mist: #e8eae7;
  --lime: #f6f7f4;
  --paper: #fff;
  --madder: #9e2f28;
  --madder-2: #b13a31;
  --madder-ink: #7a221c;
  --ember: #f0a04b;
  --ink: #2c221c;
  --ink-2: #5a514a;
  --ink-3: #6e655e; /* 4,7:1 върху мъглата (#e8eae7), 5,7:1 върху бяло */
  --line: #d9d5cd;
  --line-2: #e9e6e0;
  --ok-bg: #dbecdc;
  --ok: #3a7a4c;
  --ok-ink: #1b3a25;
  --wait-bg: #fbe0d0;
  --wait: #c2412f;
  --wait-ink: #5a1f15;
  --bk-bg: #dae5f4;
  --bk: #2f5d9c;
  --bk-ink: #17304f;
  --inq-bg: #fff0c2;
  --inq: #b3851a;
  --inq-ink: #4a3a10;
  --cancel-bg: #f6e4e1;
  --cancel: #9b3c33;
  --weekend: #f3ebdf;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 28, 36, 0.06), 0 6px 18px rgba(20, 28, 36, 0.08);
  --shadow-lg: 0 10px 40px rgba(20, 28, 36, 0.22);
  --ff: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ff-d: 'Old Standard TT', Georgia, 'Times New Roman', serif;
  --head-h: 58px;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 400 15px/1.45 var(--ff);
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--madder);
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid rgba(240, 160, 75, 0.9);
  outline-offset: 2px;
}
.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.noscript {
  padding: 24px;
  text-align: center;
}

/* ---------- зареждане ---------- */
.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--ink-2);
}
.wheel {
  width: 44px;
  height: 44px;
  color: var(--madder);
}
.wheel--spin {
  animation: spin 1.6s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .wheel--spin {
    animation: none;
  }
  * {
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- бутони, полета ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 560;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn--primary {
  background: var(--madder);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  background: var(--madder-2);
}
.btn--line {
  border-color: var(--line);
  background: var(--paper);
}
.btn--line:hover:not(:disabled) {
  border-color: var(--ink-3);
}
.btn--ghost {
  background: transparent;
}
.btn--ghost:hover:not(:disabled) {
  background: rgba(44, 34, 28, 0.06);
}
.btn--danger {
  color: var(--cancel);
  border-color: #e3bdb7;
  background: var(--paper);
}
.btn--danger:hover:not(:disabled) {
  background: var(--cancel-bg);
}
.btn--sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}
.btn--icon {
  width: 42px;
  padding: 0;
}
.btn--sm.btn--icon {
  width: 34px;
}
.btn.is-busy {
  position: relative;
  color: transparent !important;
}
.btn.is-busy::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn--line.is-busy::after,
.btn--ghost.is-busy::after {
  border-color: rgba(44, 34, 28, 0.25);
  border-top-color: var(--ink);
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.field > span,
.field__label {
  font-size: 13px;
  font-weight: 560;
  color: var(--ink-2);
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(240, 160, 75, 0.28);
}
.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.45;
}
.select {
  appearance: none;
  padding-right: 34px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235a514a' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.input[aria-invalid='true'],
.select[aria-invalid='true'],
.textarea[aria-invalid='true'] {
  border-color: var(--wait);
}
.field__err {
  font-size: 13px;
  color: var(--wait);
  min-height: 0;
}
.field__err:empty {
  display: none;
}
.money {
  position: relative;
}
.money .input {
  padding-right: 32px;
}
.money::after {
  content: '€';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  cursor: pointer;
  font-size: 15px;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--madder);
  margin: 0;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--line-2);
  gap: 2px;
  flex-wrap: wrap;
}
.seg button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 560;
  color: var(--ink-2);
  cursor: pointer;
}
.seg button[aria-pressed='true'] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 28, 36, 0.15);
}
.seg--status button[data-v='inquiry'][aria-pressed='true'] {
  background: var(--inq-bg);
  color: var(--inq-ink);
}
.seg--status button[data-v='booked'][aria-pressed='true'] {
  background: var(--ok-bg);
  color: var(--ok-ink);
}
.seg--status button[data-v='cancelled'][aria-pressed='true'] {
  background: var(--cancel-bg);
  color: var(--cancel);
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 520;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.chip[aria-pressed='true'] {
  border-color: var(--night);
  background: var(--night);
  color: #fff;
}
.chip .n {
  font-size: 12px;
  color: var(--ink-3);
}
.chip[aria-pressed='true'] .n {
  color: rgba(255, 255, 255, 0.8);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ember);
  color: var(--night);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--line-2);
  color: var(--ink-2);
}
.tag--ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
}
.tag--wait {
  background: var(--wait-bg);
  color: var(--wait-ink);
}
.tag--booking {
  background: var(--bk-bg);
  color: var(--bk-ink);
}
.tag--inquiry {
  background: var(--inq-bg);
  color: var(--inq-ink);
}
.tag--cancelled {
  background: var(--cancel-bg);
  color: var(--cancel);
}
.tag--new {
  background: var(--ember);
  color: var(--night);
}

/* ---------- рамката ---------- */
.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--head-h);
  padding: 0 18px;
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--head-h) + env(safe-area-inset-top, 0px));
  background: var(--night);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}
.brand .wheel {
  width: 30px;
  height: 30px;
  color: var(--ember);
}
.brand b {
  display: block;
  font: 400 19px/1.05 var(--ff-d);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.tabs {
  display: flex;
  gap: 2px;
  margin-left: 12px;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 540;
  font-size: 14.5px;
  white-space: nowrap;
}
.tabs a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.tabs a[aria-current='page'] {
  color: var(--night);
  background: var(--lime);
}
.top__end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.search {
  position: relative;
}
.search .i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.search input {
  width: 230px;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
}
.search input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}
.search input:focus {
  outline: none;
  border-color: var(--ember);
  background: rgba(255, 255, 255, 0.12);
}
.top .btn--ghost {
  color: #fff;
}
.top .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}
.top__new {
  background: var(--ember);
  color: var(--night);
}
.top__new:hover {
  background: #f5b46a;
}
.userbtn {
  max-width: 160px;
}
.userbtn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  flex: 1;
  width: 100%;
  padding: 18px 18px 28px;
}
.view-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 14px;
}
.view-head h1 {
  font: 400 28px/1.1 var(--ff-d);
  margin-right: auto;
}
.view-head h1 small {
  display: block;
  margin-top: 4px;
  font: 500 13px/1.3 var(--ff);
  color: var(--ink-3);
}
.wrap {
  max-width: 1240px;
  margin: 0 auto;
}
.wrap--narrow {
  max-width: 820px;
  margin: 0 auto;
}
.monthnav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.monthnav .select {
  width: auto;
  min-height: 38px;
  padding: 6px 30px 6px 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.card {
  background: var(--paper);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card--pad {
  padding: 18px;
}
.card h2 {
  font-size: 17px;
  margin-bottom: 12px;
}
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty .i {
  width: 34px;
  height: 34px;
  color: var(--line);
}
.muted {
  color: var(--ink-3);
}
.small {
  font-size: 13px;
}
.note {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--lime);
  border: 1px solid var(--line-2);
  font-size: 14px;
}
.note--warn {
  background: var(--wait-bg);
  border-color: #f0c2ad;
  color: var(--wait-ink);
}
.note--info {
  background: var(--inq-bg);
  border-color: #ecd98f;
  color: var(--inq-ink);
}

/* ---------- долното меню (телефон) ---------- */
.bnav {
  display: none;
}
.fab {
  display: none;
}

/* ---------- Таблица ---------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border-left: 4px solid;
}
.lg-ok {
  background: var(--ok-bg);
  border-color: var(--ok) !important;
}
.lg-wait {
  background: var(--wait-bg);
  border-color: var(--wait) !important;
}
.lg-booking {
  background: var(--bk-bg);
  border-color: var(--bk) !important;
}
.lg-inquiry {
  background: var(--inq-bg);
  border: 1.5px dashed var(--inq) !important;
}

.unassigned {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--inq-bg);
  color: var(--inq-ink);
  font-size: 14px;
}
.unassigned b {
  margin-right: 4px;
}
.unassigned button {
  border: 1px dashed var(--inq);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  padding: 5px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--inq-ink);
}

/* таблицата запълва екрана под менюто; превърта се само тя */
.view-grid {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--head-h) - 18px - 16px);
  min-height: 460px;
}
.main.view-tablitsa {
  padding-bottom: 16px;
}
.view-grid > * {
  flex: none;
}
.view-grid > .gridwrap {
  flex: 1 1 auto;
}
.gridwrap {
  --dw: 76px;
  --cw: 100px;
  --rh: 34px;
  --h1: 30px;
  --h2: 30px;
  position: relative;
  overflow: auto;
  min-height: 240px;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.grid {
  position: relative;
  display: grid;
  grid-template-columns: var(--dw) repeat(var(--n), minmax(var(--cw), 1fr));
  grid-template-rows: var(--h1) var(--h2) repeat(var(--days), var(--rh));
  width: max(100%, calc(var(--dw) + var(--n) * var(--cw)));
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x pan-y;
}
.g-corner,
.g-group,
.g-unit,
.g-date {
  display: flex;
  align-items: center;
  background: var(--paper);
}
.g-corner {
  grid-row: 1 / span 2;
  grid-column: 1;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 8;
  justify-content: center;
  font-size: 12px;
  color: var(--ink-3);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.g-group {
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 6;
  justify-content: center;
  font: 400 15px/1 var(--ff-d);
  color: var(--ink);
  background: #efebe4;
  border-right: 2px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.g-unit {
  grid-row: 2;
  position: sticky;
  top: var(--h1);
  z-index: 6;
  justify-content: center;
  padding: 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
}
.g-unit.is-last,
.g-col.is-last {
  border-right: 2px solid var(--line);
}
.g-date {
  grid-column: 1;
  position: sticky;
  left: 0;
  z-index: 5;
  gap: 6px;
  padding: 0 8px;
  font-size: 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.g-date b {
  min-width: 18px;
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.g-date span {
  color: var(--ink-3);
}
.g-date.is-we {
  background: var(--weekend);
}
.g-date.is-we span {
  color: var(--ink-2);
  font-weight: 600;
}
.g-date.is-today {
  box-shadow: inset 4px 0 0 var(--madder);
}
.g-date.is-today b {
  color: var(--madder);
}
.g-row {
  grid-column: 2 / -1;
  border-bottom: 1px solid var(--line-2);
  pointer-events: none;
}
.g-row.is-we {
  background: rgba(243, 235, 223, 0.55);
}
.g-row.is-today {
  background: rgba(158, 47, 40, 0.06);
}
.g-col {
  grid-row: 3 / -1;
  border-right: 1px solid var(--line-2);
  pointer-events: none;
}
.g-sel {
  z-index: 2;
  margin: 2px;
  border: 2px solid var(--ember);
  border-radius: 6px;
  background: rgba(240, 160, 75, 0.22);
  pointer-events: none;
}
.blk {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  margin: 2px 3px;
  padding: 2px 6px 2px 7px;
  border: 0;
  border-left: 4px solid var(--ok);
  border-radius: 6px;
  background: var(--ok-bg);
  color: var(--ok-ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(20, 28, 36, 0.06);
  transition: filter 0.12s, box-shadow 0.12s;
}
.blk:hover {
  filter: brightness(0.97);
  box-shadow: 0 2px 8px rgba(20, 28, 36, 0.15);
}
.blk__in {
  display: block;
  min-width: 0;
}
.blk.tall {
  justify-content: flex-start;
  padding-top: 6px;
  overflow: clip;
}
/* името остава видимо, докато се превърта дълъг престой */
.blk.tall .blk__in {
  position: sticky;
  top: calc(var(--h1) + var(--h2) + 6px);
}
.blk.tall b {
  display: -webkit-box;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.blk.tall small {
  margin-top: 2px;
}
.blk b {
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blk small {
  display: block;
  font-size: 11.5px;
  line-height: 1.25;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blk .marks {
  position: absolute;
  top: 3px;
  right: 4px;
  display: flex;
  gap: 3px;
}
.blk .mk {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.75);
}
.blk.has-marks b {
  padding-right: 18px;
}
.blk.s-wait {
  border-color: var(--wait);
  background: var(--wait-bg);
  color: var(--wait-ink);
}
.blk.s-booking {
  border-color: var(--bk);
  background: var(--bk-bg);
  color: var(--bk-ink);
}
.blk.s-inquiry {
  border: 1.5px dashed var(--inq);
  border-left: 4px solid var(--inq);
  background: var(--inq-bg);
  color: var(--inq-ink);
}
.blk.cont-up {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 0;
}
.blk.cont-down {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}

.selbar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: var(--night);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  max-width: calc(100vw - 24px);
}
.selbar__text {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.selbar.has-tip {
  border-radius: 18px;
}
.selbar__tip {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  text-overflow: ellipsis;
}
.selbar .btn--ghost {
  color: #fff;
}

/* ---------- Резервации (списък) ---------- */
.mtabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.mtabs a {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 560;
  color: var(--ink-2);
  text-decoration: none;
  background: transparent;
}
.mtabs a:hover {
  background: rgba(44, 34, 28, 0.06);
}
.mtabs a[aria-current='page'] {
  background: var(--night);
  color: #fff;
}
.mtabs a .n {
  margin-left: 4px;
  font-size: 12px;
  opacity: 0.6;
}
.rtable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14.5px;
}
.rtable th {
  position: sticky;
  top: var(--head-h);
  z-index: 2;
  padding: 10px 10px;
  background: #efebe4;
  text-align: left;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.rtable th:first-child {
  border-top-left-radius: var(--r);
}
.rtable th:last-child {
  border-top-right-radius: var(--r);
}
.rtable td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
  background: var(--paper);
}
.rtable tr.row {
  cursor: pointer;
}
.rtable tr.row:hover td {
  background: #fbfaf7;
}
.rtable td:first-child {
  border-left: 4px solid var(--ok);
}
.rtable tr.s-wait td:first-child {
  border-left-color: var(--wait);
}
.rtable tr.s-booking td:first-child {
  border-left-color: var(--bk);
}
.rtable tr.s-inquiry td:first-child {
  border-left-color: var(--inq);
}
.rtable tr.s-cancelled td {
  background: #fbf3f2;
  color: var(--cancel);
}
.rtable tr.s-cancelled td:first-child {
  border-left-color: var(--cancel);
}
.rtable tr.s-cancelled .strike {
  text-decoration: line-through;
}
.rtable .nights {
  white-space: nowrap;
  font-weight: 600;
}
.rtable .nm {
  font-weight: 650;
}
.rtable .num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.rtable .wide {
  min-width: 180px;
  max-width: 340px;
}
.rtable tfoot td {
  background: #f3f0ea;
  font-weight: 600;
  border-bottom: 0;
}
.rtable tfoot td:first-child {
  border-left-color: transparent;
  border-bottom-left-radius: var(--r);
}
.rtable tfoot td:last-child {
  border-bottom-right-radius: var(--r);
}
.tbl-card {
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.rtable-wrap {
  overflow-x: auto;
}
.rtable-wrap .rtable th {
  position: static;
}
.rtable .num {
  text-align: right;
}
.rtable .num .tag {
  margin-top: 3px;
}
.rtable .what {
  min-width: 140px;
}
.phone-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px dotted var(--ink-3);
}
.rcards {
  display: none;
}
.rcard {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px 12px 14px;
  border: 0;
  border-left: 5px solid var(--ok);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}
.rcard.s-wait {
  border-left-color: var(--wait);
}
.rcard.s-booking {
  border-left-color: var(--bk);
}
.rcard.s-inquiry {
  border-left-color: var(--inq);
}
.rcard.s-cancelled {
  border-left-color: var(--cancel);
  background: #fbf3f2;
}
.rcard.s-cancelled .nm {
  text-decoration: line-through;
  color: var(--cancel);
}
.rcard__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.rcard .nights {
  font-weight: 650;
  font-size: 14px;
}
.rcard .nm {
  font-size: 16px;
  font-weight: 650;
}
.rcard .meta {
  font-size: 14px;
  color: var(--ink-2);
}
.rcard .money-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 14px;
}
.totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--r);
  background: #f3f0ea;
  font-size: 14px;
}
.totals b {
  font-variant-numeric: tabular-nums;
}

/* ---------- запитвания ---------- */
.inq-list {
  display: grid;
  gap: 12px;
}
.inq {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--inq);
}
.inq.is-new {
  box-shadow: 0 0 0 2px var(--ember), var(--shadow);
}
.inq__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.inq__top h2 {
  font-size: 18px;
  margin-right: auto;
}
.inq__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14.5px;
}
.inq__facts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inq__msg {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--lime);
  font-size: 14.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.inq__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- сметки ---------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.stat span {
  display: block;
  font-size: 13px;
  color: var(--ink-3);
}
.stat b {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.stat.is-warn b {
  color: var(--wait);
}
.mtable td.num,
.mtable th.num {
  text-align: right;
}
.mtable td:first-child {
  border-left: 0;
  font-weight: 600;
}
.mtable tr.is-empty td {
  color: var(--ink-3);
}
.list {
  display: grid;
}
.list-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-2);
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row .grow {
  flex: 1;
  min-width: 180px;
}
.list-row .nm {
  font-weight: 650;
}
.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.linkbtn:hover .nm {
  text-decoration: underline;
}
.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

/* ---------- телефони ---------- */
.guest {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
}
.guest:last-child {
  border-bottom: 0;
}
.guest .grow {
  flex: 1;
  min-width: 200px;
}
.guest .nm {
  font-weight: 650;
  font-size: 15.5px;
}
.contact {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 560;
  color: var(--ink);
  text-decoration: none;
}
.contact a:hover {
  border-color: var(--ink-3);
}
.contact a.is-main {
  border-color: var(--night);
  background: var(--night);
  color: #fff;
}

/* ---------- настройки ---------- */
.settings {
  display: grid;
  gap: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.units-edit {
  display: grid;
  gap: 8px;
}
.units-edit .row {
  display: grid;
  grid-template-columns: 90px 1fr 1.4fr auto;
  gap: 8px;
  align-items: center;
}
.units-edit .grp {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 600;
}

/* ---------- прозорецът на резервацията ---------- */
dialog {
  color: inherit;
}
dialog::backdrop {
  background: rgba(20, 28, 36, 0.45);
}
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(600px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--lime);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: slidein 0.22s ease-out;
}
@keyframes slidein {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}
.drawer__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 18px 12px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  background: var(--paper);
  border-bottom: 1px solid var(--line-2);
}
.drawer__head h2 {
  font: 400 24px/1.15 var(--ff-d);
  overflow-wrap: anywhere;
}
.drawer__head .sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-3);
}
.drawer__head .btn--icon {
  margin-left: auto;
  flex: none;
}
.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 24px;
  overscroll-behavior: contain;
}
.drawer__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  padding-bottom: calc(12px + var(--safe-b));
  background: var(--paper);
  border-top: 1px solid var(--line-2);
}
.drawer__foot .grow {
  flex: 1;
}
.sec {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(20, 28, 36, 0.05);
}
.sec > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.sec > h3 .i {
  width: 18px;
  height: 18px;
  color: var(--madder);
}
.row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.nights-info {
  font-size: 14px;
  color: var(--ink-2);
}
.nights-info b {
  color: var(--ink);
}
.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  height: 44px;
}
.stepper button {
  width: 40px;
  height: 100%;
  border: 0;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink-2);
}
.stepper input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stepper input:focus {
  outline: none;
}
.stepper:focus-within {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(240, 160, 75, 0.28);
}
.upick {
  display: grid;
  gap: 10px;
}
.upick__grp {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  align-items: start;
}
.upick__name {
  display: grid;
  gap: 2px;
  padding-top: 6px;
  font-size: 14px;
  font-weight: 650;
}
.upick__all {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--madder);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.upick__units {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ubtn {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 44px;
  padding: 0 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
}
.ubtn small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-3);
}
.ubtn[aria-pressed='true'] {
  border-color: var(--madder);
  background: var(--madder);
  color: #fff;
}
.ubtn[aria-pressed='true'] small {
  color: rgba(255, 255, 255, 0.8);
}
.ubtn.is-busy {
  border-style: dashed;
  color: var(--ink-3);
  background: repeating-linear-gradient(-45deg, #f4f2ee, #f4f2ee 5px, #ebe8e2 5px, #ebe8e2 10px);
  cursor: not-allowed;
}
.ubtn.is-busy[aria-pressed='true'] {
  border: 2px solid var(--wait);
  background: var(--wait-bg);
  color: var(--wait-ink);
  cursor: pointer;
}
.busy-list {
  display: grid;
  gap: 2px;
  font-size: 13px;
  color: var(--ink-3);
}
.unit-dates {
  display: grid;
  gap: 8px;
}
.unit-dates .row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}
.total-line {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 15px;
}
.total-line b {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.history {
  display: grid;
  gap: 8px;
  font-size: 13.5px;
}
.history li {
  list-style: none;
}
.history ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.history .when {
  color: var(--ink-3);
  font-size: 12.5px;
}
details.more > summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
details.more > summary::-webkit-details-marker {
  display: none;
}
details.more > summary::before {
  content: '▸';
  font-size: 12px;
  transition: transform 0.15s;
}
details.more[open] > summary::before {
  transform: rotate(90deg);
}
details.more > div {
  margin-top: 10px;
}

/* ---------- малки прозорци ---------- */
.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 22px;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}
.modal h2 {
  font: 400 22px/1.2 var(--ff-d);
  margin-bottom: 10px;
}
.modal p {
  color: var(--ink-2);
}
.modal .actions {
  justify-content: flex-end;
  margin-top: 20px;
}
.menu {
  position: fixed;
  min-width: 220px;
  padding: 6px;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  margin: 0;
}
.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.menu a:hover,
.menu button:hover {
  background: var(--lime);
}
.menu hr {
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--line-2);
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--night);
  color: #fff;
  font-size: 14.5px;
  box-shadow: var(--shadow-lg);
  animation: toastin 0.2s ease-out;
}
.toast--err {
  background: #7a221c;
}
@keyframes toastin {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
}

/* ---------- вход ---------- */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(120% 70% at 50% 0%, #2a3a4a 0%, var(--night) 60%);
}
.auth__card {
  width: min(420px, 100%);
  padding: 30px 26px 26px;
  border-radius: 20px;
  background: var(--lime);
  box-shadow: var(--shadow-lg);
}
.auth__brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 20px;
  text-align: center;
}
.auth__brand .wheel {
  width: 48px;
  height: 48px;
}
.auth__brand b {
  font: 400 26px/1.1 var(--ff-d);
}
.auth__brand small {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.auth form {
  display: grid;
  gap: 14px;
}
.auth .btn--primary {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
}
.auth__err {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--wait-bg);
  color: var(--wait-ink);
  font-size: 14px;
}
.auth__err:empty {
  display: none;
}
.auth__hint {
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

/* ---------- допълнения ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ember);
  color: var(--night);
  font-weight: 650;
  text-decoration: none;
}
.skip:focus {
  left: 8px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--madder);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn--danger-solid {
  background: var(--madder);
  color: #fff;
}
.btn--danger-solid:hover:not(:disabled) {
  background: var(--madder-ink);
}
.btn .i {
  width: 18px;
  height: 18px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
}
.toast--action {
  pointer-events: auto;
}
.toast button {
  flex: none;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--ember);
  color: var(--night);
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
}
.menu {
  z-index: 90;
}
.menu .i {
  color: var(--ink-3);
}
.menu .is-danger {
  color: var(--cancel);
}
.field__hint {
  font-size: 12.5px;
  color: var(--ink-3);
}
.field__static {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--ink-2);
}
.field--empty {
  visibility: hidden;
}
.with-btn {
  display: flex;
  gap: 6px;
  align-items: center;
}
.with-btn .input {
  flex: 1;
  min-width: 0;
}
.check--field {
  align-self: end;
  min-height: 44px;
}
.is-wait {
  color: var(--wait);
}
.ok-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ok);
  font-weight: 600;
}
.sep {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--line-2);
}
.h3 {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 650;
}
form > .h3:first-child {
  margin-top: 0;
}
.card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .i {
  color: var(--madder);
}
.view-head .monthnav .btn {
  flex: none;
}
.g-hint {
  margin-top: 10px;
}
.g-hint--touch {
  display: none;
}
@media (pointer: coarse) {
  .g-hint--mouse {
    display: none;
  }
  .g-hint--touch {
    display: inline;
  }
}
.unassigned button:hover {
  background: #fff;
}
.rtable .nm.linkbtn {
  font-weight: 650;
}
.rtable th[scope='row'] {
  position: static;
  background: var(--paper);
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-2);
}
.mtable tfoot th[scope='row'] {
  background: #f3f0ea;
}
.mtable th[scope='row'] a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-3);
}
.mtable tr.is-empty th a {
  color: var(--ink-3);
}
.rcards--all {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 10px;
}
.rcard .meta .i {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
}
.rcard .linkbtn.nm {
  justify-self: start;
}
.rcard .contact a {
  min-height: 32px;
  font-size: 13.5px;
}
.l-count {
  margin-bottom: 8px;
}
.money-line .is-wait {
  font-weight: 600;
}
.totals .is-wait b {
  color: var(--wait);
}
.inq__top h2 .linkbtn {
  font: inherit;
}
.inq__top h2 .linkbtn:hover {
  text-decoration: underline;
}
.inq__facts .i {
  width: 17px;
  height: 17px;
  color: var(--ink-3);
}
.inq__actions .contact {
  margin-right: auto;
}
.inq__free {
  margin-top: -2px;
}
.guest__bookings {
  flex-basis: 100%;
  padding: 4px 0 2px;
}
.gb-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--lime);
  list-style: none;
  font-size: 14px;
}
.gb-list .linkbtn:hover b {
  text-decoration: underline;
}
.guest--more {
  justify-content: center;
}
.gu-search {
  flex: 1;
}
.list-row .num {
  font-variant-numeric: tabular-nums;
}
.data-rows {
  display: grid;
  gap: 4px;
}
.data-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.data-row:last-of-type {
  border-bottom: 0;
}
.data-row .grow {
  min-width: 220px;
}
.data-row p {
  margin-top: 2px;
}
.select--sm {
  width: auto;
  min-height: 42px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.file-btn {
  position: relative;
  overflow: hidden;
  max-width: 260px;
}
.file-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-btn:focus-within {
  outline: 3px solid rgba(240, 160, 75, 0.9);
  outline-offset: 2px;
}
.units-edit .row--head {
  align-items: end;
}
.units-edit .check {
  justify-content: center;
}
.settings details.more {
  margin-top: 12px;
}
.drawer__form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.drawer__head .grow {
  min-width: 0;
}
.sec--status {
  gap: 8px;
}
.msg {
  margin-bottom: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.badge--new {
  box-shadow: 0 0 0 2px rgba(240, 160, 75, 0.35);
}
.bnav #more.is-current {
  color: var(--madder);
}
.auth__title {
  font: 400 24px/1.2 var(--ff-d);
  text-align: center;
}
.auth__lead {
  font-size: 14px;
  color: var(--ink-2);
  text-align: center;
}
.auth-root {
  min-height: 100dvh;
}

/* ---------- по-малки екрани ---------- */
@media (max-width: 1380px) {
  .tabs a .i {
    display: none;
  }
}
@media (max-width: 1180px) {
  .search input {
    width: 170px;
  }
  .tabs a {
    padding: 0 10px;
  }
}
@media (max-width: 1100px) {
  .stat-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .userbtn span {
    display: none;
  }
  .userbtn {
    width: 42px;
    padding: 0;
  }
  .brand__text {
    display: none;
  }
  .tabs {
    margin-left: 4px;
  }
  .tabs a {
    padding: 0 9px;
  }
  .tabs .tab--wide {
    display: none;
  }
  .search input {
    width: 150px;
  }
  .top__new {
    width: 42px;
    padding: 0;
  }
  .top__new span {
    display: none;
  }
}
@media (max-width: 420px) {
  .drawer__foot .btn--danger span {
    display: none;
  }
  .drawer__foot .btn--danger {
    width: 38px;
    padding: 0;
  }
}
@media (max-width: 899px) {
  :root {
    --head-h: 54px;
  }
  body {
    font-size: 15.5px;
  }
  .tabs,
  .top .userbtn,
  .top__new {
    display: none;
  }
  .top {
    padding: 0 10px 0 14px;
    gap: 8px;
  }
  .search input {
    width: 150px;
  }
  .main {
    padding: 12px 10px calc(var(--nav-h) + 86px + var(--safe-b));
  }
  .view-head h1 {
    font-size: 24px;
  }
  .bnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--nav-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: var(--paper);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(20, 28, 36, 0.06);
  }
  .bnav a,
  .bnav button {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    background: none;
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 560;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .bnav .i {
    width: 23px;
    height: 23px;
  }
  .bnav [aria-current='page'] {
    color: var(--madder);
  }
  .bnav .badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
  }
  .fab {
    position: fixed;
    right: 14px;
    bottom: calc(var(--nav-h) + 14px + var(--safe-b));
    z-index: 41;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: var(--madder);
    color: #fff;
    box-shadow: 0 6px 20px rgba(158, 47, 40, 0.45);
    cursor: pointer;
  }
  .fab .i {
    width: 26px;
    height: 26px;
    stroke-width: 2.2;
  }
  .gridwrap {
    --dw: 62px;
    --cw: 86px;
    --rh: 38px;
    border-radius: 10px;
  }
  .view-grid {
    height: calc(100dvh - var(--head-h) - var(--nav-h) - var(--safe-b) - 12px - 10px);
    min-height: 420px;
  }
  .main.view-tablitsa {
    padding-bottom: calc(var(--nav-h) + var(--safe-b) + 10px);
  }
  .g-hint {
    display: none;
  }
  .g-date {
    padding: 0 6px;
    gap: 4px;
  }
  .selbar {
    bottom: calc(var(--nav-h) + 12px + var(--safe-b));
  }
  .kk-sel .fab {
    display: none;
  }
  /* последните нощи да може да се превъртят над лентата с избора */
  .kk-sel .gridwrap {
    padding-bottom: 110px;
  }
  .toasts {
    bottom: calc(var(--nav-h) + 16px + var(--safe-b));
  }
  .rtable-wrap {
    display: none;
  }
  .rcards {
    display: grid;
    gap: 10px;
  }
  .cols-2 {
    grid-template-columns: 1fr;
  }
  .drawer {
    width: 100vw;
  }
  .drawer[open] {
    animation-name: slideup;
  }
  @keyframes slideup {
    from {
      transform: translateY(30px);
      opacity: 0;
    }
  }
  .mtable-wrap {
    overflow-x: auto;
  }
}
@media (max-width: 560px) {
  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .stat b {
    font-size: 19px;
  }
  .brand b {
    font-size: 17px;
  }
  .brand small {
    display: none;
  }
  .search {
    margin-left: auto;
  }
  .search input {
    width: 44px;
    padding: 0;
    color: transparent;
    cursor: pointer;
  }
  .search input::placeholder {
    color: transparent;
  }
  .search input:focus,
  .search input.has-value {
    position: fixed;
    left: 10px;
    right: 10px;
    top: calc(8px + env(safe-area-inset-top, 0px));
    width: auto;
    z-index: 50;
    padding: 0 12px 0 36px;
    color: #fff;
    background: var(--night-2);
    cursor: text;
  }
  .search input:focus::placeholder {
    color: rgba(255, 255, 255, 0.55);
  }
  .search input:focus + .i,
  .search input.has-value + .i {
    position: fixed;
    left: 22px;
    top: calc(8px + 19px + env(safe-area-inset-top, 0px));
    z-index: 51;
  }
  .top__end {
    margin-left: 0;
  }
  .row3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* датата на капарото с бутона „Днес“ не се събира в половин ред */
  .row2--deposit {
    grid-template-columns: minmax(0, 1fr);
  }
  /* изборът в таблицата: текстът на цял ред (стаята и датите да се четат), бутоните под него */
  .selbar {
    left: 10px;
    right: 10px;
    max-width: none;
    transform: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 8px;
    padding: 10px 10px 10px 16px;
    border-radius: 18px;
  }
  .selbar__text {
    flex: 1 1 100%;
    white-space: normal;
  }
  .upick__grp {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .upick__name {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-top: 0;
  }
  .units-edit .row {
    grid-template-columns: 1fr 1fr;
  }
  .units-edit .grp {
    grid-column: 1 / -1;
  }
  .drawer__body {
    padding: 12px 10px 20px;
  }
  .sec {
    padding: 12px;
  }
  .card--pad {
    padding: 14px;
  }
  .view-head {
    gap: 8px 10px;
  }
  /* „Таблица“ на телефон: горната част в по-малко редове, повече място за самата таблица */
  .view-grid .view-head {
    margin-bottom: 10px;
  }
  .view-grid .view-head h1 {
    font-size: 22px;
  }
  .view-grid .view-head h1 small {
    display: none; /* месецът е в списъка до заглавието */
  }
  .view-grid .toolbar {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 8px;
  }
  .view-grid .chips,
  .view-grid .legend,
  .unassigned {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .view-grid .chips::-webkit-scrollbar,
  .view-grid .legend::-webkit-scrollbar,
  .unassigned::-webkit-scrollbar {
    display: none;
  }
  .view-grid .chips {
    padding: 2px 0; /* място за рамката при фокус */
  }
  .view-grid .chip {
    flex: none;
    min-height: 32px;
  }
  .view-grid .legend {
    gap: 12px;
    font-size: 12px;
    white-space: nowrap;
  }
  .view-grid .legend span,
  .unassigned b,
  .unassigned button {
    flex: none;
    white-space: nowrap;
  }
  .unassigned {
    margin-bottom: 8px;
    padding: 6px 10px;
  }
}
/* нисък телефон (SE, телефон в браузъра с лентите): долу се виждат само 2–3 нощи и лентата с избора би
   закрила следващите. Затова е горе, върху заглавието и месеца (докато се избира, не трябват), и на един ред. */
@media (max-width: 560px) and (max-height: 700px) {
  .selbar {
    top: calc(var(--head-h) + env(safe-area-inset-top, 0px) + 8px);
    bottom: auto;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 8px 8px 14px;
  }
  .selbar__text {
    flex: 1 1 auto;
    font-size: 13px;
    line-height: 1.3;
  }
  .selbar__tip {
    font-size: 11.5px;
  }
  .selbar__new {
    display: none;
  }
  .selbar [data-new] {
    flex: none;
    width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .kk-sel .gridwrap {
    padding-bottom: 0; /* лентата е горе: долу нищо не закрива нощите */
  }
  /* под лентата: месецът и филтрите да не се подават изпод нея (връщат се, щом изборът се махне) */
  .kk-sel .view-grid .view-head,
  .kk-sel .view-grid .chips {
    visibility: hidden;
  }
}
@media (max-width: 360px) {
  .row2 {
    grid-template-columns: 1fr;
  }
  .gridwrap {
    --dw: 56px;
    --cw: 80px;
  }
  .seg button {
    padding: 0 10px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .view-grid {
    height: auto;
    min-height: 0;
  }
  .view-grid > .gridwrap {
    flex: none;
    height: calc(100dvh - var(--head-h) - var(--nav-h) - var(--safe-b) - 20px);
    min-height: 200px;
  }
  .fab {
    width: 50px;
    height: 50px;
  }
  /* входът на хоризонтален телефон: по-сбит, бутонът „Вход“ да е по-близо */
  .auth {
    padding: 12px 16px;
  }
  .auth__card {
    padding: 16px 22px 18px;
  }
  .auth__brand {
    grid-auto-flow: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }
  .auth__brand .wheel {
    width: 30px;
    height: 30px;
  }
  .auth__brand b {
    font-size: 22px;
  }
}

@media print {
  .top,
  .bnav,
  .fab,
  .toolbar,
  .selbar {
    display: none !important;
  }
  .gridwrap {
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }
}
