/* 日付ナビ・事前変更予定・登録フォーム・変更履歴・週表示のスタイル。
   色だけで意味を伝えず、必ず文字ラベルを併用する（正本 §6-2）。 */

/* 日付バー */
.date-bar {
  position: relative;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.date-nav { display: flex; align-items: center; gap: 8px; }
.date-current {
  font-size: 18px; font-weight: 700; letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums; min-width: 190px; text-align: center;
}
.btn-nav { font-size: 12px; padding: 4px 10px; }
.view-tabs {
  display: inline-flex; border: 1px solid var(--line-strong);
  border-radius: var(--radius); overflow: hidden; background: #f8fafc;
}
.view-tab {
  font-size: 13px; padding: 5px 18px; border: 0; background: transparent;
  color: var(--ink-2); cursor: pointer;
}
.view-tab + .view-tab { border-left: 1px solid var(--line-strong); }
.view-tab:hover { background: #eef2f7; }
.view-tab.is-active { background: var(--accent); color: #fff; font-weight: 700; }
.btn-history { margin-left: auto; }
.btn-history.is-active { background: #eef2ff; border-color: #93b4e8; color: #1e3a8a; }
.date-bar .app-dummy-badge { margin-left: 0; }

/* カレンダー（日付選択）。過去の予定を確認するための選択だけを行う。 */
.calendar-pop {
  position: absolute; top: calc(100% - 4px); left: 16px; z-index: 40;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 10px 12px 12px;
}
.calendar-head { display: flex; align-items: center; gap: 8px; }
.calendar-month {
  font-size: 14px; font-weight: 700; min-width: 96px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.calendar-head .btn-mini:last-child { margin-left: 8px; }
.calendar-note {
  font-size: 11px; color: var(--ink-3); margin: 6px 0 8px; max-width: 268px; line-height: 1.5;
}
.calendar-table { border-collapse: collapse; }
.cal-th {
  font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 2px 0; width: 38px;
}
.cal-td { padding: 1px; }
.cal-day {
  width: 36px; height: 30px; font-size: 12px; font-variant-numeric: tabular-nums;
  border: 1px solid transparent; border-radius: 4px; background: transparent;
  color: var(--ink-3); cursor: default;
}
.cal-day.is-out { color: #c3c8cf; }
.cal-day.has-data {
  color: var(--ink); background: #eef2f7; border-color: var(--line-strong); cursor: pointer;
  font-weight: 700;
}
.cal-day.has-data:hover { background: #dbe6f5; border-color: #93b4e8; }
.cal-day.is-closed { background: #f3f4f6; color: var(--ink-3); font-weight: 400; }
.cal-day.is-current {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.cal-day:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-day:disabled { cursor: default; }

/* 事前変更予定・連絡事項（前もって登録しておく備忘録） */
.planned-panel {
  margin: 12px 16px 0; padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line-strong); border-left: 4px solid #b45309;
  border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.planned-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.planned-title { font-size: 14px; font-weight: 700; letter-spacing: 0.01em; }
.planned-count {
  font-size: 13px; font-weight: 700; background: #eef1f5;
  border-radius: 999px; padding: 1px 10px; color: var(--ink-2);
}
.planned-pending {
  font-size: 12px; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 1px 10px; color: var(--ink-3);
}
.planned-pending.is-open { background: #fef3c7; border-color: #d97706; color: #92400e; font-weight: 700; }
.btn-primary {
  background: var(--accent); border-color: #1e40af; color: #fff; font-weight: 700;
}
.btn-primary:hover:not(:disabled) { background: #1e40af; border-color: #1e3a8a; }
.btn-add { margin-left: auto; }
.planned-note { font-size: 12px; color: var(--ink-3); line-height: 1.6; margin-top: 6px; }
.planned-other {
  font-size: 12px; color: var(--ink-3); line-height: 1.6; margin-top: 6px;
  padding: 5px 9px; background: #f8fafc; border-left: 3px solid var(--line-strong); border-radius: 4px;
}
.planned-list { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.planned-empty { font-size: 13px; color: var(--ink-3); }
.planned-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd;
}
.planned-item.is-todo { background: #fffbeb; border-color: #fcd34d; }
.planned-item.is-today { box-shadow: inset 3px 0 0 var(--accent); }
.planned-status {
  font-size: 11px; font-weight: 700; border-radius: 3px; padding: 1px 8px;
  background: #e5e7eb; color: var(--ink-2); white-space: nowrap;
}
.planned-item.is-todo .planned-status { background: #b45309; color: #fff; }
.planned-client { font-size: 14px; font-weight: 700; min-width: 92px; }
.planned-when { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* サービスコードは確認用のダミー表示。算定・請求の判断には使わない。 */
.planned-code {
  font-size: 11px; color: var(--ink-2); background: #eef2f7;
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 7px;
}
.planned-reason {
  font-size: 12px; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0 9px; color: var(--ink-2); background: #fff; white-space: nowrap;
}
.planned-text { font-size: 12px; color: var(--ink-2); }
.planned-by { font-size: 11px; color: var(--ink-3); }
.planned-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.btn-mini { font-size: 12px; padding: 3px 9px; }

/* 変更予定の登録フォーム（画面内の一時データのみ。保存も送信もしない） */
.event-form {
  margin-top: 10px; padding: 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: #f8fafc;
}
.form-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field-label { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.field-input {
  font-size: 13px; padding: 5px 8px; min-width: 132px;
  border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink);
}
.field-input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.form-note { font-size: 12px; color: var(--ink-3); line-height: 1.6; margin-top: 10px; }
.form-error {
  font-size: 12px; color: #b91c1c; font-weight: 700; margin-top: 6px;
  background: #fef2f2; border: 1px solid #fca5a5; border-radius: 4px; padding: 4px 8px;
}
.form-actions { display: flex; gap: 8px; margin-top: 10px; }

/* 職種グループの見出し行 */
.group-row .left-col {
  background: #eef1f5; border-bottom: 1px solid var(--line-strong);
  display: flex; align-items: center; padding: 4px 8px;
}
.group-row .track {
  height: 30px; background: #eef1f5; border-bottom: 1px solid var(--line-strong);
  display: flex; align-items: center;
}
.group-toggle {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent;
  font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; padding: 2px 0;
}
.group-caret { font-size: 10px; color: var(--ink-3); }
.group-name { letter-spacing: 0.04em; }
.group-meta {
  position: sticky; left: 8px; font-size: 12px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* 週表示 */
.week-view { margin: 16px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.week-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line); }
.week-title { font-size: 15px; font-weight: 700; }
.week-note { font-size: 12px; color: var(--ink-3); }
.week-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.week-th {
  text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 700;
  padding: 8px 14px; border-bottom: 1px solid var(--line-strong); background: #f8fafc;
}
.week-td {
  padding: 9px 14px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.week-row:hover { background: #f8fafc; }
.week-row.is-target { background: #eef4ff; }
.week-row.is-target .week-td { color: var(--ink); font-weight: 600; }
.week-link {
  border: 0; background: transparent; font-size: 14px; font-weight: 700;
  color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline;
}
.week-tag {
  font-size: 11px; margin-left: 8px; padding: 1px 7px; border-radius: 3px;
  background: #dbeafe; color: #1e3a8a; border: 1px solid #93b4e8;
}
.week-closed { background: #f3f4f6; color: var(--ink-3); border-color: var(--line-strong); }
.week-unassigned.has-value { color: #1f2937; font-weight: 700; }
.week-warned.has-value { color: #b91c1c; font-weight: 700; }
.week-changed.has-value { color: #5b21b6; font-weight: 700; }

/* 対象日以外の日（閲覧のみ） */
.readonly-day { margin: 16px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.readonly-banner {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; background: #f3f4f6; border-bottom: 1px solid var(--line-strong);
  font-size: 13px; color: var(--ink-2);
}
.readonly-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 12px 14px; }
.readonly-date { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.readonly-meta { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.readonly-list { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.readonly-item {
  display: flex; align-items: baseline; gap: 12px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd;
}
.readonly-staff { font-size: 13px; font-weight: 700; min-width: 110px; }
.readonly-role { font-size: 12px; color: var(--ink-3); }
.readonly-count { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; }

/* 変更一覧（別画面） */
.history-page {
  margin: 12px 16px 20px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden;
}
.history-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line-strong);
}
.history-title { font-size: 15px; font-weight: 700; }
.history-count {
  font-size: 13px; font-weight: 700; background: #e5e7eb; border-radius: 999px; padding: 1px 10px;
}
.history-head .btn { margin-left: auto; }
.history-note { padding: 8px 14px; font-size: 12px; color: var(--ink-3); background: #f8fafc; }
.history-empty { padding: 16px 14px; font-size: 13px; color: var(--ink-3); }
.history-scroll { overflow: auto; max-height: calc(100vh - 220px); }
.history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.history-th {
  position: sticky; top: 0; text-align: left; font-size: 11px; color: var(--ink-3);
  padding: 7px 10px; background: #f8fafc; border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.history-td {
  padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--ink-2);
  vertical-align: top; font-variant-numeric: tabular-nums;
}
.history-row:hover { background: #f8fafc; }
.history-at { white-space: nowrap; font-weight: 700; color: var(--ink); }
.history-client { font-weight: 700; color: var(--ink); white-space: nowrap; }
.history-after { color: #5b21b6; font-weight: 700; }
