/* 싸빠맛 데이터 자동화 - 스타일 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans KR", sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 540px;
  margin: 0 auto;
  padding: 24px 16px;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 14px;
  color: #888;
}

/* ── 탭 네비게이션 ── */
.tabs {
  display: flex;
  gap: 4px;
  background: #e5e7eb;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: white;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab:hover:not(.active) {
  color: #333;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ── 매출정산 바로가기 링크 ── */
.quick-links {
  background: white;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e5e7eb;
}

.quick-links-title {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  margin-bottom: 10px;
  text-align: center;
}

.link-buttons {
  display: flex;
  gap: 10px;
}

.link-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
}

.link-btn:hover {
  transform: translateY(-1px);
}

.baemin-link {
  background: #f0faf5;
  border: 1px solid #c6f0d8;
}

.baemin-link:hover {
  background: #e0f5ec;
}

.coupang-link {
  background: #f5f0fa;
  border: 1px solid #d8c6f0;
}

.coupang-link:hover {
  background: #ece0f5;
}

.link-label {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 2px;
}

.baemin-link .link-label { color: #1b9e5c; }
.coupang-link .link-label { color: #7b3fe4; }

.toss-link {
  background: #f0f5fa;
  border: 1px solid #c6d8f0;
}

.toss-link:hover {
  background: #e0ecf5;
}

.toss-link .link-label { color: #1a56db; }

.link-sub {
  font-size: 12px;
  color: #999;
}

.divider {
  height: 1px;
  background: #e5e7eb;
  margin: 20px 0;
}

/* ── 정보 박스 ── */
.info-box {
  background: #f0f7ff;
  border: 1px solid #c6d8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.info-box p {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}

.info-box .hint {
  color: #999;
  font-size: 12px;
  margin-top: 4px;
}

/* ── 폼 ── */
.form-group {
  margin-bottom: 24px;
}

.form-group > label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

/* 플랫폼 선택 */
.platform-buttons {
  display: flex;
  gap: 12px;
}

.platform-btn {
  flex: 1;
  cursor: pointer;
}

.platform-btn input[type="radio"] {
  display: none;
}

.platform-btn span {
  display: block;
  text-align: center;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  background: white;
  transition: all 0.2s;
}

.platform-btn input:checked + span {
  border-color: #2563eb;
  background: #eff6ff;
  color: #2563eb;
}

.platform-btn span:hover {
  border-color: #93c5fd;
}

/* 파일 업로드 영역 */
.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #2563eb;
  background: #f8faff;
}

.drop-icon {
  font-size: 36px;
  color: #aaa;
  margin-bottom: 8px;
}

.drop-zone-text p {
  color: #888;
  font-size: 14px;
  margin-bottom: 4px;
}

.hint {
  font-size: 12px !important;
  color: #bbb !important;
}

.file-name {
  display: none;
  font-size: 16px;
  font-weight: 600;
  color: #2563eb;
  word-break: break-all;
}

/* ── 텍스트 입력 ── */
.text-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 2px solid #ddd;
  border-radius: 12px;
  background: white;
  color: #333;
  transition: border-color 0.2s;
  margin-bottom: 4px;
}

.text-input:focus {
  outline: none;
  border-color: #2563eb;
}

.text-input::placeholder {
  color: #bbb;
}

/* ── 버튼 ── */
button[type="submit"],
.action-btn {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  color: white;
  background: #2563eb;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

button[type="submit"]:hover:not(:disabled),
.action-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

button[type="submit"]:disabled,
.action-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.action-btn {
  background: #059669;
}

.action-btn:hover:not(:disabled) {
  background: #047857;
}

/* ── 결과 ── */
.result {
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
}

.result.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.result.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.result-icon {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 8px;
}

.success .result-icon {
  color: #16a34a;
}

.error .result-icon {
  color: #dc2626;
}

.result h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.result ul {
  list-style: none;
  text-align: left;
}

.result li {
  padding: 4px 0;
  font-size: 14px;
  color: #555;
}

.result li::before {
  content: "- ";
  color: #aaa;
}

/* ── 교차검증 요약 ── */
.v-summary {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.v-stat {
  flex: 0 0 auto;
  min-width: 70px;
  padding: 10px 12px;
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  text-align: center;
}

.v-stat .v-num {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #333;
}

.v-stat .v-label {
  display: block;
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.v-stat.match .v-num { color: #16a34a; }
.v-stat.minor .v-num { color: #d97706; }
.v-stat.mismatch .v-num { color: #dc2626; }

.v-avg {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
}

/* ── 교차검증 테이블 ── */
.v-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 13px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.v-table th {
  background: #f8f9fa;
  padding: 10px 8px;
  font-weight: 600;
  color: #555;
  text-align: right;
  border-bottom: 2px solid #e5e7eb;
}

.v-table th:first-child,
.v-table th:nth-child(2) {
  text-align: left;
}

.v-table td {
  padding: 8px;
  text-align: right;
  border-bottom: 1px solid #f0f0f0;
  color: #444;
}

.v-table td:first-child,
.v-table td:nth-child(2) {
  text-align: left;
}

.v-table tr.match td { background: #f0fdf4; }
.v-table tr.minor td { background: #fffbeb; }
.v-table tr.mismatch td { background: #fef2f2; }

.status-cell {
  font-weight: 800;
  text-align: center !important;
}

.status-cell.match { color: #16a34a; }
.status-cell.minor { color: #d97706; }
.status-cell.mismatch { color: #dc2626; }

td.match { color: #16a34a; font-weight: 600; }
td.minor { color: #d97706; font-weight: 600; }
td.mismatch { color: #dc2626; font-weight: 600; }

/* ── 로딩 ── */
.loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}

/* ── 반응형 ── */
@media (max-width: 400px) {
  .v-summary {
    gap: 6px;
  }
  .v-stat {
    min-width: 56px;
    padding: 8px 6px;
  }
  .v-stat .v-num {
    font-size: 18px;
  }
  .v-table {
    font-size: 11px;
  }
  .v-table th,
  .v-table td {
    padding: 6px 4px;
  }
}
