@page {
  size: A4 landscape;
  margin: 3mm;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Tahoma, Verdana, sans-serif;
  color: #111;
  background: #f5f6f7;
}

.sheet {
  width: 100%;
  padding: 8px;
}

.controls {
  background: #ffffff;
  border: 1px solid #d5d8dd;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

.controls h1 {
  margin: 0 0 8px;
  font-size: 18px;
}

.controls form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.controls label {
  font-size: 13px;
  font-weight: 700;
}

.controls input,
.controls select,
.controls button {
  height: 34px;
  border: 1px solid #b9bfc8;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.controls button {
  cursor: pointer;
  font-weight: 700;
}

.report {
  background: #fff;
  border: 1px solid #cfd5dc;
  border-radius: 8px;
  padding: 6px;
}

.report-head {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 4px;
}

.report-head h2 {
  margin: 0;
  font-size: 14px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 9px;
  margin-bottom: 4px;
  color: #333;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.legend b {
  font-size: 11px;
}

.legend .glyphicon {
  font-size: 10px;
  vertical-align: middle;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(var(--screen-cols, 6), minmax(0, 1fr));
  gap: 3px;
}

.room-card {
  border: 1px solid #1f1f1f;
  padding: 2px;
  height: 62px;
  display: grid;
  grid-template-rows: 1fr auto;
  break-inside: avoid;
  page-break-inside: avoid;
  overflow: hidden;
}

.card-top {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 3px;
  align-items: start;
  min-height: 0;
}

.card-bottom {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 3px;
  align-items: center;
  margin-top: 1px;
  min-height: 0;
}

.status-col,
.sb-col {
  text-align: center;
}

.sb-col {
  font-size: 8px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-col .glyphicon {
  font-size: 9px;
  vertical-align: middle;
}

.room-col {
  min-width: 0;
}

.even {
  background: #eceff2;
}

.t-out {
  font-size: 8px;
  font-weight: 700;
}

.t-in {
  font-size: 8px;
  font-weight: 700;
}

.status {
  text-align: center;
  font-weight: 700;
}

.status-code {
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  text-align: center;
}

.status-code .glyphicon {
  font-size: 11px;
  vertical-align: middle;
}

.status-time {
  font-size: 9px;
  line-height: 1.05;
  font-weight: 700;
  text-align: center;
}

.status-text {
  font-size: 9px;
  text-align: left;
  color: #1c2f40;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.05;
}

.meta {
  font-size: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error {
  border: 1px solid #d31d1d;
  background: #ffeaea;
  color: #8a0d0d;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
}

@media print {
  html,
  body {
    background: #fff;
  }

  .no-print {
    display: none !important;
  }

  .sheet {
    padding: 0;
  }

  .report {
    border: none;
    border-radius: 0;
    padding: 0;
  }

  .report-head {
    margin-bottom: 1mm;
  }

  .report-head h2 {
    font-size: 10px;
  }

  .legend {
    display: none;
  }

  .status-code,
  .status-text {
    font-size: 7px;
  }

  .status-code .glyphicon {
    font-size: 8px;
  }

  .status-time {
    font-size: 6px;
  }

  .sb-col {
    font-size: 6px;
  }

  .sb-col .glyphicon {
    font-size: 7px;
  }

  .room-grid {
    display: grid;
    grid-template-columns: repeat(var(--print-cols, 7), minmax(0, 1fr));
    gap: 1.2mm;
  }

  .room-card {
    width: auto;
    margin: 0;
    padding: 0.4mm;
    height: 8.8mm;
    border-width: 1px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .card-top {
    grid-template-columns: 17px 1fr;
    column-gap: 1mm;
  }

  .card-bottom {
    grid-template-columns: 20px 1fr;
    column-gap: 1mm;
    margin-top: 0;
  }

  .room {
    font-size: 7px;
    line-height: 1.02;
  }

  .meta {
    font-size: 5.8px;
    line-height: 1;
  }

  .status-text {
    font-size: 5.8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .status-code {
    font-size: 6px;
    line-height: 1;
    white-space: nowrap;
  }

  .status-code .glyphicon {
    font-size: 7px;
  }

  .report--dense .room-card {
    padding: 0.25mm;
    height: 8.6mm;
  }

  .report--dense .card-top {
    grid-template-columns: 14px 1fr;
    column-gap: 0.8mm;
  }

  .report--dense .card-bottom {
    grid-template-columns: 16px 1fr;
    column-gap: 0.8mm;
  }

  .report--dense .status-code .glyphicon {
    font-size: 6px;
  }

  .report--dense .status-time {
    font-size: 5.3px;
    line-height: 1;
  }

  .report--dense .room {
    font-size: 6.3px;
  }

  .report--dense .meta,
  .report--dense .status-text {
    font-size: 5.2px;
    line-height: 1;
  }
}
