:root {
  color-scheme: light;
  --ink: #1d2321;
  --muted: #64706a;
  --paper: #fbfaf5;
  --white: #ffffff;
  --line: #dbe3dd;
  --soft: #eef3ef;
  --accent: #1b6f5b;
  --accent-strong: #0f4f43;
  --sun: #d59645;
  --rose: #b94f52;
  --radius: 8px;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a,
.import-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

button,
a,
.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font-weight: 800;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(16px, 4vw, 44px);
  background: #13211d;
  color: var(--white);
}

.admin-header h1,
.panel-title h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--sun);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions button,
.admin-actions a,
.import-button {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--white);
}

.import-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-shell {
  display: grid;
  gap: 18px;
  padding: clamp(16px, 3vw, 32px);
}

.warning-panel,
.calendar-panel,
.table-panel,
.detail-panel {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.warning-panel {
  padding: 16px 18px;
  border-color: rgba(185, 79, 82, 0.28);
  background: rgba(185, 79, 82, 0.07);
}

.warning-panel strong {
  color: var(--rose);
}

.warning-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.warning-panel code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.summary-grid div {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--accent-strong);
  font-size: 30px;
}

.toolbar {
  display: grid;
  grid-template-columns: 180px 180px minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus,
a:focus {
  outline: 3px solid rgba(27, 111, 91, 0.18);
  border-color: var(--accent);
}

.danger-button {
  background: var(--rose);
  color: var(--white);
  border-color: var(--rose);
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.weekday-grid,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-grid {
  padding: 10px 14px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.calendar-grid {
  gap: 1px;
  padding: 14px;
  background: var(--line);
}

.calendar-day {
  min-height: 118px;
  padding: 9px;
  background: var(--white);
}

.calendar-day[data-muted="true"] {
  background: #f4f2ec;
  color: var(--muted);
}

.date-number {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
}

.reservation-chip {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 6px 7px;
  border: 0;
  border-radius: 6px;
  background: rgba(27, 111, 91, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  text-align: left;
}

.reservation-chip[data-status="confirmed"] {
  background: rgba(27, 111, 91, 0.18);
}

.reservation-chip[data-status="pending"] {
  background: rgba(213, 150, 69, 0.22);
  color: #67420d;
}

.reservation-chip[data-status="cancelled"] {
  background: rgba(185, 79, 82, 0.13);
  color: var(--rose);
  text-decoration: line-through;
}

.ledger-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

td {
  font-size: 13px;
  line-height: 1.55;
}

tr[data-selected="true"] td {
  background: rgba(27, 111, 91, 0.08);
}

td strong {
  display: block;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.detail-panel {
  position: sticky;
  top: 16px;
  padding: 18px;
}

.detail-panel h2 {
  margin: 0 0 14px;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 3px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-list dd {
  margin: 0;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 980px) {
  .admin-header,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid,
  .toolbar,
  .ledger-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .admin-actions {
    width: 100%;
  }

  .admin-actions button,
  .admin-actions a,
  .import-button {
    flex: 1 1 130px;
  }

  .calendar-day {
    min-height: 92px;
    padding: 6px;
  }

  .reservation-chip {
    padding: 5px;
    font-size: 11px;
  }
}
