/* CSS 변수 */
:root {
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-border: #dee2e6;
  --color-border-focus: #495057;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-primary: #0d6efd;
  --color-primary-hover: #0b5ed7;
  --color-danger: #dc3545;
  --color-danger-hover: #b02a37;
  --color-secondary: #6c757d;
  --color-secondary-hover: #5c636a;
  --color-nav-bg: #1a1a2e;
  --color-nav-text: #ffffff;
  --color-badge-building-bg: #fff3cd;
  --color-badge-building-text: #856404;
  --color-badge-success-bg: #d1e7dd;
  --color-badge-success-text: #0a5c36;
  --color-badge-failed-bg: #f8d7da;
  --color-badge-failed-text: #842029;
  --color-log-bg: #1a1a1a;
  --color-log-text: #d4d4d4;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* 네비게이션 */
.nav {
  background-color: var(--color-nav-bg);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.nav-logo {
  color: var(--color-nav-text);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s, color 0.15s;
}

.nav-link:hover {
  color: var(--color-nav-text);
  background-color: rgba(255, 255, 255, 0.1);
}

/* 메인 */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* 페이지 헤더 */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
}

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-secondary-hover);
}

.btn-danger {
  background-color: var(--color-danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--color-danger-hover);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
}

.btn-icon:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* 빈 상태 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 64px 0;
  text-align: center;
}

.empty-state-text {
  color: var(--color-text-muted);
  font-size: 15px;
}

/* 테이블 */
.table-wrapper {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background-color: var(--color-bg);
}

.table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

/* 유틸리티 */
.mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  background-color: var(--color-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.muted {
  color: var(--color-text-muted);
  font-size: 13px;
}

.link {
  color: var(--color-primary);
  text-decoration: none;
}

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

.hidden {
  display: none !important;
}

/* 상태 뱃지 */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.badge-building {
  background-color: var(--color-badge-building-bg);
  color: var(--color-badge-building-text);
}

.badge-success {
  background-color: var(--color-badge-success-bg);
  color: var(--color-badge-success-text);
}

.badge-failed {
  background-color: var(--color-badge-failed-bg);
  color: var(--color-badge-failed-text);
}

/* 업로드 폼 */
.upload-form {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  max-width: 600px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--color-text);
  background-color: var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* 슬러그 입력 */
.slug-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slug-input-row .form-input {
  flex: 1;
}

.slug-suffix {
  flex-shrink: 0;
  color: var(--color-text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.form-hint {
  margin-top: 5px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* 드롭존 */
.dropzone {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  user-select: none;
}

.dropzone:hover,
.dropzone:focus {
  border-color: var(--color-primary);
  background-color: rgba(13, 110, 253, 0.02);
  outline: none;
}

.dropzone.drag-over {
  border-color: var(--color-primary);
  background-color: rgba(13, 110, 253, 0.05);
}

.dropzone.has-file {
  border-color: var(--color-border-focus);
  background-color: rgba(0, 0, 0, 0.01);
}

.dropzone-text {
  color: var(--color-text-muted);
  font-size: 14px;
  pointer-events: none;
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* 로그 */
.log-container {
  margin-top: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 800px;
}

.log-header {
  padding: 8px 16px;
  background-color: #2d2d2d;
  color: #aaa;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.log-output {
  display: block;
  padding: 16px;
  background-color: var(--color-log-bg);
  color: var(--color-log-text);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
  min-height: 80px;
}

/* 결과 / 에러 컨테이너 */
.result-container,
.error-container {
  margin-top: 24px;
  padding: 20px 24px;
  border-radius: var(--radius);
  max-width: 600px;
}

.result-container {
  background-color: #d1e7dd;
  border: 1px solid #a3cfbb;
}

.result-title {
  font-weight: 700;
  font-size: 15px;
  color: #0a5c36;
  margin-bottom: 10px;
}

.result-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.result-url {
  font-size: 14px;
  word-break: break-all;
}

.error-container {
  background-color: #f8d7da;
  border: 1px solid #f1aeb5;
}

.error-title {
  font-weight: 700;
  font-size: 15px;
  color: #842029;
  margin-bottom: 6px;
}

.error-message {
  color: #842029;
  font-size: 13px;
  margin-bottom: 16px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* 도움말 페이지 */
.docs-layout {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.docs-section {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.docs-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.docs-desc {
  margin-bottom: 16px;
  line-height: 1.7;
  color: var(--color-text);
}

.docs-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.docs-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.docs-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background-color: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.docs-step-body {
  flex: 1;
  padding-top: 4px;
}

.docs-step-body strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.docs-code {
  margin-top: 10px;
  background-color: #1a1a1a;
  color: #d4d4d4;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  line-height: 1.7;
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
}

.docs-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.docs-tab-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.docs-code-good {
  border: 1px solid #a3cfbb;
}

.docs-code-bad {
  border: 1px solid #f1aeb5;
}

.docs-tip {
  background-color: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
}

.badge-method-get {
  background-color: #d1e7dd;
  color: #0a5c36;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.badge-method-post {
  background-color: #cfe2ff;
  color: #084298;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.badge-method-delete {
  background-color: #f8d7da;
  color: #842029;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}

/* 배포 유형 선택 */
.deploy-type-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deploy-type-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.deploy-type-option:has(input:checked) {
  border-color: var(--color-primary);
  background-color: #f0f6ff;
}

.deploy-type-option input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

.deploy-type-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.deploy-type-label strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.deploy-type-label small {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* 환경변수 textarea */
.env-textarea {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}

/* 타임라인 */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-color: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-border);
}

.timeline-dot-deploy,
.timeline-dot-redeploy      { background-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary); }
.timeline-dot-build_success  { background-color: #0a5c36; box-shadow: 0 0 0 2px #0a5c36; }
.timeline-dot-build_failed,
.timeline-dot-delete         { background-color: var(--color-danger); box-shadow: 0 0 0 2px var(--color-danger); }
.timeline-dot-env_update     { background-color: #f59e0b; box-shadow: 0 0 0 2px #f59e0b; }
.timeline-dot-slug_change    { background-color: #8b5cf6; box-shadow: 0 0 0 2px #8b5cf6; }

.timeline-content {
  padding: 4px 0 0 8px;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-action {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text);
}

.timeline-time {
  font-size: 12px;
  color: var(--color-text-muted);
}

.timeline-detail {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
  font-family: 'SFMono-Regular', Consolas, monospace;
}

.timeline-detail .diff-add { color: #0a5c36; }
.timeline-detail .diff-del { color: var(--color-danger); }
.timeline-detail .diff-mod { color: #f59e0b; }

/* 타임라인 아코디언 */
.timeline-item-expandable {
  cursor: pointer;
}

.timeline-item-expandable:hover .timeline-content {
  background-color: rgba(0, 0, 0, 0.015);
  border-radius: var(--radius-sm);
}

.timeline-chevron {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.timeline-chevron::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--color-text-muted);
  border-bottom: 1.5px solid var(--color-text-muted);
  transform: rotate(-45deg);
  margin-top: 2px;
  margin-left: 2px;
}

.timeline-item-expanded .timeline-chevron {
  transform: rotate(90deg);
}

.timeline-detail-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 0;
}

.timeline-item-expanded .timeline-detail-wrapper {
  max-height: 500px;
  opacity: 1;
}

.timeline-detail-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-right: 6px;
}

.timeline-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12px;
  color: var(--color-text);
}

/* ========== 카드 컴포넌트 ========== */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-body {
  padding: 20px 24px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

/* ========== 대시보드 카드 그리드 ========== */
.deploy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.deploy-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}

.deploy-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: #c0c5cb;
}

.deploy-card-bar {
  height: 3px;
  flex-shrink: 0;
}

.deploy-card-bar-success  { background-color: #16a34a; }
.deploy-card-bar-building { background-color: #eab308; }
.deploy-card-bar-failed   { background-color: var(--color-danger); }

.deploy-card-body {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deploy-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.deploy-card-slug {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.deploy-card-slug:hover {
  color: var(--color-primary);
}

.deploy-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.deploy-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.deploy-card-meta-label {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.deploy-card-url {
  font-size: 12px;
  word-break: break-all;
}

.deploy-card-url a {
  color: var(--color-primary);
  text-decoration: none;
}

.deploy-card-url a:hover {
  text-decoration: underline;
}

.deploy-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-bg);
}

.deploy-card-footer .muted {
  font-size: 12px;
}

/* ========== 상세 페이지 섹션 ========== */
.detail-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 상세 헤더 카드 */
.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px;
}

.detail-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-hero-slug {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

.detail-hero-url {
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: none;
  word-break: break-all;
}

.detail-hero-url:hover {
  text-decoration: underline;
}

/* 상세 정보 그리드 */
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.detail-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-info-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-info-value {
  font-size: 14px;
  color: var(--color-text);
}

/* 환경변수 에디터 스타일 */
.env-editor {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.env-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.env-editor-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 환경변수 탭 */
.env-tabs {
  display: flex;
  gap: 0;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.env-tab {
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.env-tab:hover {
  color: var(--color-text);
}

.env-tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
}

/* 환경변수 인풋 모드 */
.env-input-panel {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.env-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.env-input-key {
  width: 30%;
  flex-shrink: 0;
  padding: 6px 10px;
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.env-input-key:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.env-input-key::placeholder {
  color: var(--color-text-muted);
}

.env-input-value {
  flex: 1;
  padding: 6px 10px;
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.env-input-value:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.env-input-value::placeholder {
  color: var(--color-text-muted);
}

.env-input-delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.env-input-delete:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background-color: rgba(220, 53, 69, 0.05);
}

.env-input-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  margin-top: 4px;
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  align-self: flex-start;
}

.env-input-add:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

/* 환경변수 텍스트 모드 (textarea) */
.env-text-panel textarea {
  min-height: 120px;
  padding: 14px 16px;
  background-color: var(--color-bg);
  color: var(--color-text);
  border: 1px solid #adb5bd;
  border-radius: var(--radius);
  margin: 12px 14px;
  width: calc(100% - 28px);
  outline: none;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
}

.env-text-panel textarea::placeholder {
  color: var(--color-text-muted);
}

.env-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 14px;
}

/* 관리 카드 */
.manage-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.manage-block {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.manage-block:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.manage-block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.manage-block-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* 위험 구역 카드 */
.danger-card {
  border-color: #fca5a5;
  background-color: #fef2f2;
}

.danger-card .card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.danger-card-info {
  flex: 1;
  min-width: 200px;
}

.danger-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #991b1b;
  margin-bottom: 4px;
}

.danger-card-desc {
  font-size: 12px;
  color: #b91c1c;
}

/* 히스토리 빈 상태 */
.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 0;
  text-align: center;
}

.history-empty-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 18px;
}

.history-empty-text {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* 컨테이너 상태 그리드 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stats-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background-color: var(--color-bg);
  border-radius: var(--radius);
}

.stats-item-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-item-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

/* ========== 히스토리 그룹 카드 ========== */
.history-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-surface);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.history-group-expandable > .history-group-header {
  cursor: pointer;
}

.history-group-expandable > .history-group-header:hover {
  background-color: rgba(0, 0, 0, 0.015);
}

.history-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 8px;
}

.history-group-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-group-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.history-group-chevron {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.history-group-chevron::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--color-text-muted);
  border-bottom: 1.5px solid var(--color-text-muted);
  transform: rotate(-45deg);
  margin-top: 2px;
  margin-left: 2px;
}

.history-group-expanded .history-group-chevron {
  transform: rotate(90deg);
}

.history-group-action {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text);
}

.history-group-time {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.history-group-detail-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 0;
}

.history-group-expanded .history-group-detail-wrapper {
  max-height: 500px;
  opacity: 1;
}

.history-group-detail {
  padding: 0 16px 12px;
  border-top: 1px solid var(--color-border);
}

.history-group-detail-item {
  padding: 8px 0;
  font-size: 12px;
  color: var(--color-text-muted);
  font-family: 'SFMono-Regular', Consolas, monospace;
}

.history-group-detail-item + .history-group-detail-item {
  border-top: 1px dashed var(--color-border);
}

/* 히스토리 스텝 타임라인 */
.history-step-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 0 8px;
  position: relative;
}

.history-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  position: relative;
  padding-left: 20px;
}

.history-step::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-border);
}

.history-step:first-child::before {
  top: 50%;
}

.history-step:last-child::before {
  bottom: 50%;
}

.history-step-dot {
  position: absolute;
  left: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-text-muted);
  z-index: 1;
}

.history-step-dot-deploy,
.history-step-dot-redeploy      { background-color: #0d6efd; }
.history-step-dot-build_success  { background-color: #0a5c36; }
.history-step-dot-build_failed   { background-color: var(--color-danger); }
.history-step-dot-env_update     { background-color: #f59e0b; }
.history-step-dot-slug_change    { background-color: #8b5cf6; }
.history-step-dot-delete         { background-color: var(--color-danger); }

.history-step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  min-width: 80px;
}

.history-step-time {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ========== 반응형 ========== */
@media (max-width: 640px) {
  .nav-inner {
    gap: 8px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .table-wrapper {
    overflow-x: auto;
  }

  .docs-tabs {
    grid-template-columns: 1fr;
  }

  .upload-form {
    padding: 16px;
  }

  .deploy-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .danger-card .card-body {
    flex-direction: column;
    align-items: flex-start;
  }
}
