/* ==========================================================================
   dashboard.css — Dashboard / Numbers 등 로그인 후 페이지 전용 스타일
   색상은 theme.css 변수를 그대로 참조합니다.
   ========================================================================== */

.dashboard-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ---------------------------------- 웰컴 헤더 ---------------------------------- */
.welcome-header { margin-bottom: 28px; }
.welcome-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', 'Pretendard', sans-serif;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--color-text);
}
.welcome-header h2 .icon-badge {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
}
.welcome-header h2 .icon-badge svg { width: 18px; height: 18px; }
.welcome-header p { margin: 0; color: var(--color-text-muted); font-size: 15px; }

/* ---------------------------------- 알림 메시지 ---------------------------------- */
.dash-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 14.5px;
  line-height: 1.6;
  border: 1px solid transparent;
}
.dash-alert svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.dash-alert.success { background: rgba(var(--color-primary-rgb), 0.08); border-color: rgba(var(--color-primary-rgb), 0.28); color: var(--color-primary-dark); }
.dash-alert.warning { background: rgba(var(--color-accent-rgb), 0.08); border-color: rgba(var(--color-accent-rgb), 0.3); color: #B85327; }
.dash-alert.danger  { background: rgba(225, 73, 90, 0.08); border-color: rgba(225, 73, 90, 0.3); color: #C23548; }
.dash-alert.info    { background: rgba(var(--color-primary-rgb), 0.06); border-color: rgba(var(--color-primary-rgb), 0.2); color: var(--color-text); }

/* ---------------------------------- 통계 카드 ---------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px 22px 20px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary-dark);
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.accent { background: rgba(var(--color-accent-rgb), 0.14); color: var(--color-accent); }
.stat-label { font-size: 13px; color: var(--color-text-muted); font-weight: 600; margin-bottom: 6px; }
.stat-value { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 800; color: var(--color-text); }
.stat-value.link { font-size: 18px; color: var(--color-accent); display: flex; align-items: center; gap: 6px; }

/* ---------------------------------- 섹션 카드 ---------------------------------- */
.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 26px 26px 28px;
  margin-bottom: 24px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  color: var(--color-text);
}
.badge-count {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-primary-dark);
  background: rgba(var(--color-primary-rgb), 0.1);
  padding: 4px 12px;
  border-radius: 999px;
}

/* ---------------------------------- 빈 상태 ---------------------------------- */
.empty-state { text-align: center; padding: 34px 16px; }
.empty-state .empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
}
.empty-state .empty-icon svg { width: 26px; height: 26px; }
.empty-state h4 { font-size: 16px; font-weight: 800; margin: 0 0 8px; }
.empty-state p { font-size: 14px; color: var(--color-text-muted); margin: 0 0 20px; }

/* ---------------------------------- 구매 내역 카드 ---------------------------------- */
.purchase-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.purchase-card:last-child { margin-bottom: 0; }
.purchase-card.pending { cursor: pointer; }
.purchase-card.pending:hover { border-color: rgba(var(--color-primary-rgb), 0.4); box-shadow: var(--shadow-soft); }

.purchase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.phone-number-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Sora', monospace;
  font-weight: 700;
  font-size: 15.5px;
  color: var(--color-text);
}
.phone-number-badge svg { width: 16px; height: 16px; color: var(--color-primary-dark); }

.status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}
.status-badge.active   { background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary-dark); }
.status-badge.pending  { background: rgba(108, 116, 158, 0.12); color: #545F82; }
.status-badge.expiring { background: rgba(var(--color-accent-rgb), 0.14); color: var(--color-accent); }
.status-badge.expired  { background: rgba(225, 73, 90, 0.1); color: #C23548; }

.detail-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.detail-row:last-of-type { margin-bottom: 0; }
@media (max-width: 520px) { .detail-row { grid-template-columns: 1fr; } }
.detail-item { display: flex; align-items: flex-start; gap: 10px; }
.detail-item svg { flex: none; width: 15px; height: 15px; margin-top: 3px; color: var(--color-text-muted); }
.detail-content { display: flex; flex-direction: column; gap: 2px; }
.detail-label { font-size: 12px; color: var(--color-text-muted); }
.detail-value { font-size: 14px; font-weight: 700; color: var(--color-text); }
.detail-value.price { color: var(--color-primary-dark); }

.pending-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
}
.pending-info svg { width: 14px; height: 14px; flex: none; }

.extend-btn {
  width: 100%;
  margin-top: 14px;
  border: 1px solid rgba(var(--color-primary-rgb), 0.35);
  background: rgba(var(--color-primary-rgb), 0.06);
  color: var(--color-primary-dark);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.extend-btn:hover { background: rgba(var(--color-primary-rgb), 0.12); }
.extend-btn svg { width: 15px; height: 15px; }

/* ---------------------------------- 번호 관리 ---------------------------------- */
.number-info { margin-bottom: 20px; }
.number-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.number-info-row:last-child { border-bottom: none; }
.number-info-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--color-text-muted); font-weight: 600; }
.number-info-label svg { width: 15px; height: 15px; }
.number-info-value { font-family: 'Sora', monospace; font-weight: 700; font-size: 15px; color: var(--color-text); }
.number-info-value.not-set { font-family: 'Pretendard', sans-serif; font-weight: 500; color: var(--color-text-muted); }

/* ---------------------------------- 모달 (커스텀, Bootstrap 미사용) ---------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 27, 45, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}
.modal-overlay.show { display: flex; }

.modal-panel {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px -20px rgba(16,27,45,0.4);
  max-height: 88vh;
  overflow-y: auto;
  animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--color-border);
}
.modal-head h3 { display: flex; align-items: center; gap: 8px; font-size: 16.5px; font-weight: 800; margin: 0; }
.modal-close { background: none; border: none; color: var(--color-text-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px; }
.modal-close:hover { color: var(--color-text); }

.modal-body { padding: 22px 24px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--color-border);
}

.info-box {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.info-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13.5px; }
.info-row .label { color: var(--color-text-muted); display: flex; align-items: center; gap: 6px; }
.info-row .label svg { width: 14px; height: 14px; }
.info-row strong { color: var(--color-text); }

.dash-field-group { margin-bottom: 18px; }
.dash-field-group label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 700; margin-bottom: 8px; color: var(--color-text);
}
.dash-field-group label svg { width: 14px; height: 14px; color: var(--color-primary-dark); }
.dash-field-group input[type="date"] {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
}
.dash-field-group input[type="date"]:focus { outline: none; border-color: var(--color-primary); }
.dash-field-group small { display: block; margin-top: 6px; font-size: 12px; color: var(--color-text-muted); }

.calc-end-date {
  background: rgba(var(--color-primary-rgb), 0.06);
  border: 1px dashed rgba(var(--color-primary-rgb), 0.35);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary-dark);
}

/* 연장 기간 선택 라디오 그리드 */
.period-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.period-option { position: relative; }
.period-radio { position: absolute; opacity: 0; }
.period-label {
  display: block;
  text-align: center;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 8px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.period-label div:first-child { font-size: 13px; font-weight: 700; color: var(--color-text); margin-bottom: 4px; }
.period-price { font-size: 13.5px; font-weight: 800; color: var(--color-primary-dark); }
.period-radio:checked + .period-label {
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.08);
}
.period-radio:focus-visible + .period-label { outline: 2px solid var(--color-primary); outline-offset: 2px; }

@media (max-width: 480px) {
  .period-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-container { padding: 28px 16px 60px; }
  .section-card { padding: 20px 18px 22px; }
}
