:root {
  --bg: #f7f2e6;
  --surface: #fffdf7;
  --line: #e6ddca;
  --text: #3f3327;
  --muted: #7a6a57;
  --brand: #9f6a2e;
  --brand-deep: #7e4f1f;
  --ok: #4f7e38;
  --mid: #5f7894;
  --none: #9a5b3f;
  --shadow-lg: 0 18px 38px rgba(101, 76, 43, 0.14);
  --shadow-sm: 0 4px 14px rgba(111, 85, 52, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 18% 0%, #fff9ef 0%, var(--bg) 54%, #efe6d6 100%);
  overflow-x: hidden;
  max-width: 100%;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.blob {
  position: absolute;
  border-radius: 999px;
  opacity: 0.2;
  filter: blur(3px);
}

.blob-a {
  width: 320px;
  height: 320px;
  top: -130px;
  right: 4%;
  background: radial-gradient(circle at 32% 30%, #f8ebcd, #e7d4ab);
}

.blob-b {
  width: 250px;
  height: 250px;
  top: 24%;
  left: -120px;
  background: radial-gradient(circle at 50% 40%, #fbf3e1, #e6dbc0);
}

.blob-c {
  width: 210px;
  height: 210px;
  bottom: -100px;
  right: 20%;
  background: radial-gradient(circle at 42% 50%, #f3ebd9, #ddd1b3);
}

.shell {
  width: min(1120px, 100% - 28px);
  margin: 20px auto 28px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.page-head h1 {
  margin: 8px 0 0;
  font-size: clamp(30px, 4.3vw, 44px);
  line-height: 1.05;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  color: var(--brand-deep);
}

.lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.ghost-link {
  border: 1px solid #dbcdb4;
  border-radius: 999px;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 12px;
  color: #6a4f33;
  background: #fffcf5;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 14px;
}

.filter-panel {
  margin-top: 14px;
}

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

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

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
}

.field span {
  font-size: 12px;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

.field input,
.field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #dbcdb5;
  border-radius: 10px;
  padding: 10px 11px;
  background: #fffdf8;
  color: var(--text);
}

.field input[type="date"] {
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  -webkit-min-logical-width: 0;
}

.field input:disabled {
  opacity: 0.66;
}

.filter-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.filter-footer > * {
  min-width: 0;
  max-width: 100%;
}

.lookup-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #695740;
}

.check-inline input {
  width: 16px;
  height: 16px;
}

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

.primary-btn,
.sub-btn,
.danger-btn {
  min-height: 42px;
  border-radius: 10px;
  padding: 0 14px;
  cursor: pointer;
}

.primary-btn {
  border: 1px solid #8b5d2d;
  color: #ffffff;
  background: linear-gradient(180deg, #c98c4a 0%, #99602a 100%);
}

.sub-btn {
  border: 1px solid #d6c8b0;
  color: #5f4930;
  background: #fffcf4;
}

.danger-btn {
  border: 1px solid #b35f4a;
  color: #ffffff;
  background: linear-gradient(180deg, #cb7356 0%, #a04f36 100%);
}

.flash-message {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  color: transparent;
}

.flash-message.error,
.flash-message.info {
  color: #ffffff;
  border-radius: 10px;
  padding: 8px 10px;
}

.flash-message.error {
  background: #9e5d3e;
}

.flash-message.info {
  background: #6d5437;
}

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

.summary-grid article {
  border: 1px solid #e6dcc6;
  border-radius: 14px;
  background: rgba(255, 254, 249, 0.95);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
}

.summary-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 30px;
  line-height: 1;
  color: var(--brand-deep);
}

.result-panel {
  margin-top: 12px;
}

.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.result-head h2 {
  margin: 0;
  font-size: 22px;
}

.result-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.booking-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.booking-card {
  border: 1px solid #e3d7c0;
  border-radius: 12px;
  background: #fffcf5;
  padding: 11px;
  display: grid;
  gap: 8px;
}

.booking-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.booking-time {
  margin: 0;
  font-weight: 700;
  color: #5c4228;
  font-size: 14px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d9ccb5;
  padding: 3px 9px;
  font-size: 12px;
  background: #fffef9;
}

.status-chip.confirmed {
  color: var(--ok);
}

.status-chip.pending {
  color: var(--mid);
}

.status-chip.canceled {
  color: var(--none);
}

.booking-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.booking-main h3 {
  margin: 0;
  font-size: 18px;
  color: #4f3821;
}

.booking-meta {
  margin: 4px 0 0;
  color: #6f5b45;
  font-size: 13px;
}

.booking-code {
  border: 1px solid #e2d4bb;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12px;
  color: #6a4d31;
  background: #fff8ea;
}

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

.booking-detail-grid p {
  margin: 0;
  font-size: 13px;
  color: #634e39;
}

.booking-detail-grid strong {
  color: #4c3724;
}

.booking-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.booking-actions .sub-btn.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.booking-actions .danger-btn.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.booking-muted {
  color: var(--muted);
  font-size: 12px;
}

.note-box {
  border: 1px dashed #dbcdb5;
  border-radius: 10px;
  padding: 7px 9px;
  background: #fffdf8;
  font-size: 12px;
  color: #67533e;
}

.empty-card {
  border: 1px dashed #dccdb4;
  border-radius: 12px;
  background: #fffcf5;
  padding: 16px;
  text-align: center;
}

.empty-card h3 {
  margin: 0;
  font-size: 18px;
}

.empty-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lookup-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 18px, 900px);
    margin-top: 14px;
  }

  .page-head {
    flex-direction: column;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .lookup-grid {
    grid-template-columns: 1fr;
  }

  .filter-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    width: 100%;
    flex-direction: column;
  }

  .primary-btn,
  .sub-btn,
  .danger-btn {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .booking-main {
    grid-template-columns: 1fr;
  }

  .booking-detail-grid {
    grid-template-columns: 1fr;
  }

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

  .booking-actions .sub-btn.small {
    width: 100%;
  }

  .booking-actions .danger-btn.small {
    width: 100%;
  }
}
