:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --line: #e2e8f0;
  --bg: #f4f6f9;
}
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans JP", system-ui, sans-serif;
  background: var(--bg);
  color: #334155;
  font-size: 14px;
}
.font-display { font-family: "Noto Sans JP", system-ui, sans-serif; }

.loading-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; font-size: .95rem; color: #94a3b8;
}

/* ===== サイドナビ（明るい白ベース・業務ソフト調） ===== */
.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
}
.nav-item {
  transition: background .12s, color .12s;
  border-left: 3px solid transparent;
  color: #475569;
}
.nav-item:hover { background: #f1f5f9; color: #1e293b; }
.nav-item.active {
  background: #eff6ff;
  border-left-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
}
.nav-item.active i { color: #2563eb; }

/* ===== カード（枠線ベース・控えめ） ===== */
.card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card-hover { transition: border-color .12s, background .12s; }
.card-hover:hover { border-color: #93c5fd; background: #fafcff; }
.table-row { transition: background .1s; }
.table-row:hover { background: #f8fafc; }

/* セクション見出し */
.section-title { font-size: .95rem; font-weight: 700; color: #1e293b; }
.page-title { font-size: 1.25rem; font-weight: 700; color: #1e293b; }

/* ===== バッジ（彩度控えめ） ===== */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 4px; font-size: .72rem; font-weight: 700; }
.badge-green { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-yellow{ background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-red   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-blue  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-gray  { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-purple{ background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }

/* ===== ボタン（フラット・業務系） ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 15px; border-radius: 6px; font-weight: 700; transition: background .12s, border-color .12s; cursor: pointer; font-size: .84rem; white-space: nowrap; border: 1px solid transparent; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.btn-ghost:hover { background: #e2e8f0; }
.btn-outline { background: #fff; color: #2563eb; border-color: #bfdbfe; }
.btn-outline:hover { background: #eff6ff; border-color: #93c5fd; }
.btn-danger { background: #fff; color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 4px 10px; font-size: .76rem; border-radius: 5px; }

/* ===== 入力 ===== */
.input, .select, textarea.input { width: 100%; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .86rem; background: #fff; transition: border-color .12s, box-shadow .12s; color: #1e293b; }
.input:focus, .select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.input::placeholder { color: #94a3b8; }
.label { font-size: .74rem; font-weight: 700; color: #64748b; margin-bottom: 4px; display: block; }

/* ===== モーダル（控えめ） ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto; animation: fadeIn .12s; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 640px; margin-top: 28px; box-shadow: 0 12px 32px -8px rgba(15,23,42,.3); border: 1px solid #e2e8f0; }
.modal-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== 出欠ボタン ===== */
.att-btn { padding: 5px 11px; border-radius: 5px; font-size: .76rem; font-weight: 700; border: 1px solid #cbd5e1; cursor: pointer; transition: all .1s; background: #fff; color: #475569; }
.att-btn:hover { border-color: #94a3b8; background: #f8fafc; }
.att-btn.sel-present { background: #047857; color: #fff; border-color: #047857; }
.att-btn.sel-absent  { background: #dc2626; color: #fff; border-color: #dc2626; }
.att-btn.sel-furikae { background: #b45309; color: #fff; border-color: #b45309; }

/* ===== クラス色（カレンダー・時間割） ===== */
.c-sky    { background: #eff6ff; border-color: #60a5fa; color: #1e40af; }
.c-violet { background: #f5f3ff; border-color: #a78bfa; color: #5b21b6; }
.c-emerald{ background: #ecfdf5; border-color: #34d399; color: #065f46; }
.c-amber  { background: #fffbeb; border-color: #fbbf24; color: #92400e; }
.c-rose   { background: #fff1f2; border-color: #fb7185; color: #9f1239; }
.c-indigo { background: #eef2ff; border-color: #818cf8; color: #3730a3; }
.c-teal   { background: #f0fdfa; border-color: #2dd4bf; color: #115e59; }
.c-orange { background: #fff7ed; border-color: #fb923c; color: #9a3412; }
.c-cyan   { background: #ecfeff; border-color: #22d3ee; color: #155e75; }
.c-lime   { background: #f7fee7; border-color: #a3e635; color: #3f6212; }

/* ===== ステップインジケータ ===== */
.step { display: flex; align-items: center; gap: 8px; }
.step-dot { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; background: #e2e8f0; color: #64748b; }
.step-dot.active { background: #2563eb; color: #fff; }
.step-dot.done { background: #047857; color: #fff; }

/* ===== トースト ===== */
#toast { position: fixed; bottom: 20px; right: 20px; z-index: 100; }
.toast-item { background: #1e293b; color: #fff; padding: 11px 18px; border-radius: 7px; margin-top: 8px; box-shadow: 0 6px 20px -4px rgba(15,23,42,.4); animation: slideIn .18s ease; display: flex; align-items: center; font-size: .84rem; }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== スケルトン ===== */
.skeleton { background: linear-gradient(90deg,#e9eef4 25%,#f4f6f9 50%,#e9eef4 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ===== 空状態 ===== */
.empty-state { text-align: center; padding: 40px 20px; color: #94a3b8; }
.empty-state i { font-size: 2rem; margin-bottom: 10px; opacity: .5; }

/* ===== クラスセル（時間割） ===== */
.lesson-cell { padding: 7px 9px; border-radius: 6px; font-size: .74rem; cursor: pointer; transition: filter .1s; border-left: 3px solid; }
.lesson-cell:hover { filter: brightness(.97); }

/* ===== カレンダーイベント ===== */
.cal-event { border-radius: 5px; padding: 4px 6px; cursor: pointer; border-left: 3px solid; transition: filter .1s; line-height: 1.3; }
.cal-event:hover { filter: brightness(.96); }
.cal-time { font-size: .68rem; font-weight: 700; opacity: .85; }
.cal-name { font-size: .72rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-meta { font-size: .64rem; opacity: .8; margin-top: 1px; }
.cal-cancelled { opacity: .5; text-decoration: line-through; }

/* ===== 色スウォッチ（クラス色選択） ===== */
.color-swatch { width: 28px; height: 28px; border-radius: 6px; cursor: pointer; border: 1px solid rgba(15,23,42,.1); transition: transform .1s; }
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { outline: 2px solid #2563eb; outline-offset: 1px; }

/* ===== テーブル共通 ===== */
table th { font-weight: 700; }
.data-table thead th { background: #f8fafc; color: #64748b; font-size: .74rem; border-bottom: 1px solid var(--line); padding: 9px 14px; text-align: left; }
.data-table td { padding: 9px 14px; border-bottom: 1px solid #eef2f6; }

/* ===== 申し送りメモ ===== */
.memo-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 7px; padding: 10px 12px; font-size: .82rem; color: #78350f; }

/* ===== スクロールバー ===== */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== ユーティリティ ===== */
.fade-in { animation: fadeIn .15s ease; }
.divider { height: 1px; background: var(--line); }
