/* Papan jadwal, blok reservasi, status ruangan */

/* ---------- Papan jadwal ---------- */
.board-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}
.board {
  min-width: 520px;
  max-width: 100%;
  transition: opacity 0.15s;
}
.board.loading {
  opacity: 0.45;
  pointer-events: none;
}
.bhead,
.bbody {
  display: grid;
  grid-template-columns: var(--time-col) repeat(var(--rooms), minmax(0, 1fr));
}
.bhead {
  border-bottom: 1px solid var(--line);
  background: var(--wash);
  position: sticky;
  top: 0;
  z-index: 4;
}
.bhead div {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  border-left: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bhead div:first-child {
  border-left: 0;
}
.bhead .short {
  display: none;
}
.bbody {
  position: relative;
}

.times {
  position: relative;
}
.times span {
  position: absolute;
  left: 0;
  right: 8px;
  text-align: right;
  font-size: 12px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
  transform: translateY(3px);
}
.col {
  position: relative;
  height: calc(var(--slots) * var(--row));
  border-left: 1px solid var(--line);
  cursor: pointer;
  touch-action: manipulation;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0 calc(var(--row) * 2 - 1px),
      var(--line) calc(var(--row) * 2 - 1px) calc(var(--row) * 2)
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0 calc(var(--row) - 1px),
      var(--line-soft) calc(var(--row) - 1px) var(--row)
    );
}
.past {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  background: repeating-linear-gradient(
    135deg,
    var(--past-a) 0 4px,
    var(--past-b) 4px 8px
  );
  -webkit-mask-image: repeating-linear-gradient(
    to bottom,
    #000 0 calc(var(--row) - 1px),
    transparent calc(var(--row) - 1px) var(--row)
  );
  mask-image: repeating-linear-gradient(
    to bottom,
    #000 0 calc(var(--row) - 1px),
    transparent calc(var(--row) - 1px) var(--row)
  );
  pointer-events: none;
}
.now {
  position: absolute;
  left: var(--time-col);
  right: 0;
  height: 0;
  border-top: 2px solid var(--err);
  pointer-events: none;
  z-index: 3;
}
.now-label {
  position: absolute;
  top: -10px;
  left: 4px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--err);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
}

.bk {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 1;
  background: var(--other);
  border-left: 3px solid var(--other-edge);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bk .l1 {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.bk .t {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.bk .nm {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.routine-badge {
  display: inline-block;
  flex: 0 0 auto;
  padding: 0 4px;
  border: 1px solid var(--wika);
  border-radius: 3px;
  background: #fff;
  color: #075b84;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
  text-transform: uppercase;
  white-space: nowrap;
}
.bk .p {
  color: var(--sub);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.bk.mine {
  background: var(--wika-soft);
  border-left-color: var(--wika);
  color: var(--ink);
}
.bk.mine .t {
  color: var(--accent);
}
.bk.editable {
  cursor: pointer;
}
.bk.selected {
  box-shadow:
    0 0 0 2px var(--paper),
    0 0 0 4px var(--accent);
}

.sel {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 2;
  pointer-events: none;
  border: 2px dashed var(--accent);
  border-radius: 3px;
  background: var(--selection-bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sel.bad {
  border-color: var(--err);
  background: var(--danger-bg);
  color: var(--err);
}

.note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--sub);
}
.selection-help {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--wash);
  color: var(--sub);
  font-size: 12px;
}

/* ---------- Status ruangan di header papan (hari ini) ---------- */
.bhead .hs {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hs::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 1px;
}
.hs.free {
  color: var(--ok);
}
.hs.free::before {
  background: var(--ok);
}
.hs.busy {
  color: var(--err);
}
.hs.busy::before {
  background: var(--err);
}
