/* === HARD STOP PAGE HORIZONTAL SCROLL === */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

html.no-scroll, html.no-scroll body { overflow: hidden; }

.grid > *, .card {
  min-width: 0;
}

/* === CAROUSEL === */
.carousel-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}

.carousel-actions{
  display:flex;
  gap:8px;
}

.carousel-btn{
  width:40px;
  height:36px;
  border-radius:10px;
  border:1px solid var(--c-soft);
  background:#eef1f3;
  cursor:pointer;
  font-size:22px;
}

.carousel{
  overflow:hidden;
}

.carousel-track{
  display:flex;
  gap:12px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
}

.carousel-item{
  flex:0 0 auto;
  width:320px;
  scroll-snap-align:start;
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--c-soft);
}

.carousel-img{
  width:100%;
  height:200px;
  object-fit:cover;
}

@media (max-width:900px){
  .carousel-item{ width:70vw; }
}

@media (max-width:520px){
  .carousel-item{ width:88vw; }
}

/* === RICH TEXT === */
.richtext p{ margin:0 0 10px }
.richtext ul{ padding-left:18px }

/* === AVAILABILITY === */
.avail{
  display:grid;
  gap:12px;
  grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
}

@media (max-width: 900px){
  .avail{ grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); }
}

@media (max-width: 520px){
  .avail{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
}

@media (max-width: 360px){
  .avail{ grid-template-columns:1fr; }
}

.day{
  position:relative;
  cursor:pointer;
  user-select:none;
}

.day-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.pill{
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--c-soft);
  background:rgba(0,0,0,0.03);
  white-space:nowrap;
}

.pill.ok{
  border-color:rgba(34,197,94,0.35);
  background:rgba(34,197,94,0.10);
}

.pill.danger{
  border-color:rgba(239,68,68,0.35);
  background:rgba(239,68,68,0.10);
}

/* === CUSTOMER DETAILS SHEET (modal) === */
.sheet{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  display:none;
  align-items:stretch;
  justify-content:flex-end;
  z-index:999;
}

.sheet.is-open{ display:flex; }

.sheet__panel{
  width:min(560px, 100%);
  height:100%;
  background:var(--c-white);
  border-left:1px solid var(--c-soft);
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;

  transform: translateX(18px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.sheet.is-open .sheet__panel{
  transform: translateX(0);
  opacity: 1;
}

.sheet__head{
  padding:16px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--c-soft);
}

.sheet__title{ font-family:Montserrat; font-weight:700; font-size:18px; }

.sheet__close{ min-height:40px; }

.sheet__status{
  margin:12px 16px 0;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--c-soft);
  background:rgba(0,0,0,0.03);
}
.sheet__status[data-kind="error"]{
  border-color:rgba(180,35,24,0.18);
  background:var(--c-danger-bg);
  color:var(--c-danger);
}
.sheet__status[data-kind="success"]{
  border-color:rgba(15,118,110,0.20);
  background:rgba(15,118,110,0.10);
  color:#0f766e;
}

.sheet__body{
  padding:16px;
  overflow:auto;
}

.sheet__foot{
  padding:16px;
  border-top:1px solid var(--c-soft);
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

/* Mobile: bottom sheet (full-width, safe on small screens) */
@media (max-width: 520px){
  .sheet{
    justify-content:stretch;
    align-items:flex-end;
  }

  .sheet__panel{
    width:100%;
    height:auto;
    max-height: 92vh;
    border-left:none;
    border-top:1px solid var(--c-soft);
    border-radius: 18px 18px 0 0;
    transform: translateY(18px);
  }

  .sheet.is-open .sheet__panel{
    transform: translateY(0);
  }

  .sheet__head{ padding:14px; }
  .sheet__body{ padding:14px; }
  .sheet__foot{ padding:14px; }
}

.day.selected{
  outline:3px solid rgba(59,130,246,0.35);
  border-color:rgba(59,130,246,0.45);
}

.day:focus{
  outline:3px solid rgba(59,130,246,0.25);
}

.day[aria-disabled='true']{
  cursor:not-allowed;
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* Force dashboard buttons (higher specificity than .btn.ghost etc.) */
a.btn.dash-btn-details,
button.btn.dash-btn-details{
  background: rgba(15,118,110,0.08) !important;
  border: 1px solid rgba(15,118,110,0.25) !important;
  color: #0f766e !important;
  font-weight: 600;
}

a.btn.dash-btn-details:hover,
button.btn.dash-btn-details:hover{
  background: rgba(15,118,110,0.14) !important;
}

/* Soft danger for cancel */
button.btn.dash-btn-cancel,
a.btn.dash-btn-cancel{
  background: rgba(180,35,24,0.08) !important;
  border: 1px solid rgba(180,35,24,0.35) !important;
  color: #b42318 !important;
  font-weight: 600;
}

button.btn.dash-btn-cancel:hover,
a.btn.dash-btn-cancel:hover{
  background: rgba(180,35,24,0.14) !important;
}

/* === PAYMENTS UI/UX === */
.payments-grid{ gap:16px; }
.payments-title{ margin-bottom:10px; }
.payments-help{ opacity:0.8; margin-bottom:12px; }

.pay-mode{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

@media (max-width: 900px){
  .pay-mode{ grid-template-columns:1fr; }
}

.pay-mode__opt{
  display:flex;
  gap:10px;
  align-items:flex-start;
  border:1px solid var(--c-soft);
  border-radius:16px;
  padding:12px;
  cursor:pointer;
  background: rgba(0,0,0,0.01);
}

.pay-mode__opt:hover{ background: rgba(0,0,0,0.035); }

.pay-mode__radio{ margin-top:4px; }
.pay-mode__title{ display:block; font-weight:800; font-family:Montserrat; }
.pay-mode__sub{ display:block; font-size:12px; opacity:0.75; margin-top:2px; }

.pay-mode__opt:has(input:checked){
  border-color: rgba(59,130,246,0.45);
  background: rgba(59,130,246,0.06);
}

.pay-section{ margin-top:12px; }

.pay-kpi{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  padding:12px;
  border:1px solid var(--c-soft);
  border-radius:16px;
  background: rgba(0,0,0,0.015);
}

.pay-kpi--compact{ padding:10px; border-radius:14px; }

.pay-kpi.ok{ border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.08); }
.pay-kpi.warn{ border-color: rgba(234,179,8,0.45); background: rgba(234,179,8,0.06); }

.pay-kpi__amount{ font-family:Montserrat; font-weight:800; font-size:18px; }
.pay-kpi__pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--c-soft);
  font-size:12px;
  background: rgba(0,0,0,0.02);
}

.pay-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:12px;
}

@media (max-width: 900px){
  .pay-grid{ grid-template-columns:1fr; }
}

.payments-grid .label{ display:block; font-size:12px; opacity:0.8; margin-bottom:6px; }
.payments-grid .help{ font-size:12px; opacity:0.65; margin-top:6px; }
.pay-notes{ margin-top:12px; }

.split-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:12px;
}

.split-totals{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--c-soft);
  border-radius:12px;
  background: rgba(0,0,0,0.02);
}

@media (max-width: 720px){
  .split-totals{ margin-left:0; width:100%; justify-content:space-between; }
}

.split-totals__amount{ font-family:Montserrat; font-weight:800; }

.split-list{ display:grid; gap:12px; margin-top:12px; }

.split-row{
  border:1px solid var(--c-soft);
  border-radius:16px;
  padding:12px;
  background: rgba(0,0,0,0.015);
}

.split-row.is-active{ background: rgba(0,0,0,0.02); }

.split-row__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.split-row__title{ font-family:Montserrat; font-weight:800; }

.split-row__grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

@media (max-width: 900px){
  .split-row__grid{ grid-template-columns:1fr; }
}

.split-row__notes{ margin-top:12px; }

.pay-footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:14px;
}

.payments-summary{ position: sticky; top: 80px; }
@media (max-width: 900px){ .payments-summary{ position: static; } }

.payments-summary__bookid{ font-weight:700; font-family:Montserrat; }
.payments-summary__list{ display:grid; gap:8px; }
.payments-summary__row{ display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.payments-summary__right{ font-weight:600; text-align:right; }
.payments-summary__strong{ font-weight:600; }
.payments-summary__spacer{ height:8px; }
.payments-summary__total-amount{ font-family:Montserrat; font-weight:800; font-size:20px; }

/* === PAYMENTS: SAFER MULTI SPLIT UX === */
.payment-line{
  position:relative;
  padding-left:14px;
}

.payment-line::before{
  content:"";
  position:absolute;
  left:0;
  top:12px;
  bottom:12px;
  width:4px;
  border-radius:4px;
  background:#e5e7eb;
}

.payment-line.is-split::before{
  background: linear-gradient(180deg, #22c55e, #0ea5e9);
}

/* Soft focus hint on amount when switching to Split */
.input-focus-hint{
  outline:none;
  border-color: rgba(34,197,94,0.6);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
  transition: box-shadow 0.2s ease;
}

/* ------------------------------------------------------------
   Split parts as tinted cards (filled panels)
   ------------------------------------------------------------ */

.split-part{
  border: 1px solid var(--c-soft);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0,0,0,0.015);
}

/* First payment: soft green */
.split-part.part-1{
  border-color: rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.06);
  border-left: 4px solid rgba(34,197,94,0.55);
}

/* Remaining: soft blue */
.split-part.part-2{
  border-color: rgba(14,165,233,0.35);
  background: rgba(14,165,233,0.06);
  border-left: 4px solid rgba(14,165,233,0.55);
}

.split-part__head{
  margin-bottom: 10px;
}

.split-part-title{
  font-family: Montserrat;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.2px;
  opacity: 0.9;
}

.split-part-title.part-1{ color: rgba(22,101,52,0.95); }
.split-part-title.part-2{ color: rgba(3,105,161,0.95); }

.split-part .label{
  opacity: 0.75;
}



/* === SHEETS: mobile behavior improvements === */
@media (max-width: 520px){
  /* hide global navbar while any sheet is open (clean mobile UX) */
  body.sheet-open .navbar{ display:none !important; }
  body.sheet-open .container{ padding-top: 10px; }
}

/* Primary mobile sheet header (nice Exit bar) */
.sheet__head--primary{
  background: transparent;
}
@media (max-width: 520px){
  .sheet__head--primary{
    background: var(--c-primary);
    color: #fff;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .sheet__head--primary .muted{ color: rgba(255,255,255,0.82) !important; }
  .sheet__head--primary .sheet__exit{
    background: rgba(255,255,255,0.14) !important;
    border: 1px solid rgba(255,255,255,0.28) !important;
    color: #fff !important;
  }
}

/* Participants list cards */
.participants-list{
  display:grid;
  gap:12px;
}
.participant-card{
  border:1px solid var(--c-soft);
  border-radius:16px;
  padding:12px;
  background: rgba(0,0,0,0.02);
}
.participant-card__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.participant-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(31,95,84,0.22);
  background: rgba(31,95,84,0.08);
  color: var(--c-primary);
  font-weight:700;
  font-size:12px;
}
.participant-card__hint{
  font-size:12px;
  color: var(--c-muted);
}
.participant-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 520px){
  .participant-grid{ grid-template-columns: 1fr; }
}
.participant-required{
  color: var(--c-danger);
  font-weight:700;
}
