:root {
  --primary: #7b1a2e;
  --primary-dark: #5a0f1f;
  --primary-light: #a83250;
  --secondary: #64748b;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  font-size: 14px;
}

.min-h-screen { min-height: 100vh; }

/* ---------- ログイン ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, #3d0b17 0%, #7b1a2e 45%, #5a0f1f 100%);
}
.login-wrap { display: flex; gap: 22px; align-items: stretch; flex-wrap: wrap; justify-content: center; max-width: 860px; }
.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  border-top: 4px solid var(--primary);
}
.login-header { text-align: center; margin-bottom: 22px; }
.login-header .logo { font-size: 36px; color: var(--primary); margin-bottom: 8px; }

/* ---------- 品質方針カード（ログイン画面・ヘッダーのモーダルで共用） ---------- */
.policy-card {
  background: #fff;
  border-radius: 18px;
  padding: 26px 26px 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  border-top: 4px solid var(--primary);
}
.policy-title { font-size: 24px; font-weight: 900; color: var(--primary); letter-spacing: .1em; margin: 0 0 16px; }
.policy-body { font-size: 13px; line-height: 1.85; color: var(--text); margin: 0 0 10px; }
.policy-sign { font-size: 12px; color: var(--text-muted); text-align: right; margin-top: 16px; line-height: 1.7; }
@media (max-width: 800px) { .policy-card { max-width: 460px; } }
.login-header h1 { font-size: 18px; font-weight: 900; letter-spacing: 0.08em; color: var(--primary); margin: 0 0 4px; }
.login-header p { font-size: 12px; color: var(--text-muted); margin: 0; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.form-control {
  width: 100%;
  padding: 11px 13px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  background: #f8fafc;
  transition: border-color .2s, background .2s;
}
.form-control:focus { border-color: var(--primary); background: #fff; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
textarea.form-control { resize: vertical; min-height: 70px; }
.error-text { color: var(--danger); font-size: 12px; margin-top: 6px; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; min-height: 38px;
  transition: transform .1s, background .15s; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; min-height: 30px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- ヘッダー ---------- */
.app-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20;
  box-shadow: var(--shadow-md);
}
.app-header .title { font-weight: 900; font-size: 16px; letter-spacing: .04em; }
.app-header .subtitle { font-size: 11px; opacity: .85; }
.app-header nav { display: flex; gap: 6px; margin-left: 12px; flex-wrap: wrap; }
.app-header nav button {
  background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 8px;
  padding: 7px 12px; font-size: 12.5px; cursor: pointer; font-weight: 600;
}
.app-header nav button.active { background: #fff; color: var(--primary); }
.app-header .spacer { flex: 1; }
.app-header .userbox { font-size: 12px; text-align: right; line-height: 1.4; }
.app-header .userbox .role { opacity: .8; font-size: 10.5px; }

main.container { max-width: 1200px; margin: 0 auto; padding: 22px 18px 60px; }
main.container.container-wide { max-width: none; padding: 22px 20px 40px; }

.breadcrumb { font-size: 16px; color: var(--text-muted); margin-bottom: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.breadcrumb a { color: var(--primary); text-decoration: none; cursor: pointer; font-weight: 700; padding: 3px 4px; border-radius: 5px; }
.breadcrumb a:hover { text-decoration: underline; background: var(--bg); }

/* ---------- カード ---------- */
.card {
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px;
}
.grid-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px;
}
/* 情報量の多いカード用（部門品質目標管理表の月次コメント・月別実績など）。横幅に応じて2〜4列に可変。 */
.grid-cards-2col {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px;
}
.card.is-dragging { opacity: .4; }
.card.drag-over-row { outline: 2px dashed var(--primary); outline-offset: -2px; }
.card .drag-handle { display: inline-block; width: auto; cursor: grab; }
.card .drag-handle:active { cursor: grabbing; }
/* 文書が1件だけのカテゴリを開いた直後に、クリック無しで見えるプレビュー */
.doc-preview-card { padding: 0; overflow: hidden; }
.doc-preview-frame { display: block; width: 100%; height: 78vh; min-height: 420px; border: none; }
.doc-preview-img { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: #f4f4f4; }
/* 「0.品質方針」専用の見開きレイアウト：左に社屋写真、右に方針本文（開いた瞬間に全文見えることを優先し、スクロールなしを目標にする） */
.qp-hero { display: flex; gap: 24px; align-items: stretch; padding: 20px; flex-wrap: wrap; }
.qp-photo { flex: 1 1 42%; min-width: 280px; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.qp-photo img { display: block; width: 100%; height: 100%; min-height: 260px; object-fit: cover; }
.qp-text { flex: 1 1 54%; min-width: 300px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.qp-title { font-size: 26px; letter-spacing: 6px; margin: 0 0 4px; color: var(--text); }
.qp-title-accent { color: #c0392b; }
.qp-lead { font-size: 13.5px; line-height: 1.8; color: var(--text); margin: 0; }
.qp-body { font-size: 13.5px; line-height: 1.85; color: var(--text); margin: 0; }
.qp-word { font-weight: 700; }
.qp-word-green { color: #1f9d55; }
.qp-word-red { color: #e0342f; }
.qp-word-blue { color: #3f6fd1; }
.qp-word-orange { color: #f39c12; }
.qp-sign { margin-top: 10px; font-size: 13px; line-height: 1.7; color: var(--text-muted, #666); text-align: right; }
@media (max-width: 760px) {
  .qp-hero { flex-direction: column; }
  .qp-title { font-size: 22px; letter-spacing: 3px; }
}
.category-card {
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 14px; cursor: pointer; transition: box-shadow .15s, transform .1s;
  display: flex; flex-direction: column; gap: 6px; border-top: 3px solid var(--primary-light);
}
.category-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
/* アイコン＋名称の行。名称にカード幅を目一杯使わせ、長い名称でも変な位置で改行しないようにする */
.category-card .cc-head { display: flex; align-items: center; gap: 8px; }
.category-card .cc-icon { font-size: 19px; color: var(--primary); flex: 0 0 auto; }
.category-card .cc-name { font-weight: 700; font-size: 13.5px; line-height: 1.35; flex: 1 1 auto; }
/* 部署名／変更禁止表示（左）と保存期間チップ（右）を名称行とは別の行にして、名称の折り返しに影響しないようにする */
.category-card .cc-sub { display: flex; align-items: center; gap: 8px; margin-top: 1px; }
.category-card .meta { font-size: 11px; color: var(--text-muted); }
/* 保存期間チップ：年数だけ目立たせる。詳しい保管年月はホバーのツールチップで見せる */
.qms-retention-chip { flex: 0 0 auto; margin-left: auto; text-align: right; line-height: 1.15; }
.qrc-years { font-size: 13px; font-weight: 800; color: var(--primary-dark); white-space: nowrap; }
.qrc-range { font-size: 9.5px; color: var(--text-muted); white-space: nowrap; }
/* QMS本文で対応する規格項番（例:「4.1 当社及びその状況の理解」）を点線で区切って薄く全件・1行ずつ表示。
   変な折り返しをしないよう1項目=1行のnowrap+省略記号にする（収まらない分は「…」、ホバーで全文表示）。
   各項目はクリックでQMS本文の該当章にジャンプするリンクにしている。 */
.category-card .qms-hint-list {
  display: flex; flex-direction: column; gap: 1px;
  margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--border);
}
.category-card .qms-hint-heading { font-size: 9.5px; font-weight: 700; color: var(--text-muted); letter-spacing: .04em; margin-bottom: 2px; }
.category-card .qms-hint-item {
  display: block; font-size: 10.5px; color: var(--text-muted); opacity: .85; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  text-decoration: none;
}
.category-card .qms-hint-item:hover { color: var(--primary-dark); opacity: 1; text-decoration: underline; }
/* QMSページ側：カードのリンクから来た時に該当条項の見出しをハイライトする（しばらく色を保持してからゆっくり消す） */
.manual-clause-flash { animation: manualClauseFlash 5s ease-in; border-radius: 4px; }
@keyframes manualClauseFlash {
  0% { background: #fff3cd; }
  70% { background: #fff3cd; }
  100% { background: transparent; }
}
/* カテゴリの性質別カラー（経営レベル系=紫／設備・現場系=青／監査・審査系=橙／品質記録・不具合系=赤／教育系=緑） */
.category-card.cat-group-mgmt { border-top-color: #7c3aed; }
.category-card.cat-group-equip { border-top-color: #2563eb; }
.category-card.cat-group-audit { border-top-color: var(--warning); }
.category-card.cat-group-issue { border-top-color: var(--danger); }
.category-card.cat-group-edu { border-top-color: var(--success); }
.category-card.locked { border-top-color: var(--warning); }

/* ---------- ドラッグ&ドロップ並び替え（共通） ---------- */
.drag-handle { cursor: grab; text-align: center; color: var(--text-muted); width: 28px; }
.drag-handle:active { cursor: grabbing; }
.drag-handle:hover { color: var(--primary); }
tr.is-dragging { opacity: .4; }
tr.drag-over-row td { box-shadow: inset 0 2px 0 var(--primary); }

/* ---------- テーブル ---------- */
/* 全社共通ルール：表は固定幅+折り返しでなくnowrap+可変幅を基本形にする。
   はみ出す場合は各テーブルを包む overflow-x:auto ラッパー側で横スクロールさせる。 */
table.data-table { width: auto; min-width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  text-align: left; font-size: 11.5px; color: var(--text-muted); font-weight: 600;
  padding: 6px 10px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
table.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
table.data-table td.cell-wrap { white-space: normal; }
/* コンパクト表示（スクロール回数を減らしたい一覧向け）：行の高さ・文字サイズを詰める */
table.data-table.compact { font-size: 12px; }
table.data-table.compact th { padding: 4px 8px; font-size: 11px; }
table.data-table.compact td { padding: 3px 8px; }
table.data-table.compact .form-control { min-height: 24px; padding: 2px 6px; font-size: 11.5px; }
table.data-table.compact .badge { padding: 2px 6px; font-size: 10.5px; }
table.data-table.compact .btn-sm { padding: 2px 8px; font-size: 11px; min-height: 22px; }
table.data-table tr:hover td { background: #f8fafc; }
table.data-table tr.row-overdue td { background: #fff1f2; }
table.data-table tr.row-overdue:hover td { background: #ffe4e6; }
/* リスク及び機会への取組み */
table.data-table tr.row-risk-changed td { box-shadow: inset 0 2px 0 #dc2626, inset 0 -2px 0 #dc2626; }
table.data-table tr.row-risk-changed td:first-child { box-shadow: inset 2px 2px 0 #dc2626, inset 0 -2px 0 #dc2626; }
table.data-table tr.row-risk-changed td:last-child { box-shadow: inset -2px 2px 0 #dc2626, inset 0 -2px 0 #dc2626; }
.risk-multiline { white-space: pre-line; }
table.data-table tr.risk-section-row td {
  background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 10px;
}
table.data-table tr.risk-section-row:hover td { background: var(--primary); }
table.data-table tr.risk-section-row .meta { color: rgba(255,255,255,.75) !important; }
table.data-table tr.risk-section-row .btn-secondary { background: rgba(255,255,255,.9); }
.risk-action-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 22px;
  border-radius: 5px; font-weight: 800; font-size: 13px;
}
table.plan-months-table th, table.plan-months-table td { min-width: 34px; text-align: center; white-space: nowrap; }
table.plan-months-table td:first-child, table.plan-months-table th:first-child { text-align: left; min-width: auto; }

table.plan-months-inline { border-collapse: collapse; font-size: 9.5px; color: var(--text-muted); }
table.plan-months-inline td { padding: 0 3px; text-align: center; white-space: nowrap; line-height: 1.5; }
table.plan-months-inline td:first-child { text-align: left; padding-right: 4px; font-weight: 600; }
table.plan-months-inline input[type="checkbox"] { width: 12px; height: 12px; margin: 0; cursor: pointer; vertical-align: middle; }
table.data-table td.is-editable { cursor: pointer; }
table.data-table td.is-editable:hover { background: #fff4e6 !important; }
.cell-truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
}
.badge-admin { background: #fee2e2; color: #991b1b; }
.badge-editor { background: #dbeafe; color: #1e40af; }
.badge-locked { background: #fef3c7; color: #92400e; }
.badge-expired { background: #fee2e2; color: #991b1b; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* 設備一覧: 本日の日常点検が未了の設備を点滅させて目立たせる／一覧上部のアラームバナー */
@keyframes equip-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.equip-blink { animation: equip-blink 1.1s ease-in-out infinite; }
.equip-daily-alarm {
  background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b;
  border-radius: var(--radius); padding: 10px 14px; font-size: 12.5px; font-weight: 700;
  animation: equip-blink 1.6s ease-in-out infinite;
}

/* ---------- スキルマップ（元Excelの色分けマトリクスに合わせた表示） ---------- */
/* スキルマップ本体：変更履歴を3:1で右側に常時表示する */
.skillmap-layout { display: flex; gap: 14px; align-items: flex-start; }
.skillmap-main-col { flex: 3; min-width: 0; }
/* 役職者力量（マネジメント評価）は技術スキルと違う画面だとひと目でわかるよう、色味だけ紫系に変える */
.skillmap-main-col-mgmt { border-top: 4px solid #7c3aed; background: linear-gradient(180deg, #f5f3ff 0%, var(--card-bg) 90px); }
.skillmap-main-col-mgmt table.skillmap-table thead th { background: #7c3aed; border-bottom-color: #5b21b6; }
.skillmap-main-col-mgmt table.skillmap-table th.col-minor { background: #6d28d9; }
.skillmap-main-col-mgmt table.skillmap-table tbody tr:nth-child(even) td.col-major { background: #ede9fe; }
.skillmap-main-col-mgmt table.skillmap-table td.col-major { color: #5b21b6; }
.skillmap-history-col { flex: 1; min-width: 220px; max-height: calc(100vh - 140px); overflow-y: auto; position: sticky; top: 8px; }
.skillmap-history-list { display: flex; flex-direction: column; gap: 8px; }
.skillmap-history-item { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.skillmap-history-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: 11px; margin-bottom: 2px; }
.skillmap-history-reason { margin-top: 2px; color: var(--text-muted); }
.skillmap-history-note { margin-top: 4px; color: var(--primary); font-size: 11px; font-weight: 600; }
@media (max-width: 900px) {
  .skillmap-layout { flex-direction: column; }
  .skillmap-history-col { position: static; max-height: none; width: 100%; }
}

.skillmap-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.skillmap-legend .legend-label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-right: 4px; }
.skillmap-legend .legend-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 6px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; border: 1px solid rgba(0,0,0,.06);
}
.skillmap-legend .legend-chip .dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.skillmap-legend .legend-desc { font-weight: 500; opacity: .75; }

.skillmap-table .cell-editable-text { display: inline-block; }
.skillmap-table td.col-major, .skillmap-table td.col-minor { position: relative; }
.skillmap-table .skillmap-delete-btn {
  display: none; position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--danger); cursor: pointer; padding: 2px 4px; font-size: 11px;
}
.skillmap-table td.col-major:hover .skillmap-delete-btn, .skillmap-table td.col-minor:hover .skillmap-delete-btn { display: inline-block; }
.skillmap-table .skillmap-delete-btn:hover { color: #991b1b; }

.skillmap-wrap { overflow: auto; max-height: calc(100vh - 250px); min-height: 320px; border: 1px solid var(--border); border-radius: var(--radius-sm); display: inline-block; max-width: 100%; }
table.skillmap-table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: max-content; }
table.skillmap-table th, table.skillmap-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }

table.skillmap-table thead th {
  position: sticky; top: 0; z-index: 3; background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; padding: 6px 4px; text-align: center; white-space: nowrap;
  border-right-color: rgba(255,255,255,.2); border-bottom-color: var(--primary-dark);
}
table.skillmap-table thead th:first-child, table.skillmap-table thead th:nth-child(2) { z-index: 4; }
table.skillmap-table thead th.emp-th { min-width: 38px; width: 38px; padding: 0; }
table.skillmap-table thead th.emp-th .emp-th-name { writing-mode: vertical-rl; text-orientation: mixed; letter-spacing: 1px; padding: 3px 0; }
.emp-th-btn {
  display: block; width: 100%; padding: 6px 4px; margin: 0; border: none; background: none; cursor: pointer;
  font: inherit; color: inherit;
}
.emp-th-btn:hover { background: rgba(255,255,255,.18); }
.emp-th-btn:hover .emp-th-name { text-decoration: underline; }

table.skillmap-table th.col-major, table.skillmap-table th.col-minor { text-align: left; }
table.skillmap-table td.col-major, table.skillmap-table td.col-minor {
  position: sticky; background: var(--card-bg); z-index: 1; white-space: nowrap; padding: 6px 8px;
  overflow: hidden; text-overflow: ellipsis;
}
table.skillmap-table td.col-major { left: 0; z-index: 2; font-weight: 700; color: var(--primary-dark); background: #faf3f4; }
table.skillmap-table th.col-major { position: sticky; left: 0; z-index: 5; }
table.skillmap-table td.col-minor { left: 80px; }
table.skillmap-table th.col-minor { position: sticky; left: 80px; z-index: 5; }
table.skillmap-table td.col-major, table.skillmap-table th.col-major { min-width: 80px; max-width: 80px; width: 80px; }
table.skillmap-table td.col-drag, table.skillmap-table th.col-drag {
  position: sticky; left: 0; z-index: 5; text-align: center; padding: 0;
  width: 26px; min-width: 26px; max-width: 26px; background: var(--card-bg);
}
table.skillmap-table th.col-drag { background: var(--primary); }
table.skillmap-table.has-drag-col td.col-major, table.skillmap-table.has-drag-col th.col-major { left: 26px; }
table.skillmap-table.has-drag-col td.col-minor, table.skillmap-table.has-drag-col th.col-minor { left: 106px; }
table.skillmap-table td.col-minor, table.skillmap-table th.col-minor { min-width: 110px; max-width: 480px; box-shadow: 2px 0 3px -2px rgba(0,0,0,.15); }
table.skillmap-table th.col-minor { background: var(--primary); box-shadow: 2px 0 3px -2px rgba(0,0,0,.3); }

table.skillmap-table td.cell-level { padding: 0; text-align: center; min-width: 38px; }

table.skillmap-table td.col-major.is-editable, table.skillmap-table td.col-minor.is-editable { cursor: pointer; }
table.skillmap-table td.col-major.is-editable:hover, table.skillmap-table td.col-minor.is-editable:hover { background: #fff4e6; }
.skillmap-inline-edit {
  width: 100%; height: 22px; font-size: 12.5px; font-family: inherit; padding: 0 4px;
  border: 1px solid var(--primary); border-radius: 4px; box-sizing: border-box;
}
table.skillmap-table tbody tr:nth-child(odd) td.col-minor { background: #fff; }
table.skillmap-table tbody tr:nth-child(even) td.col-minor { background: #fafafa; }
table.skillmap-table tbody tr:nth-child(even) td.col-major { background: #f5eaec; }

.skillmap-badge {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 26px;
  font-weight: 800; font-size: 12px;
}
.skillmap-cell-btn {
  border: none; cursor: pointer; font-family: inherit; padding: 0; margin: 0; box-sizing: border-box;
}
.skillmap-cell-btn:hover { filter: brightness(0.94); }
.skillmap-cell-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* 有資格者リスト（資格×人マトリクス）のマス。評価でなく所持有無のみなのでシンプルな2〜3状態 */
.qual-cell-btn {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 26px;
  border: none; background: transparent; color: var(--border); font-weight: 800; font-size: 13px;
  font-family: inherit; padding: 0; margin: 0; box-sizing: border-box; cursor: pointer;
}
button.qual-cell-btn:hover { filter: brightness(0.94); }
.qual-cell-btn.is-acquired { background: #dcfce7; color: #166534; }
.qual-cell-btn.is-expired { background: #fee2e2; color: #991b1b; }
/* このテーブルには大項目列が無いため、資格名列（col-minor）を先頭（左端）に固定する */
table.qualification-table td.col-minor, table.qualification-table th.col-minor { left: 0; }
table.qualification-table.has-drag-col td.col-minor, table.qualification-table.has-drag-col th.col-minor { left: 26px; }
/* 品質マニュアル（章ごとの直接編集） */
.manual-chapter-card { border-left: 3px solid var(--primary); }
.manual-content { font-size: 13.5px; line-height: 1.7; color: var(--text); }
.manual-content h3 { font-size: 15px; margin: 14px 0 6px; color: var(--primary-dark); }
.manual-content h4 { font-size: 13.5px; margin: 10px 0 4px; }
.manual-content p { margin: 6px 0; }
.manual-content ul, .manual-content ol { margin: 6px 0 6px 22px; }
table.manual-table { border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
table.manual-table td, table.manual-table th { border: 1px solid var(--border); padding: 4px 8px; }
.manual-toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.manual-editor {
  border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; min-height: 200px;
  max-height: 50vh; overflow: auto; background: #fff;
}
.manual-editor:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
/* 画面表示用の表紙カード（版数・承認欄）。印刷用の.manual-cover-page系は別途印刷ウィンドウ内で完結しているため無関係 */
.manual-approve-mini-cell { text-align: center; min-width: 46px; }
.manual-approve-mini-cell .manual-seal-img { display: block; margin: 0 auto 2px; object-fit: contain; }
/* QMS本文中で参照される記録・帳票名（原本PDFで文字色が変わっている箇所＝愛知溶業独自の帳票）を赤字で強調。
   関連ページが存在するものはリンク化し、対応する画面へワンクリックで遷移できる。 */
.qms-ref { color: #c0392b; font-weight: 600; }
a.qms-ref { text-decoration: none; cursor: pointer; border-bottom: 1px dashed #c0392b; }
a.qms-ref:hover { color: #96281b; border-bottom-style: solid; }
/* 業務上絶対に必須の資格を色分け表示する */
table.qualification-table td.col-minor.is-mandatory { background: #fef2f2; color: #b91c1c; font-weight: 800; }
table.qualification-table tbody tr:nth-child(even) td.col-minor.is-mandatory { background: #fee2e2; }
.qual-mandatory-badge {
  display: inline-block; background: #dc2626; color: #fff; font-size: 9.5px; font-weight: 800;
  padding: 1px 5px; border-radius: 3px; margin-right: 5px; vertical-align: middle; letter-spacing: .5px;
}

.skillmap-cell-wrap { position: relative; display: flex; width: 100%; height: 26px; }
td.cell-level.cell-changed { box-shadow: inset 0 0 0 2px #dc2626; border-radius: 4px; }
.skillmap-badge-blink { animation: skillmap-badge-blink 1.2s linear infinite; }
@keyframes skillmap-badge-blink {
  0%, 45% { background-color: var(--badge-bg, #e2e8f0); color: var(--badge-text, #64748b); }
  50%, 95% { background-color: #dc2626; color: #fff; }
  100% { background-color: var(--badge-bg, #e2e8f0); color: var(--badge-text, #64748b); }
}
.legend-sample-badge { width: 20px; height: 20px; display: inline-flex; margin-right: 4px; vertical-align: middle; background: #e2e8f0; color: #64748b; }
.skillmap-legend-changed-box { display: inline-block; width: 12px; height: 12px; box-shadow: inset 0 0 0 2px #dc2626; border-radius: 3px; margin-right: 4px; vertical-align: middle; }

.skillmap-picker-backdrop { position: fixed; inset: 0; z-index: 60; background: transparent; }
.skillmap-tagpicker {
  position: fixed; z-index: 61; background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  border: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 4px; width: 200px;
}
.skillmap-tag {
  border: none; border-radius: 6px; padding: 6px 8px; font-size: 12px; font-weight: 700; text-align: left;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.skillmap-tag:hover { filter: brightness(0.94); }
.skillmap-tag.is-current { box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); }
.skillmap-tag-plan-btn {
  border: none; border-top: 1px dashed var(--border); margin-top: 2px; padding: 8px 6px 2px; font-size: 11.5px;
  font-weight: 600; text-align: left; cursor: pointer; font-family: inherit; background: transparent; color: var(--primary);
  white-space: nowrap;
}
.skillmap-tag-plan-btn:hover { text-decoration: underline; }

.lvl-0 { background: #e2e8f0; color: #64748b; }
.lvl-1 { background: #fde3cf; color: #9a4a12; }
.lvl-2 { background: #fed7a1; color: #9a5b00; }
.lvl-3 { background: #fef08a; color: #7a5c00; }
.lvl-4 { background: #bfdbfe; color: #1e40af; }
.lvl-5 { background: #bbf7d0; color: #14532d; }

/* ---------- モーダル ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex;
  align-items: center; justify-content: center; padding: 16px; z-index: 40;
}
.modal-card { background: #fff; border-radius: var(--radius); padding: 20px; width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; }
.modal-card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 800; }
.modal-close { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--text-muted); }

/* ---------- 評価基準編集フォーム ---------- */
.criteria-edit-table { display: flex; flex-direction: column; gap: 4px; }
.criteria-edit-row {
  display: grid; grid-template-columns: 30px 100px 1fr 44px 44px; gap: 8px; align-items: center;
}
.criteria-edit-row.criteria-edit-head { font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 0 0 2px; }
.criteria-edit-row.criteria-edit-head span:nth-child(4), .criteria-edit-row.criteria-edit-head span:nth-child(5) { text-align: center; }
.criteria-color-input { padding: 2px; height: 34px; cursor: pointer; }

.empty-state { text-align: center; color: var(--text-muted); padding: 40px 0; font-size: 13px; }
.section-title { font-weight: 800; font-size: 14px; margin-bottom: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
/* td に直接 display:flex を当てるとそのセルが table-cell でなくなり行の罫線がズレるため、
   通常のセルのまま右寄せ＋ボタン間の余白だけをつける */
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > * { margin-left: 6px; }
.row-actions > *:first-child { margin-left: 0; }

/* ---------- 組織図 ---------- */
.orgchart { padding: 8px 4px 24px; overflow-x: auto; }

/* ヘッダー帯（タイトル・月タグ・保存ボタン・説明文）は1行にまとめて縦の高さを使わない */
.org-desc-inline { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* 最上段：左=会社ルート（小さめ）／中央=役員（余った横幅を使って広く）／右=出向中。縦に積まず横一列にして高さを圧縮する */
/* 役員は中央（従来位置）に固定し、愛知溶業だけをその左隣に添える。出向中は右端。
   グリッドの中央列に役員（＋左隣の愛知溶業）を置くことで、役員自体の位置は動かさない */
.org-top-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: flex-start; gap: 14px; position: relative; padding-bottom: 24px; margin-bottom: 0; }
.org-top-row::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 2px; height: 24px; background: var(--border); transform: translateX(-50%); }
.org-top-center-group { display: flex; align-items: flex-start; gap: 14px; justify-self: center; }
.org-top-right-wrap { justify-self: end; }
.org-top-header-col { display: flex; flex-direction: column; gap: 6px; justify-self: start; width: 100%; padding-top: 4px; padding-right: 24px; }
.org-root-box-compact { padding: 8px 16px; font-size: 12.5px; flex-shrink: 0; }
.org-root-box {
  background: var(--primary); color: #fff; font-weight: 800; font-size: 15px;
  padding: 12px 32px; border-radius: 10px; text-align: center; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; align-items: center; gap: 4px; white-space: nowrap;
}
.org-root-sub { font-size: 11px; font-weight: 600; opacity: .85; }

.org-divisions { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; border-top: 2px solid var(--border); padding-top: 24px; position: relative; }
.org-division { position: relative; border: 1px solid; border-radius: 12px; padding: 12px; background: #fbfbfa; }
.org-division::before { content: ''; position: absolute; top: -24px; left: 50%; width: 2px; height: 24px; background: var(--border); transform: translateX(-50%); }
.org-division-title { font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 7px; text-align: center; margin-bottom: 8px; }
/* 部そのものに直属する人（部長など、特定の課に属さない）。課の一覧とは点線で区切って見分ける */
.org-division-head { display: flex; flex-direction: column; gap: 4px; min-height: 20px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed var(--border); }
.org-division-head-empty { font-size: 10.5px; color: var(--text-muted); text-align: center; padding: 2px 4px; }
.org-division-children { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.org-division .org-dept { width: 190px; }

.org-dept-secondment .org-dept-title, .org-dept-secondment .org-dept-box { border-style: dashed; }
.org-dept-exec .org-dept-title { box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); }

.org-dept { position: relative; width: 220px; }
.org-dept-title {
  font-weight: 800; font-size: 12.5px; padding: 8px 10px; border-radius: 8px 8px 0 0;
  border: 1px solid; border-bottom: none; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-dept-count { font-weight: 600; opacity: .75; margin-left: 2px; }
.org-dept-box {
  border: 1px solid var(--border); border-radius: 0 0 8px 8px; padding: 8px; background: #fff;
  min-height: 40px; display: flex; flex-direction: column; gap: 4px; transition: outline .1s;
}
.org-member { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 4px; border-radius: 5px; white-space: nowrap; }
.org-member:hover { background: #f8fafc; }
.org-member[draggable="true"] { cursor: grab; }
.org-member.is-dragging { opacity: .4; }
.org-title { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
.org-name { font-weight: 600; }
.org-empty { font-size: 11.5px; color: var(--text-muted); padding: 4px; text-align: center; }
.org-unassigned { margin: 24px auto 0; max-width: 260px; }
[data-org-drop-dept].org-drop-over .org-dept-box { outline: 2px dashed var(--primary); outline-offset: -2px; }
.org-division-head.org-drop-over { outline: 2px dashed var(--primary); outline-offset: -2px; border-radius: 6px; }

/* ---------- 設備一覧＋設備点検表（Phase3） ---------- */
/* 実際の工場設備MAP（1F・2F・第二工場）の画像に設備ピンを重ねる。
   ピンの座標(map_x/map_y)は画像に対する%指定のため、wrapの実寸は画像の自然なアスペクト比に完全追従させる（cleaning-map-wrapと同じ考え方） */
.equipment-map-card { padding: 0; overflow: hidden; }
/* 営業側マップ(車両イラスト)は製造側の実寸フロア図と違い、画面幅いっぱいに広げると間延びするため幅を絞って中央寄せする */
.equipment-map-card.is-compact { display: flex; justify-content: center; background: #f8fafc; }
.equipment-map-card.is-compact .equipment-map-wrap { width: 100%; max-width: 640px; }
.equipment-map-wrap {
  position: relative; display: block; width: 100%; line-height: 0; min-height: 120px;
  background: #f8fafc;
  cursor: default;
  container-type: inline-size; /* ピンのサイズをマップの実表示幅に連動させ、タブレット等で縮小しても被らないようにする */
}
/* マップ画像自体は薄く（設備ピンが埋もれて見えなくなるため）、ピン(.equipment-pin)側は不透明のまま目立たせる */
.equipment-map-wrap img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; opacity: 0.45; }
.equipment-map-wrap.is-placing { cursor: crosshair; }
/* 折り返し・省略はせず、名称をそのまま全部表示する（文字の折り返し禁止ルール踏襲）。ピルの幅はテキスト量に応じて可変。
   サイズはcqw（マップ表示幅基準）で指定し、マップが縮小されるほどピンも比例して小さくなるようにする */
.equipment-pin {
  position: absolute; transform: translate(-50%, -50%); width: max-content;
  min-width: clamp(24px, 3.6cqw, 48px); height: clamp(15px, 2.4cqw, 32px);
  border-radius: clamp(7px, 1.25cqw, 16px); padding: 0 clamp(3px, 0.95cqw, 12px); box-sizing: border-box;
  border-style: solid; border-width: clamp(1px, 0.19cqw, 2.5px);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(8px, 1cqw, 13px); font-weight: 800; line-height: 1; white-space: nowrap; text-align: center; cursor: pointer;
  box-shadow: 0 0 0 clamp(1px, 0.23cqw, 3px) #fff, var(--shadow); /* 白いフチでマップ画像から浮き上がらせる */
}
.equipment-pin:hover { filter: brightness(0.96); }
.equipment-map-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12.5px; text-align: center; padding: 20px; }

table.equip-daily-table th, table.equip-daily-table td { text-align: center; }
table.equip-daily-table .equip-item-name {
  text-align: left; max-width: 200px; display: flex; align-items: center; gap: 3px;
}
.equip-item-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-edit-btn {
  flex: none; border: none; background: none; color: var(--text-muted); cursor: pointer;
  padding: 2px 4px; font-size: 11px; border-radius: 4px;
}
.icon-edit-btn:hover { background: var(--bg); color: var(--primary); }
.equip-day-col { min-width: 34px; }
.equip-day-col.equip-day-today { background: #fff7ed; }
.equip-day-dow { font-size: 9.5px; color: var(--text-muted); font-weight: 400; }
.equip-cell { padding: 4px !important; }
.equip-mark-btn {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border); background: #fff;
  font-size: 16px; font-weight: 800; cursor: pointer;
}
.equip-mark-btn:hover { background: #f8fafc; }
.equip-numeric-input { width: 56px; text-align: center; padding: 4px 2px; font-size: 11.5px; border: 1px solid var(--border); border-radius: 6px; }
.equip-text-input { width: 96px; padding: 4px 4px; font-size: 11.5px; border: 1px solid var(--border); border-radius: 6px; }
.equip-inspector-select { width: 72px; font-size: 10.5px; padding: 3px 2px; border: 1px solid var(--border); border-radius: 6px; }
.equip-footer-row td { background: #f8fafc; font-weight: 700; font-size: 11px; color: var(--text-muted); }
.equip-chief-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--border);
  cursor: pointer;
}
.equip-chief-btn.is-checked { background: #dcfce7; border-color: #16a34a; color: #16a34a; }
.equip-month-current { background: #fff7ed; }
.equip-month-done { background: #f3f4f6; }
.equip-mark-btn.is-locked, .equip-numeric-input:disabled, .equip-text-input:disabled { color: #9ca3af !important; cursor: not-allowed; opacity: 0.75; background: #f3f4f6; }

/* 使用前点検表・日常点検表（1日ずつ表示、横スクロール不要のレイアウト） */
.daycheck-nav-strip { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.daycheck-day-chip {
  position: relative; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card-bg, #fff); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; cursor: pointer; line-height: 1.15; color: var(--text);
}
.daycheck-day-chip .dow { font-size: 9px; font-weight: 400; color: var(--text-muted); }
.daycheck-day-chip.is-today { border-color: #2563eb; }
.daycheck-day-chip.is-selected { background: #111827; border-color: #111827; color: #fff; }
.daycheck-day-chip.is-selected .dow { color: #cbd5e1; }
.daycheck-day-chip .chip-dot { position: absolute; bottom: 3px; width: 5px; height: 5px; border-radius: 50%; }
.daycheck-item-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.daycheck-item-row:last-child { border-bottom: none; }
.daycheck-item-name { font-weight: 700; font-size: 14px; flex: 1; min-width: 140px; }
.daycheck-mark-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.daycheck-mark-btn {
  min-width: 60px; padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--border);
  background: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.daycheck-mark-btn.is-selected { color: #fff; }
.daycheck-mark-btn:hover:not(.is-selected) { background: #f8fafc; }
.daycheck-numeric-input { width: 130px; padding: 8px 10px; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; }
.daycheck-text-input { flex: 1; min-width: 180px; padding: 8px 10px; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; }
.daycheck-footer {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end;
  padding-top: 14px; margin-top: 6px; border-top: 2px solid var(--border);
}

/* 月間まとめて確認（読み取り専用のコンパクトな一覧、最終確認・見通し用） */
table.daycheck-summary-table th, table.daycheck-summary-table td { text-align: center; padding: 3px 2px !important; font-size: 11px; }
table.daycheck-summary-table .daycheck-summary-name {
  text-align: left; padding-left: 8px !important; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.daycheck-summary-day { min-width: 22px; }
.daycheck-summary-day.is-today { background: #fff7ed; }
.daycheck-summary-day .dow { font-size: 8.5px; color: var(--text-muted); font-weight: 400; }
.daycheck-summary-cell { font-size: 13px; font-weight: 800; }
.daycheck-summary-foot td { background: #f8fafc; font-weight: 700; font-size: 10px; color: var(--text-muted); }

/* 測定器管理: 基本情報・校正記録の2カラムレイアウト */
.measuring-overview-grid { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.measuring-overview-grid .col-basic { flex: 0 0 380px; min-width: 300px; }
.measuring-overview-grid .col-calibrations { flex: 1 1 420px; min-width: 340px; }

/* 設備一覧: 基本情報・修理履歴・日常点検表の2カラムレイアウト */
.equipment-overview-grid { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.equipment-overview-grid .col-basic { flex: 0 0 380px; min-width: 300px; display: flex; flex-direction: column; gap: 14px; }
.equipment-overview-grid .col-daily { flex: 1 1 480px; min-width: 380px; display: flex; flex-direction: column; gap: 14px; }

/* 部門品質目標管理表: 月次コメント・半期のまとめを上期/下期で背景色を変えて枠分けする */
.deptgoal-half-block { border-radius: var(--radius); padding: 14px; margin-top: 10px; }
.deptgoal-half-block.is-h1 { background: #dbeafe; border: 1px solid #93c5fd; }
.deptgoal-half-block.is-h2 { background: #fef3c7; border: 1px solid #fcd34d; }
.deptgoal-half-label { font-weight: 900; font-size: 13.5px; margin-bottom: 10px; }
.deptgoal-half-block.is-h1 .deptgoal-half-label { color: #1d4ed8; }
.deptgoal-half-block.is-h2 .deptgoal-half-label { color: #b45309; }

/* 部門品質目標管理表: 目標詳細のタイトル行〜基本情報・グラフまでを画面上部に固定し、
   下の月別カードをスクロールしてもグラフが常に見える状態を保つ */
.deptgoal-sticky-top {
  position: sticky; top: 66px; z-index: 15;
  background: var(--bg); padding: 10px 0 14px; margin: -10px 0 -4px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px;
}
/* 部門品質目標管理表: 目標詳細の基本情報・グラフの2カラムレイアウト（グラフは追って実装） */
.deptgoal-overview-grid { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.deptgoal-overview-grid .col-basic { flex: 0 0 380px; min-width: 300px; }
.deptgoal-overview-grid .col-graph { flex: 1 1 420px; min-width: 320px; }
.deptgoal-kv { display: flex; flex-direction: column; gap: 10px; }
.deptgoal-kv .kv-row { display: flex; flex-direction: column; gap: 2px; }
.deptgoal-kv .kv-label { font-size: 11px; color: var(--text-muted); }
.deptgoal-kv .kv-value { font-size: 14px; white-space: pre-wrap; }

/* 部門品質目標管理表: 実施計画のガントチャート */
.gantt-table { border-collapse: collapse; font-size: 11px; width: 100%; }
.gantt-table th, .gantt-table td { border: 1px solid var(--border); text-align: center; padding: 0; height: 32px; }
.gantt-table thead th { background: #f8fafc; font-weight: 700; color: var(--text-muted); padding: 5px 2px; font-size: 10.5px; white-space: nowrap; }
.gantt-name-col { text-align: left !important; padding: 4px 8px !important; font-size: 12.5px; white-space: nowrap; min-width: 220px; }
.gantt-cell { width: 34px; min-width: 34px; position: relative; }
.gantt-cell.is-clickable { cursor: pointer; }
.gantt-cell.is-clickable:hover { background: #fef2f2; }
.gantt-cell.is-picking { background: #fee2e2; outline: 2px solid #dc2626; outline-offset: -2px; }
.gantt-bar { position: absolute; left: 0; right: 0; top: 50%; height: 3px; background: #dc2626; transform: translateY(-50%); }
.gantt-bar.has-arrow::after {
  content: ''; position: absolute; right: -1px; top: 50%; transform: translateY(-50%);
  border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid #dc2626;
}
.chart-tooltip {
  position: absolute; pointer-events: none; transform: translate(-50%, -110%);
  background: #1e293b; color: #fff; font-size: 11px; line-height: 1.5;
  padding: 6px 9px; border-radius: 6px; white-space: nowrap; z-index: 20; box-shadow: var(--shadow);
}
