:root {
  --bg: #edf2f7;
  --paper: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --border: #111111;
  --blue: #2563eb;
  --shadow: 6px 6px 0 #111111;
  --shadow-soft: 4px 4px 0 rgba(17, 24, 39, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background: var(--bg);
}

h1,
h2,
h3,
.room-chip,
.date-nav-button,
.room-link {
  font-family: "Manrope", sans-serif;
}

button,
input,
a,
table {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
  position: relative;
  z-index: 1;
}

.neo-card {
  background: var(--paper);
  border: 4px solid var(--border);
  box-shadow: var(--shadow);
}

.room-card {
  overflow: scroll;
}

.room-card__body,
.room-empty,
.room-error {
  color: var(--muted);
  line-height: 1.55;
}

.controls,
.table-shell {
  margin-bottom: 1.25rem;
  padding: 1rem;
}

.controls {
  display: grid;
  gap: 1rem;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 4px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease;
}

.mode-option:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(17, 24, 39, 0.16);
}

.mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-option span {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mode-option:has(input:checked) {
  background: #e0f2fe;
  border-color: var(--blue);
  color: #1d4ed8;
}

.mode-option--active {
  background: #e0f2fe;
  border-color: var(--blue);
  color: #1d4ed8;
}

.filter-panels {
  display: grid;
  gap: 1rem;
}

.filter-panel {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 4px solid var(--border);
  background: #f8fafc;
}

.filter-panel__header {
  display: grid;
  gap: 0.35rem;
}

.filter-panel__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.date-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.field-group {
  display: grid;
  gap: 0.45rem;
  font-weight: 700;
}

.field-group span {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.checkbox-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.65rem 0.8rem;
  border: 3px solid var(--border);
  background: #ffffff;
  box-shadow: 3px 3px 0 rgba(17, 17, 17, 0.12);
  cursor: pointer;
}

.checkbox-option input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--blue);
  flex: 0 0 auto;
}

.checkbox-option span {
  font-size: 0.9rem;
  font-weight: 700;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
}

.apply-button {
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border: 4px solid var(--border);
  background: var(--border);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(17, 17, 17, 0.18);
}

.apply-button:hover {
  transform: translate(-1px, -1px);
}

.apply-button:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.date-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.date-nav-button {
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  border: 4px solid var(--border);
  background: var(--border);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(17, 17, 17, 0.18);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease,
    color 120ms ease;
}

.date-nav-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(17, 17, 17, 0.18);
}

.date-nav-button:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.date-input {
  min-height: 3rem;
  padding: 0.6rem 0.85rem;
  border: 4px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.day-name {
  min-width: 8rem;
  padding: 0.65rem 0.9rem;
  border: 4px solid var(--border);
  background: #e0f2fe;
  color: #075985;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
}

.table-shell__header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.table-shell__header h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.6rem, 3.2vw, 2.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.room-list {
  display: grid;
  gap: 1rem;
}

.room-card {
  padding: 1rem;
  background: #fcfcfd;
}

.room-card__header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 0.95rem;
}

.room-card__header h3 {
  margin: 0.35rem 0 0;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.room-chip {
  display: none;
  background: #e0f2fe;
  border-color: var(--blue);
  color: #1d4ed8;
  margin-bottom: 0.3rem;
}

.room-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border: 3px solid var(--border);
  background: #ffffff;
  box-shadow: 3px 3px 0 rgba(17, 17, 17, 0.12);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.room-link:hover {
  transform: translate(-1px, -1px);
}

.room-card__body {
  min-height: 4.5rem;
}

.room-card__body--loading {
  display: grid;
  align-items: center;
  padding: 0.8rem 1rem;
  border: 3px dashed rgba(17, 17, 17, 0.3);
  background: #f8fafc;
  color: var(--ink);
  font-weight: 700;
}

.room-card__body--error {
  display: grid;
  align-items: center;
  padding: 0.8rem 1rem;
  border: 3px solid #dc2626;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 800;
}

.room-empty {
  padding: 0.8rem 1rem;
  border: 3px solid var(--border);
  background: #f8fafc;
  font-weight: 700;
}

.room-card table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 4px solid var(--border);
  background: #ffffff;
}

.room-card th,
.room-card td {
  padding: 0.8rem 0.7rem;
  border: 2px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.room-card th {
  background: #111111;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.room-card tbody tr:nth-child(odd) td {
  background: #fffdf7;
}

.room-card tbody tr:hover td {
  background: #eef2ff;
}

.share-button {
  min-height: 3rem;
  padding: 0.7rem 1.2rem;
  border: 4px solid var(--border);
  background: var(--blue);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(17, 17, 17, 0.18);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease;
  white-space: nowrap;
}

.share-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(17, 17, 17, 0.18);
}

.share-button:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.share-button.copied {
  background: #059669;
}

@media (min-width: 900px) {
  .controls {
    grid-template-columns: 1fr;
    align-items: start;
  }

  /* Pastikan mode-switch dan panel filter berada di atas-bawah pada layar lebar */
  .controls > .mode-switch,
  .controls > .filter-panels {
    grid-column: 1;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 1240px);
    padding-top: 0.5rem;
  }

  .controls,
  .table-shell {
    padding: 0.9rem;
  }

  .mode-switch,
  .date-range-grid,
  .checkbox-grid,
  .checkbox-grid--compact {
    grid-template-columns: 1fr;
  }

  .filter-panel,
  .mode-option,
  .checkbox-option,
  .apply-button {
    width: 100%;
  }

  .table-shell__header {
    align-items: start;
  }

  .table-shell__header h2 {
    font-size: 1.5rem;
  }

  .day-name {
    width: 100%;
  }

  .date-input {
    width: 100%;
  }

  .date-navigation {
    width: 100%;
    align-items: stretch;
  }

  .date-nav-button,
  .date-input,
  .day-name {
    width: 100%;
  }

  .date-nav-button {
    min-width: 0;
  }

  .filter-actions {
    justify-content: stretch;
  }

  .apply-button {
    justify-content: center;
  }

  .share-button {
    min-width: 0;
    padding: 0.65rem 1rem;
  }

  .room-card {
    padding: 0.85rem;
  }

  .room-card__header {
    align-items: stretch;
  }

  .room-card__header h3 {
    font-size: 1.2rem;
  }

  .room-link {
    width: 100%;
    justify-content: center;
  }

  .room-card table {
    width: 100%;
    table-layout: auto;
  }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
  }

  .room-card {
    overflow: scroll;
  }

  .room-card th,
  .room-card td {
    padding: 0.65rem 0.55rem;
    font-size: 0.88rem;
  }

  .room-card td {
    white-space: normal;
    word-break: break-word;
  }
}
