/* --- 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; }

/* --- Dashboard: SMS.by balance, in SMS.by brand colours --- */
.smsby {
  --smsby-amber: #ffb300;
  --smsby-ink: #212529;
  --smsby-alert: #ff6b6b;
  background: var(--smsby-ink);
  color: #f8f9fa;
  border-radius: .75rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / .15);
  border-left: 4px solid var(--smsby-amber);
  overflow: hidden;
}
.smsby__body {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .75rem 1.5rem; padding: 1rem 1.25rem;
}
.smsby__brand {
  font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; line-height: 1;
  padding-right: 1.5rem; border-right: 1px solid rgb(255 255 255 / .12);
}
.smsby__accent { color: var(--smsby-amber); }
.smsby__balance { flex: 1 1 auto; min-width: 8rem; }
.smsby__caption {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #adb5bd;
}
.smsby__amount {
  font-size: 1.9rem; font-weight: 700; line-height: 1.1;
  color: var(--smsby-amber); font-variant-numeric: tabular-nums;
}
.smsby__amount--error { font-size: 1.25rem; color: #adb5bd; }
.smsby__currency { font-size: .95rem; font-weight: 600; margin-left: .35rem; color: #adb5bd; }
.smsby__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; font-size: .85rem; }
.smsby__pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .65rem; border-radius: 999px;
  border: 1px solid rgb(255 255 255 / .18); color: #adb5bd;
}
.smsby__dot { width: .5rem; height: .5rem; border-radius: 50%; background: #6c757d; }
.smsby__pill--on { border-color: rgb(255 179 0 / .45); color: var(--smsby-amber); }
.smsby__pill--on .smsby__dot { background: var(--smsby-amber); box-shadow: 0 0 0 3px rgb(255 179 0 / .2); }
.smsby__link { color: #dee2e6; text-decoration: none; border-bottom: 1px solid rgb(255 255 255 / .25); }
.smsby__link:hover { color: var(--smsby-amber); border-color: var(--smsby-amber); }
.smsby__note {
  margin: 0; padding: .6rem 1.25rem; font-size: .85rem;
  background: rgb(255 179 0 / .12); color: var(--smsby-amber);
  border-top: 1px solid rgb(255 179 0 / .25);
}
/* low balance / error: the number and the stripe turn alert-red */
.smsby[data-state="low"],
.smsby[data-state="error"] { border-left-color: var(--smsby-alert); }
.smsby[data-state="low"] .smsby__amount { color: var(--smsby-alert); }
.smsby[data-state="low"] .smsby__note,
.smsby[data-state="error"] .smsby__note {
  background: rgb(255 107 107 / .12); color: var(--smsby-alert); border-top-color: rgb(255 107 107 / .3);
}
@media (max-width: 480px) {
  .smsby__brand { border-right: 0; padding-right: 0; width: 100%; }
}
