/* Claims Page Styles — mia claim.html에서 추출 */
/* CSS 클래스 변경 금지 */

.claims-layout {
  flex: 1;
  overflow: hidden;
  display: flex;
  height: 100%;
}

/* Left Panel */
.claim-left-panel {
  width: 280px; min-width: 280px; background: #fff;
  border-right: 1px solid var(--tint); display: flex; flex-direction: column;
}

.clp-search {
  padding: 12px; border-bottom: 1px solid var(--tint);
}
.clp-search input {
  width: 100%; padding: 8px 12px 8px 32px; border: 1px solid var(--tint);
  border-radius: 6px; font-size: 0.8125rem; color: var(--brand); outline: none;
  background: var(--background) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%239CA1B4' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 10px center;
}
.clp-search input:focus { border-color: #3B82F6; }

/* Stats bar */
.clp-stats-bar {
  display: flex; padding: 8px 12px; gap: 4px; border-bottom: 1px solid var(--tint);
}
.clp-stat-item {
  flex: 1; text-align: center; padding: 6px 4px; border-radius: 6px;
  font-size: 0.625rem; font-weight: 600;
}
.clp-stat-item .stat-count { font-size: 1rem; font-weight: 800; display: block; }
.stat-receipt { background: rgba(249,158,11,0.08); color: #B45309; }
.stat-process { background: rgba(59,130,246,0.08); color: #1E40AF; }
.stat-complete { background: rgba(34,197,94,0.08); color: #15803D; }
.stat-total { background: var(--bg-light); color: var(--brand); }

/* Status tabs */
.clp-status-tabs {
  display: flex; padding: 0 12px; border-bottom: 1px solid var(--tint);
}
.clp-status-tab {
  flex: 1; padding: 8px 0; text-align: center; font-size: 0.75rem; font-weight: 600;
  color: var(--tertiary); cursor: pointer; border-bottom: 2px solid transparent;
  background: none; border-top: none; border-left: none; border-right: none; transition: all 0.2s;
}
.clp-status-tab:hover { color: var(--brand); }
.clp-status-tab.active { color: #3B82F6; border-bottom-color: #3B82F6; }

/* Claim cards */
.clp-list { flex: 1; overflow-y: auto; }
.clp-card {
  padding: 12px; border-bottom: 1px solid var(--tint); cursor: pointer;
  border-left: 3px solid transparent; transition: all 0.2s;
}
.clp-card:hover { background: var(--bg-light); }
.clp-card.selected { background: rgba(59,130,246,0.06); border-left-color: #3B82F6; }
.clp-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.clp-card-id { font-size: 0.8125rem; font-weight: 700; color: var(--brand); }
.clp-card-badge {
  display: inline-block; padding: 1px 8px; border-radius: 4px;
  font-size: 0.625rem; font-weight: 700;
}
.clp-card-badge.receipt { background: rgba(249,158,11,0.1); color: #B45309; }
.clp-card-badge.process { background: rgba(59,130,246,0.1); color: #1E40AF; }
.clp-card-badge.complete { background: rgba(34,197,94,0.1); color: #15803D; }
.clp-card-sub { font-size: 0.6875rem; color: var(--light); margin-bottom: 2px; }
.clp-card-summary {
  font-size: 0.75rem; color: var(--tertiary); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.clp-card-date { font-size: 0.625rem; color: var(--light); margin-top: 4px; }

/* Add button */
.clp-add-btn {
  margin: 12px; padding: 9px 0; background: var(--brand); color: #fff;
  border: none; border-radius: 6px; font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s; text-decoration: none; text-align: center; display: block;
}
.clp-add-btn:hover { opacity: 0.85; }
.clp-icon-gap { margin-right: 4px; }

/* Right Panel */
.claim-right-panel {
  flex: 1; min-width: 0; background: var(--background);
  display: flex; flex-direction: column; overflow: hidden;
}
.claim-right-panel > turbo-frame {
  display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
}
.claim-right-panel > turbo-frame > [data-controller="detail-tab"] {
  display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
}

/* Tab bar */
.crp-tab-bar { display: flex; background: #fff; border-bottom: 1px solid var(--tint); padding: 0 20px; }
.crp-tab {
  padding: 10px 16px; font-size: 0.8125rem; font-weight: 600; color: var(--tertiary);
  cursor: pointer; border-bottom: 2px solid transparent; background: none;
  border-top: none; border-left: none; border-right: none; transition: all 0.2s;
}
.crp-tab:hover { color: var(--brand); }
.crp-tab.active { color: #3B82F6; border-bottom-color: #3B82F6; }

/* Detail body */
.crp-body { flex: 1; overflow-y: auto; padding: 20px; }
.crp-detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.claim-number { font-size: 1.125rem; font-weight: 700; color: var(--brand); }
.crp-badge {
  display: inline-block; padding: 2px 10px; border-radius: 4px;
  font-size: 0.6875rem; font-weight: 700;
}
.crp-badge.receipt { background: rgba(249,158,11,0.1); color: #B45309; }
.crp-badge.assigned { background: rgba(124,58,237,0.1); color: #5B21B6; }
.crp-badge.process { background: rgba(59,130,246,0.1); color: #1E40AF; }
.crp-badge.complete { background: rgba(34,197,94,0.1); color: #15803D; }
.crp-date { font-size: 0.75rem; color: var(--light); margin-left: auto; }

/* Info */
.crp-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.crp-info-card { padding: 10px; background: white; border-radius: 6px; border: 1px solid var(--tint); }
.crp-info-label { font-size: 0.6875rem; font-weight: 600; color: var(--light); margin-bottom: 2px; }
.crp-info-value { font-size: 0.8125rem; font-weight: 500; color: var(--brand); }

/* Content */
.crp-content-card {
  background: white; border-radius: 8px; border: 1px solid var(--tint);
  padding: 16px; margin-bottom: 16px;
}
.crp-section-title {
  font-size: 0.75rem; font-weight: 700; color: var(--tertiary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.crp-content-text { font-size: 0.8125rem; color: var(--brand); line-height: 1.6; }

/* History */
.crp-history-item {
  position: relative; padding-left: 24px; padding-bottom: 16px;
  border-left: 2px solid var(--tint); margin-left: 8px;
}
.crp-history-dot {
  position: absolute; left: -6px; top: 2px; width: 10px; height: 10px;
  border-radius: 50%; background: #3B82F6; border: 2px solid white;
}
.crp-history-title { font-size: 0.8125rem; font-weight: 600; color: var(--brand); }
.crp-history-desc { font-size: 0.75rem; color: var(--tertiary); margin-top: 2px; }
.crp-history-date { font-size: 0.625rem; color: var(--light); margin-top: 2px; }

/* SMS badge */
.sms-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 0.5625rem; font-weight: 700; background: rgba(34,197,94,0.1);
  color: #15803D; margin-left: 6px;
}

/* Actions */
.crp-actions { display: flex; gap: 8px; margin-top: 20px; }
.crp-btn {
  padding: 8px 16px; border-radius: 6px; font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; border: none;
}
.crp-btn-primary { background: #3B82F6; color: white; }
.crp-btn-primary:hover { opacity: 0.85; }
.crp-btn-secondary { background: white; color: var(--tertiary); border: 1px solid var(--tint); }
.crp-btn-secondary:hover { border-color: var(--brand); }

/* Order link */
.crp-order-link { color: #3B82F6; text-decoration: none; font-weight: 600; }
.crp-order-link:hover { text-decoration: underline; }

/* Memo */
.crp-memo-textarea {
  width: 100%; min-height: 60px; padding: 10px; border: 1px solid var(--tint);
  border-radius: 6px; font-size: 0.8125rem; color: var(--brand); outline: none;
  font-family: inherit; resize: vertical;
}
.crp-memo-textarea:focus { border-color: #3B82F6; }

/* Danger button */
.crp-btn-danger {
  background: white; color: #EF4444; border: 1px solid #FCA5A5;
  padding: 8px 16px; border-radius: 6px; font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.crp-btn-danger:hover { background: #FEF2F2; border-color: #EF4444; }

/* Assignee section */
.crp-assignee-row { display: flex; gap: 8px; margin-top: 6px; }
.crp-assignee-select {
  flex: 1; padding: 8px 10px; border: 1px solid var(--tint); border-radius: 6px;
  font-size: 0.8125rem; color: var(--brand); outline: none; font-family: inherit;
}
.crp-assignee-btn {
  padding: 8px 14px; background: #7C3AED; color: white; border: none; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.crp-assignee-btn:hover { opacity: 0.85; }
.crp-assignee-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.crp-assignee-hint {
  font-size: 0.625rem; color: var(--light); margin-top: 6px; font-style: italic;
}
.crp-status-row { display: flex; gap: 8px; margin-top: 6px; }

/* Timeline */
.crp-timeline { padding: 8px 0; }
.crp-timeline-empty { padding: 24px; text-align: center; color: var(--light); font-size: 0.8125rem; }

/* Form styles */
.crp-form-errors {
  color: #EF4444; font-size: 0.8125rem; margin-bottom: 16px;
  padding: 8px 12px; background: #FEF2F2; border-radius: 6px;
}
.crp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.crp-form-field {}
.crp-form-section { margin-bottom: 16px; }
.crp-form-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--tint); border-radius: 6px;
  font-size: 0.8125rem; color: var(--brand); outline: none; font-family: inherit;
  margin-top: 4px;
}
.crp-form-input:focus { border-color: #3B82F6; }
.crp-required { color: #EF4444; }

/* Claim type chips */
.crp-chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.crp-chip {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--tint);
  font-size: 0.75rem; font-weight: 600; color: var(--tertiary); cursor: pointer;
  transition: all 0.2s; background: white;
}
.crp-chip:hover { border-color: var(--brand); color: var(--brand); }
.crp-chip:has(input:checked) { background: var(--brand); color: white; border-color: var(--brand); }

/* Card link */
.clp-card-link { text-decoration: none; color: inherit; display: block; }

/* Empty state */
.clp-empty { padding: 24px; text-align: center; color: var(--light); font-size: 0.8125rem; }

/* ── 담당자 배정 폼 (신규) ── */
.crp-assignee-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.crp-assignee-field { display: flex; flex-direction: column; gap: 4px; }
.crp-field-label { font-size: 0.6875rem; font-weight: 600; color: var(--light); }
.crp-field-input {
  padding: 8px 10px; border: 1px solid var(--tint); border-radius: 6px;
  font-size: 0.8125rem; color: var(--brand); outline: none; font-family: inherit;
}
.crp-field-input:focus { border-color: #7C3AED; }
.crp-sms-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 100px;
  background: rgba(34,197,94,0.1); color: #15803D;
  font-size: 0.75rem; font-weight: 700;
}

/* ── 처리이력 타임라인 (신규) ── */
.crp-timeline-item {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--tint);
}
.crp-timeline-item:last-child { border-bottom: none; }
.crp-timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
  background: #9CA3AF;
}
.crp-timeline-dot--claim-created   { background: #3B82F6; }
.crp-timeline-dot--status-changed  { background: #7C3AED; }
.crp-timeline-dot--claim-updated   { background: #F59E0B; }
.crp-timeline-dot--assigned        { background: #10B981; }
.crp-timeline-dot--completed       { background: #22C55E; }
.crp-timeline-body  { flex: 1; }
.crp-timeline-event { font-size: 0.8125rem; font-weight: 600; color: var(--brand); }
.crp-timeline-detail { font-size: 0.75rem; color: var(--tertiary); margin-top: 2px; }
.crp-timeline-time  { font-size: 0.6875rem; color: var(--light); margin-top: 4px; }
.crp-timeline-empty { font-size: 0.875rem; color: var(--light); text-align: center; padding: 1.5rem 0; }

/* --- 원본 수주 링크 --- */
.crp-source-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  color: #2563EB;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.crp-source-link:hover { background: rgba(59, 130, 246, 0.12); }
.crp-source-partner { color: var(--tertiary, #6B7285); font-weight: 400; }
.crp-source-date    { margin-left: auto; font-size: 0.75rem; color: var(--light, #9CA1B4); font-weight: 400; }

/* ── 상단 통계 바 (WEB-17) ── */
.crp-page-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.crp-stats-bar {
  display: flex;
  gap: 12px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid var(--tint);
  flex-shrink: 0;
}
.crp-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 16px;
  border-radius: 8px;
  background: var(--bg-light);
  min-width: 64px;
}
.crp-stat-num {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--brand);
}
.crp-stat-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--light);
  margin-top: 2px;
}
.crp-stat-receipt { background: rgba(249,158,11,0.08); }
.crp-stat-receipt .crp-stat-num { color: #B45309; }
.crp-stat-receipt .crp-stat-label { color: #B45309; }
.crp-stat-progress { background: rgba(59,130,246,0.08); }
.crp-stat-progress .crp-stat-num { color: #1E40AF; }
.crp-stat-progress .crp-stat-label { color: #1E40AF; }
.crp-stat-complete { background: rgba(34,197,94,0.08); }
.crp-stat-complete .crp-stat-num { color: #15803D; }
.crp-stat-complete .crp-stat-label { color: #15803D; }
.crp-stat-month { background: rgba(124,58,237,0.08); }
.crp-stat-month .crp-stat-num { color: #5B21B6; }
.crp-stat-month .crp-stat-label { color: #5B21B6; }

/* ── 사진 탭 (WEB-17) ── */
.crp-photo-upload-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.crp-photo-dropzone {
  position: relative;
  border: 2px dashed var(--tint);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.crp-photo-dropzone:hover,
.crp-photo-dropzone.dragover { border-color: #3B82F6; background: rgba(59,130,246,0.04); }
.crp-photo-upload-icon { font-size: 2rem; color: var(--light); margin-bottom: 8px; }
.crp-photo-upload-label { font-size: 0.875rem; font-weight: 600; color: var(--secondary); }
.crp-photo-upload-hint  { font-size: 0.75rem; color: var(--light); margin-top: 4px; }
.crp-photo-file-input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.crp-photo-submit-btn { align-self: flex-end; }
.crp-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.crp-photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--tint);
  background: var(--bg-light);
}
.crp-photo-thumb {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
}
.crp-photo-name {
  font-size: 0.65rem; color: var(--light); padding: 4px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crp-photo-delete-btn {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; padding: 0;
  background: rgba(239,68,68,0.85); color: white;
  border: none; border-radius: 4px;
  font-size: 0.7rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.crp-photo-delete-btn:hover { background: #DC2626; }
.crp-photo-empty { text-align: center; color: var(--light); padding: 24px 0; font-size: 0.875rem; }

/* --- 폼 유틸리티 (Rule 17: 인라인 style 대체) --- */
.crp-icon-warn { color: #F59E0B; margin-right: 4px; }

/* --- 메모 --- */
.crp-memo-textarea {
  width: 100%; min-height: 60px; padding: 8px 10px;
  border: 1px solid var(--tint, #CDD0D9); border-radius: 6px;
  font-size: 0.8125rem; font-family: inherit; outline: none; resize: vertical;
}
.crp-memo-textarea:focus { border-color: #3B82F6; }
.crp-memo-save-btn { margin-top: 8px; }

/* --- 사진 카운트 --- */
.crp-photo-count {
  text-align: right; font-size: 0.8rem; color: var(--light);
  font-weight: 600; margin-bottom: 8px;
}
