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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #e8edf2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.35);
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal {
  background: #fff;
  border-radius: 4px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ヘッダー */
.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #d8dde3;
}

.modal-header .close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #555;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.15s;
}

.modal-header .close-btn:hover { color: #111; }

.modal-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

/* テーブル */
.modal-body {
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

/* 申請内容ヘッダー行 */
.section-header td {
  background: #dce8f0;
  color: #2a4a60;
  font-weight: 600;
  padding: 8px 16px;
  font-size: 13px;
  border-top: 1px solid #c4d4df;
  border-bottom: 1px solid #e0e4e8;
}

/* 申請内容の通常行 */
tr:not(.section-header) td {
  padding: 9px 16px;
  border-bottom: 1px solid #e8ecef;
  vertical-align: middle;
  color: #333;
}

tr:not(.section-header) td:first-child {
  width: 120px;
  color: #555;
  white-space: nowrap;
}

/* ボタン行 */
.btn-row td {
  padding: 10px 16px;
  border-bottom: 1px solid #e8ecef;
  text-align: right;
}

.btn-open {
  background: #fff;
  border: 1px solid #b0bec8;
  border-radius: 3px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: #444;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.btn-open:hover {
  background: #f0f5f9;
  border-color: #8aa0b0;
}

.btn-open .icon-ext {
  font-size: 11px;
  opacity: 0.65;
}

/* ワークフロー進行状況ヘッダー */
.progress-header td {
  background: #dce8f0;
  color: #2a4a60;
  font-weight: 600;
  padding: 8px 16px;
  font-size: 13px;
  border-top: 1px solid #c4d4df;
}

/* コメント textarea */
.comment-cell textarea {
  width: 100%;
  border: 1px solid #c8d0d8;
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 62px;
  color: #333;
  outline: none;
  transition: border-color 0.15s;
}

.comment-cell textarea:focus {
  border-color: #5b9fce;
  box-shadow: 0 0 0 2px rgba(91, 159, 206, 0.18);
}

/* アクションボタンエリア */
.action-area {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #e8ecef;
}

.btn {
  border: none;
  border-radius: 3px;
  padding: 7px 22px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.97); }

.btn-return {
  background: #fff;
  border: 2px solid #5b9fce;
  color: #3a7fae;
}

.btn-return:hover { background: #eaf3fb; }

.btn-approve {
  background: #e8424a;
  color: #fff;
  border: 2px solid #e8424a;
}

.btn-approve:hover { filter: brightness(1.1); }

/* キャンセルエリア */
.cancel-area {
  padding: 12px 16px;
  text-align: center;
}

.btn-cancel {
  background: #fff;
  border: 1px solid #b5bec8;
  color: #555;
  padding: 7px 32px;
  font-size: 13.5px;
  font-family: inherit;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cancel:hover { background: #f4f6f8; }

/* 承認完了メッセージ */
.success-message {
  display: none; /* 初期は非表示 */
  background: #eaf6ee;
  color: #2e7d4f;
  border: 1px solid #a8d5b5;
  border-radius: 3px;
  padding: 12px 16px;
  margin: 12px 16px;
  font-size: 13.5px;
  text-align: center;
}

.success-message.visible {
  display: block; /* visibleクラスが付いたら表示 */
}

/* 差し戻し完了メッセージ */
.return-message {
  display: none;
  background: #fef6e4;
  color: #7d5a2e;
  border: 1px solid #f0d49a;
  border-radius: 3px;
  padding: 12px 16px;
  margin: 12px 16px;
  font-size: 13.5px;
  text-align: center;
}

.return-message.visible {
  display: block;
}