/* schedule 共通デザインシステム (方向性C: スレート + ティール) */
:root {
  --c-header: #0f172a;
  --c-accent: #0d9488;
  --c-accent-h: #0f766e;
  --c-accent-bg: #ccfbf1;
  --c-accent-fg: #0f766e;
  --c-bg: #f1f5f9;
  --c-surface: #ffffff;
  --c-border: #e2e8f0;
  --c-text: #1e293b;
  --c-muted: #64748b;
  --c-danger: #dc2626;
  --c-warn: #d97706;
  --c-ok: #059669;
  --c-zebra: #f8fafc;
  --c-row-hover: #f0fdfa;
  --r: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font);
  margin: 0;
  padding: 16px;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.5;
}

h1, h2, h3 { color: var(--c-text); }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── ヘッダ / ナビ ── */
header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
  margin: -16px -16px 16px;
  padding: 12px 20px;
  background: var(--c-header);
  color: #fff;
}
header strong { font-weight: 700; letter-spacing: 0.3px; }
header a { color: #cbd5e1; }
header nav a { margin-right: 14px; color: #cbd5e1; font-size: 0.95em; }
header nav a:hover { color: #fff; text-decoration: none; }
header nav a.active { color: #fff; font-weight: 700; border-bottom: 2px solid var(--c-accent); padding-bottom: 3px; }
header .greeting { font-size: 0.9em; color: #94a3b8; margin-right: 8px; }

/* ── ボタン ── */
button {
  border: none; border-radius: 6px; padding: 8px 16px;
  font-size: 0.9em; font-weight: 600; cursor: pointer;
  background: var(--c-accent); color: #fff;
}
button:hover { background: var(--c-accent-h); }
button:disabled { opacity: 0.55; cursor: default; }
button.btn-secondary { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); }
button.btn-secondary:hover { background: var(--c-zebra); }
button.btn-danger { background: var(--c-danger); color: #fff; }
button.btn-danger:hover { background: #b91c1c; }

/* ── フォーム ── */
input[type="text"], input[type="password"], input[type="date"],
input[type="number"], select, textarea {
  padding: 9px 10px; border: 1px solid var(--c-border); border-radius: 6px;
  font-size: 0.95em; background: #fff; color: var(--c-text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--c-accent); outline-offset: 0; border-color: var(--c-accent);
}
label { display: block; font-size: 0.9em; color: var(--c-muted); margin: 8px 0 4px; }

/* ── カード / パネル ── */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 16px;
}

/* ── ツールバー ── */
.toolbar {
  background: var(--c-surface); border: 1px solid var(--c-border);
  padding: 10px 12px; border-radius: var(--r); margin-bottom: 12px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 0.9em;
  box-shadow: var(--shadow);
}
/* ツールバー内ラベルは横並び (汎用 label の display:block を打ち消す) */
.toolbar label { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--c-text); }
.toolbar span { display: inline-flex; align-items: center; gap: 4px; }

/* ── テーブル (汎用 zebra + hover) ── */
table { width: 100%; border-collapse: collapse; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--r); overflow: hidden; }
th, td { padding: 9px 12px; text-align: left; }
thead th {
  background: var(--c-zebra); color: var(--c-muted);
  font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.4px;
  border-bottom: 1px solid var(--c-border);
}
tbody td { border-top: 1px solid #eef2f7; }
tbody tr:nth-child(even) { background: var(--c-zebra); }
tbody tr:hover { background: var(--c-row-hover); }

/* ── チップ / ピル / バッジ ── */
.chip, .pill {
  display: inline-block; font-size: 0.8em; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  background: var(--c-accent-bg); color: var(--c-accent-fg);
}

/* ── メッセージ / 状態 ── */
.error, .msg-error { color: var(--c-danger); margin: 8px 0; min-height: 1em; }
.msg-error { background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 8px 10px; }
.msg-ok { color: var(--c-ok); background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
.loading { color: var(--c-muted); margin: 8px 0; font-size: 0.9em; }
.loading::before { content: "⏳ "; }
.muted { color: var(--c-muted); }
.empty {
  text-align: center; color: var(--c-muted); padding: 28px;
  border: 1px dashed var(--c-border); border-radius: var(--r); background: #fafcff;
}
.hidden { display: none; }

/* ── モーダル (openModal の box) ── */
.modal-box, #modal-overlay > div {
  background: var(--c-surface) !important; color: var(--c-text) !important;
  border-radius: var(--r) !important; box-shadow: 0 12px 32px rgba(15,23,42,0.25) !important;
}
.modal-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── スケジュールグリッド (schedule.html / schedule.js) ── */
.grid-wrap { overflow-x: auto; border: 1px solid var(--c-border); border-radius: var(--r); box-shadow: var(--shadow); }
table.grid { border-collapse: collapse; font-size: 12px; white-space: nowrap; border: none; border-radius: 0; }
table.grid th, table.grid td { border: 1px solid var(--c-border); padding: 4px; vertical-align: top; text-transform: none; letter-spacing: normal; }
table.grid thead th { background: var(--c-zebra); color: var(--c-text); position: sticky; top: 0; font-size: 12px; }
table.grid tbody tr:nth-child(even) { background: transparent; }
table.grid tbody tr:hover { background: transparent; }
table.grid .name-col { position: sticky; left: 0; background: #fff; font-weight: bold; z-index: 1; }
table.grid thead .name-col { background: var(--c-zebra); z-index: 2; }
th.weekend, td.weekend { background: #f8fafc; color: #94a3b8; }
.cell { min-width: 88px; cursor: pointer; }
.cell:hover { background: var(--c-row-hover); }
.chip.sched, .grid .chip { border-radius: 3px; padding: 1px 5px; margin-bottom: 2px; display: block; font-size: 11px; background: #dddddd; color: #1e293b; }
.total { text-align: right; font-size: 11px; color: var(--c-text); }
.total.over { color: var(--c-danger); font-weight: bold; }
.total.low { color: var(--c-warn); }
.cell.over { background: #fef2f2; }

/* ── 集計 (report.html / report.js) ── */
table.agg-table { max-width: 760px; font-size: 13px; }
table.agg-table td { border-top: 1px solid #eef2f7; vertical-align: middle; }
.agg-proj { cursor: pointer; background: var(--c-zebra); font-weight: bold; }
.agg-proj:hover { background: var(--c-row-hover); }
.agg-sub td { color: var(--c-muted); font-weight: normal; padding-left: 22px; background: #fff; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.caret { color: var(--c-accent); display: inline-block; width: 1em; }
.bar { display: inline-block; height: 12px; background: var(--c-accent); border-radius: 2px; vertical-align: middle; min-width: 2px; }
.bar-sub { background: #5eead4; height: 10px; }
.bar-cell { width: 40%; }
.grand { font-weight: bold; margin: 8px 0; }

/* ── 案件色スウォッチ (projects.html) ── */
.color-swatch { display: inline-block; width: 24px; height: 16px; border: 1px solid var(--c-border); vertical-align: middle; margin-right: 4px; border-radius: 3px; }
.filter { margin: 12px 0; }
.filter label { display: inline-block; margin-right: 12px; font-size: 0.95em; color: var(--c-text); }

/* ── ログイン (index.html) ── */
body.login {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  min-height: 100vh; padding: 0;
  display: flex; align-items: center; justify-content: center; color: #e2e8f0;
}
body.login .login-card {
  background: rgba(255, 255, 255, 0.06); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 40px; border-radius: 14px; min-width: 320px; max-width: 420px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
body.login h1 { font-size: 2em; margin: 0 0 8px; color: #fff; }
body.login .subtitle { opacity: 0.8; margin-bottom: 24px; color: #cbd5e1; }
body.login label { color: #cbd5e1; }
body.login input { width: 100%; }
body.login button { width: 100%; margin-top: 20px; padding: 12px; }
body.login a { color: #5eead4; }
