/* 新規申請画面：テンプレート機能用スタイル */

/* ヘッダー左側のテンプレートボタン */
.template-control-group {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
}


.template-main-button {
  display: inline-flex;
  align-items: center;
  background-color: var(--ds-color-surface-muted);
  margin: 0 10px;
  padding: 6px var(--ds-space-5);
  border-radius: var(--ds-radius-pill);
  border: none;
  font-size: var(--ds-font-lg);
  line-height: var(--ds-line-normal);
  font-weight: bold;
  transition: background-color 0.2s;
  width: auto;
  justify-content: center;
  cursor: default;
}

.template-main-button:hover {
  background-color: #ccc;
}



/* 一覧ポップアップのオーバーレイ */
.template-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

/* モーダル本体 */
.template-modal {
  width: min(480px, 92vw);
  max-height: 80vh;
  background: #ffffff;
  border-radius: var(--ds-radius-md);
  box-shadow: var(--ds-shadow-float);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.template-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e5e5;
}

.template-modal-title {
  margin: 0;
  font-size: var(--ds-font-md);
  line-height: var(--ds-line-compact);
  font-weight: 600;
}

.template-modal-close {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1.2;
  padding: 0 4px;
  cursor: pointer;
}

.template-modal-close:hover {
  background: #f0f0f0;
  border-radius: 4px;
}

.template-modal-body {
  padding: 8px 14px 4px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.template-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.template-list-item {
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
  position: relative;
}

.template-list-item-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-list-item-btnwrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}


/* テンプレート削除（右端×） */
.template-item-delete {
    position: static;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.2;
    cursor: pointer;
    color: #666;
}

.template-item-delete:hover {
  background: #eeeeee;
  color: #222;
}

.template-list-item:hover {
  background: #f7f7f7;
  border-color: #e0e0e0;
}

  .template-list-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-right: 10px;
}

.template-list-item-meta {
    font-size: var(--ds-font-xs);
    line-height: var(--ds-line-compact);
    color: #666666;
    margin: 0 0 0 2px;
}

  .template-item-actions {
    display: flex;
    gap: 6px;
    margin-top: 0;
    margin-left: auto;
}

  .template-item-apply-btn {
    padding: 4px 10px;
    font-size: 12px;
    height: 28px;
    border-radius: 28px;
    border: 1px solid #cccccc;
    background: #f5f5f5;
    color: #222;
    cursor: pointer;
}

  .template-item-apply-btn:hover {
    background: #e9e9e9;
}

  .template-item-apply-all {
    background: #e7ebf1;
    color: #3a4a5d;
    border-color: #b5c3d6;
    font-weight: bold;
  }
  .template-item-apply-all:hover {
    background: #d2d8e0;
    color: #2a3a4d;
    border-color: #8fa1b8;
  }

.template-list-empty-message {
  font-size: 13px;
  color: #888888;
  padding: 8px 10px 4px;
}

/* フッター（保存ボタン） */
.template-modal-footer {
  padding: 10px 14px;
  border-top: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}


.template-save-button {
  min-width: 120px;
  padding: 6px 14px;
  font-size: var(--ds-font-sm);
  line-height: var(--ds-line-normal);
  border-radius: 4px;
  border: none;
  cursor: pointer;
  background: var(--ds-color-primary);
  color: #ffffff;
}

.template-save-button:hover {
  background: var(--ds-color-primary-hover);
}

/* テンプレート名入力ダイアログ */
.template-name-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.template-name-dialog {
  width: min(360px, 90vw);
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-name-header {
  margin-bottom: 4px;
}

.template-name-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.template-name-body {
  margin-bottom: 4px;
}

.template-name-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #c0c0c0;
}

.template-name-input:focus {
  outline: none;
  border-color: var(--ds-color-primary);
  box-shadow: 0 0 0 1px rgba(25, 118, 210, 0.15);
}

.template-name-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.template-name-footer button {
  min-width: 80px;
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.template-name-cancel {
  background: #e0e0e0;
  color: #333333;
}

.template-name-cancel:hover {
  background: #cfcfcf;
}

.template-name-ok {
  background: var(--ds-color-primary);
  color: #ffffff;
}

.template-name-ok:hover {
  background: var(--ds-color-primary-hover);
}

/* 確認/警告/通知 ポップアップ */
.template-popup-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.template-popup-dialog {
  width: min(380px, 90vw);
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-popup-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.template-popup-message {
  font-size: 13px;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

.template-popup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.template-popup-footer button {
  min-width: 80px;
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.template-popup-cancel {
  background: #e0e0e0;
  color: #333;
}

.template-popup-cancel:hover {
  background: #cfcfcf;
}

.template-popup-ok {
  background: var(--ds-color-primary);
  color: #fff;
}

.template-popup-ok:hover {
  background: var(--ds-color-primary-hover);
}

/* base.css の .hidden と組み合わせる前提 */
.template-modal-overlay.hidden,
.template-name-modal.hidden {
  display: none !important;
}

.template-popup-modal.hidden {
  display: none !important;
}
