:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e2e5ea;
  --text: #1f2430;
  --text-muted: #6b7280;
  --primary: #3b5bdb;
  --primary-hover: #2f4bc0;
  --accent-bg: #eef1ff;
  --danger: #d64550;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161c;
    --panel: #1c1f27;
    --border: #2c3038;
    --text: #e7e9ee;
    --text-muted: #9aa0ab;
    --primary: #6d8bff;
    --primary-hover: #8ba0ff;
    --accent-bg: #23273a;
    --danger: #ff7b86;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}

.app { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 22px; margin: 0; }

.layout { flex: 1; display: flex; overflow: hidden; }

.list-pane {
  width: 340px;
  min-width: 280px;
  border-right: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.list-controls {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--panel);
}
.list-controls input, .list-controls select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

.candidate-list { list-style: none; margin: 0; padding: 8px; flex: 1; }
.candidate-card {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 6px;
}
.candidate-card:hover { background: var(--accent-bg); }
.candidate-card.active { background: var(--accent-bg); border-color: var(--primary); }
.candidate-card .name { font-weight: 600; font-size: 16px; }
.candidate-card .sub { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.candidate-card .meta-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent-bg);
  color: var(--primary);
  white-space: nowrap;
}
.badge.stage-pass { background: #e6f4ea; color: #1e7b34; }
.badge.stage-fail { background: #fdecec; color: #b3261e; }
.badge.stage-hold { background: #fff4e0; color: #a15c00; }

@media (prefers-color-scheme: dark) {
  .badge.stage-pass { background: #163526; color: #6fd39a; }
  .badge.stage-fail { background: #3a2223; color: #ff9aa2; }
  .badge.stage-hold { background: #3a2f1a; color: #f2c169; }
}

.empty-msg { text-align: center; color: var(--text-muted); font-size: 15px; padding: 24px 12px; }

.detail-pane { flex: 1; overflow-y: auto; padding: 24px 32px; }
.empty-state { color: var(--text-muted); text-align: center; margin-top: 80px; }

.candidate-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.candidate-header h2 { margin: 0 0 4px 0; font-size: 26px; }
.candidate-header .kana { color: var(--text-muted); font-size: 15px; }
.pdf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.pdf-row .btn { flex: none; white-space: nowrap; }
.pdf-upload-label { display: inline-flex; align-items: center; }
.header-actions { display: flex; flex-wrap: wrap; flex-shrink: 0; gap: 8px; }
.header-actions .btn { white-space: nowrap; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}
.info-item .label { font-size: 13px; color: var(--text-muted); margin-bottom: 3px; }
.info-item .value { font-size: 16px; }
.info-item.full { grid-column: 1 / -1; white-space: pre-wrap; }

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 12px;
}
.section-title h3 { margin: 0; font-size: 18px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
.timeline-item .ti-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.timeline-item .ti-title { font-weight: 600; font-size: 17px; }
.timeline-item .ti-meta { font-size: 14px; color: var(--text-muted); }
.timeline-item dl { margin: 8px 0 0; }
.timeline-item dt { font-size: 13px; color: var(--text-muted); margin-top: 10px; }
.timeline-item dd { margin: 3px 0 0; font-size: 15px; white-space: pre-wrap; line-height: 1.6; }
.ti-actions { display: flex; gap: 6px; }
.ti-actions button { font-size: 14px; padding: 5px 10px; }

.btn {
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}
.btn:hover { background: var(--accent-bg); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 14px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--panel);
  border-radius: 12px;
  width: 640px;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 19px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.field-group { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-group label { display: block; font-size: 14px; color: var(--text-muted); margin-bottom: 5px; }
.field-group input, .field-group select, .field-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.hint { font-size: 14px; color: var(--text-muted); margin: 6px 0 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.topbar-actions { display: flex; gap: 8px; }

/* 参考質問集 */
.qs-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.qs-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.qs-summary { font-size: 15px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.qs-summary strong { font-size: 18px; }
.qs-meta { font-size: 13px; color: var(--text-muted); }
.qs-note { font-size: 14px; color: #a15c00; margin: 8px 0 0; }
.qs-category { font-size: 15px; margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.qs-skill { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.qs-skill summary { cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; }
.qs-skill summary::-webkit-details-marker { display: none; }
.qs-skill summary::before { content: '▸'; color: var(--text-muted); }
.qs-skill[open] summary::before { content: '▾'; }
.qs-skill-name { font-weight: 600; }
.qs-badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.qs-found { background: #e6f4ea; color: #1e7b34; }
.qs-missing { background: #eef0f3; color: #5b6270; }
.qs-warning { background: #fff4e0; color: #a15c00; }
.qs-evidence {
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg);
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  margin: 10px 0 0;
  line-height: 1.6;
}
.qs-questions { margin: 10px 0 0; padding-left: 1.5em; line-height: 1.7; font-size: 15px; }
.qs-questions li { margin-bottom: 4px; }
.qs-tailored { font-weight: 600; }
.qs-topic {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--accent-bg);
  border-radius: 4px;
  padding: 0 6px;
  margin-right: 6px;
}
.qs-checkpoints { font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.qs-checkpoints span { font-weight: 600; margin-right: 8px; }

@media (prefers-color-scheme: dark) {
  .qs-found { background: #163526; color: #6fd39a; }
  .qs-missing { background: #2a2e36; color: #aab0bb; }
  .qs-warning, .qs-note { background: #3a2f1a; color: #f2c169; }
  .qs-note { background: none; }
}

/* 応募スキル設定 */
.modal-wide { width: 860px; }
.skill-row { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.skill-row summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; }
.skill-row[open] summary { margin-bottom: 12px; }
.skill-row-title { font-weight: 600; }
.skill-row .field-group label input[type="checkbox"] { width: auto; margin-right: 6px; }
.skill-row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

@media print {
  body.printing-qs .topbar,
  body.printing-qs .list-pane,
  body.printing-qs .candidate-header .header-actions,
  body.printing-qs .pdf-row,
  body.printing-qs .info-grid,
  body.printing-qs .qs-actions,
  body.printing-qs #qs-status,
  body.printing-qs .qs-section ~ * { display: none !important; }
  body.printing-qs .app { height: auto; }
  body.printing-qs .layout, body.printing-qs .detail-pane { overflow: visible; display: block; padding: 0; }
  body.printing-qs .qs-card { border: none; padding: 0; }
  body.printing-qs .qs-skill { break-inside: avoid; }
}

/* 添付PDF一覧 */
.doc-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  padding: 4px 4px 4px 10px;
  font-size: 14px;
}
.doc-chip a, .doc-chip span { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.doc-chip a:hover { text-decoration: underline; }
.doc-remove { border: none; background: none; color: var(--text-muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.doc-remove:hover { color: var(--danger); background: var(--accent-bg); }
@media print { body.printing-qs .doc-list { display: none !important; } }

.detail-error { color: var(--danger); font-size: 15px; }

/* ログイン画面 */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 28px; width: 380px; max-width: 100%; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-submit { width: 100%; margin-top: 6px; }

/* ログイン情報 */
.current-user { font-size: 14px; color: var(--text-muted); align-self: center; margin-right: 4px; }

/* 面接官チャット */
.chat-section { margin-bottom: 20px; }
.chat-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  max-height: 340px;
  overflow-y: auto;
}
.chat-msg { margin-bottom: 12px; }
.chat-msg:last-child { margin-bottom: 0; }
.chat-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 13px; color: var(--text-muted); }
.chat-author { font-weight: 600; color: var(--text); font-size: 14px; }
.chat-msg.mine .chat-author { color: var(--primary); }
.chat-action { border: none; background: none; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 0 2px; }
.chat-action:hover { color: var(--primary); text-decoration: underline; }
.chat-body { font-size: 15px; line-height: 1.7; white-space: pre-wrap; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-form textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}
.unread-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  margin-right: 4px;
}

/* メンバー管理 */
.member-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.member-table th { text-align: left; font-size: 13px; color: var(--text-muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.member-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.member-username { color: var(--text-muted); }
.member-inactive td { opacity: 0.55; }
.member-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.member-form-title { font-size: 16px; margin: 0 0 12px; }
.member-password { color: var(--text); }
.member-password code { background: var(--accent-bg); padding: 2px 8px; border-radius: 4px; font-size: 15px; }

@media print {
  body.printing-qs .chat-section { display: none !important; }
}

/* @による指名 */
.chat-input-wrap { position: relative; flex: 1; display: flex; }
.chat-input-wrap textarea { width: 100%; }
.mention-list {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  z-index: 20;
  list-style: none;
  margin: 0;
  padding: 4px;
  min-width: 240px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.mention-list li { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.mention-list li.active, .mention-list li:hover { background: var(--accent-bg); }
.mention-name { font-weight: 600; }
.mention { color: var(--primary); font-weight: 600; }
.mention-me { background: var(--accent-bg); border-radius: 4px; padding: 0 3px; }
.chat-msg.mentions-me { border-left: 3px solid var(--primary); padding-left: 10px; margin-left: -13px; }
.chat-mentions { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.mention-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  margin-right: 4px;
}

.member-room { max-width: 170px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 14px; margin-right: 6px; }

.badge-group { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.decision-badge::before { content: '判定 '; font-weight: 400; opacity: 0.75; }

.employment-badge { background: var(--accent-bg); color: var(--primary); }
#employment-quick-select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); font-size: 15px; }

/* 選考フェーズのカード */
.phase-section { margin-bottom: 20px; }
.phase-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}
.phase-card.has-record { border-left: 3px solid var(--primary); }
.phase-card > summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  list-style: none;
}
.phase-card > summary::-webkit-details-marker { display: none; }
.phase-card > summary::before { content: '▸'; color: var(--text-muted); }
.phase-card[open] > summary { border-bottom: 1px solid var(--border); }
.phase-card[open] > summary::before { content: '▾'; }
.phase-name { font-weight: 600; font-size: 16px; min-width: 7em; }
.phase-meta { font-size: 13px; color: var(--text-muted); }
.phase-excerpt { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24em; }
.phase-empty { font-size: 13px; color: var(--text-muted); }
.phase-body { padding: 16px; }
.phase-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.phase-body input, .phase-body select, .phase-body textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.phase-detail { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.phase-detail > summary { cursor: pointer; font-size: 14px; color: var(--text-muted); }
.phase-detail[open] > summary { margin-bottom: 12px; }
.phase-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.phase-actions .hint { margin: 0; }
.phase-buttons { display: flex; gap: 8px; }

@media print { body.printing-qs .phase-section { display: none !important; } }

/* スマートフォン対応 */
.mobile-only { display: none; }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { height: 100dvh; }

  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .topbar h1 { font-size: 18px; width: 100%; }
  .topbar-actions { flex-wrap: wrap; gap: 6px; width: 100%; }
  .topbar-actions .btn { flex: 1 1 auto; padding: 8px 10px; font-size: 14px; }
  .current-user { width: 100%; margin: 0; }

  /* 一覧と詳細を1画面ずつ切り替える */
  .layout { display: block; overflow-y: auto; }
  .list-pane { width: 100%; min-width: 0; border-right: none; height: auto; }
  .detail-pane { display: none; padding: 14px; }
  body.viewing-detail .list-pane { display: none; }
  body.viewing-detail .detail-pane { display: block; }
  .mobile-only { display: inline-flex; margin-bottom: 12px; }

  .candidate-card { padding: 14px 12px; }
  .candidate-header { flex-direction: column; gap: 10px; }
  .candidate-header h2 { font-size: 22px; }
  .header-actions { width: 100%; }
  .header-actions select, .header-actions .btn { flex: 1 1 auto; }

  /* 入力欄は16px未満だとiOSで拡大されるため */
  input, select, textarea,
  .field-group input, .field-group select, .field-group textarea,
  .list-controls input, .list-controls select,
  .chat-form textarea { font-size: 16px; }

  .field-row, .phase-row { grid-template-columns: 1fr; gap: 0; }
  .info-grid { grid-template-columns: 1fr; padding: 14px; }

  .chat-form { flex-direction: column; align-items: stretch; }
  .chat-form .btn { width: 100%; }
  .mention-list { min-width: 0; width: 100%; }
  .chat-box { max-height: 50vh; }

  .phase-actions { flex-direction: column; align-items: stretch; }
  .phase-buttons { flex-direction: column; }
  .phase-buttons .btn { width: 100%; }
  .phase-excerpt { display: none; }
  .phase-body input, .phase-body select, .phase-body textarea { font-size: 16px; }

  .qs-card { padding: 14px; }
  .qs-actions { width: 100%; }
  .qs-actions .btn { flex: 1 1 auto; }
  .qs-questions { padding-left: 1.2em; }

  .timeline-item .ti-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ti-actions { align-self: flex-end; }

  .modal { width: 100%; max-width: 100%; max-height: 92dvh; border-radius: 12px 12px 0 0; margin-top: auto; }
  .modal-overlay { align-items: flex-end; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }

  /* メンバー管理の表は横スクロールで見せる */
  .member-table { display: block; overflow-x: auto; white-space: nowrap; }
  .member-actions { flex-wrap: nowrap; }
  .member-room { max-width: 150px; }
}

.phase-extra-heading { font-size: 14px; color: var(--text-muted); margin: 16px 0 6px; }

/* 参考質問集の折りたたみ */
.qs-collapse > summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  list-style: none;
  margin: 24px 0 12px;
}
.qs-collapse > summary::-webkit-details-marker { display: none; }
.qs-collapse > summary::before { content: '▸'; color: var(--text-muted); align-self: center; }
.qs-collapse[open] > summary::before { content: '▾'; }
.qs-collapse > summary h3 { margin: 0; font-size: 18px; display: inline; }
.qs-head-meta { font-size: 13px; color: var(--text-muted); }
.qs-collapse .qs-actions { justify-content: flex-end; margin-bottom: 10px; }

/* 採用状況サマリ */
.summary-page { flex: 1; overflow-y: auto; padding: 24px 32px; }
.sm-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 16px;
  break-inside: avoid;
}
.sm-card h2 { font-size: 17px; margin: 0 0 4px; }
.sm-note { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
.sm-empty { font-size: 14px; color: var(--text-muted); margin: 8px 0 0; }
.sm-sub { font-size: 12px; color: var(--text-muted); }
.sm-warn { color: var(--danger); font-weight: 600; }

.sm-insights { margin: 10px 0 0; padding-left: 1.3em; line-height: 1.9; font-size: 15px; }

.sm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.sm-tile { background: var(--bg); border-radius: 8px; padding: 12px 14px; }
.sm-tile-label { font-size: 13px; color: var(--text-muted); }
.sm-tile-value { font-size: 28px; font-weight: 700; line-height: 1.3; }
.sm-unit { font-size: 14px; font-weight: 500; margin-left: 2px; color: var(--text-muted); }
.sm-tile-note { font-size: 12px; color: var(--text-muted); }

.sm-funnel-row { display: grid; grid-template-columns: 90px 1fr 120px; align-items: center; gap: 12px; margin-bottom: 10px; }
.sm-funnel-label { font-size: 14px; font-weight: 600; }
.sm-funnel-bar { background: var(--bg); border-radius: 5px; height: 22px; }
.sm-bar-track { display: flex; height: 100%; border-radius: 5px; overflow: hidden; min-width: 2px; }
.sm-bar-seg { height: 100%; }
.sm-bar-seg.pass, .sm-legend i.pass { background: #2e9e5b; }
.sm-bar-seg.hold, .sm-legend i.hold { background: #e0a32e; }
.sm-bar-seg.fail, .sm-legend i.fail { background: #d05a62; }
.sm-bar-seg.pending, .sm-legend i.pending { background: #9aa0ab; }
.sm-funnel-num { font-size: 14px; text-align: right; }
.sm-funnel-num .sm-sub { display: block; }

.sm-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--text-muted); }
.sm-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.sm-legend i.applied { background: var(--primary); }
.sm-legend i.advanced { background: #2e9e5b; }
.sm-legend i.rejected { background: #d05a62; }

.sm-months { display: flex; align-items: flex-end; gap: 16px; height: 190px; margin-top: 12px; overflow-x: auto; }
.sm-month { display: flex; flex-direction: column; align-items: center; min-width: 64px; height: 100%; }
.sm-month-bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.sm-month-bar { width: 14px; border-radius: 3px 3px 0 0; min-height: 2px; }
.sm-month-bar.applied { background: var(--primary); }
.sm-month-bar.advanced { background: #2e9e5b; }
.sm-month-bar.rejected { background: #d05a62; }
.sm-month-label { font-size: 13px; margin-top: 6px; }
.sm-month-num { font-size: 11px; color: var(--text-muted); }

.sm-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.sm-table th { text-align: left; font-size: 12px; color: var(--text-muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sm-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sm-table td.num { text-align: right; white-space: nowrap; }
.sm-table a { color: var(--primary); }
.sm-reason { color: var(--text-muted); font-size: 13px; }
.sm-inline-bar { display: inline-block; width: 110px; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.sm-inline-bar div { height: 100%; background: var(--danger); }

@media (max-width: 760px) {
  .summary-page { padding: 14px; }
  .sm-funnel-row { grid-template-columns: 72px 1fr; }
  .sm-funnel-num { grid-column: 2; text-align: left; }
  .sm-table { display: block; overflow-x: auto; }
}

@media print {
  .topbar { display: none !important; }
  .summary-page { overflow: visible; padding: 0; }
  .sm-card { border-color: #ccc; }
}
