/* MYCFO — API/연동 준비센터 스타일 (v0.1.8) */

/* ─── 보안 배너 ─────────────────────────────────────────────────── */
.apicenter-security-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: #fff5f5;
  border: 1px solid #fca5a5;
  border-left: 4px solid #ef4444;
  border-radius: var(--radius-md, 8px);
  margin-bottom: 20px;
}

.apicenter-security-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.apicenter-security-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.apicenter-security-text strong {
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
}

.apicenter-security-text span {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

/* ─── 요약 카드 행 ───────────────────────────────────────────────── */
.apicenter-summary-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .apicenter-summary-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

.apicenter-summary-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  padding: 16px 18px;
  text-align: center;
  transition: box-shadow 0.15s;
}

.apicenter-summary-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.apicenter-summary-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text-primary, #111);
  line-height: 1.2;
}

.apicenter-summary-label {
  font-size: 11px;
  color: var(--color-text-secondary, #6b7280);
  margin-top: 4px;
}

.text-danger {
  color: #ef4444 !important;
}

/* ─── 툴바 ──────────────────────────────────────────────────────── */
.apicenter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.apicenter-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.apicenter-count-label {
  font-size: 12px;
  color: var(--color-text-secondary, #6b7280);
  white-space: nowrap;
}

/* ─── 서비스 카드 그리드 ─────────────────────────────────────────── */
.apicenter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 760px) {
  .apicenter-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── 서비스 카드 ────────────────────────────────────────────────── */
.apicenter-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-lg, 12px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s, transform 0.12s;
}

.apicenter-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.09);
  transform: translateY(-1px);
}

/* 카드 헤더 */
.apicenter-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.apicenter-card-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.apicenter-card-meta {
  flex: 1;
  min-width: 0;
}

.apicenter-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary, #111);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apicenter-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ─── 진행률 링 ──────────────────────────────────────────────────── */
.apicenter-progress-ring {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  cursor: help;
}

.apicenter-progress-ring circle:nth-child(2) {
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.apicenter-ring-pct {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--color-text-primary, #111);
  pointer-events: none;
}

/* ─── 카드 설명 ──────────────────────────────────────────────────── */
.apicenter-card-desc {
  font-size: 12px;
  color: var(--color-text-secondary, #6b7280);
  line-height: 1.5;
  margin: 0;
  /* 3줄 말줄임 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── 용도 태그 ──────────────────────────────────────────────────── */
.apicenter-purposes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.apicenter-purpose-tag {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--color-bg-subtle, #f3f4f6);
  color: var(--color-text-secondary, #6b7280);
  border-radius: 99px;
  border: 1px solid var(--color-border, #e5e7eb);
}

/* ─── 정보 행 ────────────────────────────────────────────────────── */
.apicenter-info-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}

.apicenter-info-label {
  font-weight: 500;
  color: var(--color-text-secondary, #6b7280);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 64px;
}

.apicenter-info-val {
  color: var(--color-text-primary, #374151);
}

.apicenter-link {
  color: var(--color-brand-blue, #2563eb);
  text-decoration: none;
  font-size: 12px;
}

.apicenter-link:hover {
  text-decoration: underline;
}

/* ─── 동적 상태 행 ───────────────────────────────────────────────── */
.apicenter-status-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px solid var(--color-border, #e5e7eb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.apicenter-status-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}

.apicenter-status-label {
  font-size: 10px;
  color: var(--color-text-secondary, #9ca3af);
  font-weight: 500;
}

.apicenter-status-val {
  font-size: 12px;
  color: var(--color-text-primary, #374151);
}

/* ─── 메모 미리보기 ─────────────────────────────────────────────── */
.apicenter-memo-preview {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 6px 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: 11px;
  color: #78350f;
  line-height: 1.4;
}

.apicenter-memo-preview svg {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.7;
}

/* ─── 체크리스트 프리뷰 바 ───────────────────────────────────────── */
.apicenter-checklist-preview {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apicenter-checklist-bar {
  flex: 1;
  height: 5px;
  background: var(--color-border, #e5e7eb);
  border-radius: 99px;
  overflow: hidden;
}

.apicenter-checklist-fill {
  height: 100%;
  background: var(--color-brand-blue, #2563eb);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.apicenter-checklist-label {
  font-size: 11px;
  color: var(--color-text-secondary, #6b7280);
  white-space: nowrap;
}

/* ─── 카드 액션 버튼 ────────────────────────────────────────────── */
.apicenter-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ─── 빈 상태 ────────────────────────────────────────────────────── */
.apicenter-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary, #9ca3af);
}

/* ─── 뱃지 색상 보완 ─────────────────────────────────────────────── */
.badge-blue   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-purple { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.badge-green  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-orange { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-teal   { background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; }
.badge-gray   { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }
.badge-red    { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ─── 상태 뱃지 (카드 내 환경 상태) ─────────────────────────────── */
.status-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.status-badge.status-active {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-badge.status-inactive {
  background: #f9fafb;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
}

/* ─── 상세 모달 ──────────────────────────────────────────────────── */
.apicenter-modal-box {
  max-width: 600px;
  width: 100%;
}

/* 모달 섹션 */
.ac-modal-section {
  margin-bottom: 20px;
}

.ac-modal-section:last-child {
  margin-bottom: 0;
}

.ac-modal-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ac-modal-section-warn {
  font-size: 11px;
  color: #ef4444;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* 체크리스트 */
.ac-modal-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ac-modal-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.1s;
}

.ac-modal-check-item:hover {
  background: var(--color-bg-subtle, #f3f4f6);
}

.ac-modal-check-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--color-brand-blue, #2563eb);
  flex-shrink: 0;
  cursor: pointer;
}

.ac-modal-check-label {
  font-size: 13px;
  color: var(--color-text-primary, #374151);
  line-height: 1.4;
}

/* 환경 토글 행 */
.ac-modal-env-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.ac-modal-toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-primary, #374151);
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.1s;
}

.ac-modal-toggle-item:hover {
  background: var(--color-bg-subtle, #f3f4f6);
}

.ac-modal-toggle-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--color-brand-blue, #2563eb);
  flex-shrink: 0;
}

/* 입력 필드 */
.ac-modal-input,
.ac-modal-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 6px;
  background: var(--color-surface, #fff);
  color: var(--color-text-primary, #111);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.ac-modal-input:focus,
.ac-modal-select:focus {
  border-color: var(--color-brand-blue, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.ac-modal-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 6px;
  background: var(--color-surface, #fff);
  color: var(--color-text-primary, #111);
  outline: none;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.15s;
  box-sizing: border-box;
  min-height: 80px;
}

.ac-modal-textarea:focus {
  border-color: var(--color-brand-blue, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.ac-modal-char-count {
  text-align: right;
  font-size: 11px;
  color: var(--color-text-secondary, #9ca3af);
  margin-top: 4px;
}

/* ─── 보안 정책 모달 본문 ─────────────────────────────────────────── */
.apicenter-security-policy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.apicenter-policy-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary, #111);
  margin: 0 0 8px;
}

.apicenter-policy-section ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.apicenter-policy-section li {
  font-size: 12px;
  color: var(--color-text-secondary, #6b7280);
  line-height: 1.5;
}

.apicenter-policy-section li strong {
  color: var(--color-text-primary, #374151);
}

/* ─── Toast (재사용) ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111;
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

/* ─── 반응형 ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .apicenter-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .apicenter-filter-group {
    flex-direction: column;
  }

  .apicenter-card-actions {
    flex-direction: column;
  }
}
