/* ============================================
   050BIZ 관리시스템 Style
   ============================================ */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", sans-serif;
  background: #f5f6fa;
  color: #222;
  font-size: 14px;
  line-height: 1.5;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar {
  display: flex; align-items: center;
  background: #1e293b; color: #fff;
  padding: 0 24px; height: 56px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.topbar .brand a { color: #fff; font-weight: 700; font-size: 17px; }
.topbar .gnb { display: flex; gap: 4px; margin-left: 40px; flex: 1; }
.topbar .gnb a {
  color: #cbd5e1; padding: 8px 14px; border-radius: 6px;
}
.topbar .gnb a:hover { background: #334155; color: #fff; text-decoration: none; }
.topbar .userbox { display: flex; align-items: center; gap: 12px; color: #cbd5e1; }

/* Container */
.container { max-width: 1400px; margin: 24px auto; padding: 0 24px; }

/* Card */
.card {
  background: #fff; border-radius: 8px;
  padding: 24px; margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card h2 { margin-top: 0; font-size: 18px; border-bottom: 2px solid #e5e7eb; padding-bottom: 12px; }

/* Form */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block; margin-bottom: 6px; font-weight: 600; color: #374151;
  font-size: 13px;
}
.form-row .help { color: #6b7280; font-size: 12px; margin-top: 4px; }
input[type=text], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=email],
select, textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
textarea { min-height: 80px; resize: vertical; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 768px) { .form-grid { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-block; padding: 8px 16px;
  background: #2563eb; color: #fff; border: 0; border-radius: 6px;
  cursor: pointer; font-size: 14px; text-decoration: none;
  font-family: inherit;
}
.btn:hover { background: #1d4ed8; text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: #dc2626; } .btn-danger:hover { background: #b91c1c; }
.btn-warn   { background: #f59e0b; } .btn-warn:hover   { background: #d97706; }
.btn-gray   { background: #6b7280; } .btn-gray:hover   { background: #4b5563; }
.btn-outline {
  background: #fff; border: 1px solid #d1d5db; color: #374151;
}
.btn-outline:hover { background: #f3f4f6; color: #111; }

/* Table */
.table {
  width: 100%; border-collapse: collapse; background: #fff;
  font-size: 13px;
}
.table th, .table td {
  padding: 10px 12px; border-bottom: 1px solid #e5e7eb; text-align: left;
}
.table th {
  background: #f9fafb; font-weight: 600; color: #374151;
  border-bottom: 2px solid #e5e7eb;
}
.table tr:hover { background: #f9fafb; }
.table .num  { text-align: right; font-variant-numeric: tabular-nums; }
.table .ctr  { text-align: center; }

/* Badges */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.badge-gray   { background: #e5e7eb; color: #374151; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }

/* Alerts */
.alert {
  padding: 12px 16px; border-radius: 6px; margin-bottom: 16px;
  font-size: 14px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Login */
.login-wrap {
  max-width: 380px; margin: 80px auto; background: #fff;
  padding: 32px; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.login-wrap h1 { text-align: center; margin-top: 0; font-size: 22px; }
.login-wrap .sub { text-align: center; color: #6b7280; margin-bottom: 24px; font-size: 13px; }
.login-wrap .btn { width: 100%; padding: 11px; font-size: 15px; }

/* Dashboard stats */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: #fff; padding: 20px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-card .label { color: #6b7280; font-size: 12px; margin-bottom: 6px; }
.stat-card .value { font-size: 26px; font-weight: 700; color: #111827; }
.stat-card .foot  { color: #6b7280; font-size: 11px; margin-top: 8px; }

/* Pagination */
.pager { display: flex; gap: 4px; margin-top: 16px; justify-content: center; }
.pager a, .pager span {
  padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 4px;
  background: #fff; color: #374151;
}
.pager .active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Search bar */
.search-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
  padding: 16px; background: #fff; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.search-bar input, .search-bar select {
  width: auto; min-width: 140px;
}

.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.toolbar h1 { margin: 0; font-size: 22px; }

.footer {
  text-align: center; padding: 24px;
  color: #9ca3af; font-size: 12px;
}

/* Details for info view */
.detail-row { display: grid; grid-template-columns: 150px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed #e5e7eb; }
.detail-row .k { color: #6b7280; font-weight: 600; }

/* =========================================
   v2 추가 스타일
   ========================================= */

/* 공통 유틸 */
.muted { color: #6b7280; font-size: 12px; }
.ctr { text-align: center; }
.req { color: #ef4444; }

/* 탭 */
.tabs {
  display: flex; gap: 2px; border-bottom: 2px solid #e5e7eb;
  margin: 16px 0 0; padding: 0;
}
.tabs .tab {
  padding: 10px 18px; background: #f9fafb; color: #6b7280;
  border: 1px solid #e5e7eb; border-bottom: none;
  border-radius: 6px 6px 0 0; font-weight: 500;
  text-decoration: none;
}
.tabs .tab:hover { background: #f3f4f6; color: #111827; text-decoration: none; }
.tabs .tab.active {
  background: #fff; color: #2563eb; border-color: #e5e7eb;
  border-bottom: 2px solid #fff; margin-bottom: -2px;
  font-weight: 600;
}
.tab-content { background: #fff; padding: 16px; border: 1px solid #e5e7eb; border-top: none; border-radius: 0 0 8px 8px; }

/* 카드 그리드 (회원 상세 요약) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.cards .card {
  background: #fff; padding: 14px; border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04); border: 1px solid #e5e7eb;
}
.card .card-label { color: #6b7280; font-size: 11px; margin-bottom: 4px; }
.card .card-value { font-size: 18px; font-weight: 700; color: #111827; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card {
  background: #fff; padding: 16px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 16px;
}

/* 서브 툴바 */
.sub-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding: 8px 0;
}

/* 일괄 작업 바 */
.bulk-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.bulk-bar label { margin: 0; font-weight: normal; }

/* 행 상태 */
.row-ok       { color: #059669 !important; font-weight: 600; }
.row-fail     { color: #dc2626 !important; }
.row-unchanged { color: #9ca3af; background: #f9fafb; }

/* 경고 알림 */
.alert-warning {
  background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
  padding: 12px 16px; border-radius: 6px; margin-bottom: 16px;
}

/* 폼 그리드 */
.form-grid {
  background: #fff; padding: 20px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.form-grid fieldset {
  border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 16px; margin-bottom: 16px;
}
.form-grid legend {
  padding: 0 8px; font-weight: 600; color: #374151;
}
.form-grid label {
  display: block; font-weight: 500; color: #374151;
  margin: 10px 0 4px;
}
.form-grid input[type=text], .form-grid input[type=email],
.form-grid input[type=password], .form-grid input[type=number],
.form-grid input[type=date], .form-grid select, .form-grid textarea {
  width: 100%; max-width: 480px;
  padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 4px;
  font-size: 14px;
}
.form-grid input[readonly] { background: #f9fafb; color: #6b7280; }
.form-actions {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid #e5e7eb;
  display: flex; gap: 8px;
}

/* 테이블 상세 */
.detail-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.detail-table th, .detail-table td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}
.detail-table th { background: #f9fafb; width: 140px; color: #374151; font-weight: 600; }
.detail-table pre {
  margin: 0; padding: 8px; background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 4px; font-size: 12px; max-height: 300px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
}

/* API 로그 목록 전용 */
.list-table { width: 100%; border-collapse: collapse; background: #fff; }
.list-table th, .list-table td { padding: 8px 10px; border-bottom: 1px solid #e5e7eb; font-size: 13px; }
.list-table th { background: #f9fafb; text-align: left; }
.list-table tr.row-fail td { background: #fef2f2; }
.list-table .url-cell { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-table .empty { text-align: center; color: #9ca3af; padding: 30px; }

/* 페이지네이션 */
.pagination { display: flex; gap: 4px; margin-top: 16px; justify-content: center; }
.pagination a, .pagination span {
  padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 4px;
  background: #fff; color: #374151; text-decoration: none;
}
.pagination .current { background: #2563eb; color: #fff; border-color: #2563eb; }

/* 기타 */
.msg-err { color: #dc2626; padding: 12px; background: #fef2f2; border-radius: 4px; }
.btn-link {
  display: inline-block; padding: 4px 10px;
  background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb;
  border-radius: 4px; text-decoration: none; font-size: 12px;
}
.btn-link:hover { background: #e5e7eb; text-decoration: none; }

/* Grid 2 col */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid input, .form-grid select, .form-grid textarea { max-width: 100%; }
}
