/* music-admin.css — 共通スタイル (Sprint4 L1+L2+L5+L6) */

:root {
  /* 2026-05-13 Sprint 2.1: talent-hub palette に統一 (operator 指示)
     ink + 落ち着いた紫 + canvas で AI SaaS っぽくないシンプルトーン */
  --primary: #0A0A0F;        /* ink (deep black) */
  --primary-dark: #000000;
  --primary-light: #1F1F26;
  --accent: #5B5BD6;         /* 落ち着いた紫 (ネオンではない) */
  --accent-dark: #4848B0;
  --accent-soft: #EEF0FF;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;
  --info: #5B5BD6;
  --bg: #FAFAFB;             /* canvas */
  --card: #FFFFFF;            /* surface */
  --text: #0A0A0F;
  --text-muted: #6B7280;     /* mute */
  --text-light: #9AA0A6;     /* mute2 */
  --border: #EDEDF0;         /* line */
  --border-light: #F5F5F7;
  --sidebar-w: 240px;
  --sidebar-mini-w: 72px;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 15, 0.04), 0 1px 1px rgba(10, 10, 15, 0.02);
  --shadow-md: 0 4px 12px rgba(10, 10, 15, 0.06), 0 2px 4px rgba(10, 10, 15, 0.03);
  --shadow-lg: 0 8px 24px rgba(10, 10, 15, 0.08), 0 2px 6px rgba(10, 10, 15, 0.04);
  --z-sidebar: 100;
  --z-dialog: 1000;
  --z-toast: 1100;
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ===== App shell ===== */
/* 2026-05-13 Sprint 2.3: sidebar dark → light, talent-hub style に統一 */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--card);
  color: var(--text);
  padding: 1rem 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: var(--z-sidebar);
  transition: width 0.2s;
  border-right: 1px solid var(--border);
}
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 1.5rem;
  min-width: 0;
  transition: margin-left 0.2s;
  background: var(--bg);
}

/* ===== Sidebar nav ===== */
.sidebar h1 { font-size: 13px; font-weight: 700; color: var(--primary); padding: 0 1rem 14px; border-bottom: 1px solid var(--border); letter-spacing: -0.01em; }
.sidebar .user { padding: 10px 1rem; font-size: 11px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.nav-section { padding: 14px 1rem 6px; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.nav-item {
  display: block;
  padding: 8px 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  transition: background 0.12s, color 0.12s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg); color: var(--primary); }
.nav-item.active { background: var(--accent-soft); border-left-color: var(--accent); color: var(--primary); font-weight: 600; }

/* ===== Page header ===== */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.page-head p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.page-head .page-head-meta { display: flex; gap: 0.75rem; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.page-head .page-head-meta strong { color: var(--primary); font-weight: 700; }

/* ===== Cards ===== (2026-05-13 talent-hub 統一: 影なし + border + 余白詰め) */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.card-title { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border-light); letter-spacing: -0.01em; }

/* ===== Stats ===== (talent-hub 統一: 影なし、 数値ふっとく、 textAlign left) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-align: left; }
.stat:hover { border-color: var(--text-light); }
.stat .number { font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1.1; letter-spacing: -0.02em; }
.stat .label { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }

/* ===== Data table ===== 2026-05-13: sticky col-actions のため border-collapse:separate + overflow 削除 */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* overflow:hidden は sticky を壊す → 削除 */
}
.data-table th {
  background: var(--primary);
  color: #fff;
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 500;
  position: sticky;
  top: 0;
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { background: var(--primary-light); }
.data-table th.sortable::after { content: ''; display: inline-block; width: 0.6em; margin-left: 0.25em; opacity: 0.5; }
.data-table th.sortable[aria-sort="ascending"]::after { content: '▲'; opacity: 1; }
.data-table th.sortable[aria-sort="descending"]::after { content: '▼'; opacity: 1; }
.data-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.data-table tbody tr { transition: background 0.12s; }
.data-table tr:hover td { background: var(--accent-soft); cursor: default; }
/* 「🔍 詳細」 などの操作ボタン (table-icon-button) の visual 強化 */
.table-icon-button {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; margin: 0 2px 0 0;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card); color: var(--text);
  font-size: 11.5px; font-weight: 500; cursor: pointer;
  line-height: 1.3; transition: border-color 0.12s, background 0.12s, color 0.12s;
  white-space: nowrap;
}
.table-icon-button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.table-icon-button.danger:hover { border-color: var(--danger); background: #FEE2E2; color: var(--danger); }
.table-icon-button.compact { padding: 4px 6px; min-width: 28px; justify-content: center; font-size: 13px; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
/* 操作列を右 sticky 固定 → 横スクロールでも見切れない (operator 報告対応) */
.data-table .col-actions {
  position: sticky; right: 0; z-index: 2;
  background: var(--card);
  border-left: 1px solid var(--border-light);
  box-shadow: -4px 0 8px -8px rgba(10, 10, 15, 0.2);
}
.data-table thead th.col-actions { background: var(--bg); }
.data-table tbody tr:hover td.col-actions { background: var(--accent-soft); }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .checkbox-cell { width: 2.5rem; text-align: center; }
/* 内部管理 ID 列は短く ellipsis (operator: 大事な情報が狭くなる問題) */
.data-table .col-code {
  max-width: 110px; min-width: 80px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 11px; color: var(--text-muted);
}
.data-table th.col-code { font-size: 10.5px; }
.data-table .col-actions { width: 84px; max-width: 84px; min-width: 84px; white-space: nowrap; text-align: center; padding: 0.6rem 0.5rem; }
.table-icon-button.action-detail { background: var(--primary); color: #fff; border-color: var(--primary); }
.table-icon-button.action-detail:hover { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }

/* Wrapper for horizontal scroll */
.table-wrap { overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem; }

/* ===== Sub-table (project-detail) ===== */
.section-title { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: 0.6rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--accent); }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem 1rem; font-size: 0.9rem; }
.kv-item { padding: 0.4rem 0; border-bottom: 1px dashed var(--border-light); }
.kv-key { color: var(--text-muted); font-size: 0.78rem; }
.kv-val { font-weight: 600; margin-top: 0.1rem; }
.sub-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.sub-table th { background: #f6f7f8; color: #4a5568; padding: 0.5rem 0.6rem; border-bottom: 2px solid #e5e7eb; text-align: left; font-weight: 600; }
.sub-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid #e5e7eb; }

/* ===== Toolbar ===== 2026-05-13 talent-hub 風統一: 影削除 + 余白詰め */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.toolbar-search { flex: 1; min-width: 220px; max-width: 320px; position: relative; }
.toolbar-search input {
  width: 100%;
  padding: 6px 10px 6px 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  background: var(--card);
  transition: border-color 0.12s;
}
.toolbar-search::before {
  content: '🔍';
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.55;
  pointer-events: none;
}
.toolbar-search input:focus { outline: none; border-color: var(--accent); }
.toolbar-filter select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  background: var(--card);
  min-width: 140px;
  transition: border-color 0.12s;
}
.toolbar-filter select:focus { outline: none; border-color: var(--accent); }
.toolbar-spacer { flex: 1; }
.toolbar-info { font-size: 11px; color: var(--text-muted); white-space: nowrap; font-weight: 500; }
.toolbar-bulk-actions { display: flex; gap: 6px; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 1rem; font-size: 0.88rem; }
.pagination button { background: var(--card); border: 1px solid var(--border); padding: 0.4rem 0.75rem; border-radius: 6px; min-width: 2.25rem; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button[aria-current="page"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:not(:disabled):not([aria-current="page"]):hover { background: var(--border-light); }

/* ===== Status tokens (意味ベース) ===== */
.status { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
/* table-action-btn — 「次のステップ」 を primary 強調、 他を secondary
   2026-05-13 sprint-2.5: 相談受付の UX 改善 */
.table-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600;
  cursor: pointer; line-height: 1.2;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
  margin-right: 4px; white-space: nowrap;
  border: 1px solid transparent;
}
.table-action-btn:hover { transform: translateY(-1px); }
.table-action-btn.action-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.table-action-btn.action-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
.table-action-btn.action-secondary {
  background: var(--card); color: var(--text-muted); border-color: var(--border);
}
.table-action-btn.action-secondary:hover { border-color: var(--text-light); color: var(--text); }
.table-action-btn.action-approve { /* primary 補強なし、 .action-primary に従う */ }
.table-action-btn.action-convert-pending {
  background: var(--accent); color: #fff; border-color: var(--accent);
  animation: convert-pulse-soft 2.4s ease-in-out infinite;
}
.table-action-btn.action-convert-pending:hover { background: var(--accent-dark); border-color: var(--accent-dark); animation: none; }
@keyframes convert-pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 91, 214, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(91, 91, 214, 0); }
}
.table-action-btn.action-reject {
  /* secondary base + reject 用 hover */
}
.table-action-btn.action-reject:hover { border-color: var(--danger); color: var(--danger); }

/* status chip — talent-hub 配色に統一 */
.status--success, .status--done { background: #DCFCE7; color: #166534; }
.status--warning, .status--pending { background: #FEF3C7; color: #92400E; }
.status--danger, .status--stop { background: #FEE2E2; color: #991B1B; }
.status--info { background: #DBEAFE; color: #1E40AF; }
.status--neutral { background: #F1F5F9; color: #475569; }
.status--hold { background: #EEF0FF; color: #4338CA; }

/* Legacy badge aliases (互換) */
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge-done { background: #e8f3ec; color: #1f5c3f; }
.badge-pending { background: #fff4db; color: #8a5a00; }

/* Pill (detail view) */
.pill { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 10px; font-size: 0.72rem; font-weight: 600; background: var(--border-light); color: #4a5568; }
.pill.-ok { background: #c6f6d5; color: #276749; }
.pill.-wait { background: #fef3c7; color: #92400e; }
.pill.-manual { background: #fed7d7; color: #9b2c2c; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 6px; font-size: 12.5px; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: border-color 0.12s, background 0.12s; text-decoration: none; line-height: 1.3; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary { background: var(--card); color: var(--primary); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--border-light); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #c0392b; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--border-light); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

.primary-action { background: var(--primary); color: #fff; border: 1px solid var(--primary); padding: 7px 14px; border-radius: 6px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background 0.12s, border-color 0.12s; line-height: 1.3; }
.primary-action:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary-light); }

.recalc-btn { border: 1px solid #2b6cb0; background: #2b6cb0; color: #fff; border-radius: 6px; padding: 0.45rem 0.9rem; cursor: pointer; font-size: 0.86rem; font-weight: 600; }
.recalc-btn:hover { opacity: 0.9; }
.recalc-btn:disabled { opacity: 0.6; cursor: wait; }

/* ===== Form sections ===== 2026-05-13 talent-hub 統一: 影削除 + 余白詰め + h3 控えめ */
.form-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.form-section h3 { font-size: 12.5px; font-weight: 700; color: var(--primary); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 6px; letter-spacing: -0.01em; }
.form-section-hint { font-size: 11.5px; color: var(--text-muted); margin: 0 0 12px; line-height: 1.5; }
/* 2026-05-13: 2 列固定 (auto-fit だと field 数で右余白が空く問題を解消) */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.form-grid > .field-wrap[hidden] { display: none; }
.form-grid > .field-wrap.field-slot > .field[hidden] { display: none; }
/* 注意: 「slot 内 全 hidden なら slot ごと hide」 ルールは削除。
   両方 hidden (相談元区分 未選択時) でも slot は表示維持し、 ユーザが区分選択後にスムーズに表示される。 */
.form-grid-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; letter-spacing: 0.02em; }
.field label .required { color: var(--danger); margin-left: 3px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.12s;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.field .hint { font-size: 10.5px; color: var(--text-light); margin-top: 4px; }
.field .field-error { font-size: 11px; color: var(--danger); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.field .field-error::before { content: '⚠'; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field.has-error input:focus, .field.has-error select:focus { box-shadow: 0 0 0 3px #FEE2E2; }

/* Checkbox group */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 160px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.checkbox-group label { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text); margin-bottom: 0; }
.checkbox-group label:hover { color: var(--primary); }

/* Save bar */
.save-bar {
  position: sticky;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  margin: 1rem -1.5rem -1.5rem;
  z-index: 10;
  font-size: 0.85rem;
  color: var(--text-muted);
  align-items: center;
}
.save-bar .save-bar-hint { flex: 1; }
.save-bar.-saved .save-bar-hint { color: var(--success); }
.save-bar.-saved .save-bar-hint::before { content: '✓ '; }
.save-bar.-dirty .save-bar-hint { color: var(--warning); }

/* ===== Dialog (modal) ===== 2026-05-13 talent-hub 統一 */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 15, 0.5); z-index: var(--z-dialog); display: flex; justify-content: center; align-items: center; padding: 1rem; animation: fadein 0.15s; }
.dialog {
  background: var(--card);
  border-radius: 10px;
  max-width: 640px;
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideup 0.2s;
  border: 1px solid var(--border);
}
.dialog-lg { max-width: 960px; }
.dialog-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--card); }
.dialog-header h3 { font-size: 14px; font-weight: 700; color: var(--primary); margin: 0; letter-spacing: -0.01em; }
.dialog-close { background: transparent; border: none; font-size: 18px; color: var(--text-muted); padding: 4px 8px; border-radius: 6px; line-height: 1; cursor: pointer; transition: background 0.12s; }
.dialog-close:hover { background: var(--bg); color: var(--text); }
.dialog-body { padding: 16px 18px; overflow-y: auto; flex: 1; background: var(--bg); }
.dialog-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--card); }

/* ===== Tabs (Sprint4 L6) ===== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1rem; }
.tabs [role="tab"] {
  background: transparent;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
}
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { color: var(--primary); border-bottom-color: var(--accent); }
.tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[role="tabpanel"][hidden] { display: none; }

/* ===== Toast (Sprint4 L2) ===== */
.toast-region { position: fixed; top: 1rem; right: 1rem; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.toast {
  background: var(--card);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  min-width: 260px;
  max-width: 360px;
  pointer-events: auto;
  animation: slideright 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.toast.-success { border-left-color: var(--success); }
.toast.-success::before { content: '✓'; color: var(--success); font-weight: 700; }
.toast.-warning { border-left-color: var(--warning); }
.toast.-warning::before { content: '⚠'; color: var(--warning); font-weight: 700; }
.toast.-danger { border-left-color: var(--danger); }
.toast.-danger::before { content: '✕'; color: var(--danger); font-weight: 700; }
.toast.-info::before { content: 'ℹ'; color: var(--info); }

/* ===== Animations ===== */
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideup { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideright { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ===== Misc ===== */
.loading { text-align: center; padding: 2rem; color: var(--text-muted); }
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 2.5rem; opacity: 0.3; margin-bottom: 0.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ===== Responsive: Tablet (1024px以下) — sidebar mini ===== */
@media (max-width: 1024px) {
  .sidebar { width: var(--sidebar-mini-w); }
  .sidebar h1 { font-size: 0; padding: 0.5rem; }
  .sidebar h1::first-letter { font-size: 1.2rem; }
  .sidebar .user { display: none; }
  .nav-section { font-size: 0; padding: 0.4rem 0; position: relative; }
  .nav-section::before { content: '—'; color: rgba(255,255,255,0.3); }
  .nav-item {
    font-size: 0;
    text-align: center;
    padding: 0.6rem 0;
    position: relative;
  }
  .nav-item::first-letter { font-size: 0.85rem; letter-spacing: 0; }
  .main { margin-left: var(--sidebar-mini-w); padding: 1rem; }
  .page-head h1 { font-size: 1.3rem; }
}

/* ===== Responsive: Mobile (640px以下) — card list ===== */
@media (max-width: 640px) {
  :root { --sidebar-w: 100%; --sidebar-mini-w: 100%; }
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    padding: 0.5rem 0;
  }
  .sidebar h1 { font-size: 1rem; padding: 0.25rem 1rem; border-bottom: none; }
  .sidebar h1::first-letter { font-size: 1rem; }
  .sidebar .user, .nav-section { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 0.25rem; padding: 0 0.5rem; }
  .nav-item {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .nav-item::first-letter { font-size: 0.75rem; }
  .nav-item.active { border-left: none; border-bottom-color: var(--accent); }
  .main { margin-left: 0; padding: 0.75rem; }
  .app { flex-direction: column; }

  .page-head { flex-direction: column; align-items: stretch; }
  .page-head h1 { font-size: 1.2rem; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .stat { padding: 0.75rem; }
  .stat .number { font-size: 1.5rem; }

  .toolbar { flex-direction: column; align-items: stretch; padding: 0.5rem; }
  .toolbar-search, .toolbar-filter select { width: 100%; max-width: none; min-width: 0; }

  /* Table → card list */
  .table-wrap.table-mobile-cards { display: block; }
  .table-wrap.table-mobile-cards .data-table thead { display: none; }
  .table-wrap.table-mobile-cards .data-table,
  .table-wrap.table-mobile-cards .data-table tbody,
  .table-wrap.table-mobile-cards .data-table tr { display: block; }
  .table-wrap.table-mobile-cards .data-table tr {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
  }
  .table-wrap.table-mobile-cards .data-table td {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border: none;
    font-size: 0.85rem;
  }
  .table-wrap.table-mobile-cards .data-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    flex-shrink: 0;
  }
  .table-wrap.table-mobile-cards .data-table td:empty { display: none; }

  .dialog { max-height: 95vh; max-width: 100%; }
  .dialog-footer { flex-direction: column-reverse; }
  .dialog-footer .btn { width: 100%; }

  .form-grid { grid-template-columns: 1fr; }
  .save-bar { flex-direction: column; align-items: stretch; gap: 0.5rem; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== Admin Home page additions ===== */
.home-hero { background: linear-gradient(135deg, var(--primary) 0%, #16213e 100%); color: #fff; padding: 3rem 2rem; text-align: center; border-radius: 12px; margin-bottom: 2rem; }
.home-hero h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.home-hero p { opacity: 0.8; margin-bottom: 1.5rem; }
.departments { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.dept { background: var(--card); border-radius: 12px; padding: 1.25rem; box-shadow: var(--shadow-sm); }
.dept h3 { font-size: 1.1rem; color: var(--primary); margin-bottom: 0.75rem; }
.dept ul { list-style: none; }
.dept li { padding: 0.35rem 0; font-size: 0.85rem; border-bottom: 1px solid var(--border-light); }
.dept li a { color: var(--text); text-decoration: none; cursor: pointer; }
.dept li a:hover { color: var(--accent); }
.dept li::before { content: "→ "; color: var(--accent); font-weight: 600; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.feature { background: var(--card); border-radius: 12px; padding: 1rem; text-align: center; box-shadow: var(--shadow-sm); }
.feature .icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.feature h4 { font-size: 0.9rem; color: var(--primary); margin-bottom: 0.2rem; }
.feature p { font-size: 0.75rem; color: var(--text-muted); }
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-box { background: var(--card); border-radius: 16px; padding: 3rem; text-align: center; box-shadow: var(--shadow-lg); max-width: 400px; }
.login-box h1 { color: var(--primary); margin-bottom: 0.5rem; }
.login-box p { color: var(--text-muted); margin-bottom: 2rem; }
.login-box .btn { padding: 0.75rem 2rem; font-size: 1rem; }

@media (max-width: 768px) {
  .departments, .features { grid-template-columns: 1fr; }
  .home-hero { padding: 2rem 1rem; }
  .home-hero h2 { font-size: 1.4rem; }
}

/* ============================================================
   tc-* (Talent-hub Compatible) component classes
   2026-05-13 Sprint 2.1: dashboard modern skin
   既存 --primary / --accent / --bg を継承、 紫グレーは使わない (DESIGN_SYSTEM 準拠)
   ============================================================ */
.tc-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 0 0 18px; flex-wrap: wrap; }
.tc-page-head h1 { font-size: 22px; font-weight: 700; color: var(--primary); letter-spacing: -0.02em; margin: 0; }
.tc-page-head .tc-page-meta { color: var(--text-muted); font-size: 11.5px; display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }

/* KPI grid (Top tiles) — シンプル: 単色 border + 数値 + label */
.tc-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.tc-kpi-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.12s;
}
.tc-kpi-tile:hover { border-color: var(--text-light); }
.tc-kpi-tile .tc-kpi-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; }
.tc-kpi-tile .tc-kpi-value { font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1.1; margin-top: 6px; letter-spacing: -0.02em; }
.tc-kpi-tile .tc-kpi-trend { font-size: 11px; margin-top: 4px; color: var(--text-muted); }
.tc-kpi-tile .tc-kpi-trend.up { color: var(--success); }
.tc-kpi-tile .tc-kpi-trend.down { color: var(--danger); }
/* accent / warn / success バリアントは廃止 (シンプル統一) */

/* Section grid (2-3 col responsive) */
.tc-section-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.tc-section-grid.even { grid-template-columns: 1fr 1fr; }
.tc-section-grid.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 900px) {
  .tc-section-grid, .tc-section-grid.even, .tc-section-grid.three { grid-template-columns: 1fr; }
}

/* Card — シンプル: border + 余白のみ、 影は使わない */
.tc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
}
.tc-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border-light); }
.tc-card__head h2, .tc-card__head h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--primary); letter-spacing: -0.01em; }
.tc-card__head .tc-meta { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.tc-card__body { color: var(--text); font-size: 12.5px; }
.tc-card__body p { line-height: 1.65; color: var(--text); margin: 0 0 8px; font-size: 12.5px; }
.tc-card__body p.muted { color: var(--text-muted); font-size: 12px; }

/* Spec grid (key-value pairs) */
.tc-spec-grid { display: grid; grid-template-columns: 100px 1fr; gap: 0.5rem 0.9rem; font-size: 0.88rem; }
.tc-spec-grid dt { color: var(--text-muted); font-weight: 500; }
.tc-spec-grid dd { color: var(--text); font-weight: 600; margin: 0; }

/* Chip */
.tc-chip {
  display: inline-flex; align-items: center;
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: var(--border-light); color: var(--text);
  margin: 0 4px 4px 0;
}
.tc-chip.success { background: #e7f4ec; color: #1f5a44; }
.tc-chip.warn { background: #fff4d6; color: #8b5e00; }
.tc-chip.danger { background: #fde8e8; color: #8b1e1e; }
.tc-chip.accent { background: #fde8ed; color: var(--accent-dark); }
.tc-chip.primary { background: #e8e8f3; color: var(--primary); }

/* Micro action card (next action / alert list item) */
.tc-micro { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.85rem; margin-bottom: 0.55rem; transition: border-color 0.12s; }
.tc-micro:hover { border-color: var(--accent); }
.tc-micro .tc-micro-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; letter-spacing: 0.03em; margin-bottom: 4px; }
.tc-micro .tc-micro-tag.act { background: #e8e8f3; color: var(--primary); }
.tc-micro .tc-micro-tag.alert-high { background: #fde8e8; color: #8b1e1e; }
.tc-micro .tc-micro-tag.alert-mid { background: #fff4d6; color: #8b5e00; }
.tc-micro .tc-micro-tag.info { background: #e7f4ec; color: #1f5a44; }
.tc-micro .tc-micro-title { font-size: 0.88rem; font-weight: 600; color: var(--primary); margin: 0.25rem 0 0.15rem; line-height: 1.4; }
.tc-micro .tc-micro-body { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

/* Action row (link buttons) — シンプル: 細 border / 控えめ hover */
.tc-action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tc-action-btn { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 500; transition: border-color 0.12s, background 0.12s; }
.tc-action-btn:hover { border-color: var(--text-light); background: var(--bg); }
.tc-action-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.tc-action-btn.primary:hover { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }

/* ============================================================
   月次集計 export panel (Sprint 2.6: CSV/JSON/PDF + 月次セレクト)
   ============================================================ */
.monthly-export-panel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin: 0 0 14px; }
.monthly-export-head { margin: 0 0 12px; }
.monthly-export-head h3 { font-size: 14px; font-weight: 700; color: var(--primary); margin: 0 0 4px; letter-spacing: -0.01em; }
.monthly-export-head p { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.monthly-export-controls { display: grid; gap: 12px; align-items: start; }
@media (min-width: 768px) { .monthly-export-controls { grid-template-columns: 220px 1fr; } }
.monthly-export-field { min-height: 56px; display: flex; flex-direction: column; }
.monthly-export-field label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); margin: 0 0 6px; letter-spacing: 0.04em; line-height: 1.4; min-height: 16px; }
.monthly-export-field select { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; background: var(--card); color: var(--text); transition: border-color 0.12s; height: 34px; }
.monthly-export-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.monthly-export-types { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.monthly-export-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 11.5px; font-weight: 500; cursor: pointer; background: var(--card); transition: border-color 0.12s, background 0.12s; height: 28px; line-height: 1; }
.monthly-export-chip:hover { border-color: var(--text-light); }
.monthly-export-chip input { margin: 0; cursor: pointer; }
.monthly-export-chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.monthly-export-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.monthly-export-hint { margin: 10px 0 0; font-size: 11px; color: var(--text-light); line-height: 1.55; }
.monthly-export-hint code { background: var(--bg); padding: 1px 6px; border-radius: 4px; font-size: 10.5px; }

/* ============================================================
   project-card layout (Sprint 2.5: 稼働単位 card 表示)
   稼働単位で 参加メンバー + 同行担当者 を横断確認するための UI
   ============================================================ */
.project-card-list { display: grid; gap: 12px; }
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.project-card:hover { border-color: var(--text-light); }
.project-card.has-conflict { border-left: 3px solid var(--danger); }
.project-card__head { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light); }
.project-card__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.project-card__title { font-size: 15px; font-weight: 700; color: var(--primary); margin: 0 0 6px; letter-spacing: -0.01em; line-height: 1.4; }
.project-card__meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.project-card__detail { font-size: 12.5px; color: var(--text); margin: 8px 0 0; line-height: 1.55; }
.project-card__body { display: grid; gap: 14px; }
@media (min-width: 768px) { .project-card__body { grid-template-columns: 1fr 1fr; } }
.project-card__section { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.project-card__section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); margin: 0 0 8px; letter-spacing: 0.04em; text-transform: uppercase; display: flex; align-items: baseline; gap: 6px; }
.project-card__count { font-size: 10.5px; color: var(--accent); font-weight: 700; letter-spacing: 0; text-transform: none; }
.project-card__chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.project-card__empty { font-size: 11.5px; color: var(--text-light); margin: 0; font-style: italic; }
.project-card__foot { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-light); font-size: 11.5px; color: var(--text-muted); }
.project-card__foot-item strong { color: var(--text); font-weight: 600; margin-right: 4px; }
.project-card-empty { text-align: center; padding: 40px 1rem; color: var(--text-muted); background: var(--card); border: 1px dashed var(--border); border-radius: 10px; }

/* participant chip (staff vs member 区別) */
.participant-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; border: 1px solid transparent;
  line-height: 1.3;
}
.participant-chip small { font-size: 10px; font-weight: 500; opacity: 0.7; }
.participant-chip--staff { background: var(--accent-soft); color: var(--accent-dark); border-color: #C7CCFF; }
.participant-chip--member { background: #DCFCE7; color: #166534; border-color: #BBF7D0; }
.participant-chip.has-conflict { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }

/* Sub-tabs (segmented) */
.tc-sub-tabs { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 0; margin-bottom: 0.9rem; }
.tc-sub-tab { padding: 6px 14px; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); cursor: pointer; border-radius: 6px; background: transparent; border: 0; transition: all 0.12s; }
.tc-sub-tab.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ============================================================
   tc-workspace primitives (Sprint 2.2: dashboard workspace parity)
   codex 提案ベース、 music-pm DESIGN_SYSTEM 制約準拠
   - 角丸控えめ / 影最小 / gradient なし / AI SaaS 風味除去
   ============================================================ */
.tc-workspace { margin: 0 -1.5rem; padding: 0 1.5rem; }

/* Context banner (上部 文脈バナー talent-hub vision-banner 相当) */
.tc-context-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tc-context-banner .tc-eyebrow {
  font-size: 10.5px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.tc-context-banner h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.tc-context-banner .tc-context-copy {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.5;
}
.tc-context-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.tc-flag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.tc-flag.warn { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.tc-flag.danger { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }
.tc-flag.ok { background: #DCFCE7; color: #166534; border-color: #BBF7D0; }

/* Page tabs (主タブ talent-hub page-tabs 相当) */
.tc-page-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tc-tab-button {
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.tc-tab-button:hover { color: var(--primary); }
.tc-tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Page pane (lazy render) */
.tc-page-pane { padding: 4px 0 16px; }
.tc-page-pane[hidden] { display: none; }
.tc-pane-title { font-size: 14px; font-weight: 700; color: var(--primary); margin: 0 0 12px; letter-spacing: -0.01em; }
.tc-pane-section { margin-bottom: 20px; }
.tc-pane-section:last-child { margin-bottom: 0; }

