/* カタチ. — 人事制度AI 対話型ウィザードUI */
/* Design: Claude.ai inspired — white, spacious, calm, warm green accent */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* LP設計仕様書 v2 準拠 */
  --accent: #3D6B4A;
  --accent-hover: #2D4A23;
  --accent-light: #ECF4E8;
  --accent-border: #B8D4A5;
  --accent-muted: #7BAF5E;

  --text-heading: #1A1A1A;
  --text-body: #444444;
  --text-sub: #777777;

  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;

  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 760px;

  --font: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.8;
  color: var(--text-body);
  background: #fff;
  -webkit-font-smoothing: auto;
  font-optical-sizing: auto;
}

/* #app はJS側で display 制御。.app-container で レイアウト定義 */

/* ========== ヘッダー ========== */
header {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: #fff;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}

.reset-btn {
  margin-left: auto;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text-sub);
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
}

.reset-btn:hover {
  color: #c00;
  border-color: #c00;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0.04em;
}

.logo-dot {
  color: var(--accent-muted);
}

.logo-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-sub);
}

/* ========== ウィザード進捗 ========== */
.wizard-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard-steps {
  display: flex;
  gap: 4px;
}

.wizard-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  transition: color 0.3s;
  position: relative;
}

.wizard-step .step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
  flex-shrink: 0;
  transition: all 0.3s;
}

.wizard-step.active {
  color: var(--accent);
  font-weight: 600;
}

.wizard-step.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(61,107,74,0.18); }
  50%       { box-shadow: 0 0 0 6px rgba(61,107,74,0.08); }
}

.wizard-step.completed {
  color: var(--text-body);
}

.wizard-step.completed .step-dot {
  background: var(--accent);
}

.progress-track {
  height: 3px;
  background: var(--gray-100);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phase-label {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.progress-percent {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ========== チャットエリア ========== */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 32px 28px;
  scroll-behavior: smooth;
}

.chat-area::-webkit-scrollbar {
  width: 4px;
}

.chat-area::-webkit-scrollbar-track {
  background: transparent;
}

.chat-area::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 2px;
}

/* ========== メッセージ ========== */
.message {
  margin-bottom: 28px;
  animation: msgInLeft 0.38s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

/* ナギ: 左からスライドイン */
@keyframes msgInLeft {
  from { opacity: 0; transform: translateX(-14px) translateY(6px); }
  to   { opacity: 1; transform: translateX(0) translateY(0); }
}

/* 社長: 右からスライドイン */
.message.user {
  animation: msgInRight 0.35s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes msgInRight {
  from { opacity: 0; transform: translateX(14px) translateY(6px); }
  to   { opacity: 1; transform: translateX(0) translateY(0); }
}

.message-sender {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message-bubble {
  padding: 18px 22px;
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ナギのメッセージ */
.message.assistant .message-bubble {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--text-body);
}

/* 社長のメッセージ */
.message.user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.message.user .message-sender {
  text-align: right;
}

.message.user .message-bubble {
  background: var(--accent);
  color: #fff;
  border: none;
  max-width: 85%;
  border-radius: var(--radius) var(--radius) 4px var(--radius);
}

/* ========== 選択肢ボタン ========== */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  max-width: 480px;
}

.choice-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  background: #fff;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  color: var(--text-heading);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  line-height: 1.5;
  /* スタガー入場 */
  animation: choiceIn 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes choiceIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 選択肢の遅延 */
.choice-btn:nth-child(1) { animation-delay: 0.05s; }
.choice-btn:nth-child(2) { animation-delay: 0.12s; }
.choice-btn:nth-child(3) { animation-delay: 0.19s; }
.choice-btn:nth-child(4) { animation-delay: 0.26s; }
.choice-btn:nth-child(5) { animation-delay: 0.33s; }

@media (hover: hover) {
  .choice-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(61, 107, 74, 0.12);
  }
}

.choice-btn:active {
  transform: translateY(0);
}

.choice-btn.choice-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ========== フェーズ切り替え ========== */
.phase-transition {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  margin: 12px 0 24px;
  animation: phaseReveal 0.6s cubic-bezier(0.4,0,0.2,1) both;
}

@keyframes phaseReveal {
  from { opacity: 0; transform: scaleX(0.7); }
  to   { opacity: 1; transform: scaleX(1); }
}

@keyframes phaseContentIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.phase-transition::before,
.phase-transition::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.phase-transition-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  animation: phaseContentIn 0.5s 0.15s cubic-bezier(0.34,1.2,0.64,1) both;
}

.phase-transition-icon {
  font-size: 20px;
}

.phase-transition-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.phase-transition-sub {
  font-size: 11px;
  color: var(--text-sub);
}

/* ========== タイピングインジケータ ========== */
.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 18px 22px;
  margin-bottom: 28px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  width: fit-content;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-muted);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-of-type(2) { animation-delay: 0.18s; }
.typing-dot:nth-of-type(3) { animation-delay: 0.36s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0);  opacity: 0.45; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

.typing-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-right: 8px;
}

.typing-slow {
  font-size: 12px;
  color: var(--text-sub);
  margin-left: 8px;
}

/* ========== 入力エリア ========== */
.input-area {
  padding: 16px 28px 24px;
  border-top: 1px solid var(--gray-200);
  background: #fff;
  flex-shrink: 0;
}

.input-container {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 6px 6px 6px 18px;
  transition: border-color 0.2s;
}

.input-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 107, 74, 0.1);
}

.message-input {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: var(--font);
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 200px;
  color: var(--text-heading);
}

.message-input::placeholder {
  color: var(--text-sub);
}

.send-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:disabled {
  background: var(--gray-200);
  color: var(--text-sub);
  cursor: not-allowed;
}

.send-btn:not(:disabled):hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.send-btn:not(:disabled):active {
  transform: scale(0.98);
}

.input-hint {
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-sub);
}

/* ========== システムメッセージ ========== */
.system-message {
  text-align: center;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 13px;
  color: var(--text-sub);
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

/* ========== ドキュメントパネル（完了画面） ========== */
.doc-panel {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.doc-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  font-size: 16px;
}

.doc-panel-icon { font-size: 20px; }

.doc-section {
  padding: 16px 22px;
}

.doc-section + .doc-section {
  border-top: 1px solid var(--gray-100);
}

.doc-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.doc-item:hover {
  border-color: var(--accent-border);
  background: var(--accent-light);
}

.doc-item-info {
  flex: 1;
  min-width: 0;
}

.doc-item-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
}

.doc-item-desc {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 2px;
}

.doc-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 16px;
}

.doc-view-btn, .doc-csv-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.doc-view-btn {
  background: var(--accent);
  color: #fff;
}

.doc-view-btn:hover {
  background: var(--accent-hover);
}

.doc-csv-btn {
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent-border);
}

.doc-csv-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

/* ========== 中間ドキュメントリンク ========== */
.interim-doc-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--accent-light);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius);
  margin-top: -4px;
}

.interim-doc-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.interim-doc-info {
  flex: 1;
  min-width: 0;
}

.interim-doc-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
}

.interim-doc-desc {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 2px;
}

/* ========== ペイウォール ========== */
.paywall-panel {
  background: #fff;
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 28px 28px 20px;
  text-align: center;
}

.paywall-note {
  font-size: 13px;
  color: var(--accent);
  background: #f0f7f2;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 20px;
  text-align: left;
  line-height: 1.6;
}

.paywall-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.paywall-desc {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.7;
  margin-bottom: 20px;
}

.paywall-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 24px;
}

.paywall-features {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  text-align: left;
  display: inline-block;
}
.paywall-features li {
  font-size: 14px;
  color: var(--text-body);
  padding: 4px 0 4px 20px;
  position: relative;
}
.paywall-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.paywall-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 12px;
}

.paywall-btn:hover {
  background: var(--accent-hover);
}

.paywall-cancel {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========== Google Drive 連携必須パネル ========== */
.gdrive-required-panel {
  background: #fff;
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  margin: 16px 0;
}

.gdrive-required-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.gdrive-required-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.gdrive-required-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
}

.gdrive-required-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.gdrive-required-btn:hover {
  background: var(--accent-hover);
}

.gdrive-restore-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
}

.gdrive-restore-skip:hover {
  color: var(--text-secondary);
}

/* ========== レスポンシブ ========== */
@media (max-width: 600px) {
  header {
    padding: 16px 20px 14px;
  }

  .header-brand {
    margin-bottom: 16px;
  }

  .wizard-step {
    font-size: 11px;
  }

  .wizard-step .step-label {
    font-size: 9px;
  }

  .input-hint {
    display: none;
  }

  .chat-area {
    padding: 20px 16px;
  }

  .input-area {
    padding: 12px 16px 20px;
  }

  .message-bubble {
    padding: 14px 18px;
  }

  .message.user .message-bubble {
    max-width: 92%;
  }

  .logo {
    font-size: 20px;
  }

  .choices {
    max-width: 100%;
  }
}

/* ========== 完了画面の入力エリア置換 ========== */
.input-area .doc-panel {
  margin: 0;
}

/* ========== メール入力ゲート ========== */
.email-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.email-gate-inner {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.email-gate-brand {
  margin-bottom: 48px;
}

.email-gate-brand .logo {
  font-size: 32px;
  margin-bottom: 4px;
}

.email-gate-sub {
  font-size: 14px;
  color: var(--text-sub);
}

.email-gate-card {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 40px 32px;
  margin-bottom: 24px;
  animation: cardRise 0.6s cubic-bezier(0.34, 1.1, 0.64, 1) both;
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(32px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.email-gate-heading {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.email-gate-desc {
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 32px;
}

.email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.email-input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font);
  color: var(--text-heading);
  outline: none;
  transition: border-color 0.2s;
}

.email-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 107, 74, 0.1);
}

.email-input::placeholder {
  color: var(--text-sub);
}

.email-submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s;
}

.email-submit-btn:hover {
  background: var(--accent-hover);
}

.email-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.email-gate-tips {
  list-style: none;
  margin: 16px 0 0;
  padding: 14px 16px;
  background: #f7faf8;
  border-radius: 8px;
  text-align: left;
}
.email-gate-tips li {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.7;
  padding: 2px 0;
}

.email-gate-footer {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.email-gate-footer a {
  font-size: 13px;
  color: var(--text-sub);
  text-decoration: none;
}

.email-gate-footer a:hover {
  color: var(--text-body);
}

/* ========== 給与シミュレーション: アップロードパネル ========== */
.salary-upload-panel {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}

.salary-upload-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  font-size: 16px;
}

.salary-upload-icon { font-size: 20px; }

.salary-upload-body {
  padding: 20px 22px;
}

.salary-upload-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-body);
  margin-bottom: 16px;
}

.salary-template-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--accent-light);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 20px;
}

.salary-template-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.salary-template-link svg {
  flex-shrink: 0;
}

.salary-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.salary-dropzone-active,
.salary-dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.salary-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-sub);
}

.salary-dropzone-content svg {
  color: var(--gray-300);
}

.salary-dropzone-content p {
  font-size: 14px;
  margin: 0;
}

.salary-dropzone-sub {
  font-size: 12px !important;
  color: var(--text-sub);
}

.salary-file-label {
  display: inline-block;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.salary-file-label:hover {
  background: var(--accent-hover);
}

.salary-dropzone-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  font-size: 14px;
}

.salary-error {
  margin-top: 12px;
  padding: 12px 16px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  color: #B91C1C;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ========== 給与シミュレーション: 結果パネル ========== */
.salary-result-panel {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}

.salary-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  font-size: 16px;
}

.salary-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 20px 22px 0;
}

.salary-summary-card {
  padding: 14px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  text-align: center;
}

.salary-summary-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}

.salary-summary-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
  margin-left: 2px;
}

.salary-summary-label {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 4px;
}

.salary-card-ok {
  border-color: var(--accent-border);
  background: var(--accent-light);
}

.salary-card-ok .salary-summary-value {
  color: var(--accent);
}

.salary-card-warn {
  border-color: #FDE68A;
  background: #FFFBEB;
}

.salary-card-warn .salary-summary-value {
  color: #D97706;
}

.salary-card-alert {
  border-color: #FECACA;
  background: #FEF2F2;
}

.salary-card-alert .salary-summary-value {
  color: #DC2626;
}

.salary-cost-summary {
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.salary-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.salary-cost-up {
  color: #DC2626;
  font-weight: 600;
}

.salary-cost-neutral {
  color: var(--text-body);
  font-weight: 600;
}

/* 社員別テーブル */
.salary-table-wrapper {
  overflow-x: auto;
  padding: 0 22px 16px;
}

.salary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.salary-table th {
  background: var(--gray-50);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-sub);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}

.salary-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-body);
}

.salary-table .salary-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.salary-row-alert {
  background: #FEF2F2;
}

.salary-row-warn {
  background: #FFFBEB;
}

.salary-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.salary-status-ok {
  background: var(--accent-light);
  color: var(--accent);
}

.salary-status-warn {
  background: #FEF3C7;
  color: #D97706;
}

.salary-status-alert {
  background: #FEE2E2;
  color: #DC2626;
}

.salary-status-unknown {
  background: var(--gray-100);
  color: var(--text-sub);
}

/* 確定ボタン */
.salary-action {
  padding: 20px 22px;
  text-align: center;
  border-top: 1px solid var(--gray-100);
}

.salary-confirm-btn {
  display: inline-block;
  padding: 14px 48px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.salary-confirm-btn:hover {
  background: var(--accent-hover);
}

.salary-confirm-btn:disabled {
  background: var(--gray-200);
  color: var(--text-sub);
  cursor: not-allowed;
}

.salary-action-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-sub);
}

@media (max-width: 600px) {
  .salary-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .salary-table {
    font-size: 12px;
  }

  .salary-table th,
  .salary-table td {
    padding: 8px 8px;
  }

  .salary-confirm-btn {
    width: 100%;
    padding: 14px;
  }
}

/* app-container は #app の display:flex を維持 */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ==========================================================
   評価結果管理ページ (evaluation.html)
   ========================================================== */

.eval-page {
  min-height: 100vh;
  background: #fff;
}

/* ヘッダー */
.eval-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--gray-200);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.eval-header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.eval-back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.eval-back-link:hover {
  text-decoration: underline;
}

/* コンテナ */
.eval-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 28px 64px;
}

.eval-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-sub);
  font-size: 16px;
}

.eval-empty a {
  color: var(--accent);
}

/* ステップカード */
.eval-step {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.eval-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.eval-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.eval-step-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
}

.eval-step-desc {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.7;
  margin-bottom: 20px;
}

.eval-step-note {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 12px;
}

.eval-step-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

/* 期間選択 */
.eval-period-selector {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.eval-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eval-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}

.eval-select {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-heading);
  background: #fff;
  outline: none;
  max-width: 200px;
  transition: border-color 0.2s;
}

.eval-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 107, 74, 0.1);
}

.eval-period-buttons {
  display: flex;
  gap: 10px;
}

.eval-period-btn {
  padding: 12px 24px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 15px;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-heading);
  cursor: pointer;
  transition: all 0.2s;
}

.eval-period-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-hover);
}

.eval-period-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ボタン */
.eval-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.eval-primary-btn:hover {
  background: var(--accent-hover);
}

.eval-primary-btn:disabled {
  background: var(--gray-200);
  color: var(--text-sub);
  cursor: not-allowed;
}

.eval-secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.eval-secondary-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

/* テンプレートダウンロード */
.eval-template-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--accent-light);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
}

.eval-template-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ドロップゾーン */
.eval-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.eval-dropzone-active,
.eval-dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.eval-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-sub);
}

.eval-dropzone-content svg {
  color: var(--gray-300);
}

.eval-dropzone-content p {
  font-size: 14px;
  margin: 0;
}

.eval-dropzone-sub {
  font-size: 12px !important;
  color: var(--text-sub);
}

.eval-file-label {
  display: inline-block;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.eval-file-label:hover {
  background: var(--accent-hover);
}

/* エラー・成功メッセージ */
.eval-error {
  margin-top: 12px;
  padding: 12px 16px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  color: #B91C1C;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.eval-success {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

/* バリデーション結果 */
.eval-validation-header {
  margin-top: 20px;
  margin-bottom: 12px;
}

.eval-validation-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
}

.eval-validation-summary {
  padding: 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}

.eval-validation-summary p {
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 8px;
}

.eval-grade-counts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.eval-grade-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-body);
  font-weight: 500;
}

/* 退職者・新入社員調整 */
.eval-adjust-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}

.eval-adjust-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 8px;
}

/* タブ */
.eval-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.eval-tab {
  padding: 12px 24px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-sub);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.eval-tab:hover {
  color: var(--accent);
}

.eval-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* サマリーカード（4つ横並び） */
.eval-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.eval-summary-card {
  padding: 16px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  text-align: center;
}

.eval-summary-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.eval-summary-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  margin-left: 2px;
}

.eval-summary-label {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 6px;
}

.eval-card-warn {
  border-color: #FDE68A;
  background: #FFFBEB;
}

.eval-card-warn .eval-summary-value {
  color: #D97706;
}

.eval-card-alert {
  border-color: #FECACA;
  background: #FEF2F2;
}

.eval-card-alert .eval-summary-value {
  color: #DC2626;
}

/* テーブル */
.eval-table-wrapper {
  overflow-x: auto;
  margin-bottom: 16px;
}

.eval-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.eval-table-wide {
  min-width: 1100px;
}

.eval-table th {
  background: var(--gray-50);
  padding: 8px 6px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-sub);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}

.eval-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-body);
  white-space: nowrap;
}

.eval-table td:first-child {
  min-width: 80px;
  white-space: normal;
}

.eval-table .eval-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 手直し可能セル */
.eval-editable {
  cursor: pointer;
  position: relative;
}

.eval-editable:hover {
  background: var(--accent-light);
}

.eval-inline-input {
  width: 100%;
  min-width: 80px;
  padding: 4px 8px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  text-align: right;
  outline: none;
  background: #fff;
}

/* 調整済みバッジ */
.eval-adjusted {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #EFF6FF;
  color: #2563EB;
  white-space: nowrap;
  vertical-align: middle;
}

/* キャップ適用行 */
.eval-capped {
  background: #FFFBEB;
}

.eval-cap-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #FEF3C7;
  color: #D97706;
  white-space: nowrap;
}

/* ダウンロードアクション */
.eval-download-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 16px;
}

/* 確定ステップ */
.eval-confirm-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.eval-confirm-btn {
  padding: 14px 48px;
  font-size: 16px;
}

.eval-consult-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.eval-consult-link:hover {
  text-decoration: underline;
}

.eval-confirmed {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
}

.eval-confirmed svg {
  color: var(--accent);
  flex-shrink: 0;
}

.eval-d-note {
  margin-top: 12px;
  padding: 12px 16px;
  background: #fef3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius-sm);
  color: #856404;
  font-size: 13px;
  line-height: 1.6;
}

.eval-d-note p {
  margin: 0;
}

/* ========== 評価結果管理 レスポンシブ ========== */

@media (max-width: 768px) {
  .eval-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .eval-header {
    padding: 14px 16px;
  }

  .eval-container {
    padding: 20px 16px 48px;
  }

  .eval-step {
    padding: 20px 16px;
  }

  .eval-period-buttons {
    flex-direction: column;
  }

  .eval-summary-cards {
    grid-template-columns: 1fr 1fr;
  }

  .eval-table {
    font-size: 12px;
  }

  .eval-table th,
  .eval-table td {
    padding: 8px 8px;
  }

  .eval-confirm-btn {
    width: 100%;
    padding: 14px;
  }

  .eval-confirm-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .eval-consult-link {
    text-align: center;
  }

  .eval-download-actions {
    flex-direction: column;
  }

  .eval-download-actions .eval-secondary-btn {
    width: 100%;
    justify-content: center;
  }

  .eval-table-wide {
    font-size: 12px;
  }

  .eval-table-wide th,
  .eval-table-wide td {
    padding: 6px 6px;
  }
}

/* ========== 評価ページ追加スタイル（v2） ========== */

/* 幅広テーブル */
.eval-table-wide {
  min-width: 1100px;
}

/* 社長加減 input */
.eval-adjust-input {
  width: 90px;
  padding: 6px 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  text-align: right;
  outline: none;
  transition: border-color 0.2s;
}

.eval-adjust-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 107, 74, 0.1);
}

/* 決定額セル（強調） */
.eval-decided {
  font-weight: 600;
  color: var(--text-heading);
}

/* 合計行 */
.eval-total-row {
  background: var(--gray-50, #f8f9fa);
  border-top: 2px solid var(--gray-300);
}

.eval-total-row td {
  font-weight: 600;
}

/* 昇格UI */
.eval-promo-cell {
  white-space: nowrap;
}

.eval-promo-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
}

.eval-promo-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.eval-promo-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  background: #fef3cd;
  color: #856404;
  border-radius: 3px;
  margin-left: 4px;
}

.eval-promo-select {
  display: block;
  margin-top: 4px;
  padding: 4px 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  outline: none;
}

.eval-promo-select:focus {
  border-color: var(--accent);
}

.eval-promoted-row {
  background: #fef9e7;
}

/* 按分バッジ */
.eval-proration-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  background: #e2e3f1;
  color: #4a4a8a;
  border-radius: 3px;
  margin-left: 4px;
}

/* ステータス除外タグ */
.eval-status-excluded {
  background: #f5c6cb !important;
  color: #721c24 !important;
}

/* 昇給スキップ通知 */
.eval-raise-skip-notice {
  padding: 16px 20px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius-sm);
  color: #856404;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

/* アクセントカード */
.eval-card-accent {
  border-left: 4px solid var(--accent);
}

.eval-card-accent .eval-summary-value {
  color: var(--accent);
}

/* 計算方法ガイド */
.eval-calc-guide {
  margin-bottom: 20px;
}

.eval-guide-toggle {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 14px;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.eval-guide-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.eval-guide-content {
  margin-top: 12px;
  padding: 20px;
  background: var(--gray-50, #f8f9fa);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}

.eval-guide-section {
  margin-bottom: 20px;
}

.eval-guide-section:last-child {
  margin-bottom: 0;
}

.eval-guide-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--gray-200);
}

.eval-guide-section ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-body);
}

.eval-guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 8px 0 12px;
}

.eval-guide-table th,
.eval-guide-table td {
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  text-align: right;
}

.eval-guide-table th {
  background: var(--gray-100, #eee);
  font-weight: 600;
  text-align: center;
}

.eval-guide-table td:first-child {
  text-align: left;
  font-weight: 500;
}

/* ========== フィードバック面談シート通知パネル ========== */

.eval-feedback-panel {
  margin-top: 20px;
  padding: 20px;
  background: #f3f8f4;
  border: 1px solid #c8e6c9;
  border-radius: 12px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.eval-feedback-icon {
  flex-shrink: 0;
  padding-top: 2px;
}

.eval-feedback-body {
  flex: 1;
}

.eval-feedback-title {
  font-size: 16px;
  font-weight: 600;
  color: #2e7d32;
  margin: 0 0 6px;
}

.eval-feedback-desc {
  font-size: 14px;
  color: #444;
  margin: 0 0 12px;
}

.eval-feedback-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.eval-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #3D6B4A;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.eval-feedback-btn:hover {
  background: #2D4A23;
}

.eval-feedback-note {
  font-size: 12px;
  color: #888;
  margin: 12px 0 0;
}

@media (max-width: 600px) {
  .eval-feedback-panel {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
