/* Fireplan - 소방설비 자재 산출 시스템 스타일시트 */
/* 폰트: Noto Sans KR, 포인트 컬러: #CC0000 */

/* ===== CSS 변수 ===== */
:root {
  --color-primary: #CC0000;
  --color-primary-dark: #990000;
  --color-primary-light: #FF3333;
  --color-bg: #f5f5f5;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-border: #e0e0e0;
  --color-success: #28a745;
  --color-warning: #e69500;
  --color-warning-bg: #fff3cd;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --radius: 8px;
  --transition: 0.2s ease;
}

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

/* ===== 기본 스타일 ===== */
body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ===== 헤더 ===== */
.header {
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__brand {
  display: flex;
  flex-direction: column;
}

.header__logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.header__subtitle {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
  font-weight: 400;
}

.header__back {
  color: #ffffff;
  font-size: 13px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity var(--transition);
  text-decoration: none;
}

.header__back:hover {
  opacity: 1;
}

/* ===== 컨테이너 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ===== 카드 ===== */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 24px;
  margin-bottom: 20px;
}

/* ===== 섹션 제목 ===== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.section-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  line-height: 1.7;
}

/* ===== 업로드 존 ===== */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
  margin-bottom: 16px;
}

.upload-zone:hover {
  border-color: var(--color-primary);
  background-color: #fef9f9;
}

.upload-zone.drag-over {
  border-color: var(--color-primary);
  background-color: #fef0f0;
  border-style: solid;
}

.upload-zone__icon {
  font-size: 48px;
  color: var(--color-primary);
  margin-bottom: 12px;
  display: block;
  line-height: 1;
}

.upload-zone__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

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

/* ===== 선택된 파일 정보 ===== */
.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: #f0f9f0;
  border: 1px solid #c3e6c3;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.file-info__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.file-info__detail {
  flex: 1;
  min-width: 0;
}

.file-info__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-info__size {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.file-info__remove {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--color-primary);
  padding: 4px 6px;
  border-radius: 4px;
  transition: background-color var(--transition);
  font-family: inherit;
}

.file-info__remove:hover {
  background-color: #fef0f0;
}

/* ===== 프로그레스 바 ===== */
.progress-wrap {
  margin-bottom: 16px;
}

.progress-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.progress-wrap.is-active .progress-label::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.34);
  animation: uploadStatusPulse 1.15s ease-out infinite;
}

.progress-bar {
  height: 8px;
  background-color: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar__fill {
  height: 100%;
  background-color: var(--color-primary);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}

.progress-wrap.is-active .progress-bar__fill {
  background-image: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.42) 45%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 240px 100%;
  animation: uploadBarSweep 1s linear infinite;
}

.btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: uploadSpin 0.72s linear infinite;
}

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

@keyframes uploadStatusPulse {
  70% {
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

@keyframes uploadBarSweep {
  from {
    background-position: 240px 0;
  }
  to {
    background-position: 0 0;
  }
}

/* ===== 버튼 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
  white-space: nowrap;
  line-height: 1;
}

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

.btn.is-uploading:disabled {
  opacity: 1;
}

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

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

.btn--outline {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

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

.btn--success {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: #ffffff;
}

.btn--success:not(:disabled):hover {
  background-color: #218838;
  border-color: #218838;
}

.btn--danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #ffffff;
}

.btn--danger:not(:disabled):hover {
  background-color: #c82333;
  border-color: #c82333;
}

/* ===== 버튼 그룹 ===== */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.btn-group:last-child {
  margin-bottom: 0;
}

/* ===== 에러 메시지 ===== */
.error-msg {
  background-color: #fdf0f0;
  border: 1px solid #f5c6cb;
  border-left: 4px solid var(--color-primary);
  color: #721c24;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ===== 결과 요약 카드 ===== */
.summary-card {
  margin-bottom: 20px;
}

.summary-card .card-title {
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-bottom: 4px;
}

.summary-card .file-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 20px;
  word-break: break-all;
}

.summary-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-block {
  flex: 1;
  min-width: 120px;
  padding: 16px;
  background-color: var(--color-bg);
  border-radius: var(--radius);
  text-align: center;
}

.stat__value {
  font-size: 32px;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  display: block;
}

.stat__value--warn {
  color: var(--color-warning);
}

.stat__label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
  display: block;
}

/* ===== 결과 테이블 ===== */
.result-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 8px;
}

.result-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  min-width: 540px;
}

.result-table th {
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  font-size: 12px;
}

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

.result-table tr:nth-child(even) td {
  background-color: #fafafa;
}

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

.td-name {
  font-weight: 500;
  color: var(--color-text);
}

.td-sub .td-name {
  padding-left: 20px;
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 12px;
}

.td-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 500;
}

/* 카테고리 구분 행 */
.category-row td {
  background-color: #fef0f0;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 12px;
  padding: 7px 12px;
  letter-spacing: 0.3px;
}

/* 소계 행 */
.subtotal-row td {
  background-color: #f9f9f9;
  color: var(--color-text-muted);
  font-size: 12px;
  font-style: italic;
  text-align: right;
  padding: 6px 12px;
}

/* ===== 미확인 블록 섹션 ===== */
.unknown-section {
  border: 2px solid var(--color-warning);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.unknown-section__header {
  background-color: var(--color-warning-bg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #856404;
}

.unknown-section__body {
  padding: 0;
}

/* ===== 뱃지 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.badge--danger {
  background-color: var(--color-primary);
  color: #ffffff;
}

.badge--warning {
  background-color: var(--color-warning);
  color: #ffffff;
}

.badge--muted {
  background-color: var(--color-border);
  color: var(--color-text-muted);
}

/* ===== 로딩 스피너 ===== */
.loading-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

/* ===== 푸터 ===== */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--color-text-muted);
  font-size: 12px;
  border-top: 1px solid var(--color-border);
  margin-top: 24px;
}

/* ===== 커스텀 모달 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 32px 28px;
  max-width: 360px;
  width: calc(100% - 48px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.modal-icon {
  font-size: 40px;
  margin-bottom: 12px;
  line-height: 1;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.modal-message {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

.modal-filename {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 24px;
  word-break: break-all;
}

.modal-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ===== 유틸리티 ===== */
.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }

/* ===== 반응형: 태블릿 이하 ===== */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }

  .header__logo {
    font-size: 18px;
  }

  .card {
    padding: 20px 16px;
  }

  .container {
    padding: 16px 12px;
  }

  .upload-zone {
    padding: 36px 16px;
  }

  .summary-stats {
    gap: 10px;
  }

  .stat__value {
    font-size: 26px;
  }

  .btn {
    padding: 9px 16px;
    font-size: 13px;
  }
}

/* ===== 반응형: 모바일 ===== */
@media (max-width: 480px) {
  .header {
    padding: 10px 12px;
  }

  .header__logo {
    font-size: 16px;
  }

  .header__subtitle {
    display: none;
  }

  .card {
    padding: 16px 12px;
    border-radius: 6px;
  }

  .upload-zone {
    padding: 28px 12px;
  }

  .upload-zone__icon {
    font-size: 36px;
  }

  .summary-stats {
    flex-direction: column;
  }

  .stat-block {
    min-width: unset;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 12px;
  }

  .stat__value {
    font-size: 22px;
    order: 2;
  }

  .stat__label {
    margin-top: 0;
    order: 1;
    font-size: 13px;
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

/* ===== Fireplan SaaS home ===== */
.home-page {
  --color-primary: #dc2626;
  --color-primary-dark: #b91c1c;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.08);
  font-family: 'Noto Sans KR', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 48%, #ffffff 100%);
  color: var(--color-text);
}

.home-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(14px);
}

.home-header__inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-logo {
  height: 42px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.home-brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.home-brand__text strong {
  font-size: 18px;
  font-weight: 900;
  color: #111827;
  line-height: 1.1;
}

.home-brand__text span {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
}

.home-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.home-history-link {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  background: #ffffff;
  transition: border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.home-history-link:hover {
  color: var(--color-primary);
  border-color: #fecaca;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.home-user-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.home-login-status {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.home-login-status strong {
  color: #dc2626;
}

.home-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 28px 56px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 500px);
  gap: 56px;
  align-items: center;
}

.home-hero__copy {
  max-width: 590px;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fef2f2;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 22px;
}

.home-hero h1 {
  font-size: 54px;
  line-height: 1.14;
  font-weight: 900;
  color: #111827;
  letter-spacing: 0;
  margin-bottom: 22px;
}

.home-hero h1 span {
  color: var(--color-primary);
}

.home-hero__desc {
  max-width: 520px;
  font-size: 18px;
  line-height: 1.75;
  color: #4b5563;
  margin-bottom: 18px;
}

.home-hero__meta {
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
}

.upload-card {
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.12);
}

.upload-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.upload-card__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.upload-card h2 {
  font-size: 22px;
  line-height: 1.3;
  color: #111827;
  font-weight: 900;
}

.upload-card__badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid var(--color-border);
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.home-page .upload-zone {
  min-height: 240px;
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  padding: 38px 24px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.home-page .upload-zone:hover,
.home-page .upload-zone.drag-over {
  border-color: var(--color-primary);
  background: #fff7f7;
}

.home-page .upload-zone.is-uploading {
  border-color: #ef4444;
  background: linear-gradient(180deg, #fff7f7 0%, #ffffff 100%);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.12), 0 12px 34px rgba(220, 38, 38, 0.08);
  animation: uploadZoneGlow 1.35s ease-in-out infinite alternate;
}

.home-page .upload-zone.is-uploading .upload-zone__icon {
  animation: uploadIconFloat 1.15s ease-in-out infinite;
}

.home-page .upload-zone__icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fee2e2;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}

.home-page .upload-zone__title {
  max-width: 340px;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 800;
  color: #111827;
}

.home-page .upload-zone__desc {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}

.home-page .file-info {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-radius: 14px;
}

.home-page .file-info.is-uploading {
  background: #fff7ed;
  border-color: #fed7aa;
}

.home-page .file-info__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dcfce7;
  color: #047857;
  font-size: 10px;
  font-weight: 900;
}

.home-page .btn {
  min-height: 46px;
  border-radius: 12px;
}

.home-page .btn--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 14px 28px rgba(220, 38, 38, 0.22);
}

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

.home-page .btn--outline {
  background: #ffffff;
  border-color: var(--color-border);
  color: #374151;
}

.home-page .btn--outline:not(:disabled):hover {
  border-color: #fecaca;
  color: var(--color-primary);
}

.upload-card__actions {
  margin-bottom: 18px;
}

.upload-card__actions .btn {
  width: 100%;
}

.home-page .progress-bar {
  background: #e5e7eb;
}

.home-page .progress-bar__fill {
  background: var(--color-primary);
}

@keyframes uploadZoneGlow {
  from {
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.12), 0 12px 34px rgba(220, 38, 38, 0.08);
  }
  to {
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.2), 0 18px 42px rgba(220, 38, 38, 0.15);
  }
}

@keyframes uploadIconFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.feature-panel {
  margin-top: 34px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 70px 16px 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  box-shadow: 0 20px 54px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.feature-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 9% 0%, rgba(220, 38, 38, 0.07), transparent 30%),
    radial-gradient(circle at 91% 10%, rgba(14, 165, 233, 0.08), transparent 32%);
}

.feature-panel__header {
  position: absolute;
  top: 20px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.feature-panel__eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.feature-panel__header h2 {
  color: #111827;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
  text-align: right;
}

.feature-track {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 102px;
  height: 2px;
  background: linear-gradient(90deg, #fecaca, #bfdbfe, #99f6e4, #fed7aa);
  opacity: 0.9;
  pointer-events: none;
}

.feature-item {
  position: relative;
  z-index: 1;
  min-height: 190px;
  padding: 24px 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.feature-item:hover {
  transform: translateY(-3px);
  border-color: #fecaca;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 20px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.feature-icon--red {
  background: #fee2e2;
  color: #dc2626;
}

.feature-icon--blue {
  background: #dbeafe;
  color: #2563eb;
}

.feature-icon--mint {
  background: #ccfbf1;
  color: #0f766e;
}

.feature-icon--orange {
  background: #ffedd5;
  color: #ea580c;
}

.feature-item h3 {
  font-size: 18px;
  line-height: 1.35;
  color: #111827;
  font-weight: 900;
  margin-bottom: 12px;
}

.feature-item p {
  font-size: 14.5px;
  line-height: 1.75;
  color: #4b5563;
  word-break: keep-all;
}

.recent-panel {
  margin-top: 28px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.05);
  display: block;
}

.recent-panel__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.recent-panel h2 {
  font-size: 20px;
  font-weight: 900;
  color: #111827;
  margin-bottom: 8px;
}

.recent-panel p {
  font-size: 14px;
  line-height: 1.7;
  color: #6b7280;
}

.home-recent-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.home-recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.home-recent-item:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

.home-recent-file {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.home-recent-file__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  flex: 0 0 auto;
}

.home-recent-file strong {
  display: block;
  max-width: 100%;
  color: #111827;
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recent-file span:not(.home-recent-file__icon) {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
}

.home-recent-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: #6b7280;
  font-size: 13px;
  white-space: nowrap;
}

.home-recent-stats b {
  color: #dc2626;
  font-weight: 900;
}

.home-legacy-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.home-recent-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: #dc2626;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.home-recent-action:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.home-recent-empty {
  padding: 22px;
  border: 1px dashed #e5e7eb;
  border-radius: 16px;
  background: #f9fafb;
}

.home-recent-empty strong {
  display: block;
  color: #111827;
  font-size: 15px;
  font-weight: 900;
}

.home-recent-empty p {
  margin-top: 6px;
}

.home-footer {
  background: #ffffff;
  margin-top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 960px) {
  .home-main {
    padding-top: 48px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .home-hero__copy {
    max-width: 760px;
  }

  .home-hero h1 {
    font-size: 44px;
  }

  .feature-panel {
    grid-template-columns: repeat(2, 1fr);
    padding-top: 94px;
  }

  .feature-panel__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .feature-panel__header h2 {
    text-align: left;
  }

  .feature-track {
    display: none;
  }
}

@media (max-width: 640px) {
  .home-header {
    height: auto;
  }

  .home-header__inner {
    padding: 14px 18px;
    gap: 14px;
  }

  .brand-logo {
    height: 24px;
  }

  .home-user-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .home-brand__text strong {
    font-size: 16px;
  }

  .home-brand__text span {
    display: none;
  }

  .home-history-link {
    height: 36px;
    padding: 0 12px;
  }

  .home-main {
    padding: 34px 18px 36px;
  }

  .home-hero h1 {
    font-size: 34px;
  }

  .home-hero__desc {
    font-size: 16px;
  }

  .upload-card {
    padding: 20px;
    border-radius: 18px;
  }

  .home-page .upload-zone {
    min-height: 210px;
    padding: 30px 16px;
  }

  .feature-panel {
    grid-template-columns: 1fr;
    border-radius: 18px;
    padding: 112px 12px 12px;
  }

  .feature-item {
    min-height: auto;
  }

  .recent-panel {
    align-items: stretch;
    padding: 22px;
    border-radius: 18px;
  }

  .recent-panel__top,
  .home-recent-item,
  .home-recent-stats {
    align-items: stretch;
    flex-direction: column;
  }

  .recent-panel__top {
    display: flex;
  }

  .home-recent-item {
    display: flex;
  }

  .home-recent-stats {
    justify-content: flex-start;
    white-space: normal;
  }

  .recent-panel .btn {
    width: 100%;
  }

  .home-recent-action {
    width: 100%;
  }
}

/* ===== Fireplan SaaS history ===== */
.history-page {
  --color-primary: #dc2626;
  --color-primary-dark: #b91c1c;
  --color-bg: #f9fafb;
  --color-surface: #ffffff;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  font-family: 'Noto Sans KR', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f9fafb;
  color: #111827;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e5e7eb;
  backdrop-filter: blur(14px);
}

.app-header__inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}


.app-brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.app-brand__text strong {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 900;
  color: #111827;
}

.app-brand__text span {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.app-header__button {
  height: 40px;
  padding: 0 16px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  transition: border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.app-header__button:hover {
  color: #dc2626;
  border-color: #fecaca;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.app-user-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.history-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 28px 56px;
}

.history-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
  transition: color var(--transition);
}

.history-back:hover {
  color: #111827;
}

.history-shell {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.07);
}

.history-shell__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.history-title-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.history-title-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 900;
  flex-shrink: 0;
}

.history-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.history-title-row h1 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 900;
  color: #111827;
}

.history-count-badge {
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
}

.history-title-block p {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.7;
}

.history-new-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.18);
  transition: background-color var(--transition), box-shadow var(--transition);
}

.history-new-button:hover {
  background: #b91c1c;
  box-shadow: 0 16px 30px rgba(185, 28, 28, 0.2);
}

.history-content {
  min-height: 120px;
}

.history-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
}

.history-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 14px;
}

.history-table th {
  height: 48px;
  padding: 0 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.history-table td {
  padding: 15px 16px;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  vertical-align: middle;
}

.history-table tbody tr {
  transition: background-color var(--transition);
}

.history-table tbody tr:hover {
  background: #f9fafb;
}

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

.history-col-index,
.history-index {
  width: 60px;
  text-align: center !important;
}

.history-col-date {
  width: 150px;
}

.history-col-count,
.history-mapped,
.history-unknown {
  width: 94px;
  text-align: center !important;
}

.history-col-actions,
.history-actions {
  width: 180px;
  text-align: center !important;
}

.history-index {
  color: #6b7280 !important;
  font-weight: 700;
}

.history-file {
  min-width: 260px;
}

.history-file__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin-right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 10px;
  font-weight: 900;
  vertical-align: middle;
}

.history-file__name {
  color: #111827;
  font-weight: 700;
  word-break: break-all;
  vertical-align: middle;
}

.history-date {
  color: #6b7280 !important;
  white-space: nowrap;
}

.history-mapped {
  color: #dc2626 !important;
  font-weight: 900;
}

.history-unknown {
  color: #374151 !important;
  font-weight: 800;
}

.history-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.history-action {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.history-action--primary {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.history-action--primary:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.history-action--muted {
  background: #f3f4f6;
  border-color: #f3f4f6;
  color: #374151;
}

.history-action--muted:hover {
  background: #e5e7eb;
  border-color: #e5e7eb;
}

.history-empty {
  min-height: 260px;
  border: 1px dashed #d1d5db;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  background: #f9fafb;
}

.history-empty__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 16px;
}

.history-empty strong {
  color: #111827;
  font-size: 16px;
  margin-bottom: 6px;
}

.history-empty p {
  color: #6b7280;
  font-size: 14px;
}

.history-error {
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 14px;
  padding: 16px 18px;
  background: #fef2f2;
  color: #991b1b;
}

.history-error strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.history-error p {
  font-size: 13px;
  color: #991b1b;
}

.history-loading {
  min-height: 220px;
}

.history-footer {
  color: #9ca3af;
  font-size: 13px;
  background: #f9fafb;
  margin-top: 0;
}

@media (max-width: 900px) {
  .history-main {
    padding: 24px 20px 44px;
  }

  .history-shell {
    padding: 26px;
  }

  .history-shell__header {
    align-items: stretch;
    flex-direction: column;
  }

  .history-new-button {
    align-self: flex-start;
  }

  .history-table {
    min-width: 720px;
  }

  .history-col-count,
  .history-mapped,
  .history-unknown {
    width: 82px;
  }
}

@media (max-width: 640px) {
  .app-header {
    height: auto;
  }

  .app-header__inner {
    padding: 14px 18px;
    gap: 14px;
  }

  .app-user-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .app-brand__text strong {
    font-size: 16px;
  }

  .app-brand__text span {
    display: none;
  }

  .app-header__button {
    height: 36px;
    padding: 0 12px;
  }

  .history-main {
    padding: 20px 16px 36px;
  }

  .history-shell {
    padding: 20px;
    border-radius: 18px;
  }

  .history-title-block {
    gap: 12px;
  }

  .history-title-icon {
    width: 40px;
    height: 40px;
  }

  .history-title-row h1 {
    font-size: 22px;
  }

  .history-new-button {
    width: 100%;
  }

  .history-table-wrap {
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
  }

  .history-table,
  .history-table thead,
  .history-table tbody,
  .history-table tr,
  .history-table th,
  .history-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .history-table thead {
    display: none;
  }

  .history-table tr {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  }

  .history-table td {
    border-bottom: 0;
    padding: 9px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: right !important;
  }

  .history-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    flex-shrink: 0;
  }

  .history-file {
    align-items: flex-start !important;
  }

  .history-file .history-file__name {
    max-width: 62%;
    text-align: right;
  }

  .history-file__icon {
    display: none;
  }

  .history-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .history-actions::before {
    margin-bottom: 4px;
  }

  .history-action {
    width: 100%;
  }
}

/* ===== Fireplan SaaS result ===== */
.result-page {
  --color-primary: #dc2626;
  --color-primary-dark: #b91c1c;
  --color-bg: #f9fafb;
  --color-surface: #ffffff;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  font-family: 'Noto Sans KR', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f9fafb;
  color: #111827;
}

.result-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px 56px;
}

.result-summary {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result-file-card,
.result-stat-card,
.result-table-card,
.result-unknown {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.result-file-card {
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-file-card__info {
  flex: 1;
  min-width: 0;
}

.result-file-card__status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 12px;
}

.result-file-card h1 {
  font-size: 24px;
  line-height: 1.35;
  color: #111827;
  font-weight: 900;
  word-break: break-all;
}

.result-file-card__download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.result-file-card__download:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.result-file-card__download:active {
  background: #f3f4f6;
}

.result-file-card__download svg {
  flex-shrink: 0;
}

.result-file-card__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .result-file-card {
    flex-direction: column;
    align-items: stretch;
  }
  .result-file-card__actions {
    flex-direction: column;
  }
  .result-file-card__download {
    justify-content: center;
  }
}

.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.result-stat-card {
  border-radius: 16px;
  padding: 24px;
}

.result-stat-card strong {
  display: block;
  font-size: 32px;
  line-height: 1.1;
  color: #dc2626;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}

.result-stat-card--warn strong {
  color: #111827;
}

.result-stat-card--cost {
  border-top: 3px solid #16a34a;
}

.result-stat-card--cost strong {
  color: #15803d;
}

.result-stat-card span {
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
}

.result-actions {
  margin: 22px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-action-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.result-action-btn--excel {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.16);
}

.result-action-btn--excel:hover {
  background: #15803d;
  border-color: #15803d;
}

.result-action-btn--pdf {
  background: #374151;
  border-color: #374151;
  color: #ffffff;
}

.result-action-btn--pdf:hover {
  background: #111827;
  border-color: #111827;
}

.result-action-btn--dxf {
  background: #0e7490;
  border-color: #0e7490;
  color: #ffffff;
}

.result-action-btn--dxf:hover {
  background: #0c647a;
  border-color: #0c647a;
}

.result-action-btn--outline {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #374151;
}

.result-action-btn--outline:hover {
  border-color: #d1d5db;
  background: #f9fafb;
  color: #111827;
}

.result-table-card {
  border-radius: 16px;
  padding: 22px;
}

.result-table-card__header {
  margin-bottom: 18px;
}

.result-table-card__header h2 {
  color: #111827;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 900;
  margin-bottom: 6px;
}

.result-table-card__header p {
  color: #6b7280;
  font-size: 14px;
}

.result-table-wrap--modern,
.result-table-wrap--unknown {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
}

.result-material-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
}

.result-material-table th {
  height: 48px;
  padding: 0 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.result-material-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  vertical-align: middle;
}

.result-material-table tbody tr:not(.result-section-row) {
  transition: background-color var(--transition);
}

.result-material-table tbody tr:not(.result-section-row):hover {
  background: #f3f4f6;
}

.result-material-table tbody tr:last-child td {
  border-bottom: 0;
}

.result-col-index,
.result-index {
  width: 68px;
  text-align: center !important;
}

.result-col-spec {
  width: 160px;
  white-space: nowrap;
}

.result-col-unit {
  width: 82px;
}

.result-col-qty,
.result-qty {
  width: 100px;
  text-align: right !important;
}

.result-col-price,
.result-price {
  width: 110px;
  text-align: right !important;
  color: #374151;
}

.result-col-total,
.result-total {
  width: 130px;
  text-align: right !important;
  font-weight: 700;
}

.result-subtotal-row td {
  background: #f0fdf4;
  border-top: 1px solid #bbf7d0;
}

.result-subtotal-label {
  text-align: right;
  color: #15803d;
  font-size: 13px;
  padding-right: 12px !important;
}

.result-subtotal-value {
  color: #15803d;
}

.result-grandtotal-row td {
  background: #14532d;
  border-top: 2px solid #16a34a;
}

.result-grandtotal-label {
  text-align: right;
  color: #d1fae5;
  font-size: 14px;
  font-weight: 600;
  padding-right: 12px !important;
}

.result-grandtotal-value {
  color: #ffffff;
  font-size: 16px;
}

.result-index {
  color: #6b7280 !important;
  font-weight: 700;
}

.result-material-name {
  color: #111827 !important;
  font-weight: 800;
}

.result-sub-row .result-material-name {
  color: #6b7280 !important;
  font-weight: 700;
}

.result-qty {
  color: #111827 !important;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.result-section-row td {
  background: #f9fafb;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  padding: 12px 16px;
}

.result-section-row td span {
  display: inline-block;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #dc2626;
  margin-right: 10px;
  vertical-align: -4px;
}

.result-unknown {
  margin-top: 22px;
  border-color: #fecaca;
  border-radius: 16px;
  overflow: hidden;
}

.result-unknown__header {
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #dc2626;
}

.result-unknown__header strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 4px;
}

.result-unknown__header p {
  color: #991b1b;
  font-size: 13px;
}

.result-unknown__header > span {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.result-unknown__body {
  padding: 20px 22px 22px;
  background: #ffffff;
}

.result-unknown-table code {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 7px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-family: Consolas, 'Courier New', monospace;
}

.result-empty {
  min-height: 180px;
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  background: #f9fafb;
  font-weight: 700;
}

.result-error {
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 14px;
  padding: 18px;
  background: #fef2f2;
  color: #991b1b;
}

.result-error strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.result-error p {
  margin-bottom: 14px;
  color: #991b1b;
  font-size: 13px;
}

.result-loading {
  min-height: 220px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
}

.result-footer {
  color: #9ca3af;
  font-size: 13px;
  background: #f9fafb;
  margin-top: 0;
}

@media (max-width: 900px) {
  .result-main {
    padding: 26px 20px 44px;
  }

  .result-material-table {
    min-width: 640px;
  }
}

@media (max-width: 640px) {
  .result-main {
    padding: 20px 16px 36px;
  }

  .result-file-card,
  .result-stat-card,
  .result-table-card {
    border-radius: 16px;
  }

  .result-file-card h1 {
    font-size: 20px;
  }

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

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .result-action-btn {
    width: 100%;
  }

  .result-table-card {
    padding: 18px;
  }

  .result-table-wrap--modern,
  .result-table-wrap--unknown {
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
  }

  .result-material-table,
  .result-material-table thead,
  .result-material-table tbody,
  .result-material-table tr,
  .result-material-table th,
  .result-material-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .result-material-table thead {
    display: none;
  }

  .result-material-table tr:not(.result-section-row) {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  }

  .result-material-table td {
    border-bottom: 0;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: right !important;
  }

  .result-material-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    flex-shrink: 0;
  }

  .result-section-row td {
    display: block;
    border-radius: 12px;
    margin: 16px 0 10px;
    text-align: left !important;
  }

  .result-section-row td::before {
    display: none;
  }

  .result-material-name {
    max-width: 66%;
  }

  .result-unknown__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-unknown__body {
    padding: 18px;
  }
}

/* ===== Fireplan SaaS admin ===== */
.admin-page {
  --color-primary: #dc2626;
  --color-primary-dark: #b91c1c;
  --color-bg: #f9fafb;
  --color-surface: #ffffff;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  font-family: 'Noto Sans KR', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f9fafb;
  color: #111827;
}

.admin-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px 56px;
}

.admin-hero {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.07);
  padding: 30px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.admin-eyebrow {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 14px;
}

.admin-hero h1 {
  font-size: 32px;
  line-height: 1.25;
  font-weight: 900;
  color: #111827;
  margin-bottom: 10px;
}

.admin-hero p,
.admin-hero__meta span {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.7;
}

.admin-hero__meta {
  max-width: 420px;
  padding: 18px;
  border-radius: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.admin-hero__meta strong {
  display: block;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 6px;
}

.admin-tabs {
  position: sticky;
  top: 76px;
  z-index: 50;
  display: flex;
  gap: 8px;
  padding: 12px;
  margin-bottom: 18px;
  background: rgba(249, 250, 251, 0.92);
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  backdrop-filter: blur(12px);
  overflow-x: auto;
}

.admin-tab {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #6b7280;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.admin-tab:hover {
  color: #111827;
  background: #ffffff;
}

.admin-tab.is-active {
  background: #ffffff;
  color: #dc2626;
  border-color: #fecaca;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.admin-panel {
  display: none;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  padding: 26px;
}

.admin-panel.is-active {
  display: block;
}

.admin-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.admin-panel__header h2 {
  font-size: 23px;
  line-height: 1.3;
  color: #111827;
  font-weight: 900;
  margin-bottom: 7px;
}

.admin-panel__header p {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.7;
}

.admin-primary-btn,
.admin-muted-btn {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.admin-primary-btn {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.admin-primary-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.admin-muted-btn {
  background: #f3f4f6;
  border-color: #f3f4f6;
  color: #374151;
}

.admin-muted-btn:hover {
  background: #e5e7eb;
  border-color: #e5e7eb;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f9fafb;
}

.admin-form-grid label,
.admin-field-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #374151;
  font-size: 12px;
  font-weight: 900;
}

.admin-form-grid__wide {
  grid-column: span 2;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-table-tools input,
.admin-edit-table input,
#bulkTextarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 11px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.admin-form-grid input:focus,
.admin-form-grid select:focus,
.admin-table-tools input:focus,
.admin-edit-table input:focus,
#bulkTextarea:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.admin-form-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.admin-table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.admin-table-tools input {
  max-width: 380px;
}

.admin-table-tools span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.admin-company-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.admin-company-toolbar input {
  width: min(420px, 100%);
  min-height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
}

.admin-company-toolbar input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.admin-company-toolbar span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-alert {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 13px;
  font-weight: 900;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
}

.admin-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  height: 48px;
  padding: 0 14px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
}

.admin-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f9fafb;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table code {
  padding: 4px 7px;
  border-radius: 7px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 104px;
  white-space: nowrap;
}

.admin-row-actions button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.admin-row-actions button:hover {
  border-color: #fecaca;
  color: #dc2626;
}

.admin-row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #374151;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.admin-row-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.admin-row-btn--danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.admin-row-btn--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.admin-danger-btn {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.admin-danger-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(6px);
}

.admin-modal {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.2);
  padding: 24px;
}

.admin-modal--small {
  width: min(460px, 100%);
}

.admin-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-modal__header h2 {
  color: #111827;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 900;
  margin-bottom: 6px;
}

.admin-modal__header p {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.7;
}

.admin-modal__close {
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  color: #374151;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.admin-modal__close:hover {
  background: #f3f4f6;
}

.admin-modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #374151;
  font-size: 13px;
  font-weight: 900;
}

.admin-modal-form input,
.admin-modal-form select {
  min-height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 11px;
  background: #ffffff;
  color: #111827;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 11px;
  outline: none;
}

.admin-modal-form input:focus,
.admin-modal-form select:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.admin-modal-form__full,
.admin-modal-actions {
  grid-column: 1 / -1;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* 업체 단가 목록 */
.supplier-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  min-height: 48px;
}

.supplier-list-item {
  display: grid;
  grid-template-columns: 1fr 120px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}

.supplier-list-item:last-child {
  border-bottom: none;
}

.supplier-name {
  font-weight: 700;
  color: #111827;
}

.supplier-price {
  font-weight: 900;
  color: #15803d;
  text-align: right;
}

.supplier-note {
  color: #6b7280;
  font-size: 13px;
}

.supplier-delete-btn {
  background: none;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}

.supplier-delete-btn:hover {
  background: #fee2e2;
}

.supplier-add-form {
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
  margin-top: 4px;
}

.admin-status,
.admin-plan {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-plan {
  background: #eff6ff;
  color: #2563eb;
}

.admin-status.is-active {
  background: #f0fdf4;
  color: #15803d;
}

.admin-status.is-paused {
  background: #f3f4f6;
  color: #4b5563;
}

.admin-status.is-review {
  background: #fff7ed;
  color: #c2410c;
}

.admin-excel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-bottom: 18px;
}

#bulkTextarea {
  min-height: 190px;
  resize: vertical;
  line-height: 1.6;
}

.admin-help {
  margin-top: 8px;
  color: #6b7280;
  font-size: 13px;
}

.admin-upload-box {
  border: 1px dashed #d1d5db;
  border-radius: 18px;
  padding: 22px;
  background: #f9fafb;
}

.admin-upload-box strong {
  display: block;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 8px;
}

.admin-upload-box p {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.admin-empty-cell {
  text-align: center;
  color: #6b7280 !important;
  padding: 32px !important;
}

.admin-edit-table input {
  min-width: 100px;
}

.admin-total-bar {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 16px;
  background: #111827;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.admin-total-bar span {
  color: #d1d5db;
  font-size: 14px;
  font-weight: 800;
}

.admin-total-bar strong {
  font-size: 24px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-metric-grid--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-metric-grid article {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f9fafb;
  padding: 18px;
}

.admin-metric-grid span {
  display: block;
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.admin-metric-grid strong {
  display: block;
  color: #111827;
  font-size: 28px;
  font-weight: 900;
}

.admin-usage-list {
  display: grid;
  gap: 12px;
}

.admin-usage-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
}

.admin-usage-card strong {
  display: block;
  color: #111827;
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 4px;
}

.admin-usage-card span,
.admin-usage-card small {
  color: #6b7280;
  font-size: 13px;
}

.admin-usage-card em {
  color: #dc2626;
  font-style: normal;
  font-weight: 900;
}

.admin-usage-bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
}

.admin-usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #dc2626;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: 1.1fr repeat(2, 1fr) 1.4fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f9fafb;
}

.admin-filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #374151;
  font-size: 12px;
  font-weight: 900;
}

.admin-filter-bar select,
.admin-filter-bar input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
}

.admin-dashboard-card {
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
  padding: 20px;
}

.admin-dashboard-card--wide {
  grid-column: 1 / -1;
}

.admin-dashboard-card__header {
  margin-bottom: 14px;
}

.admin-dashboard-card__header h3 {
  color: #111827;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 900;
  margin-bottom: 5px;
}

.admin-dashboard-card__header p {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
}

.admin-usage-table,
.admin-log-table {
  min-width: 980px;
}

.admin-unknown-table,
.admin-top-material-table {
  min-width: 620px;
}

.admin-usage-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  margin-left: 6px;
  vertical-align: 1px;
}

.admin-usage-badge.is-warning {
  background: #fef3c7;
  color: #b45309;
}

.admin-usage-badge.is-over,
.admin-log-status.is-danger {
  background: #fef2f2;
  color: #dc2626;
}

.admin-log-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-log-status.is-active {
  background: #f0fdf4;
  color: #15803d;
}

.admin-log-status.is-review {
  background: #fff7ed;
  color: #c2410c;
}

.admin-log-status.is-confirmed {
  background: #eff6ff;
  color: #2563eb;
}

.admin-mini-btn {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.admin-mini-btn:hover {
  border-color: #fecaca;
  color: #dc2626;
}

.admin-chart-list {
  display: grid;
  gap: 12px;
}

.admin-chart-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: center;
}

.admin-chart-row strong {
  display: block;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 3px;
}

.admin-chart-row span {
  color: #6b7280;
  font-size: 12px;
}

.admin-chart-bar {
  height: 12px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
}

.admin-chart-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dc2626, #f59e0b);
}

.admin-empty-text {
  color: #6b7280;
  font-size: 13px;
  padding: 18px 0;
}

.admin-footer {
  color: #9ca3af;
  font-size: 13px;
  background: #f9fafb;
  margin-top: 0;
}

@media (max-width: 1024px) {
  .admin-hero,
  .admin-panel__header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-excel-layout {
    grid-template-columns: 1fr;
  }

  .admin-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-metric-grid--five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .admin-main {
    padding: 20px 16px 36px;
  }

  .admin-hero,
  .admin-panel {
    border-radius: 18px;
    padding: 20px;
  }

  .admin-hero h1 {
    font-size: 25px;
  }

  .admin-tabs {
    top: 65px;
  }

  .admin-form-grid,
  .admin-metric-grid {
    grid-template-columns: 1fr;
  }

  .admin-metric-grid--five,
  .admin-filter-bar {
    grid-template-columns: 1fr;
  }

  .admin-form-grid__wide {
    grid-column: auto;
  }

  .admin-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-company-toolbar,
  .admin-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-company-toolbar input {
    width: 100%;
  }

  .admin-modal-form {
    grid-template-columns: 1fr;
  }

  .admin-form-actions button,
  .admin-modal-actions button,
  .admin-primary-btn,
  .admin-muted-btn {
    width: 100%;
  }

  .admin-table-wrap {
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .admin-table,
  .admin-table thead,
  .admin-table tbody,
  .admin-table tr,
  .admin-table th,
  .admin-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tr {
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    padding: 13px;
    margin-bottom: 12px;
    background: #ffffff;
  }

  .admin-table td {
    border-bottom: 0;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: right;
  }

  .admin-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-size: 12px;
    font-weight: 900;
    text-align: left;
    flex-shrink: 0;
  }

  .admin-row-actions {
    justify-content: flex-end;
    min-width: 0;
  }

  .admin-usage-card {
    grid-template-columns: 1fr;
  }

  .admin-dashboard-card {
    padding: 16px;
  }

  .admin-chart-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Fireplan auth / mypage ===== */
.auth-page,
.mypage-page {
  --color-primary: #dc2626;
  --color-primary-dark: #b91c1c;
  font-family: 'Noto Sans KR', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f9fafb;
  color: #111827;
}

.auth-shell {
  min-height: 100vh;
  padding: 40px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-shell--wide {
  align-items: flex-start;
}

.auth-card,
.mypage-card {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  padding: 30px;
}

.auth-shell--wide .auth-card {
  max-width: 840px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-brand .brand-logo {
  height: 32px;
  width: auto;
}

.auth-brand strong {
  font-size: 20px;
  font-weight: 900;
  color: #111827;
}

.auth-card h1 {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 8px;
}

.auth-card p {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 22px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-form-grid__full {
  grid-column: 1 / -1;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #374151;
  font-size: 13px;
  font-weight: 900;
}

.auth-form input,
.auth-form select {
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 11px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.auth-primary-btn {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: #dc2626;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.auth-primary-btn:hover {
  background: #b91c1c;
}

.auth-links {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.auth-links a {
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.auth-links a:hover {
  color: #dc2626;
}

.auth-error,
.auth-success {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}

.auth-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.auth-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.auth-demo {
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  padding: 12px;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 12px !important;
}

.mypage-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px 56px;
  display: grid;
  gap: 20px;
}

.mypage-card {
  max-width: none;
}

.mypage-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.mypage-header h1 {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 6px;
}

.mypage-header p {
  color: #6b7280;
  font-size: 14px;
}

.mypage-usage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.mypage-usage-grid article {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f9fafb;
  padding: 16px;
}

.mypage-usage-grid span {
  display: block;
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}

.mypage-usage-grid strong {
  color: #111827;
  font-size: 24px;
  font-weight: 900;
}

/* ── 프로필/비밀번호 2열 폼 */
.mypage-forms-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.mypage-sub-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9fafb;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
}

.mypage-sub-form__title {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-text-muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2px;
}

.mypage-sub-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

.mypage-sub-form input {
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  outline: none;
  transition: border-color var(--transition);
}

.mypage-sub-form input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.mypage-sub-form__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.mypage-save-btn {
  padding: 7px 18px;
  border-radius: 8px;
  border: none;
  background: #dc2626;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.mypage-save-btn:hover { background: #b91c1c; }

@media (max-width: 760px) {
  .auth-form-grid,
  .mypage-usage-grid {
    grid-template-columns: 1fr;
  }

  .mypage-forms-row {
    grid-template-columns: 1fr;
  }

  .auth-card,
  .mypage-card {
    padding: 22px;
    border-radius: 18px;
  }

  .mypage-main {
    padding: 20px 16px 36px;
  }
}

/* ══════════════════════════════════════════════════════
   블록 매핑 탭
   ══════════════════════════════════════════════════════ */

.admin-block-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f9fafb;
  margin-bottom: 0;
}

.admin-block-upload__row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-block-upload__row input[type="file"] {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 14px;
  color: #374151;
}

.admin-alert--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.block-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.block-map-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.block-map-card:hover {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.09);
}

/* 기존 DB 매핑이 있는 카드 강조 */
.block-map-card.is-mapped {
  border-color: #86efac;
  box-shadow: 0 0 0 1px #86efac;
}

/* '등록됨' 배지 */
.block-map-card__badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border-radius: 6px;
}

/* 카드 제외(삭제) 버튼 */
.block-map-card__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.block-map-card__remove:hover {
  background: #ef4444;
}

/* 새 블록 / 전체 블록 필터 토글 */
.block-map-filter {
  display: flex;
  gap: 8px;
  margin: 16px 0 4px;
}

.block-map-filter__btn {
  padding: 6px 14px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.block-map-filter__btn.is-active {
  border-color: #dc2626;
  background: #fef2f2;
  color: #dc2626;
}

/* 자재 DB 관리 — 블록 이미지 썸네일 */
.material-thumb-cell {
  width: 56px;
}

.material-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #1e1e2e;
  border-radius: 8px;
}

.material-thumb.is-missing {
  visibility: hidden;
}

.block-map-card__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e1e2e;
  border-bottom: 1px solid #2d2d3e;
  height: 130px;
  overflow: hidden;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
}

.block-map-card__thumb.is-loading::before {
  content: "로딩 중…";
  color: #4b5563;
}

.block-map-card__thumb.is-thumb-failed::before {
  content: "미리보기 없음";
  color: #4b5563;
}

.block-map-card__thumb img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.block-map-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}

.block-map-card__code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #dc2626;
  background: #fef2f2;
  padding: 3px 7px;
  border-radius: 6px;
  align-self: flex-start;
}

.block-map-card__meta {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 600;
}

.block-map-card__required {
  color: #dc2626;
}

.block-map-card__body label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 900;
  color: #6b7280;
}

.block-map-card__body input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.block-map-card__body input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.block-map-card__save-btn {
  margin-top: 4px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.15s;
  align-self: flex-end;
  width: 100%;
}

.block-map-card__save-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

@media (max-width: 760px) {
  .block-map-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
}

/* ===================================================================
   마이페이지 — 공지사항 / 문의하기 / 분석이력
   =================================================================== */

/* 섹션 헤더 (제목 + 우측 링크/배지) */
.mypage-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.mypage-section-header h2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text);
}
.mypage-section-link {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}
.mypage-section-link:hover { opacity: 0.75; }

.mypage-badge {
  font-size: 11px;
  font-weight: 700;
  background: #fef2f2;
  color: var(--color-primary);
  border-radius: 20px;
  padding: 2px 8px;
}

/* 로딩 / 빈 상태 */
.mypage-loading,
.mypage-empty {
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 20px 0;
  text-align: center;
}

/* 결과 보기 링크 */
.mypage-result-link {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  background: #fef2f2;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition);
}
.mypage-result-link:hover { background: #fee2e2; }

/* ── 공지사항 목록 */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.notice-item:hover {
  border-color: #f87171;
  box-shadow: var(--shadow-sm);
}

.notice-pin-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  background: var(--color-primary);
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
}

.notice-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notice-item__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-item__date {
  font-size: 11px;
  color: var(--color-text-muted);
}
.notice-item__arrow {
  font-size: 18px;
  color: #d1d5db;
  flex-shrink: 0;
}

/* ── 문의하기 */
.inquiry-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inquiry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.inquiry-item:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow-sm);
}

.inquiry-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inquiry-item__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inquiry-item__date {
  font-size: 11px;
  color: var(--color-text-muted);
}

.inquiry-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 10px;
}
.inquiry-status--done {
  background: #dcfce7;
  color: #16a34a;
}
.inquiry-status--pending {
  background: #fff7ed;
  color: #ea580c;
}

/* 문의 작성 폼 */
.inquiry-form-wrap {
  margin-bottom: 16px;
  background: #f9fafb;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
}
.inquiry-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inquiry-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}
.inquiry-form input,
.inquiry-form textarea {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition);
}
.inquiry-form input:focus,
.inquiry-form textarea:focus {
  border-color: #93c5fd;
}
.inquiry-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mypage-inquiry-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.mypage-inquiry-btn:hover { background: var(--color-primary-dark); }

.mypage-muted-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.mypage-muted-btn:hover { background: #f3f4f6; }

/* ── 마이페이지 모달 오버레이 */
.mypage-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}
.mypage-modal-overlay.hidden { display: none; }

.mypage-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mypage-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.mypage-modal__header h2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.4;
}
.mypage-modal__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: var(--color-text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.mypage-modal__close:hover { background: #e5e7eb; }

/* 공지 모달 내부 */
.notice-modal-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  background: #fef2f2;
  color: var(--color-primary);
  border-radius: 4px;
  padding: 2px 7px;
  margin-bottom: 4px;
}
.notice-modal-date {
  font-size: 11px;
  color: var(--color-text-muted);
  display: block;
  margin-top: 4px;
}
.notice-modal-body {
  font-size: 13px;
  line-height: 1.75;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 문의 모달 내부 */
.inquiry-modal-content {
  font-size: 13px;
  line-height: 1.75;
  color: var(--color-text);
  background: #f9fafb;
  border-radius: 8px;
  padding: 14px;
  word-break: break-word;
}
.inquiry-modal-reply {
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inquiry-reply-label {
  font-size: 11px;
  font-weight: 800;
  color: #16a34a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.inquiry-reply-body {
  font-size: 13px;
  line-height: 1.75;
  color: var(--color-text);
  word-break: break-word;
}
.inquiry-reply-date {
  font-size: 11px;
  color: var(--color-text-muted);
}
.inquiry-no-reply {
  font-size: 13px;
  color: var(--color-text-muted);
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px 14px;
  font-style: italic;
}

/* ===================================================================
   관리자 — 공지사항 관리 패널
   =================================================================== */

.notice-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.notice-admin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
}

.notice-pin-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  background: #fef2f2;
  color: var(--color-primary);
  border-radius: 4px;
  padding: 2px 7px;
}

.notice-admin-item__body {
  flex: 1;
  min-width: 0;
}
.notice-admin-item__body strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-admin-item__body time {
  font-size: 11px;
  color: var(--color-text-muted);
}

.notice-admin-item__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.notice-form-wrap {
  margin-bottom: 20px;
  background: #f9fafb;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
}

.admin-notice-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-notice-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}
.admin-notice-form input[type="text"],
.admin-notice-form textarea {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition);
}
.admin-notice-form input[type="text"]:focus,
.admin-notice-form textarea:focus {
  border-color: #f87171;
}
.admin-notice-form .admin-notice-form__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-notice-form label.notice-checkbox-label,
.notice-checkbox-label {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  padding: 4px 0;
  align-self: flex-start;
}
.notice-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
  order: -1;
}

/* ===================================================================
   관리자 — 문의게시판 패널
   =================================================================== */

.admin-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  margin-left: 5px;
  vertical-align: middle;
}

.inquiry-admin-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inquiry-admin-content-box {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* ===================================================================
   반응형 — 마이페이지 모달
   =================================================================== */
@media (max-width: 600px) {
  .mypage-modal {
    padding: 18px;
    max-height: 90vh;
  }
}

/* ===================================================================
   스프링클러 배관 구경 산출 (NFTC 103)
   =================================================================== */
.pipe-sizing-card {
  margin-top: 24px;
}

.pipe-sizing-card .result-table-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
}

.pipe-sizing-card .result-table-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipe-sizing-badge {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

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

.pipe-sizing-group {
  padding: 16px 24px 0;
}

.pipe-sizing-group + .pipe-sizing-group {
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  margin-top: 20px;
}

/* ─── 섹션 구분자 (세련된 미니멀) ─── */
.pipe-section {
  margin: 28px 16px 8px;
  padding: 0 0 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.pipe-section + .pipe-section {
  margin-top: 24px;
}

.pipe-section__title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  margin-bottom: 4px;
  background: #fafbfc;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1f2937;
}

.pipe-section__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
}

/* 섹션별 좌측 액센트 라인 (3px) + 매우 옅은 배경 틴트 */
.pipe-section--head        { border-left: 3px solid #475569; }
.pipe-section--head .pipe-section__num     { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }

.pipe-section--main-path   { border-left: 3px solid #4f46e5; }
.pipe-section--main-path .pipe-section__num { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }

.pipe-section--floors      { border-left: 3px solid #0d9488; }
.pipe-section--floors .pipe-section__num   { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }

.pipe-section--total       { border-left: 3px solid #18181b; background: #fafafa; }
.pipe-section--total .pipe-section__title  { background: #f4f4f5; }
.pipe-section--total .pipe-section__num    { background: #18181b; color: #fff; border-color: #18181b; font-size: 14px; }

/* 층별 그룹: 미니멀 카드 */
.pipe-sizing-group--floor {
  margin: 14px 18px 14px;
  padding: 16px 20px !important;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #0d9488;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}

.pipe-sizing-group--floor + .pipe-sizing-group--floor {
  border-top: 1px solid #e5e7eb !important;
}

.pipe-sizing-group--total {
  margin: 14px 18px 14px;
  padding: 16px 20px !important;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #18181b;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.pipe-sizing-group__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pipe-sizing-type-badge {
  display: inline-block;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

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

.pipe-sizing-total strong {
  color: var(--color-text);
  font-weight: 600;
}

.pipe-sizing-floors {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pipe-sizing-floor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #dbeafe;
  border-radius: 4px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pipe-sizing-floor strong {
  color: #111827;
  font-weight: 800;
}

.pipe-sizing-main {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-left: auto;
}

.pipe-sizing-main__value {
  font-size: 15px;
  font-weight: 700;
  color: #2563eb;
}

.pipe-sizing-table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
}

.pipe-sizing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pipe-sizing-table thead th {
  background: #f3f4f6;
  color: var(--color-text-muted);
  font-weight: 600;
  padding: 8px 12px;
  text-align: center;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.pipe-sizing-table tbody td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

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

.pipe-sizing-row--active {
  background: #eff6ff;
}

.pipe-sizing-row--active td {
  color: #1d4ed8 !important;
  font-weight: 600;
}

.pipe-sizing-check {
  color: #16a34a;
  font-weight: 700;
  font-size: 13px;
}

@media (max-width: 600px) {
  .pipe-sizing-group {
    padding: 12px 14px 0;
  }
  .pipe-sizing-group__header {
    gap: 8px;
  }
  .pipe-sizing-floors {
    width: 100%;
  }
  .pipe-sizing-main {
    margin-left: 0;
    width: 100%;
  }
}

/* ─── 부속 자재 (fittings) 섹션 ─── */
.fittings-section {
  margin-top: 24px;
}
.fittings-section .result-table-card__sub {
  margin-left: 8px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}
.fittings-options {
  margin: 12px 0 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.fittings-options__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.fittings-options__label {
  min-width: 130px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.fitting-opt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
}
.fitting-opt-chip:hover {
  border-color: #94a3b8;
}
.fitting-opt-chip input[type="radio"] {
  margin: 0;
  cursor: pointer;
}
.fitting-opt-chip input[type="radio"]:checked + span {
  color: #0e7490;
  font-weight: 600;
}
.fittings-opt-number {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
}
.fittings-opt-apply {
  padding: 6px 16px;
  background: #0e7490;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.fittings-opt-apply:hover {
  background: #155e75;
}
.fittings-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #64748b;
  padding: 8px 16px;
  border-top: 1px dashed #e2e8f0;
  border-bottom: 1px dashed #e2e8f0;
  margin-bottom: 12px;
}
.fittings-table .result-col-note {
  font-size: 12px;
  color: #64748b;
}
.fittings-table tbody tr.result-cat-row td {
  background: #f1f5f9;
  font-weight: 600;
  color: #0e7490;
}
@media (max-width: 720px) {
  .fittings-options__label { min-width: 100%; margin-bottom: 4px; }
  .fittings-meta { flex-wrap: wrap; }
}

/* ── 부속 옵션 패널 래퍼 (통합 자재 목록 상단) ── */
.fittings-controls {
  margin-bottom: 16px;
}

/* ── 상단 상세 탭 (배관 구경 / 필요 수량 / 주관·분기 분석) ── */
.detail-tabs {
  margin: 16px 0 24px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.detail-tabs__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.detail-tabs__title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.detail-tabs__hint {
  font-size: 12px;
  color: #94a3b8;
}
.detail-tabs__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.detail-tab-btn {
  padding: 9px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.detail-tab-btn:hover {
  border-color: #0e7490;
  color: #0e7490;
}
.detail-tab-btn--active {
  background: #0e7490;
  border-color: #0e7490;
  color: #fff;
}
.detail-tabs__panels {
  margin-top: 4px;
}
.detail-tab-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
  animation: detailPanelFade 0.18s ease;
}
.detail-tab-panel.hidden {
  display: none;
}
@keyframes detailPanelFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 720px) {
  .detail-tab-btn { flex: 1 1 auto; text-align: center; }
}
