/* ==========================================================================
   ERP Admin — 커스텀 CSS (erp-admin.css)
   Unfold STYLES로 전역 로드
   ========================================================================== */

/* ── 금액/숫자 ── */
.erp-amount { text-align: right; display: block; }
.erp-amount-bold { text-align: right; display: block; font-weight: 600; }
.erp-amount-lg { font-size: 1.1rem; font-weight: 700; }

/* ── 손익 색상 ── */
.erp-profit-pos { color: #2e7d32; font-weight: 600; }
.erp-profit-neg { color: #c62828; font-weight: 600; }
.dark .erp-profit-pos { color: #66bb6a; }
.dark .erp-profit-neg { color: #ef5350; }

/* ── 상태/보조 텍스트 ── */
.erp-muted { color: #9ca3af; }
.dark .erp-muted { color: #6b7280; }
.erp-sub-item { color: #9ca3af; padding-left: 20px; }
.dark .erp-sub-item { color: #6b7280; }
.erp-option-text { color: #6b7280; font-size: 0.85em; }
.dark .erp-option-text { color: #94a3b8; }

/* ==========================================================================
   Sync Dashboard (templates/admin/products/sync_dashboard.html)
   ========================================================================== */

.sync-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
}
.dark .sync-card {
  background: #1e293b;
  border-color: #334155;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}
.dark .stat-value {
  color: #f1f5f9;
}
.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}
.dark .stat-label {
  color: #94a3b8;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-running { background: #dbeafe; color: #1d4ed8; }
.badge-completed { background: #dcfce7; color: #15803d; }
.badge-failed { background: #fee2e2; color: #b91c1c; }
.dark .badge-running { background: #1e3a5f; color: #60a5fa; }
.dark .badge-completed { background: #14532d; color: #4ade80; }
.dark .badge-failed { background: #450a0a; color: #f87171; }

.sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.sync-btn-primary {
  background: #2563eb;
  color: white;
}
.sync-btn-primary:hover { background: #1d4ed8; }
.sync-btn-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}
.sync-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}
.dark .sync-btn-secondary {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}
.sync-btn-secondary:hover { background: #e5e7eb; }
.dark .sync-btn-secondary:hover { background: #475569; }

.sync-input {
  padding: 0.625rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  width: 180px;
}
.dark .sync-input {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

.sync-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.sync-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dark .sync-table th {
  color: #94a3b8;
  border-bottom-color: #334155;
}
.sync-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}
.dark .sync-table td {
  border-bottom-color: #1e293b;
  color: #cbd5e1;
}

.progress-bar-bg {
  background: #e5e7eb;
  border-radius: 9999px;
  height: 0.5rem;
  overflow: hidden;
  width: 100%;
}
.dark .progress-bar-bg { background: #334155; }
.progress-bar-fill {
  background: #2563eb;
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s;
}

/* ==========================================================================
   Readonly 필드 너비 통일 — 컬럼 꽉 채우기
   내용 길이와 무관하게 박스 끝선이 칼같이 정렬됨
   ========================================================================== */
div.readonly {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
}

/* ==========================================================================
   Frontend Layout (templates/base.html)
   ========================================================================== */

.erp-body { background: #f4f6f9; }
.erp-navbar-brand { font-weight: 700; }
.erp-user-info { font-size: .85rem; }

.erp-sidebar {
  position: fixed; top: 56px; left: 0; bottom: 0;
  width: 220px; background: #212529; padding-top: 1rem;
  overflow-y: auto;
}
.erp-sidebar .nav-link {
  color: rgba(255,255,255,.7); padding: .6rem 1.2rem;
  font-size: .9rem;
}
.erp-sidebar .nav-link:hover,
.erp-sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.1); }
.erp-sidebar .nav-link i { width: 20px; margin-right: .5rem; }
.erp-sidebar .nav-header {
  color: rgba(255,255,255,.4); font-size: .75rem;
  padding: .8rem 1.2rem .3rem; text-transform: uppercase;
  letter-spacing: .05em;
}

.erp-content-area { margin-left: 220px; padding: 1.5rem; margin-top: 56px; }

.erp-page-header { margin-bottom: 1.5rem; }
.erp-page-header h1 { font-size: 1.5rem; font-weight: 600; }
.erp-page-header p { color: #6c757d; font-size: .9rem; }

.erp-stats-card { border: none; border-radius: .5rem; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.erp-stats-card .card-body { padding: 1rem 1.2rem; }
.erp-stats-card h3 { font-size: 1.6rem; font-weight: 700; }

.erp-table th { font-weight: 600; font-size: .85rem; color: #495057; }
