/* --- Global layout guards: never let the page scroll sideways --- */
html, body { max-width: 100%; overflow-x: hidden; }
img, table, pre, iframe, video { max-width: 100%; }
/* Long unbreakable strings (phones, emails, ids) wrap instead of widening the page */
td, dd, .break-anywhere { overflow-wrap: anywhere; }
/* Any element that opts into horizontal scrolling keeps it to itself */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Calendar day-state colouring for the manager month grid */
.cal-cell { min-height: 68px; }
@media (max-width: 640px) { .cal-cell { min-height: 52px; } }
.cal-free    { background:#ecfdf3; color:#166534; }
.cal-booked  { background:#fee2e2; color:#991b1b; }
.cal-pending { background:#fef9c3; color:#854d0e; }
.cal-blocked { background:#e2e8f0; color:#475569; }
.cal-past    { background:#f8fafc; color:#cbd5e1; }
.cal-out     { background:#ffffff; color:#e2e8f0; }

/* Default form control styling (project uses hand-rolled Tailwind forms) */
form input[type=text], form input[type=tel], form input[type=email],
form input[type=date], form input[type=number], form input[type=password],
form select, form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  font-size: 0.95rem;
}
form input:focus, form select:focus, form textarea:focus {
  outline: 2px solid #2f6b3c33;
  border-color: #2f6b3c;
}
form ul { list-style: none; padding: 0; }

.bt-green {
  border-top: 3px solid green;
}

/* --- Booking calendar (custom, self-contained) --- */
.bkcal { --cell: 42px; user-select: none; }
.bkcal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.bkcal__title { font-weight: 600; text-transform: capitalize; font-size: 1rem; }
.bkcal__nav {
  width: 2.25rem; height: 2.25rem; border-radius: .6rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #334155; background: #f1f5f9; border: 0; cursor: pointer;
}
.bkcal__nav:hover { background: #e2e8f0; }
.bkcal__nav:disabled { opacity: .35; cursor: not-allowed; }
.bkcal__dow { display: grid; grid-template-columns: repeat(7, 1fr); }
.bkcal__dow div { text-align: center; font-size: .72rem; color: #94a3b8; padding: .35rem 0; }
.bkcal__week { display: grid; grid-template-columns: repeat(7, 1fr); }
.bkcal__day {
  aspect-ratio: 1 / 1; min-height: var(--cell);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; border-radius: .55rem; margin: 2px;
  border: 1px solid transparent; background: #f8fafc; color: #475569;
  cursor: default; transition: background .12s;
}
.bkcal__day--out { visibility: hidden; }
.bkcal__day--past { color: #cbd5e1; background: #fff; }
.bkcal__day--free { background: #ecfdf5; color: #065f46; cursor: pointer; }
.bkcal__day--free:hover { background: #bbf7d0; }
.bkcal__day--pending { background: #fef9c3; color: #854d0e; }
.bkcal__day--booked { background: #fee2e2; color: #b91c1c; text-decoration: line-through; }
.bkcal__day--in { background: #bbf7d0 !important; color: #065f46; border-radius: 4px; }
.bkcal__day--ci, .bkcal__day--co { background: #2f6b3c !important; color: #fff !important; }
.bkcal__summary { margin-top: .75rem; font-size: .9rem; }

/* --- Dashboard occupancy: colour by business level --- */
/*  < 30 %  низкая  → красный
    30–55 % средняя → оранжевый
    > 55 %  высокая → зелёный                                  */
.occ__track { background: #e2e8f0; }
.occ__fill  { background: #94a3b8; transition: width .3s ease; }
.occ__pct   { color: #475569; }
.occ__label { color: #94a3b8; }

.occ[data-level="low"]  .occ__fill,
.occ[data-level="low"]  .occ__pct,
.occ[data-level="low"]  .occ__label  { color: #dc2626; }
.occ[data-level="low"]  .occ__fill   { background: #dc2626; }

.occ[data-level="mid"]  .occ__fill,
.occ[data-level="mid"]  .occ__pct,
.occ[data-level="mid"]  .occ__label  { color: #ea580c; }
.occ[data-level="mid"]  .occ__fill   { background: #ea580c; }

.occ[data-level="high"] .occ__fill,
.occ[data-level="high"] .occ__pct,
.occ[data-level="high"] .occ__label  { color: #16a34a; }
.occ[data-level="high"] .occ__fill   { background: #16a34a; }
