html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #f6f8fa;
  font-family: "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
header {
  background: #004d99;
  color: #fff;
  padding: 12px 20px;
  font-size: 1.2em;
  font-weight: 700;
}
.container {
  display: grid;
  grid-template-columns: 65% 35%;
  height: calc(100vh - 50px);
}
.left-pane {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #ddd;
  overflow: hidden;
}
.right-pane {
  background: #fff;
  overflow: hidden;
}
.search-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #ddd;
  align-items: center;
}
.search-area input,
.search-area select {
  padding: 6px 10px;
  font-size: 0.9em;
  border-radius: 4px;
  border: 1px solid #ccc;
}
.search-area button {
  background: #004d99;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}
.search-area button:hover {
  background: #0a65c0;
}
.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
#monthCalendar,
#dayCalendar {
  flex: 1;
  height: 100%;
}
.fc .fc-today-button {
  display: none !important;
}
.fc .fc-toolbar-title {
  font-weight: 700;
}
.fc-right-title-only .fc-toolbar-chunk:not(:nth-child(2)) {
  display: none;
}
.fc-day-other {
  background-color: #f3f3f3;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}
.modal-content {
  background: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 92%;
  max-width: 600px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.close {
  color: #888;
  float: right;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}
.close:hover {
  color: #000;
}
.detail-title {
  font-size: 1.2em;
  font-weight: 700;
  color: #004d99;
  margin-bottom: 8px;
}
.detail-item {
  margin-bottom: 6px;
}
.result-item {
  border-bottom: 1px solid #eee;
  padding: 10px 4px;
  cursor: pointer;
}
.result-item:hover {
  background: #f0f7ff;
}
.no-result {
  text-align: center;
  color: #888;
  padding: 8px;
}

#addModal .modal-content {
  max-width: 520px;
  background: #fafafa;
}
#addModal h3 {
  margin-top: 0;
  color: #004d99;
  text-align: center;
  border-bottom: 2px solid #004d99;
  padding-bottom: 8px;
}
#addModal label {
  display: block;
  margin-top: 10px;
  font-weight: 600;
  color: #333;
}
#addModal input,
#addModal select,
#addModal textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95em;
  margin-top: 4px;
}
#saveAdd {
  background: #004d99;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  display: block;
  margin: 15px auto 5px auto;
  transition: 0.2s;
}
#saveAdd:hover {
  background: #0066cc;
}
.add-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.add-row #addDateLabel {
  font-weight: 700;
}

.results-scroll {
  max-height: 60vh;
  overflow: auto;
}

@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
}

/* ===========================
   Header / Logout Button
=========================== */
.main-header {
  background: #0d47a1;
  color: #fff;
  padding: 10px 20px;
  position: relative;
}

.main-header h1 {
  font-size: 1.2rem;
  margin: 0;
}

.logout-btn {
  position: absolute;
  right: 20px;
  top: 14px;
}

.logout-link {
  color: #fff;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: background 0.2s, opacity 0.2s;
}

.logout-link:hover {
  background: rgba(255, 255, 255, 0.15);
  opacity: 0.85;
}

/* ===========================
   Logout message
=========================== */
.logout-message {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  padding: 10px 15px;
  border-radius: 4px;
  text-align: center;
  margin: 10px auto 20px;
  width: 280px;
  font-size: 0.9rem;
}
/* --- モーダルのスクロール --- */
.modal-content {
  max-height: 80vh;
  overflow-y: auto;
}

/* --- 保存ボタンを固定（必要なら） --- */
#saveAdd {
  position: sticky;
  bottom: 0;
  background: #004c99;
  color: #fff;
  width: 100%;
  border: none;
  padding: 10px;
  border-radius: 6px;
}

.result-header {
  font-size: 14px;
  padding: 6px 0;
  color: #444;
  border-bottom: 1px solid #ccc;
  margin-bottom: 6px;
}
/* 右ペイン開閉タブ */
.day-pane-toggle {
  position: absolute;
  top: 64px;
  left: calc(65% - 12px);
  transform: none;
  width: 24px;
  height: 32px;
  border-radius: 6px 0 0 6px;
  border: 1px solid #ccc;
  background: #004d99;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  font-size: 14px;
}

.day-pane-toggle span {
  display: block;
  line-height: 1;
}

/* 右ペインを閉じたときのレイアウト */
.container.day-pane-hidden {
  grid-template-columns: 100% 0;
}

/* 右ペインを閉じている時（左カレンダーが全幅）のタブ位置 */
.container.day-pane-hidden .day-pane-toggle {
  left: auto;
  right: 0;
  top: 64px;      /* 必要に応じて上の位置は微調整可能 */
  border-radius: 6px 0 0 6px;  /* 右側に付くので形を反転 */
}