/* ===== GHS SDS Manager - Styles ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f172a; --surface: #1e293b; --border: #334155;
  --text: #f1f5f9; --muted: #94a3b8;
  /* WCAG AA(E-34): --accent は塗り（白文字を載せる面。white/accent=5.17:1）。
     暗背景に文字/アイコンとして置く場合は --accent-text（#60a5fa, on-surface 5.75:1）を使う。
     #3b82f6 は白文字3.68:1・文字用途3.98:1でAA未達だったため用途を分離。 */
  --accent: #2563eb;
  --accent-hover: #1d4ed8; --accent-text: #60a5fa;
  --success: #22c55e; --warning: #f59e0b;
  --danger: #ef4444; --radius: 10px; --sidebar-w: 220px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh; font-size: 14px; }

a { color: inherit; text-decoration: none; }

/* ---- Layout ---- */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
/* ナビは `#sidebar-mount` の中へ差し込まれる。**flex の子はマウント要素の方**で、
   .sidebar はその中の通常ブロックなので、放っておくと高さ制約を受けず内容の分だけ
   伸びて .app-layout(height:100vh, overflow:hidden) から溢れて切れる。
   マウント要素も縦フレックスにして、高さを .sidebar まで伝える（2026-07-28）。 */
#sidebar-mount { display: flex; flex-direction: column; min-height: 0; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  /* 親(#sidebar-mount)の高さいっぱいに収める。min-height:0 は flex の子
     (.sidebar-nav)が内容より縮めるようにするため（既定の auto ではスクロールしない）。 */
  height: 100%; min-height: 0; }
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.page-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ---- Inline pictogram icons (stroke SVG, currentColor) ---- */
.ic { display: inline-block; vertical-align: -0.15em; flex: none; }
button .ic, .btn .ic, a .ic { pointer-events: none; }

/* ---- Sidebar ---- */
.sidebar-logo { display: flex; align-items: center; gap: 10px;
  padding: 20px 16px; border-bottom: 1px solid var(--border); }
.logo-icon { display: inline-flex; color: var(--accent-text); }
.logo-title { font-weight: 700; font-size: 14px; }
.logo-sub { font-size: 11px; color: var(--muted); }
/* ナビの項目が画面高より多いとき、**リンク一覧だけ**を縦スクロールさせる。
   .app-layout が height:100vh + overflow:hidden なので、ここで受けないと
   はみ出した項目が切り捨てられて到達できなくなる（2026-07-28 ユーザー報告）。
   ロゴ・AI処理中の通知・フッター(ユーザー名/ログアウト)は常に見せたいので
   スクロール対象に含めない。 */
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
/* 細いスクロールバー（内容の幅を食わないよう控えめに） */
.sidebar-nav { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
/* 縮めてはいけない要素（ロゴ・通知・フッター）は flex の自動縮小から外す */
.sidebar-logo, .nav-lock-notice, .sidebar-footer { flex-shrink: 0; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted);
  transition: background .15s, color .15s; cursor: pointer; }
.nav-link:hover { background: rgba(255,255,255,.06); color: var(--text); }
.nav-link.active { background: var(--accent); color: #fff; }
.nav-icon { width: 18px; display: inline-flex; align-items: center; justify-content: center; }
/* 開発中のページ：リンクにせず（<a>を出さない＝キーボードでも到達しない）、バッジで理由を示す。
   バッジは折り返す。220px のサイドバーでは長い言語（vi等）で項目名と同じ行に収まらないため、
   切り詰めずに次行へ落として文字切れを防ぐ。 */
.nav-link.nav-wip { cursor: not-allowed; opacity: .55; }
.nav-link.nav-wip:hover { background: transparent; color: var(--muted); }
.nav-wip-text { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
/* 「開発中」バッジ。ナビ項目とボタンで共用する。 */
.badge-wip { flex-shrink: 0; padding: 1px 6px; border-radius: 999px; font-size: 10px;
  font-weight: 600; line-height: 1.5; white-space: nowrap;
  color: #fcd34d; background: rgba(245,158,11,.16); border: 1px solid rgba(245,158,11,.4); }
/* Navigation locked while an AI analysis/translation is running. */
.sidebar.ai-busy .nav-link { opacity: .4; cursor: not-allowed; }
.sidebar.ai-busy .nav-link.active { opacity: .55; }
.sidebar.ai-busy .nav-link:hover { background: transparent; color: var(--muted); }
.nav-lock-notice { display: flex; flex-direction: column; gap: 7px; margin: 8px;
  padding: 9px 11px; border-radius: 8px; font-size: 12px; line-height: 1.35;
  color: #fbbf24; background: rgba(251,191,36,.10);
  border: 1px solid rgba(251,191,36,.35); }
.nav-lock-head { display: flex; align-items: center; gap: 8px; }
.nav-lock-spinner { width: 13px; height: 13px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid rgba(251,191,36,.35); border-top-color: #fbbf24;
  animation: nav-lock-spin .8s linear infinite; }
@keyframes nav-lock-spin { to { transform: rotate(360deg); } }
/* 進捗バー（分析中：確定＝実%、不定＝推定/経過のアニメーション） */
.nav-lock-bar { height: 5px; border-radius: 3px; overflow: hidden;
  background: rgba(251,191,36,.18); }
.nav-lock-fill { height: 100%; width: 0; background: #fbbf24; border-radius: 3px;
  transition: width .4s ease; }
.nav-lock-bar.indeterminate .nav-lock-fill { width: 40% !important;
  animation: nav-lock-indet 1.2s ease-in-out infinite; }
@keyframes nav-lock-indet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.nav-lock-prog { font-size: 11px; color: #fcd34d; font-variant-numeric: tabular-nums; }
.sidebar-footer { padding: 12px 8px; border-top: 1px solid var(--border); }
.sidebar-user { padding: 4px 12px; font-size: 12px; color: var(--muted); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout:hover { color: #f87171; }

/* ---- Header ---- */
.app-header { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px; }
.header-title { font-size: 16px; font-weight: 600; }
.lang-switcher { display: flex; gap: 4px; }
.lang-btn { padding: 4px 10px; border-radius: 6px; border: none; font-size: 12px;
  font-weight: 500; cursor: pointer; background: transparent; color: var(--muted); transition: all .15s; }
.lang-btn:hover { color: var(--text); background: rgba(255,255,255,.08); }
.lang-btn.active { background: var(--accent); color: #fff; }

/* ---- Ollama widget ---- */
.ollama-widget {
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.25); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 10px; font-size: 12px;
}
.ollama-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--muted);
}
.ollama-dot.on       { background: #22c55e; box-shadow: 0 0 5px #22c55e88; }
.ollama-dot.off      { background: #475569; }
.ollama-dot.checking { background: #fbbf24; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.ollama-label { color: var(--muted); font-size: 11px; white-space: nowrap; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; }
.ollama-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 5px; border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; cursor: pointer; background: transparent;
  color: var(--text); transition: all .15s; white-space: nowrap;
}
.ollama-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); }
.ollama-btn:disabled { opacity: .5; cursor: default; }
.ollama-btn.busy-locked { cursor: not-allowed; }
.ollama-btn.start { border-color: #22c55e44; color: #22c55e; }
.ollama-btn.start:hover { background: rgba(34,197,94,.12); }
.ollama-btn.stop  { border-color: #f8717144; color: #f87171; }
.ollama-btn.stop:hover  { background: rgba(248,113,113,.12); }
.ollama-btn.install { border-color: #60a5fa44; color: #60a5fa; }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
label.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
input.form-input, select.form-select, textarea.form-textarea {
  width: 100%; background: #0f172a; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; color: var(--text); font-size: 13px; outline: none; transition: border .15s; }
input.form-input:focus, select.form-select:focus, textarea.form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59,130,246,.2); }
/* セレクトの見た目を入力欄に揃える。OS標準の描画のままだと背景・高さ・角丸が入力欄と
   食い違う（macOS で顕著。同じ「選択肢」なのに臭いの入力欄と別物に見えていた）。
   appearance を切って自前の矢印を描く。矢印のぶん右パディングを空ける。
   **要素セレクタで全 select を対象にする**。クラス未指定のセレクトが4つあり
   （管理コンソールの会社・権限、供給者テンプレートの主言語・法域）、クラス指定だけだと
   そこが取り残されるため。枠・背景も同じ理由で下の base ルールで揃える。 */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}
/* クラス未指定のセレクトにも入力欄と同じ枠・背景を与える（.form-select 指定のものは
   上の共通ルールが同じ値を先に当てているので見た目は変わらない）。 */
select:not(.llm-input) {
  background-color: #0f172a; border: 1px solid var(--border); border-radius: 8px;
  padding-top: 9px; padding-bottom: 9px; padding-left: 12px;
  color: var(--text); font-size: 13px; outline: none; }
select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59,130,246,.2); }
select { cursor: pointer; }
select.form-select option { background: var(--surface); color: var(--text); }
textarea.form-textarea { resize: vertical; min-height: 80px; }

/* プレースホルダの字色を入力欄とセレクトで揃える。
   ブラウザ既定の ::placeholder は淡色だがセレクトの未選択肢は本文色で描画されるため、
   同じ「未入力」なのに見た目が食い違っていた。
   セレクトは data-ph を付けた選択肢（＝真のプレースホルダ）が選ばれているときだけ淡色にする。
   「選択しない」「すべて」等は正規の選択値なので対象にしない。 */
input.form-input::placeholder, textarea.form-textarea::placeholder { color: var(--muted); opacity: 1; }
select.form-select:has(option[data-ph]:checked) { color: var(--muted); }

/* 変更できない入力欄（UX-07・2026-08-01）。発行済み文書の供給者情報など、値は見せるが
   触らせない欄に付ける。
   ⚠ 以前は Bootstrap の `.bg-light` を toggle していたが、**このアプリは Bootstrap を
   読み込んでいないためどこにも定義が無く、見た目が一切変わらなかった**。触れないのに
   触れそうに見える＝「入力したのに反映されない」と誤解される。
   `readonly`/`disabled` そのものを対象にするので、クラスの付け忘れでも効く。 */
input.form-input[readonly], textarea.form-textarea[readonly],
input.form-input:disabled, select:disabled, textarea.form-textarea:disabled {
  background-color: rgba(148,163,184,.12); color: var(--muted);
  border-style: dashed; cursor: not-allowed; }
input.form-input[readonly]:focus, textarea.form-textarea[readonly]:focus {
  border-color: var(--border); box-shadow: none; }

/* 表示/非表示のユーティリティ。⚠ `.d-none` も Bootstrap 由来で**未定義のまま
   toggle されていた**（`output.html` の供給者ロック注記）。空文字を入れて隠していたので
   実害は出ていなかったが、クラスに意味が無いことに変わりはない。 */
.d-none { display: none !important; }

/* 不具合フィードバックの状態バッジ（フォーム・ダッシュボード・管理で共通） */
.fb-badge { display:inline-flex; align-items:center; gap:4px; padding:2px 9px; border-radius:999px;
            font-size:11px; font-weight:600; white-space:nowrap; border:1px solid transparent; }
.fb-open { background:rgba(245,158,11,.16); border-color:rgba(245,158,11,.4); color:#fcd34d; }
.fb-prog { background:rgba(96,165,250,.16); border-color:rgba(96,165,250,.4); color:#bfdbfe; }
.fb-done { background:rgba(34,197,94,.16);  border-color:rgba(34,197,94,.4);  color:#86efac; }
.fb-hold { background:rgba(168,85,247,.16); border-color:rgba(168,85,247,.4); color:#d8b4fe; }

/* 選択候補（datalist）を持つ入力欄の「選択可」注記（黄色）。候補が実在する時のみ表示 */
.pick-hint {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  color: #fcd34d; background: rgba(245,158,11,.14); border: 1px solid rgba(245,158,11,.4);
}

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-purple { background: #7c3aed; color: #fff; }
.btn-purple:hover:not(:disabled) { background: #6d28d9; }
.btn-secondary { background: #334155; color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #475569; }
.btn-danger { background: transparent; color: #f87171; border: 1px solid rgba(248,113,113,.3); }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.1); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; }

/* ---- Lang segment ---- */
.lang-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-seg-btn { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: #0f172a; color: var(--muted); font-size: 13px; cursor: pointer; transition: all .15s; }
.lang-seg-btn:hover { border-color: var(--muted); color: var(--text); }
.lang-seg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.lang-seg-btn:disabled, .lang-seg-btn.disabled { opacity: .38; cursor: not-allowed; }
.lang-seg-btn:disabled:hover, .lang-seg-btn.disabled:hover { border-color: var(--border); color: var(--muted); }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 14px; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); font-weight: 600; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid rgba(51,65,85,.5); vertical-align: top; }
.data-table tr:hover td { background: rgba(255,255,255,.03); }
.data-table tr:last-child td { border-bottom: none; }
.mono { font-family: monospace; font-size: 12px; color: var(--muted); }

/* 一覧のページ送り（dashboard / un / reference-db で共用）。 */
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end;
  margin-top: 14px; flex-wrap: wrap; font-size: 13px; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  font-weight: 600; border: 1px solid transparent; }
.badge-prohibited { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.3); }
.badge-high { background: rgba(249,115,22,.15); color: #fb923c; border-color: rgba(249,115,22,.3); }
.badge-medium { background: rgba(234,179,8,.15); color: #facc15; border-color: rgba(234,179,8,.3); }
.badge-low { background: rgba(59,130,246,.15); color: #60a5fa; border-color: rgba(59,130,246,.3); }
/* 入力必須（第9項の必須項目バッジ）。ラベル内に小さく添えるので文字サイズを落とす。 */
.badge-req { padding: 1px 6px; font-size: 10px; font-weight: 600; vertical-align: middle;
  background: rgba(239,68,68,.14); color: #f87171; border-color: rgba(239,68,68,.28); }
/* 出力時にAI自動翻訳される自由文の項目バッジ（ユーザー確定 2026-08-05）。badge-req と同寸。 */
.badge-ai { padding: 1px 6px; font-size: 10px; font-weight: 600; vertical-align: middle;
  background: rgba(59,130,246,.14); color: #60a5fa; border-color: rgba(59,130,246,.28); }

/* ---- Alerts ---- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25); color: #4ade80; }
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25); color: #f87171; }
.alert-warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); color: #fbbf24; }
.alert-info { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.25); color: #60a5fa; }

/* ---- Drop zone ---- */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 20px;
  text-align: center; cursor: pointer; transition: all .2s; }
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: rgba(59,130,246,.05); }
.dropzone.has-file { border-color: var(--success); }
.dz-icon { font-size: 40px; margin-bottom: 10px; }
.dz-text { color: var(--muted); font-size: 13px; }
.dz-filename { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.dz-size { color: var(--muted); font-size: 12px; }

/* ---- Pictogram ---- */
.pictogram { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pic-img { width: var(--pic-size, 60px); height: var(--pic-size, 60px); object-fit: contain; display: block; }
.pic-diamond { width: var(--pic-size, 60px); height: var(--pic-size, 60px);
  background: #fff; border: 2px solid var(--pic-color, #666); border-radius: 4px;
  transform: rotate(45deg); display: flex; align-items: center; justify-content: center; }
.pic-emoji { transform: rotate(-45deg); font-size: calc(var(--pic-size,60px) * .4); line-height: 1; }
.pic-label { font-size: 11px; color: var(--muted); text-align: center; max-width: 70px; }
.pictograms-row { display: flex; flex-wrap: wrap; gap: 20px; margin: 10px 0; }

/* ---- Accordion ---- */
.accordion-item { border-bottom: 1px solid rgba(51,65,85,.5); }
.accordion-item:last-child { border-bottom: none; }
.accordion-header { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; cursor: pointer; transition: background .15s; }
.accordion-header:hover { background: rgba(255,255,255,.04); }
.accordion-title { font-size: 13px; font-weight: 500; color: #cbd5e1; }
.accordion-arrow { color: var(--muted); transition: transform .2s; }
.accordion-arrow.open { transform: rotate(180deg); }
.accordion-body { padding: 0 16px 14px; font-size: 13px; color: var(--muted);
  white-space: pre-wrap; line-height: 1.6; max-height: 220px; overflow-y: auto; display: none; }
.accordion-body.open { display: block; }

/* ---- Stats row ---- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.stat-val { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---- Action row ---- */
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---- Spinner ---- */
.spinner-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(59,130,246,.2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Toast ---- */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 12px 18px; border-radius: 8px; font-size: 13px;
  opacity: 0; transform: translateY(10px); transition: all .3s; z-index: 9999; max-width: 320px;
  display: flex; align-items: center; gap: 9px; }
.toast .ic { flex: none; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-success .ic { color: var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-error .ic { color: var(--danger); }
.toast.toast-warning .ic { color: var(--warning, #e8a33d); }
.toast.toast-info .ic { color: var(--accent-text); }

/* ---- Login page ---- */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.login-lang { display: flex; gap: 8px; margin-bottom: 32px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 36px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon { font-size: 40px; background: var(--accent); border-radius: 14px;
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.login-logo-title { font-size: 20px; font-weight: 700; }
.login-logo-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon + .form-input { padding-left: 36px; }

/* ---- Label preview card ---- */
/* ラベルプレビュー用紙：PDFと同一HTMLをiframeで実寸描画し、可用幅の85%へ縮小。 */
.label-sheet { position: relative; margin: 24px auto; width: fit-content;
  background: #fff; border: 1px solid #cbd5e1; overflow: hidden;
  box-shadow: 0 6px 22px rgba(0,0,0,.18); }
.label-sheet iframe { border: 0; display: block; background: #fff; }
/* プレビュー領域：用紙の周囲に余白を作る淡色の台紙 */
#preview-area { background: #f1f5f9; border-radius: 10px; padding: 8px 16px 20px; }

/* （旧）HTML組みプレビュー。ラベルページはiframe化したが他用途のため残置。 */
.label-preview { background: #fff; color: #1e293b; border: 2px solid #64748b;
  border-radius: 10px; padding: 24px; box-sizing: border-box;
  width: 100%; max-width: 1000px; margin: 0 auto; }
.label-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.label-preview-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; flex: 1; }
/* 注意喚起語：黒背景・白抜き・！マーク無し（危険/警告/非危険物 共通） */
.label-signal { display: inline-block; padding: 6px 20px; font-size: 18px;
  font-weight: 800; margin-bottom: 14px; background: #000; color: #fff; }
.label-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: #64748b; margin: 12px 0 6px; }
.label-stmt { font-size: 13px; color: #334155; margin-bottom: 3px; }
.label-pgroup { font-size: 12px; font-weight: 700; color: #1e293b; margin: 7px 0 3px; }
.label-batch { font-size: 16px; font-weight: 700; color: #1e293b; margin: 4px 0 12px; }
/* 本文(H句/P句/供給者)をA4横に合わせ3段組みで表示（PDFと一致・大きな文字で1枚に） */
.label-body-cols { column-count: 3; column-gap: 20px; margin-top: 8px; }
.label-body-cols .label-section-title { break-after: avoid; }
.label-body-cols .label-pgroup { break-after: avoid; }
.label-body-cols .label-stmt { break-inside: avoid; }
/* 危険有害成分ボックス（右上）：色は付けず枠線と黒文字のみ */
.label-comp-box { border: 1px solid #475569; border-radius: 4px; min-width: 230px;
  max-width: 46%; overflow: hidden; }
.label-comp-title { color: #1e293b; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-bottom: 1px solid #475569; }
.label-comp-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.label-comp-table th, .label-comp-table td { border: 1px solid #94a3b8; padding: 2px 6px;
  text-align: left; color: #1e293b; }
.label-comp-table thead th { font-weight: 700; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

/* ---- H tags ---- */
.tag { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 12px;
  margin: 2px; font-family: monospace; }
.tag-h { background: rgba(239,68,68,.12); color: #fca5a5; border: 1px solid rgba(239,68,68,.2); }
.tag-p { background: rgba(59,130,246,.12); color: #93c5fd; border: 1px solid rgba(59,130,246,.2); }

/* ---- Dashboard language chips ---- */
.doc-link { color: var(--accent-text, #60a5fa); text-decoration: none; font-weight: 600; }
.doc-link:hover { text-decoration: underline; }
.lang-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.lang-chip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px;
  text-decoration: none; background: rgba(148,163,184,.12); color: #cbd5e1;
  border: 1px solid rgba(148,163,184,.25); white-space: nowrap; cursor: pointer; }
.lang-chip:hover { background: rgba(96,165,250,.18); color: #bfdbfe; border-color: rgba(96,165,250,.4); }
.lang-chip.src { background: rgba(34,197,94,.14); color: #86efac; border-color: rgba(34,197,94,.3); }

/* その他ラベル（貼付枠）の画像選択サムネイル */
.other-slot { min-width: 0; }
.other-thumb { display: none; align-items: center; gap: 6px; margin-top: 4px; }
.other-thumb img { max-height: 40px; max-width: 70%; border: 1px solid #cbd5e1;
  border-radius: 4px; background: #fff; }
/* ファイル選択：ネイティブ文言（「ファイルの選択」等）は翻訳不可のため、
   input を隠して独自ラベル（翻訳キー適用可能）に置き換える。 */
.visually-hidden-file { position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none; }
.file-picker { display: flex; align-items: center; gap: 8px; width: 100%;
  min-width: 0; background: #0f172a; border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 8px; cursor: pointer; transition: border .15s; }
.file-picker:hover { border-color: var(--accent); }
.file-picker-btn { flex: 0 0 auto; background: #334155; color: var(--text);
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 6px;
  white-space: nowrap; transition: background .15s; }
.file-picker:hover .file-picker-btn { background: #475569; }
.file-picker-name { flex: 1; min-width: 0; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.other-slot.is-disabled { opacity: .45; }
.other-slot.is-disabled .file-picker { pointer-events: none; }

/* ── ナビグループ見出し（SDS業務／マスタ設定／管理） ── */
.nav-group-label { padding: 12px 12px 4px; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: .85;
  /* カテゴリ間を横線で区切って分かりやすくする（先頭カテゴリは下でリセット）。 */
  margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.sidebar-nav .nav-group-label:first-child { margin-top: 0; padding-top: 2px; border-top: none; }
