:root {
  --header-bg: #2d6a4f;
  --page-bg: #f5f5f0;
  --border-color: #e0e0e0;
  --today-border: #2d6a4f;
  --hp-bg: #dbeafe; --hp-text: #1d4ed8;
  --nap-bg: #dcfce7; --nap-text: #166534;
  --raku-bg: #fee2e2; --raku-text: #991b1b;
  --auto-full-text: #dc2626;
  --stay-badge-bg: #fef3c7; --stay-badge-text: #92400e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, 'Hiragino Sans', 'BIZ UDPGothic', sans-serif;
  background-color: var(--page-bg);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--header-bg);
  color: white;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
header h1 { font-size: 1.2rem; }

.month-nav { display: flex; align-items: center; gap: 1rem; }
.month-nav button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}
.month-nav button:hover { background: rgba(255,255,255,0.3); }

/* 2カラム（右ペイン非表示時） */
.dashboard-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.pane {
  padding: 1rem;
  overflow-y: auto;
}

.calendar-pane {
  background-color: white;
  border-right: 1px solid var(--border-color);
}
.daily-list-pane {
  background-color: var(--page-bg);
}

/* 右ペイン: スライドイン */
.detail-pane {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  background: white;
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 12px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  z-index: 10;
}
.detail-pane.open {
  transform: translateX(0);
}

h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--header-bg);
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--border-color);
  border: 1px solid var(--border-color);
}

.calendar-header-cell {
  background-color: #f8f9fa;
  padding: 0.5rem;
  text-align: center;
  font-weight: bold;
  font-size: 0.8rem;
}
/* 土日の色 */
.calendar-header-cell:nth-child(6) { color: #2563eb; }
.calendar-header-cell:nth-child(7) { color: #dc2626; }

.calendar-day-cell {
  background-color: white;
  min-height: 90px;
  padding: 0.4rem;
  cursor: pointer;
  transition: background 0.2s;
}
.calendar-day-cell:hover { background-color: #f0f7ff; }
.calendar-day-cell.today {
  outline: 2px solid var(--today-border);
  outline-offset: -2px;
}
.calendar-day-cell.has-reservation { background-color: #f9fdf9; }
.calendar-day-cell.selected { background-color: #e8f5e9; }
.calendar-day-cell.empty { cursor: default; }
.calendar-day-cell.empty:hover { background-color: white; }

.day-num { font-weight: bold; font-size: 0.9rem; margin-bottom: 0.3rem; }

.cal-summary { font-size: 0.7rem; line-height: 1.3; }
.cal-summary div { margin-bottom: 1px; }
.cal-checkin { color: #b45309; font-weight: 600; }
.cal-stay { color: #6b7280; }
.auto-status.full { color: var(--auto-full-text); font-weight: bold; }

/* Section Headers */
.list-section { margin-bottom: 1rem; }
.section-header {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}
.checkin-header { background: #fef3c7; color: #92400e; }
.stay-header { background: #e0e7ff; color: #3730a3; }

/* Reservation Items */
.res-item {
  background: white;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.4rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.res-item:hover { background: #f0fdf4; }
.res-item.cancelled { text-decoration: line-through; opacity: 0.6; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: bold;
}
.badge-hp { background-color: var(--hp-bg); color: var(--hp-text); }
.badge-nap { background-color: var(--nap-bg); color: var(--nap-text); }
.badge-raku { background-color: var(--raku-bg); color: var(--raku-text); }
.badge-stay { background-color: var(--stay-badge-bg); color: var(--stay-badge-text); }
.badge-auto { background-color: #eee; color: #333; }

.res-name { font-weight: 600; }
.res-people { font-size: 0.75rem; color: #888; margin-left: auto; }

/* チェックインボタン */
.checkin-btn {
  background: var(--header-bg);
  color: white;
  border: none;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 0.3rem;
  flex-shrink: 0;
}
.checkin-btn:hover { background: #1b4332; }

.undo-btn {
  background: #e5e7eb;
  color: #374151;
  border: none;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 0.3rem;
  flex-shrink: 0;
}
.undo-btn:hover { background: #d1d5db; }

/* Detail Card */
.detail-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
}
.detail-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
  padding: 0.2rem;
}
.detail-close:hover { color: #333; }

.detail-row {
  display: flex;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}
.detail-label {
  width: 100px;
  color: #666;
  flex-shrink: 0;
}
.detail-value { font-weight: 600; }

.placeholder {
  color: #999;
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
}
.placeholder.small { margin-top: 0.5rem; font-size: 0.8rem; }
