/* booking.css: student booking page (/book) */

.btn-primary { background: #1f3343; color: #fff; border: 1px solid #1f3343; }
.btn-secondary { background: #fff; color: #1f3343; border: 1px solid #c9ced4; }
.btn-secondary:hover { background: #f5f6f7; }
.bk-machine-card .btn, .day-strip .btn { box-shadow: none; }

.bk-id-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 12px;
  margin-block-end: 16px;
  text-align: right;
}
.bk-id-form label { font-weight: 500; color: #1f3343; }
.bk-id-input {
  width: 9em;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #c9ced4;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  text-transform: uppercase;
}
.bk-id-input:focus { outline: 2px solid #1f3343; outline-offset: 1px; }
.bk-id-hint { font-size: 0.85rem; }

/* machine selector: plain right-aligned segmented list */
.bk-machine-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  border: 1px solid #c9ced4;
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
}
.bk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: #fff;
  color: #1f3343;
  font-size: 0.95rem;
  border-inline-start: 1px solid #c9ced4;
}
.bk-chip:first-child { border-inline-start: 0; }
a.bk-chip:hover { background: #f5f6f7; text-decoration: none; }
.bk-chip.is-active { background: #1f3343; color: #fff; }
.bk-chip-static { color: #6b7682; }

.bk-code { font-weight: 700; }

.bk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-block-start: 12px;
  font-size: 0.85rem;
  color: #5b6672;
}
.bk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bk-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #c9ced4;
}
.bk-swatch.free { background: #fff; }
.bk-swatch.taken { background: #f1f2f4; border-color: #e3e6ea; }
.bk-swatch.mine { background: #1f3343; border-color: #1f3343; }

#grids {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 16px;
}
.bk-grid-card {
  margin: 0;
  min-height: 260px;
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  box-shadow: none;
}
.bk-grid-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.bk-grid-head .card-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bk-free-count { font-size: 0.85rem; color: #5b6672; }
.bk-free-count.none { color: #b42318; }

.bk-grid-card .slot {
  height: 36px;
  border-radius: 6px;
  border: 1px solid #c9ced4;
  background: #fff;
  color: #1f3343;
  font-family: inherit;
  box-shadow: none;
}
.bk-grid-card .slot.free:hover { background: #f5f6f7; border-color: #1f3343; color: #1f3343; }
.bk-grid-card .slot.taken { background: #f7f8f9; border-color: #e3e6ea; color: #9aa3ad; }
.bk-grid-card .slot.mine { background: #1f3343; border-color: #1f3343; color: #fff; height: auto; min-height: 36px; }
.bk-grid-card .slot.mine .slot-tag { color: #fff; opacity: .85; }

/* --- layout fixes --------------------------------------------------- */
.bk-id-form { flex-wrap: nowrap; }
.bk-id-form .bk-id-input { width: 140px; flex: none; font-size: 14px; }
.bk-id-form label { margin: 0; flex-direction: row; }

#grids { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-auto-rows: auto; }
.bk-grid-card { padding: 16px; min-height: 0; }
.bk-grid-head { flex-wrap: nowrap; align-items: center; margin-bottom: 12px; }
.bk-grid-head .card-title { margin: 0; font-size: 16px; flex-wrap: nowrap; white-space: nowrap; }
.bk-free-count { white-space: nowrap; }

.bk-grid-card .slot-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.bk-grid-card .slot,
.bk-grid-card .slot.mine {
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; width: 100%;
  height: var(--ctl-h-sm); min-height: 0; padding: 0;
  font-size: 14px; line-height: 1;
}
.bk-grid-card .slot-form { display: block; }

#grids { margin-top: 16px; }
#grids > .card, #grids > .bk-grid-card { margin: 0; }
