/* =========================================================
   審査スタッフ管理画面 専用スタイル
   ========================================================= */

body.admin {
  background: #eef0f3;
}

/* --- 管理画面ヘッダー --- */
.admin-header {
  background: #1f2630;
  color: #fff;
  border-bottom: 4px solid #c8102e;
}
.admin-header .container {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px; gap: 16px;
  /* admin-main と揃えて max-width 撤廃 */
  max-width: none;
}
.admin-header .brand {
  font-size: 1rem;
}
.admin-header .brand a { color: #fff; text-decoration: none; }
.admin-header .brand .role {
  display: inline-block; background: #c8102e;
  font-size: 0.7rem; padding: 2px 8px; border-radius: 99px;
  margin-right: 8px; vertical-align: middle;
}
.admin-header nav ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.admin-header nav a {
  color: #fff; text-decoration: none; padding: 8px 14px;
  border-radius: 4px; font-size: 0.9rem;
}
.admin-header nav a:hover, .admin-header nav a.is-current {
  background: rgba(255,255,255,0.18);
}
.admin-user {
  font-size: 0.85rem;
  display: flex; gap: 12px; align-items: center;
}
.admin-user .name { font-weight: 700; }
.admin-user button {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 4px 12px; border-radius: 4px;
  cursor: pointer; font-size: 0.85rem;
}
.admin-user button:hover { background: rgba(255,255,255,0.1); }

/* --- 未完了エスカレ バッジ (admin サイドバー) --- */
.admin-user .esc-badge, .admin-user .nav-esc-badge {
  background: #b91c1c !important; color: #fff !important;
  padding: 5px 12px; border-radius: 14px;
  font-size: 0.78rem; font-weight: 700; cursor: pointer;
  border: 1.5px solid #ef4444 !important;
  display: inline-flex; align-items: center; gap: 4px;
  width: 100%;
  margin-bottom: 6px;
  justify-content: center;
  transition: background 0.15s;
}
.admin-user .esc-badge:hover, .admin-user .nav-esc-badge:hover {
  background: #991b1b !important;
}
.admin-user .esc-badge strong { font-weight: 800; }

/* --- メインコンテナ --- */
.admin-main {
  /* 旧 1400px から実質撤廃: 大画面でも端まで活用 (申請一覧の列幅確保) */
  max-width: none; margin: 0 auto; padding: 24px 28px 60px;
}
.admin-main h1 {
  font-size: 1.4rem; margin: 0 0 18px;
  color: #1f2630;
  border-left: 6px solid #c8102e;
  padding-left: 14px;
}

/* --- ログイン画面 --- */
.login-wrap {
  max-width: 420px; margin: 60px auto;
  background: #fff; border-radius: 8px;
  padding: 36px 32px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.login-wrap h2 {
  margin: 0 0 6px; color: #1f2630;
  font-size: 1.3rem;
}
.login-wrap p { color: #666; margin: 0 0 24px; font-size: 0.9rem; }

/* --- 統計カード --- */
.stats-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 24px;
}
.stat-card {
  background: #fff; border-radius: 8px;
  padding: 18px 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #005ea7;
}
.stat-card .lbl {
  font-size: 0.85rem; color: #666; margin: 0 0 6px;
}
.stat-card .val {
  font-size: 1.6rem; font-weight: 700; color: #1f2630;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat-card .val small { font-size: 0.7em; color: #666; font-weight: 400; }
.stat-card.danger { border-left-color: #c8102e; }
.stat-card.warning { border-left-color: #b85c00; }
.stat-card.success { border-left-color: #2d7a2d; }
.stat-card.info { border-left-color: #005ea7; }

/* --- フィルターバー --- */
.filter-bar {
  background: #fff; border-radius: 8px;
  padding: 16px 20px; margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex; gap: 12px; flex-wrap: wrap; align-items: end;
}
.filter-bar .field {
  margin: 0; flex: 1 1 160px; min-width: 0;
}
.filter-bar .field label {
  display: block; font-size: 0.78rem;
  color: #666; margin-bottom: 4px; font-weight: 600;
}
.filter-bar .field input,
.filter-bar .field select {
  width: 100%; padding: 7px 10px;
  border: 1px solid #d0d0d0; border-radius: 4px;
  font-size: 0.9rem; background: #fff;
  font-family: inherit;
}
.filter-bar .actions {
  display: flex; gap: 6px;
}
.filter-bar .actions .btn {
  padding: 8px 14px; font-size: 0.85rem; min-height: 36px;
}

/* --- 申請一覧テーブル ---
   コンパクト化方針:
   - 横スクロールせず全列が画面内に収まるよう、文字サイズ・パディング・
     セル内 white-space を調整する
   - 長文 (担当者連絡先・事業者名等) は折り返し許可
   - 折り返しても 1 行で済む列 (受付番号・区分No・申請額・受付日 等) は nowrap
   --- */
.app-table-wrap {
  background: #fff; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow-x: auto;       /* 万一はみ出した時のフォールバック */
}
table.app-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.82rem;     /* 0.9 → 0.82: 横の余裕確保 */
  table-layout: auto;
}
.app-table th, .app-table td {
  padding: 7px 8px;       /* 10px 12px → 7px 8px */
  border-bottom: 1px solid #eee;
  text-align: left;
  vertical-align: middle;
  word-break: break-word; /* 折り返しを許可 (担当者名・メール等) */
}
.app-table th {
  background: #f5f5f3; font-weight: 600;
  color: #555; font-size: 0.74rem;
  position: sticky; top: 0; z-index: 1;
  text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap;    /* ヘッダーは 1 行で */
}
.app-table tbody tr:hover { background: #f7fbff; cursor: pointer; }
.app-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-table .cat-serial {
  font-weight: 700; color: #005ea7;
  width: 50px;          /* 区分No 列の固定幅 */
  text-align: center;
}
.app-table .receipt-no {
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 0.78rem; color: #005ea7;
  white-space: nowrap;
}

.channel-badge {
  display: inline-block; padding: 2px 8px;
  font-size: 0.7rem; border-radius: 99px;
  font-weight: 600; letter-spacing: .04em;
}
.channel-badge.online { background: #eaf3fb; color: #005ea7; }
.channel-badge.mail   { background: #fff7df; color: #b85c00; }

.status-badge {
  display: inline-block; padding: 2px 10px;
  font-size: 0.75rem; border-radius: 99px;
  font-weight: 700; letter-spacing: .03em;
  color: #fff;
}

/* 空表示 */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: #999;
}
.empty-state .icon { font-size: 3rem; opacity: 0.4; }

/* --- 詳細画面 --- */
.review-layout {
  display: grid; gap: 20px;
  grid-template-columns: 1.4fr 1fr;
}
@media (max-width: 1100px) { .review-layout { grid-template-columns: 1fr; } }

.review-pane {
  background: #fff; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}
.review-pane > h2 {
  background: #f5f5f3; padding: 14px 20px;
  margin: 0; font-size: 1rem;
  border-bottom: 1px solid #eee;
  display: flex; justify-content: space-between; align-items: center;
}
.review-pane .body { padding: 18px 20px; }
.review-pane dl { margin: 0; }
.review-pane dl > div {
  display: grid; grid-template-columns: 160px 1fr; gap: 16px;
  padding: 8px 0; border-bottom: 1px dashed #eee;
}
.review-pane dl > div:last-child { border-bottom: 0; }
.review-pane dt { color: #666; font-weight: 600; font-size: 0.9rem; }
.review-pane dd { margin: 0; word-break: break-word; }

/* 添付ファイル一覧 */
.attachment-grid {
  display: grid; gap: 14px;
  /* 1 枚あたりの最小幅を 220px → 360px に拡大 (申請内容の視認性向上) */
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}
.attachment-card {
  background: #fafafa; border: 1px solid #ddd;
  border-radius: 6px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.attachment-card .thumb {
  width: 100%; height: 280px;     /* 160px → 280px に拡大 */
  background: #fff; border: 1px solid #eee;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: 4px;
  cursor: zoom-in;
}
.attachment-card .thumb img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}
.attachment-card .fname {
  font-size: 0.85rem; word-break: break-all;
  font-weight: 600;
}
.attachment-card .fmeta {
  font-size: 0.75rem; color: #888;
}
.attachment-card .actions {
  display: flex; gap: 6px;
}

/* OCRチェックリスト */
.ocr-check-card {
  background: #f5fbff; border: 1px solid #c5deef;
  border-radius: 6px; padding: 12px 14px;
  margin-top: 10px; font-size: 0.9rem;
}
.ocr-check-card h5 { margin: 0 0 6px; font-size: 0.95rem; color: #00457a; }

/* 監査履歴 */
.audit-list {
  list-style: none; padding: 0; margin: 0;
  font-size: 0.9rem;
}
.audit-list li {
  padding: 10px 0; border-bottom: 1px dashed #eee;
}
.audit-list li:last-child { border-bottom: 0; }
.audit-list time {
  color: #888; font-size: 0.78rem; display: block;
  margin-bottom: 2px;
}
.audit-list .reviewer { font-weight: 700; color: #1f2630; }
.audit-list .from-to {
  display: inline-block; padding: 1px 6px;
  background: #f0ede2; border-radius: 4px;
  font-size: 0.75rem; margin: 0 4px;
}
.audit-list .comment {
  background: #fafafa; padding: 8px 10px;
  border-radius: 4px; margin-top: 4px;
  white-space: pre-wrap;
}

/* 審査アクションパネル */
.audit-actions {
  background: #fff8e1; border: 1px solid #f5a623;
  border-radius: 6px; padding: 16px;
  margin-top: 16px;
}
.audit-actions h4 { margin: 0 0 10px; color: #b85c00; }
.audit-actions .field { margin-bottom: 10px; }
.audit-actions .status-buttons {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.audit-actions .status-buttons button {
  padding: 6px 12px; font-size: 0.85rem;
  border: 2px solid; border-radius: 4px;
  background: transparent; cursor: pointer; font-weight: 700;
  font-family: inherit;
}

/* --- 郵送受付画面（スキャン） --- */
.scan-layout {
  display: grid; gap: 20px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 980px) { .scan-layout { grid-template-columns: 1fr; } }

.scan-pane {
  background: #fff; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 20px;
}
.scan-pane h3 {
  margin: 0 0 14px; font-size: 1.05rem;
  color: #1f2630;
  padding-bottom: 8px; border-bottom: 2px solid #f5f5f3;
}
.scan-pane .form-section { margin-bottom: 16px; }
.scan-pane .form-section h3 {
  font-size: 0.95rem;
  margin: 0 0 8px;
  padding: 0;
  border-bottom: 0;
  color: #1f2630;
}
.scan-pane .upload-area {
  padding: 18px 16px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.scan-pane .upload-area .ico { font-size: 1.6rem; margin-bottom: 4px; }
.scan-pane .upload-area .main { font-size: 0.9rem; margin: 0; }
.scan-pane .upload-area .sub { font-size: 0.78rem; margin: 4px 0 0; }

/* カメラ取込 */
.camera-area {
  border: 2px dashed #aaa;
  border-radius: 6px; padding: 14px;
  background: #fafafa;
  margin-bottom: 14px;
}
.camera-area video {
  width: 100%; max-height: 320px;
  background: #000; display: block; border-radius: 4px;
}
.camera-area canvas { display: none; }
.camera-area .cam-actions {
  display: flex; gap: 8px; margin-top: 10px;
  flex-wrap: wrap;
}

.scanned-list {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  margin-top: 14px;
}
.scanned-item {
  position: relative;
  background: #fff; border: 1px solid #ddd;
  border-radius: 4px; padding: 6px;
}
.scanned-item img {
  width: 100%; height: 120px;
  object-fit: cover; border-radius: 3px;
}
.scanned-item .lbl {
  font-size: 0.75rem; margin-top: 4px;
  text-align: center; color: #666;
}
.scanned-item .rm-btn {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(200,16,46,0.9); color: #fff;
  border: 0; border-radius: 50%; cursor: pointer;
  font-size: 0.85rem; line-height: 22px; padding: 0;
}
.scanned-item.processing { opacity: 0.6; }
.scanned-item .badge {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,0.7); color: #fff;
  font-size: 0.7rem; padding: 2px 6px; border-radius: 4px;
}

/* OCR結果プレビュー */
.ocr-preview {
  background: #f5fbff; border: 1px solid #c5deef;
  border-radius: 6px; padding: 12px 14px;
  font-size: 0.85rem;
  max-height: 280px; overflow-y: auto;
}
.ocr-preview pre {
  background: #fff; padding: 8px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  white-space: pre-wrap; word-break: break-all;
  margin: 6px 0;
}

/* タブ */
.tabs {
  display: flex; gap: 2px;
  margin-bottom: 16px;
  border-bottom: 2px solid #ddd;
  flex-wrap: wrap;
}
.tabs button {
  background: transparent; border: 0;
  padding: 10px 18px; cursor: pointer;
  font-family: inherit; font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-weight: 600; color: #666;
}
.tabs button:hover { color: #005ea7; }
.tabs button.is-active {
  color: #005ea7; border-bottom-color: #005ea7;
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* 自動入力ハイライト */
.auto-filled {
  background: #fff7df !important;
  animation: highlight 2s ease-out;
}
@keyframes highlight {
  from { background: #f5a623 !important; }
  to { background: #fff7df !important; }
}

/* ステータスダイアログ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
/* 重要: HTMLの hidden 属性を CSS の display: flex が上書きしないようにする */
.modal-bg[hidden] { display: none !important; }
.email-modal-bg[hidden] { display: none !important; }
.modal {
  background: #fff; border-radius: 8px;
  padding: 24px; min-width: 320px; max-width: 480px;
  width: 100%;
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.modal.modal-lg { max-width: 640px; }
.modal { position: relative; }
.modal h3 { margin: 0 0 12px; color: #1f2630; padding-right: 36px; }
.modal-close-btn {
  position: absolute;
  top: 14px; right: 16px;
  width: 32px; height: 32px;
  border: 1px solid #ddd;
  background: #fafafa;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: #555;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  z-index: 1;
}
.modal-close-btn:hover {
  background: #c8102e;
  border-color: #c8102e;
  color: #fff;
}
.modal .field { margin-bottom: 16px; }
.modal .field label {
  display: block; font-weight: 600;
  margin-bottom: 6px; font-size: 0.9rem; color: #333;
}
.modal .actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

/* 受付簿出力モーダル：タブ */
.export-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #ddd;
  margin-bottom: 12px;
}
.export-tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #666;
  margin-bottom: -2px;
}
.export-tab:hover { color: #005ea7; }
.export-tab.is-active {
  color: #005ea7;
  border-bottom-color: #005ea7;
}
.export-tab-desc {
  background: #f5fbff;
  border: 1px solid #c5deef;
  border-radius: 6px;
  padding: 12px 14px;
}

/* 区分チェックボックス */
.export-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
@media (max-width: 480px) {
  .export-cat-grid { grid-template-columns: 1fr; }
}
.export-cat-grid label {
  display: flex !important; gap: 8px; align-items: center;
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  margin-bottom: 0 !important;
  transition: all .15s ease;
}
.export-cat-grid label:hover {
  background: #eaf3fb;
  border-color: #005ea7;
}
.export-cat-grid label:has(input:checked) {
  background: #eaf3fb;
  border-color: #005ea7;
  box-shadow: inset 0 0 0 1px #005ea7;
}
.export-cat-actions {
  display: flex; gap: 6px;
  margin-top: 8px;
}

/* 日付範囲 */
.export-date-row {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap;
}
.export-date-row input[type="date"] {
  flex: 1; min-width: 130px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}

/* ============================================================
   システム仮審査パネル
   ============================================================ */
.auto-review-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  margin-bottom: 20px;
  overflow: hidden;
  border-top: 6px solid #888;
  transition: border-top-color .2s ease;
}
.auto-review-panel.verdict-ok   { border-top-color: #2d7a2d; }
.auto-review-panel.verdict-warn { border-top-color: #b85c00; }
.auto-review-panel.verdict-ng   { border-top-color: #c8102e; }

.auto-review-header {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
  border-bottom: 1px solid #eee;
  align-items: center;
}
@media (max-width: 700px) {
  .auto-review-header { grid-template-columns: 60px 1fr; }
  .auto-review-header .ar-stats { grid-column: 1 / -1; flex-direction: row; justify-content: space-around; }
}

.auto-review-header .ar-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700;
  background: #f0ede2; color: #888;
}
.verdict-ok   .ar-icon { background: #e6f4e6; color: #2d7a2d; }
.verdict-warn .ar-icon { background: #fff5e0; color: #b85c00; }
.verdict-ng   .ar-icon { background: #fde7e9; color: #c8102e; }

.ar-verdict-block h2 {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: #888;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ar-verdict {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1f2630;
  line-height: 1.3;
}
.verdict-ok   .ar-verdict { color: #2d7a2d; }
.verdict-warn .ar-verdict { color: #b85c00; }
.verdict-ng   .ar-verdict { color: #c8102e; }

.ar-note {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: #666;
}

.ar-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
  background: #fff;
  padding: 10px 14px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ar-stat-row {
  display: flex; gap: 6px; align-items: center;
  color: #555;
}
.ar-stat-row strong {
  font-size: 1rem;
  display: inline-block;
  min-width: 22px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #1f2630;
}
.ar-stat-row .ico {
  font-weight: 700;
  font-size: 0.95rem;
  width: 20px; text-align: center;
}
.ar-stat-row .ico.ok   { color: #2d7a2d; }
.ar-stat-row .ico.warn { color: #b85c00; }
.ar-stat-row .ico.ng   { color: #c8102e; }

.auto-review-body {
  padding: 12px 22px 16px;
}

.auto-review-checks {
  list-style: none;
  padding: 0;
  margin: 0;
}
.auto-review-checks li {
  display: grid;
  grid-template-columns: 32px 7em 14em 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed #eee;
  align-items: center;
  font-size: 0.9rem;
}
.auto-review-checks li:last-child { border-bottom: 0; }
@media (max-width: 800px) {
  .auto-review-checks li {
    grid-template-columns: 28px 1fr;
    gap: 6px 10px;
  }
  .auto-review-checks .cat,
  .auto-review-checks .label,
  .auto-review-checks .msg {
    grid-column: 2;
  }
  .auto-review-checks .label { font-weight: 700; }
}
.auto-review-checks .ico {
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.auto-review-checks .ico.ok   { color: #2d7a2d; }
.auto-review-checks .ico.warn { color: #b85c00; }
.auto-review-checks .ico.ng   { color: #c8102e; }
.auto-review-checks .cat {
  font-size: 0.7rem;
  background: #f0ede2;
  padding: 2px 8px;
  border-radius: 99px;
  text-align: center;
  color: #555;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.auto-review-checks li.row-ok   .cat { background: #e6f4e6; color: #1f5a1f; }
.auto-review-checks li.row-warn .cat { background: #fff5e0; color: #804000; }
.auto-review-checks li.row-ng   .cat { background: #fde7e9; color: #7a1010; }
.auto-review-checks .label {
  font-weight: 600;
  color: #1f2630;
}
.auto-review-checks .msg {
  color: #555;
  word-break: break-word;
}
.auto-review-checks li.row-warn { background: linear-gradient(90deg, #fffaf2 0%, transparent 100%); }
.auto-review-checks li.row-ng   { background: linear-gradient(90deg, #fff5f5 0%, transparent 100%); }

/* 要綱条文参照バッジ */
.auto-review-checks .yoko-ref {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 4px;
  background: #eef;
  color: #447;
  border-radius: 3px;
  font-size: 0.7em;
  border: 1px solid #cce;
  vertical-align: middle;
  white-space: nowrap;
}
.auto-review-checks li.row-ng .yoko-ref { background: #fde7e9; color: #7a1010; border-color: #f5c2c7; }
.auto-review-checks li.row-warn .yoko-ref { background: #fff5e0; color: #804000; border-color: #ffe3b3; }

.auto-review-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
  align-items: center;
}

/* メール送信モーダル */
.email-modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 24px;
}
.email-modal {
  background: #fff; border-radius: 8px;
  width: 100%; max-width: 720px; max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.email-modal h3 {
  margin: 0 0 16px;
  color: #1f2630;
  border-bottom: 2px solid #005ea7;
  padding-bottom: 8px;
}
.email-form .email-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  margin-bottom: 10px;
  align-items: start;
}
.email-form .email-row label {
  font-weight: 600; padding-top: 8px; font-size: 0.9rem; color: #333;
}
.email-form input,
.email-form textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
}
.email-form input[readonly] { background: #f5f3eb; color: #555; }
.email-form textarea {
  resize: vertical;
  min-height: 200px;
  line-height: 1.6;
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.85rem;
}
.email-note {
  background: #fff7df;
  border-left: 4px solid #f5a623;
  padding: 10px 14px;
  font-size: 0.85rem;
  margin: 14px 0 0;
}
.email-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 16px; flex-wrap: wrap;
  border-top: 1px solid #eee;
  padding-top: 14px;
}

/* 拡大プレビュー */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 95%; max-height: 95%;
  box-shadow: 0 4px 30px rgba(0,0,0,0.6);
}
.lightbox .close-btn {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.2); color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 50%; width: 40px; height: 40px;
  font-size: 1.2rem; cursor: pointer;
}

/* ==========================================================
   🏷 仮審査 verdict バッジ (申請一覧)
   ========================================================== */
.verdict-cell {
  text-align: center;
  white-space: nowrap;
}
.verdict-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: help;
}
.verdict-badge.ok   { background: #e7f5e7; color: #2d7a2d; border: 1px solid #2d7a2d; }
.verdict-badge.warn { background: #fff4e6; color: #b85c00; border: 1px solid #b85c00; }
.verdict-badge.ng   { background: #fdecec; color: #c8102e; border: 1px solid #c8102e; }
.verdict-badge small { font-size: 0.7rem; opacity: 0.85; }

/* ==========================================================
   🏷 ステージバッジ (受付/仮審査/本審査/完了)
   ========================================================== */
.stage-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

/* ==========================================================
   📊 ステージ別件数トラッカー (申請一覧上部)
   ========================================================== */
.stage-tracker {
  margin: 12px 0 16px;
}
.stage-tracker .stage-scope {
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: #666;
}
.stage-tracker .scope-chip {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 4px;
  background: #eef3f9;
  color: #1f2630;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #c4d4e6;
}
.stage-tracker .scope-chip.scope-all {
  background: #f5f9fc;
  color: #888;
  font-weight: 500;
}
.stage-tracker .stage-cards {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex-wrap: wrap;
}
.stage-card {
  flex: 1 1 180px;
  min-width: 160px;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 2px solid #d6dee8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  font: inherit;
  color: inherit;
}
.stage-card:hover {
  background: #f5f9fc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.stage-card.is-active { color: #fff; }
.stage-card.is-active .stage-no { background: rgba(255,255,255,0.3); color: #fff; }
.stage-card.is-active .stage-desc { color: rgba(255,255,255,0.85); }
.stage-no {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f0f3f7;
  color: #4a4a4a;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 1.05rem;
}
.stage-body { flex: 1; min-width: 0; }
.stage-label { font-size: 0.85rem; font-weight: 700; }
.stage-count {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 2px 0;
}
.stage-count small { font-size: 0.7rem; font-weight: 500; margin-left: 2px; }
.stage-desc { font-size: 0.72rem; color: #888; line-height: 1.3; }
.stage-arrow {
  display: flex; align-items: center;
  color: #aaa;
  font-size: 1.2rem;
  padding: 0 4px;
}
.stage-warning {
  width: 100%;
  margin-top: 6px;
  padding: 8px 14px;
  background: #fff5f5;
  border: 1px solid #fcc;
  border-radius: 4px;
  color: #c8102e;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ==========================================================
   ⚖️ 本審査ガイド付きウィザード
   ========================================================== */
.mr-stepper {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}
.mr-stepper li {
  flex: 1;
  min-width: 80px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  font-size: 0.82rem;
  color: #888;
  position: relative;
}
.mr-stepper li::after {
  content: '';
  position: absolute;
  right: -8px; top: 50%;
  width: 16px; height: 2px;
  background: #d6dee8;
}
.mr-stepper li:last-child::after { display: none; }
.mr-stepper .step-no {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #d6dee8;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.mr-stepper li.is-done .step-no {
  background: #2d7a2d;
}
.mr-stepper li.is-done {
  color: #2d7a2d;
}
.mr-stepper li.is-current .step-no {
  background: #005ea7;
  box-shadow: 0 0 0 4px rgba(0,94,167,0.2);
}
.mr-stepper li.is-current {
  color: #005ea7;
  font-weight: 700;
}

#mr-step-body h4 {
  margin: 0 0 10px;
  color: #1f2630;
  border-bottom: 2px solid #005ea7;
  padding-bottom: 4px;
}
.mr-checklist {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.mr-checklist li {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: #fafbfd;
  border: 1px solid #d6dee8;
  border-radius: 4px;
}
.mr-checklist li.is-checked {
  background: #e7f5e7;
  border-color: #2d7a2d;
}
.mr-checklist label {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.92rem;
}
.mr-checklist input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
  flex-shrink: 0;
}
.mr-doc-preview {
  margin: 12px 0;
  padding: 10px;
  background: #fafbfd;
  border: 1px dashed #d6dee8;
  border-radius: 4px;
  text-align: center;
  min-height: 100px;
}
.mr-doc-thumb {
  display: inline-block;
  margin: 4px;
  padding: 6px;
  background: #fff;
  border: 1px solid #d6dee8;
  border-radius: 4px;
  vertical-align: top;
  max-width: 200px;
}
.mr-doc-thumb img {
  max-width: 180px;
  max-height: 240px;
  display: block;
  margin: 0 auto;
}
.mr-info-dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  font-size: 0.9rem;
}
.mr-info-dl dt {
  color: #666;
  white-space: nowrap;
}
.mr-info-dl dd {
  margin: 0;
  font-weight: 600;
}

/* ==========================================================
   📨 未紐付けメール アラートバー + ナビバッジ
   ========================================================== */
.inbox-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  margin: 12px 0;
  background: linear-gradient(135deg, #fff4e6 0%, #fde6c4 100%);
  border: 2px solid #b85c00;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(184, 92, 0, 0.12);
}
.inbox-alert-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}
.inbox-alert-body {
  flex: 1;
  min-width: 0;
}
.inbox-alert-title {
  font-size: 1.05rem;
  color: #b85c00;
  margin-bottom: 4px;
}
.inbox-alert-desc {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.4;
}
.inbox-alert a.btn {
  background: #b85c00;
  color: #fff;
  border-color: #b85c00;
  white-space: nowrap;
  flex-shrink: 0;
}
.inbox-alert a.btn:hover {
  background: #946100;
  color: #fff;
}

/* ナビメニューの 📨 未紐付けメール の件数バッジ */
.nav-inbox-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  background: #c8102e;
  color: #fff;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

/* ==========================================================
   📧 メール受信バッジ (申請一覧 - ステータス列)
   ========================================================== */
.mail-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  background: #0a8488;
  color: #fff;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: help;
  white-space: nowrap;
}

/* ==========================================================
   📋 区分タブ (申請一覧上部)
   ========================================================== */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px;
  padding: 6px;
  background: #f5f7fa;
  border: 1px solid #d6dee8;
  border-radius: 6px;
}
.category-tabs .cat-tab {
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2630;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.category-tabs .cat-tab:hover {
  background: #eef3f9;
  border-color: #88a4c4;
}
.category-tabs .cat-tab.is-active {
  background: #005ea7;
  color: #fff;
  border-color: #005ea7;
}
.category-tabs .cat-tab .count {
  font-size: 0.82em;
  font-weight: 500;
  opacity: 0.85;
  margin-left: 2px;
}
.category-tabs .cat-tab.is-active .count {
  color: #fff;
}

/* ==========================================================
   🤖 仮審査 — 手動オーバーライド表示
   ========================================================== */
.auto-review-checks .ar-override-btn {
  vertical-align: middle;
}
.auto-review-checks .row-ng .ar-override-btn {
  background: #fff;
}
.auto-review-checks .override-badge {
  cursor: help;
}

/* ==========================================================
   ✏️ 申請内容 編集モーダル
   ========================================================== */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 150;
}
.modal-bg[hidden] { display: none !important; }
.modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  padding: 24px;
  max-width: 92vw;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
}
.modal.modal-lg { width: 720px; }
.modal h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  border-bottom: 2px solid #005ea7;
  padding-bottom: 6px;
}
.modal .modal-close-btn {
  position: absolute;
  top: 10px; right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 4px;
}
.modal .modal-close-btn:hover {
  background: #f0f0f0;
  color: #000;
}
.modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid #e5e9ee;
}
.edit-section-btn {
  font-weight: 500 !important;
}
#edit-form .field-row {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}
#edit-form .field-row.cols-2 { grid-template-columns: 1fr 1fr; }
#edit-form .field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
  #edit-form .field-row.cols-2,
  #edit-form .field-row.cols-3 { grid-template-columns: 1fr; }
}
#edit-form .field {
  display: flex;
  flex-direction: column;
}
#edit-form .field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f2630;
  margin-bottom: 3px;
}
#edit-form .field input,
#edit-form .field select,
#edit-form .field textarea {
  padding: 7px 9px;
  border: 1px solid #c3cdd9;
  border-radius: 4px;
  font-size: 0.95rem;
}
#edit-form .field input:focus,
#edit-form .field select:focus,
#edit-form .field textarea:focus {
  outline: 2px solid #005ea7;
  border-color: #005ea7;
}
#edit-form fieldset {
  background: #fafbfd;
}
#edit-form fieldset legend {
  background: #e8eef5;
  color: #1f2630;
  border-radius: 4px;
}

/* =========================================================
   レスポンシブ対応 (管理画面全体)
   - 1280px 以下: max-width を緩める
   - 980px 以下: タブレット/縦置き; ヘッダー縦並び, サイドカラム解除
   - 768px 以下: モバイル; テーブル横スクロール許可
   - 480px 以下: 最小化; ナビ簡略表示
   ========================================================= */

/* --- 全幅化 (デスクトップでも 1400px 固定をやめる) --- */
@media (max-width: 1440px) {
  .admin-header .container,
  .admin-main { max-width: 100%; }
}

/* --- タブレット (~1024px) --- */
@media (max-width: 1024px) {
  .admin-main { padding: 18px 14px 48px; }
  .admin-header .container { padding: 12px 14px; flex-wrap: wrap; row-gap: 8px; }
  .admin-header nav ul { gap: 2px; }
  .admin-header nav a { padding: 6px 10px; font-size: 0.85rem; }
  .admin-main h1 { font-size: 1.2rem; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .stat-card .val { font-size: 1.4rem; }
  .stage-cards { gap: 4px; }
  .stage-card { min-width: 130px; }
}

/* --- タブレット縦 / 大型スマホ (~768px) --- */
@media (max-width: 768px) {
  body.admin { font-size: 0.95rem; }
  .admin-header .container { flex-direction: column; align-items: flex-start; gap: 8px; }
  .admin-header .brand { font-size: 0.95rem; width: 100%; }
  .admin-header nav { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-header nav ul { flex-wrap: nowrap; min-width: max-content; }
  .admin-user { width: 100%; justify-content: space-between; font-size: 0.8rem; }

  .admin-main { padding: 14px 10px 40px; }
  .admin-main h1 { font-size: 1.1rem; margin-bottom: 12px; }

  /* テーブルは横スクロール許可 */
  .admin-main table { font-size: 0.82rem; }
  .admin-main .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* フィルタ・検索行 縦並び */
  .filter-row, .search-row { flex-direction: column !important; align-items: stretch !important; }
  .filter-row > *, .search-row > * { width: 100% !important; }

  /* ステージカードは横スクロール */
  .stage-tracker, .stage-cards-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stage-cards { flex-wrap: nowrap !important; min-width: max-content; }
  .stage-card { min-width: 110px; padding: 8px 10px; font-size: 0.85rem; }
  .stage-arrow { font-size: 1.4rem; }

  /* 申請一覧の補助列 (検索・追加) を畳む */
  .admin-main .actions { gap: 4px; flex-wrap: wrap; }
  .btn { padding: 6px 10px; font-size: 0.85rem; }

  /* 統計カードは 2 列 */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* 審査画面のレビューペイン */
  .review-pane { padding: 12px; }
  .review-pane h2 { font-size: 0.95rem; }
  .attachment-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .attachment-card { padding: 8px; }
  .attachment-card .thumb { height: 80px; }

  /* メール添付の差し替えコントロールも縦並び */
  .mail-att { flex-direction: column; align-items: stretch !important; }
  .mail-att select { max-width: 100% !important; width: 100%; }
}

/* --- スマホ (~480px) --- */
@media (max-width: 480px) {
  body.admin { font-size: 0.9rem; }
  .admin-header { border-bottom-width: 3px; }
  .admin-header .container { padding: 10px; }
  .admin-header .brand { font-size: 0.88rem; }
  .admin-header .brand .role { font-size: 0.62rem; padding: 1px 6px; }
  .admin-header nav a { padding: 5px 8px; font-size: 0.78rem; }

  .admin-main { padding: 10px 8px 32px; }
  .admin-main h1 { font-size: 1rem; padding-left: 8px; border-left-width: 4px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .stat-card .lbl { font-size: 0.75rem; }
  .stat-card .val { font-size: 1.2rem; }

  /* テーブルは更にスリム化 */
  .admin-main table { font-size: 0.75rem; }
  .admin-main table th, .admin-main table td { padding: 5px 6px !important; }

  .btn { padding: 5px 8px; font-size: 0.78rem; }
  .btn-sm { padding: 3px 6px; font-size: 0.72rem; }

  /* ライトボックス / プレビュー */
  .mail-preview-lb img, .mail-preview-lb iframe {
    max-width: 96vw !important;
    max-height: 76vh !important;
  }
}

/* --- 印刷時 --- */
@media print {
  .admin-header, .admin-user, .nav-inbox-count, .stage-warning,
  .filter-row, .search-row, .actions,
  .review-action-bar { display: none !important; }
  .admin-main { max-width: 100%; padding: 0; }
}

/* =========================================================
   ⚖️ 審査アクションバー (常時表示・タブ外、折りたたみ可)
   ========================================================= */
.review-action-bar {
  margin: 0 0 16px;
}
.action-bar-shell {
  background: #fffaf3;
  border: 2px solid #d4a017;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(212, 160, 23, 0.18);
}
.action-bar-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, #fff5e0, #fffaf3);
  border-radius: 6px 6px 0 0;
  font-weight: 700;
  color: #1f2630;
  user-select: none;
}
.action-bar-summary::-webkit-details-marker { display: none; }
.action-bar-summary::before {
  content: '▼';
  display: inline-block;
  margin-right: 8px;
  color: #d4a017;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}
details:not([open]) > .action-bar-summary::before { transform: rotate(-90deg); }
.action-bar-title { font-size: 1.05rem; }
.action-bar-hint { font-size: 0.78rem; color: #888; font-weight: 400; }
.action-bar-body {
  padding: 14px 18px 16px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, 1fr);   /* デスクトップ: 3 列固定 */
  align-items: start;
  background: #fff;
  border-radius: 0 0 6px 6px;
}
.action-bar-body .audit-actions {
  margin: 0;
  min-width: 0;       /* グリッド内で内容物がはみ出さないように */
}
/* 各列の内側で textarea / button が縦に潰れすぎないよう微調整 */
.action-bar-body .audit-actions textarea { width: 100%; box-sizing: border-box; }
.action-bar-body .audit-actions .status-buttons { gap: 4px; }
.action-bar-body .audit-actions .status-buttons button { font-size: 0.82rem; padding: 4px 9px; }

/* タブレット: 2 列に縮約 (3列目を回り込ませると幅が狭くなりすぎるため) */
@media (max-width: 1100px) {
  .action-bar-body { grid-template-columns: repeat(2, 1fr); }
}
/* モバイル: 1 列 */
@media (max-width: 768px) {
  .action-bar-body { grid-template-columns: 1fr; padding: 10px 12px 12px; gap: 10px; }
  .action-bar-summary { padding: 10px 12px; }
  .action-bar-title { font-size: 0.95rem; }
}

/* タブのバッジ (mail/auto-review) */
.tabs .tab-badge {
  display: inline-block;
  background: #c8102e;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  margin-left: 4px;
  vertical-align: middle;
  min-width: 18px;
  text-align: center;
}
.tabs .tab-badge.is-ok { background: #2d7a2d; }
.tabs .tab-badge.is-warn { background: #b85c00; }

/* ===========================================================
   📐 左サイドバーレイアウト (全 admin ページ共通)
   既存の上部ヘッダを左端固定サイドバーに変換
   =========================================================== */
.admin-header {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 220px;
  border-bottom: none;
  border-right: 4px solid #c8102e;
  z-index: 100;
  overflow-y: auto;
}
.admin-header .container {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  height: 100%;
  padding: 0;
  gap: 0;
}
.admin-header .brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 0.95rem;
  line-height: 1.4;
}
.admin-header .brand a {
  display: block;
}
.admin-header .brand .role {
  display: inline-block;
  margin: 0 0 6px;
}
.admin-header nav {
  flex: 1;
  padding: 8px 0;
}
.admin-header nav ul {
  flex-direction: column;
  gap: 0;
  flex-wrap: nowrap;
}
.admin-header nav li {
  width: 100%;
}
.admin-header nav a {
  display: block;
  padding: 10px 16px;
  border-radius: 0;
  border-left: 3px solid transparent;
  font-size: 0.9rem;
}
.admin-header nav a:hover {
  background: rgba(255,255,255,0.08);
}
.admin-header nav a.is-current {
  background: rgba(0,94,167,0.4);
  border-left-color: #ffd700;
}
.admin-user {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.admin-user button {
  width: 100%;
}

/* メインコンテンツを左サイドバー分ずらす */
.admin-main,
#dashboard-page > .admin-main,
#dashboard-page main.admin-main {
  margin-left: 220px;
  padding: 24px 28px 60px;
}

/* admin-review.html: 直下 main も対象 */
body.admin > main.admin-main {
  margin-left: 220px;
}

/* レスポンシブ: 狭画面では サイドバーを上部バーに戻す */
@media (max-width: 900px) {
  .admin-header {
    position: static;
    width: auto;
    height: auto;
    border-right: none;
    border-bottom: 4px solid #c8102e;
  }
  .admin-header .container {
    flex-direction: row;
    padding: 12px 14px;
  }
  .admin-header nav ul {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-header nav a {
    border-left: none;
    border-radius: 4px;
  }
  .admin-user {
    flex-direction: row;
    border-top: none;
    padding: 0;
  }
  .admin-user button { width: auto; }
  .admin-main,
  body.admin > main.admin-main,
  #dashboard-page > .admin-main,
  #dashboard-page main.admin-main {
    margin-left: 0;
  }
}

/* ===========================================================
   📐 admin-review.html 専用: 右サイドバー (審査アクション)
   drawer を常時表示の右固定サイドバーに変換
   =========================================================== */
body.has-action-sidebar .action-drawer-trigger,
body.has-action-sidebar .action-drawer-overlay {
  display: none !important;
}
body.has-action-sidebar .action-drawer {
  position: fixed !important;
  right: 0 !important;
  top: 0;
  bottom: 0;
  width: 380px !important;
  max-width: 38vw;
  background: #fff;
  box-shadow: -4px 0 14px rgba(0,0,0,0.10);
  transform: none !important;
  z-index: 90;
  border-left: 1px solid #d6e4f0;
  display: flex !important;
  flex-direction: column;
}
body.has-action-sidebar .action-drawer[hidden] {
  display: flex !important;  /* 常時表示なので hidden 属性無効化 */
}
body.has-action-sidebar .action-drawer-close { display: none; }
body.has-action-sidebar > main.admin-main {
  margin-right: 380px;
}
@media (max-width: 1280px) {
  body.has-action-sidebar .action-drawer { width: 320px !important; }
  body.has-action-sidebar > main.admin-main { margin-right: 320px; }
}
@media (max-width: 900px) {
  /* 狭画面では drawer 方式に戻す */
  body.has-action-sidebar .action-drawer-trigger,
  body.has-action-sidebar .action-drawer-overlay {
    display: revert !important;
  }
  body.has-action-sidebar .action-drawer {
    transform: translateX(100%) !important;
  }
  body.has-action-sidebar .action-drawer.is-open {
    transform: translateX(0) !important;
  }
  body.has-action-sidebar .action-drawer[hidden] {
    display: flex !important;
  }
  body.has-action-sidebar .action-drawer-close { display: revert; }
  body.has-action-sidebar > main.admin-main { margin-right: 0; }
}

/* ===========================================================
   📐 左サイドバー 3エリア構成 (admin-nav.js の構造に対応)
   =========================================================== */
.admin-header .admin-nav-block {
  flex: 0 0 auto;
}
.admin-header .admin-nav-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.admin-header .admin-nav-block a {
  display: block;
  padding: 10px 16px;
  color: #ccc;
  text-decoration: none;
  border-radius: 0;
  border-left: 3px solid transparent;
  font-size: 0.9rem;
}
.admin-header .admin-nav-block a:hover {
  background: rgba(255,255,255,0.08);
}
.admin-header .admin-nav-block a.is-current {
  background: rgba(0,94,167,0.4);
  border-left-color: #ffd700;
  color: #fff;
}
/* 主要画面エリア: 強調表示 */
.admin-header .admin-nav-primary a {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  padding: 12px 16px;
}
/* 外部リンクエリア: 少し控えめ */
.admin-header .admin-nav-footer a {
  color: #aaa;
  font-size: 0.85rem;
}
.admin-header .admin-nav-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 8px 12px;
  flex: 0 0 auto;
}
/* 中段の業務メニューは flex 余白を取る */
.admin-header .admin-nav-menu {
  flex: 1 1 auto;
  padding: 4px 0;
}

/* 狭画面 (横並び復帰時) */
@media (max-width: 900px) {
  .admin-header .admin-nav-block ul {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-header .admin-nav-block a {
    border-left: none;
    border-radius: 4px;
  }
  .admin-header .admin-nav-divider {
    display: none;
  }
}

/* === 共通フッター (admin-nav.js が自動生成) === */
.admin-footer {
  margin-left: 220px;  /* サイドバー幅分オフセット */
  padding: 14px 28px;
  background: #2d3748;
  color: #cbd5e0;
  border-top: 1px solid #1a202c;
  font-size: 0.8rem;
  text-align: center;
}
.admin-footer p { margin: 0; }
body.admin-login .admin-footer,
body.has-action-sidebar .admin-footer {
  margin-left: 220px;
}
body.admin-login .admin-footer {
  /* ログインページはサイドバーないので中央配置 */
  margin-left: 0;
  background: transparent;
  color: rgba(255,255,255,0.55);
  border-top: none;
  padding: 18px 20px 24px;
}
@media (max-width: 900px) {
  .admin-footer { margin-left: 0; }
}

/* === main class="wrap" も .admin-main と同じレイアウト扱い (admin-analytics / admin-callcenter-operators 等) === */
main.wrap {
  margin-left: 220px;
  padding: 24px 28px 60px;
  max-width: none;
}
body.admin > main.wrap,
#dashboard-page > main.wrap,
#dashboard-page main.wrap {
  margin-left: 220px;
}
@media (max-width: 900px) {
  main.wrap,
  body.admin > main.wrap,
  #dashboard-page > main.wrap,
  #dashboard-page main.wrap {
    margin-left: 0;
    padding: 18px 14px 48px;
  }
}
/* admin-footer も同様 */
.admin-footer {
  margin-left: 220px;
}
@media (max-width: 900px) {
  .admin-footer { margin-left: 0; }
}

/* ===========================================================
   📋 申請データ起源 vs 送付先データ 2カラム比較
   =========================================================== */
.src-compare-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 14px;
}
.src-col {
  background: #fafcfe;
  border: 1px solid #d6dee8;
  border-radius: 6px;
  padding: 10px 12px;
  min-width: 0;
}
.src-col-head {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #1a4d7a;
  border-bottom: 1px solid #d6e4f0;
  padding-bottom: 4px;
}
.src-form-preview {
  background: #fff;
  border: 1px solid #e5ebf2;
  border-radius: 4px;
  padding: 8px 10px;
}
.src-form-title {
  font-weight: 600;
  font-size: 0.82rem;
  color: #555;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #cbd6e2;
}
.src-form-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.src-form-table th {
  text-align: left;
  background: #f0f4f9;
  color: #1a4d7a;
  padding: 4px 8px;
  vertical-align: top;
  width: 32%;
  font-weight: 600;
  border-bottom: 1px solid #e5ebf2;
}
.src-form-table td {
  padding: 4px 8px;
  vertical-align: top;
  border-bottom: 1px solid #e5ebf2;
  word-break: break-all;
}
.src-mail-docs {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.src-mail-docs .mr-doc-thumb { max-width: 100%; }
.src-empty {
  padding: 14px;
  background: #fff7df;
  border: 1px dashed #f5a623;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #6e4a00;
  text-align: center;
}
/* 狭い画面: 縦に並べる */
@media (max-width: 800px) {
  .src-compare-cols { grid-template-columns: 1fr; }
}

/* ===========================================================
   📎 本審査モーダル 添付ファイルビューア (右側拡張)
   =========================================================== */
.mr-att-viewer {
  width: 560px;
  max-width: 50vw;
  background: #1a1a1a;
  color: #eee;
  display: flex;
  flex-direction: column;
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  animation: mrAttSlideIn 0.25s ease-out;
}
@keyframes mrAttSlideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.mr-att-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #2c2c2c; border-bottom: 1px solid #444;
  position: relative;
}
.mr-att-head h4 { margin: 0; font-size: 1rem; color: #fff; }
.mr-att-head .modal-close-btn { color: #fff; background: transparent; border: none; font-size: 1.4rem; position: static; }
.mr-att-nav {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 16px; background: #252525; border-bottom: 1px solid #444;
}
.mr-att-nav button { color: #fff; background: #444; border: 1px solid #666; font-size: 1.3rem; line-height: 1; width: 38px; height: 38px; }
.mr-att-nav button:hover { background: #555; }
.mr-att-nav button:disabled { opacity: 0.3; cursor: not-allowed; }
.mr-att-counter { font-weight: 600; font-size: 0.95rem; min-width: 80px; text-align: center; }
.mr-att-meta {
  padding: 6px 16px; font-size: 0.8rem; color: #aaa; border-bottom: 1px solid #333;
  background: #1f1f1f; word-break: break-all;
}
.mr-att-stage {
  flex: 1; overflow: auto; background: #0d0d0d;
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
}
.mr-att-stage img,
.mr-att-stage iframe { max-width: 100%; max-height: 100%; background: #fff; border-radius: 4px; }
.mr-att-stage iframe { width: 100%; height: 100%; min-height: 60vh; }
.mr-att-stage .att-fallback {
  color: #ccc; text-align: center; padding: 30px;
}
.mr-att-stage .att-fallback a { color: #6bf; text-decoration: underline; }

@media (max-width: 1200px) {
  .mr-att-viewer { width: 400px; }
}
@media (max-width: 900px) {
  .mr-att-viewer { display: none !important; }
}

/* 添付ビューア: Excel/Word/PDF 内部スタイル */
.mr-att-stage iframe {
  width: 100%; height: 100%; min-height: 60vh;
  background: #fff; border: 0; border-radius: 4px;
}
.mr-att-stage img { object-fit: contain; }
.xlsx-viewer {
  width: 100%; height: 100%;
  overflow: auto;
  background: #fff;
  color: #000;
  border-radius: 4px;
  padding: 0;
}
.xlsx-sheet { border-bottom: 1px solid #ddd; }
.xlsx-sheet-head {
  background: #1a4d7a; color: #fff;
  padding: 6px 12px; font-weight: 600; font-size: 0.9rem;
  position: sticky; top: 0; z-index: 2;
}
.xlsx-sheet-body { padding: 8px; }
.xlsx-sheet-body table {
  border-collapse: collapse;
  font-size: 0.8rem;
  font-family: 'Yu Gothic UI', 'Meiryo', sans-serif;
}
.xlsx-sheet-body td, .xlsx-sheet-body th {
  border: 1px solid #ccc;
  padding: 3px 6px;
  vertical-align: top;
  white-space: nowrap;
}
.docx-viewer {
  width: 100%; height: 100%;
  overflow: auto;
  background: #fff; color: #000;
  padding: 28px 36px;
  border-radius: 4px;
  line-height: 1.7;
  font-family: 'Yu Gothic', 'Yu Gothic UI', 'Meiryo', serif;
  font-size: 0.92rem;
}
.docx-viewer img { max-width: 100%; height: auto; }
.docx-viewer p { margin: 0 0 0.6em; }
.docx-viewer table { border-collapse: collapse; margin: 1em 0; }
.docx-viewer td, .docx-viewer th { border: 1px solid #999; padding: 4px 8px; }

/* ===== ステータス別件数トラッカー (新8チップ) ===== */
.status-tracker { margin: 14px 0; padding: 12px 14px; background: #fafcfe; border: 1px solid #d6e4f0; border-radius: 8px; }
.status-tracker .stage-scope { font-size: 0.82rem; color: #555; margin-bottom: 8px; }
.status-tracker .scope-chip { display: inline-block; padding: 2px 8px; background: #fff; border: 1px solid #cbd6e2; border-radius: 99px; margin-right: 4px; font-size: 0.78rem; color: #333; }
.status-tracker .scope-chip.scope-all { background: #eef5fb; color: #005ea7; }
.status-chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* カテゴリタブと統一感のある、横並び・丸ピル型チップ */
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; background: #fff; border: 1.5px solid #cfd8e3; border-radius: 999px; cursor: pointer; transition: background 0.12s, border-color 0.12s, box-shadow 0.12s; font-family: inherit; line-height: 1.2; }
.status-chip:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.status-chip.is-active { font-weight: 700; }
.status-chip-label { font-size: 0.88rem; font-weight: 600; }
.status-chip-count { font-size: 0.95rem; font-weight: 700; min-width: 1.2em; text-align: right; }
.status-chip-count small { font-size: 0.72rem; font-weight: 400; margin-left: 1px; opacity: 0.7; }
.status-tracker .stage-warning { display: inline-block; margin-top: 10px; padding: 6px 12px; background: #fef3c7; border: 1px solid #f59e0b; border-radius: 999px; font-size: 0.85rem; color: #92400e; }
