/* ================================
   NDC TBMS - Modern UI (Front)
   ================================ */

:root{
  --ndc-bg: #ffffff;
  --ndc-surface: #ffffff;
  --ndc-border: rgba(17, 24, 39, .10);
  --ndc-border2: rgba(17, 24, 39, .08);
  --ndc-text: #0f172a;
  --ndc-muted: rgba(15, 23, 42, .62);
  --ndc-shadow: 0 10px 30px rgba(2, 6, 23, .10);
  --ndc-shadow2: 0 18px 50px rgba(2, 6, 23, .12);
  --ndc-radius: 14px;

  --ndc-closed-bg: #fee2e2;
  --ndc-closed-tx: #991b1b;

  --ndc-open-bg: #dcfce7;
  --ndc-open-tx: #166534;

  --ndc-hold-bg: #dbeafe;
  --ndc-hold-tx: #1e40af;
}

.ndc-tbms-front{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ndc-text);
}

.ndc-tbms-muted{ opacity:1; color: var(--ndc-muted); font-size:12.5px; }

.ndc-tbms-front__toolbar{
  display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px;
  align-items:center; margin:10px 0 14px;
}

.ndc-tbms-front__title strong{ font-size:20px; letter-spacing:-.2px; }

.ndc-tbms-front__controls{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.ndc-tbms-front__controls .button{ border-radius:999px; }

.ndc-tbms-front-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background: var(--ndc-surface);
  border:1px solid var(--ndc-border);
  border-radius: var(--ndc-radius);
  overflow:hidden;
  box-shadow: var(--ndc-shadow);
}

.ndc-tbms-front-table th,
.ndc-tbms-front-table td{
  border-bottom:1px solid var(--ndc-border2);
  border-right:1px solid var(--ndc-border2);
  padding:12px 10px;
  text-align:center;
  font-size:13.5px;
}

.ndc-tbms-front-table tr:last-child td{ border-bottom:0; }
.ndc-tbms-front-table th:last-child,
.ndc-tbms-front-table td:last-child{ border-right:0; }

.ndc-tbms-front-table th{
  background: #fbf7ef;
  font-weight:900;
  letter-spacing:.2px;
  position:sticky;
  top:0;
  z-index:2;
}

.ndc-tbms-time{
  width:120px;
  background:#fff;
  font-weight:900;
  position:sticky;
  left:0;
  z-index:3;
}

.ndc-tbms-cell{
  cursor:pointer;
  user-select:none;
  border-radius:12px;
  transition: transform .10s ease, filter .12s ease, box-shadow .12s ease;
}

.ndc-tbms-cell:hover{
  filter:brightness(.985);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(2, 6, 23, .08);
}

.ndc-tbms-closed{ background: var(--ndc-closed-bg); color: var(--ndc-closed-tx); font-weight:900; }
.ndc-tbms-open{ background: var(--ndc-open-bg); color: var(--ndc-open-tx); font-weight:900; }
.ndc-tbms-hold{ background: var(--ndc-hold-bg); color: var(--ndc-hold-tx); font-weight:900; }
.ndc-tbms-booked{ color:#0b1220; font-weight:900; } /* background set by JS */

.ndc-tbms-front__hint{ margin-top:10px; }

.ndc-tbms-daily-toolbar{ display:flex; gap:10px; align-items:center; margin:10px 0; }

.ndc-tbms-daily-list .ndc-tbms-daily-item{
  display:flex; justify-content:space-between; gap:10px;
  padding:12px 14px;
  border:1px solid var(--ndc-border);
  border-radius: var(--ndc-radius);
  margin-bottom:10px;
  background:#fff;
  box-shadow: 0 8px 18px rgba(2, 6, 23, .06);
}

.ndc-tbms-daily-item strong{ font-size:14.5px; }

.ndc-tbms-daily-pill{
  padding:6px 12px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  border:1px solid var(--ndc-border);
}
.ndc-tbms-daily-pill.closed{ background: var(--ndc-closed-bg); color: var(--ndc-closed-tx); }
.ndc-tbms-daily-pill.open{ background: var(--ndc-open-bg); color: var(--ndc-open-tx); }
.ndc-tbms-daily-pill.hold{ background: var(--ndc-hold-bg); color: var(--ndc-hold-tx); }
.ndc-tbms-daily-pill.booked{ background:#f3f4f6; color:#111827; }

.ndc-tbms-savebar{ margin-top:10px; }
.ndc-tbms-save-msg{ margin-left:10px; font-weight:900; }

/* Availability */
.ndc-tbms-availability .ndc-tbms-cell.is-locked{
  opacity:.55;
  cursor:not-allowed;
  filter:saturate(.8);
}

/* Modal */
.ndc-tbms-modal{ position:fixed; inset:0; z-index:999999; }
.ndc-tbms-modal__backdrop{
  position:absolute; inset:0;
  background:rgba(2, 6, 23, .55);
  backdrop-filter: blur(6px);
}
.ndc-tbms-modal__panel{
  position:relative;
  max-width:920px;
  margin:5vh auto;
  background:#fff;
  border-radius: 18px;
  box-shadow: var(--ndc-shadow2);
  padding:16px;
  max-height:90vh;
  overflow:auto;
  border:1px solid var(--ndc-border);
}
.ndc-tbms-modal__header{
  display:flex; justify-content:space-between; align-items:center;
  gap:10px; padding-bottom:10px; border-bottom:1px solid var(--ndc-border2);
}
.ndc-tbms-front-meta{ margin:10px 0 14px; }

#ndcTbmsFrontPdf{
  width:100%;
  height:520px;
  border:1px solid var(--ndc-border);
  border-radius: 14px;
}
#ndcTbmsReportText{
  width:100%;
  border:1px solid var(--ndc-border);
  border-radius: 14px;
  padding:12px;
  outline:none;
}
#ndcTbmsReportText:focus{
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
  border-color: rgba(59, 130, 246, .45);
}

.ndc-tbms-report-actions{ display:flex; align-items:center; gap:10px; margin-top:10px; }

@media (max-width: 900px){
  .ndc-tbms-time{ width:110px; }
  .ndc-tbms-front-table th, .ndc-tbms-front-table td{ padding:10px 8px; font-size:13px; }
  #ndcTbmsFrontPdf{ height:420px; }
}
@media (max-width: 640px){
  .ndc-tbms-front__toolbar{ align-items:flex-start; }
  .ndc-tbms-front-table{ display:block; overflow:auto; }
}

.ndc-tbms-pdf-list .button{ border-radius:999px; }
