/* ==== 共有カレンダー デザイントークン ====
   インク（濃紺）× 生成り紙 × 朱の差し色。
   見出しは明朝、本文はゴシックで可読性重視。 */

:root {
  --paper: #F3EEE3;
  --card: #FFFDF8;
  --line: #D8CFB8;
  --line-dark: #4A5449;
  --ink: #1F2A24;
  --sub: #5A5546;
  --muted: #8A8367;
  --red: #8B4A47;
  --blue: #4A5B8B;
  --holiday-bg: #F7EDE9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

h1, h2, h3, .month-label, .app-title {
  font-family: "Hiragino Mincho ProN", serif;
}

/* ---- ログイン画面 ---- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 40px 32px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 4px 24px rgba(30,30,20,0.08);
}
.login-eyebrow {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--red);
  margin-bottom: 6px;
}
.login-box h1 {
  font-size: 24px;
  margin: 0 0 24px;
}
.login-box label, .field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 4px;
}
.login-box input, input[type="text"], input[type="password"], input[type="time"], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}
.error-message {
  background: var(--holiday-bg);
  color: var(--red);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ---- 共通ボタン ---- */
.btn, .btn-primary, .btn-danger {
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-danger {
  color: var(--red);
  border-color: var(--red);
  background: #fff;
}
.btn-block { width: 100%; margin-top: 20px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-link {
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  padding: 5px 12px;
  font-size: 12px;
  margin-left: 8px;
}

/* ---- ヘッダー ---- */
.app-header {
  background: var(--ink);
  color: var(--paper);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.app-title { font-size: 18px; letter-spacing: 1px; }
.app-user { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.user-dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; margin-right: 6px;
}

/* ---- メイン ---- */
.app-main { max-width: 900px; margin: 24px auto; padding: 0 16px 40px; }
.admin-main { max-width: 640px; }

.calendar-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.month-label { font-size: 26px; }
.toolbar-buttons { display: flex; gap: 8px; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.weekday-cell {
  background: #EAE3D3;
  text-align: center;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
}
.weekday-cell.sun { color: var(--red); background: var(--holiday-bg); }
.weekday-cell.sat { color: var(--blue); background: #EAEDF5; }

.day-cell {
  background: var(--card);
  min-height: 92px;
  padding: 6px;
  cursor: pointer;
}
.day-cell.empty { opacity: 0.3; cursor: default; }
.day-cell.holiday { background: var(--holiday-bg); }

.day-number { font-size: 12px; margin-bottom: 1px; color: var(--sub); }
.day-number.today {
  background: var(--red); color: #fff; border-radius: 50%;
  width: 18px; height: 18px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px;
}
.day-number.red { color: var(--red); }
.day-number.blue { color: var(--blue); }

.holiday-name {
  font-size: 10px; color: var(--red); margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.event-chip {
  font-size: 11px; padding: 2px 4px; border-radius: 2px;
  margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; cursor: pointer;
}
.birthday-chip {
  background: #FBF0DC;
  border-left: 3px solid #C9A24B;
  color: #6B5A2A;
}

.calendar-help { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ---- モーダル ---- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(31,42,36,0.4);
  align-items: center; justify-content: center; padding: 16px; z-index: 10;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--card); border-radius: 6px; padding: 24px;
  width: 340px; max-width: 100%;
}
.modal-date { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.modal-box h3 { margin: 0 0 16px; }
.checkbox-row {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  margin-bottom: 10px; cursor: pointer;
}
.checkbox-row input { width: 18px; height: 18px; }
.time-fields { display: flex; gap: 10px; margin-bottom: 4px; }
.time-field { flex: 1; }
.time-field-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.modal-actions {
  display: flex; justify-content: space-between; margin-top: 20px;
}
.modal-actions-right { display: flex; gap: 8px; }

/* ---- 管理画面 ---- */
.admin-section {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 20px; margin-bottom: 20px;
}
.admin-section h2 { font-size: 16px; margin: 0 0 10px; }
.notice {
  background: var(--holiday-bg); padding: 10px 14px; border-radius: 4px;
  font-size: 13px; margin-bottom: 16px;
}
.user-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.user-table th, .user-table td {
  text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line);
}

@media (max-width: 480px) {
  .month-label { font-size: 20px; }
  .day-cell { min-height: 68px; }
}
