body {
  margin: 0;
  background: #f6f7f4;
  color: #1f2a26;
  font-family: "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: #0c766d;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  background: #fff;
  border-bottom: 1px solid #d7dbd2;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.topbar p {
  margin: 0;
  color: #637067;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.button,
button {
  display: inline-block;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #d7dbd2;
  border-radius: 6px;
  background: #fff;
  color: #1f2a26;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  border-color: #0c766d;
  background: #0c766d;
  color: #fff;
  font-weight: 700;
}

.danger {
  color: #a83d35;
  border-color: #d8b5b1;
}

main {
  padding: 18px 22px 32px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tabs a {
  padding: 7px 13px;
  border: 1px solid #d7dbd2;
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
}

.tabs .active {
  border-color: #0c766d;
  background: #e5f3f1;
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pane {
  border: 1px solid #d7dbd2;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.event-list {
  display: grid;
  gap: 8px;
}

.event-item {
  display: block;
  padding: 10px;
  border: 1px solid #d7dbd2;
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
  color: #1f2a26;
}

.event-item.active {
  border-color: #0c766d;
  background: #f0faf8;
}

.event-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.muted {
  color: #637067;
}

.stats,
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.stat,
.summary div {
  border: 1px solid #d7dbd2;
  border-radius: 6px;
  padding: 8px;
  background: #fbfcfb;
}

.stat span {
  display: block;
  color: #637067;
  font-size: 12px;
}

.stat strong {
  font-size: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border: 1px solid #d7dbd2;
  padding: 6px 7px;
  vertical-align: middle;
  word-break: break-word;
}

th {
  background: #eef1eb;
  text-align: left;
}

.reservations th:nth-child(1) { width: 42px; }
.reservations th:nth-child(2) { width: 150px; }
.reservations th:nth-child(3) { width: 210px; }
.reservations th:nth-child(4) { width: 52px; }
.reservations th:nth-child(5) { width: 112px; }
.reservations th:nth-child(6) { width: 135px; }
.reservations th:nth-child(8) { width: 88px; }

.roster th:nth-child(1) { width: 42px; }
.roster th:nth-child(2) { width: 155px; }
.roster th:nth-child(3) { width: 155px; }
.roster th:nth-child(4) { width: 54px; }
.roster th:nth-child(5) { width: 72px; }
.roster th:nth-child(6) { width: 110px; }

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.status.active {
  background: #e8f5ec;
  color: #246b42;
}

.status.cancelled {
  background: #f8ebe9;
  color: #a83d35;
}

.field-small {
  width: 62px;
  height: 30px;
}

.field-wide {
  width: 100%;
  height: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

label {
  display: grid;
  gap: 4px;
  color: #637067;
  font-weight: 700;
}

label input,
label textarea {
  border: 1px solid #d7dbd2;
  border-radius: 5px;
  padding: 7px 8px;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.print-title {
  margin-bottom: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
}

.print-summary {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.4fr 2fr;
  margin-top: 10px;
}

.print-summary div {
  min-height: 52px;
  border: 1px solid #d7dbd2;
  padding: 8px;
}

.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login form {
  width: 360px;
}

.error {
  padding: 8px 10px;
  border: 1px solid #d8b5b1;
  background: #f8ebe9;
  color: #a83d35;
  border-radius: 6px;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 6mm;
  }

  body {
    min-width: 0;
    background: white;
    font-size: 8.5px;
  }

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

  main {
    padding: 0;
  }

  .pane {
    border: none;
    padding: 0;
  }

  .print-title {
    margin-bottom: 3px;
    font-size: 11px;
  }

  th,
  td {
    height: 14px;
    padding: 1px 3px;
    border-color: #000;
  }

  .roster {
    font-size: 8.5px;
  }

  .print-summary {
    margin-top: 4px;
  }

  .print-summary div {
    min-height: 34px;
    border-color: #000;
    padding: 4px;
  }
}

