@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

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

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fff;
  color: #333;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input,
textarea,
select,
button {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* ========== Auth / Login ========== */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f8f9fa;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
}

.login-box {
  background: #fff;
  padding: 3rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #222;
}

.login-logo .logo-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.login-box h2 {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: #333;
}

.login-subtitle {
  text-align: center;
  color: #999;
  margin-bottom: 2rem;
  font-size: 0.85rem;
}

/* ========== Top Navbar (Figma: bg #F5F7FA, px 260, py 14) ========== */
.navbar {
  background: #f5f7fa;
  padding: 14px 260px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
}

.navbar-logo {
  display: flex;
  align-items: center;
}

.navbar-logo-img {
  height: 38px;
  width: 134px;
  object-fit: contain;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 40px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 50px;
}

.navbar-link {
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.32px;
  color: #7e80a0;
  transition: color 0.2s;
}

.navbar-link:hover,
.navbar-link.active {
  color: #141414;
}

.navbar-external {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.32px;
  color: #3a43ff;
  transition: background 0.2s;
}

.navbar-external:hover {
  background: rgba(58, 67, 255, 0.04);
}

.navbar-external svg {
  width: 20px;
  height: 20px;
}

/* ========== Page Layout ========== */
.page-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 40px 80px;
  min-height: calc(100vh - 64px - 200px);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: #222;
}

/* ========== Form ========== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
  color: #333;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #4a6cf7;
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
}

.form-group input::placeholder {
  color: #bbb;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 16px;
  background: #3a43ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.32px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #2d35e0;
}

.btn-primary:disabled {
  background: #a0b0f0;
  cursor: not-allowed;
}

.btn-primary.full-width {
  width: 100%;
}

.error-msg {
  color: #e74c3c;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
}

/* ========== Payment History (ph-*) ========== */
.ph-container {
  width: 100%;
}

/* Search Section */
.ph-search-section {
  margin-bottom: 32px;
}

.ph-search-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 25px;
  letter-spacing: -0.36px;
  color: #141414;
  margin: 0 0 16px 0;
}

.ph-search-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid #E6E8EB;
  border-radius: 12px;
}

.ph-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ph-filter-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: -0.28px;
  color: #292F32;
}

/* Date Picker */
.ph-date-picker-wrapper {
  position: relative;
}

.ph-date-picker-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1px solid #E6E8EB;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  min-width: 260px;
  transition: border-color 0.2s;
}

.ph-date-picker-box:hover {
  border-color: #8C8C8C;
}

.ph-date-text {
  flex: 1;
  font-size: 14px;
  font-weight: 400;
  color: #141414;
  white-space: nowrap;
}

.ph-date-text.placeholder {
  color: #BFBFBF;
}

.ph-calendar-icon {
  flex-shrink: 0;
}

/* Calendar Popup */
.cal-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1000;
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 20px;
  border: 1px solid #E6E8EB;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.cal-nav-btn:hover {
  background: #F3F4F7;
}

.cal-title {
  font-size: 16px;
  font-weight: 600;
  color: #141414;
}

.cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.cal-day-label {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #8C8C8C;
  padding: 6px 0;
}

.cal-day-label.sunday {
  color: #FF4444;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 400;
  color: #141414;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}

.cal-day:hover:not(.selected):not(.out-month) {
  background: #F3F4F7;
}

.cal-day.out-month {
  color: #D9D9D9;
}

.cal-day.sunday:not(.out-month):not(.selected) {
  color: #FF4444;
}

.cal-day.selected {
  background: #3A43FF;
  color: #fff;
}

.cal-day.in-range {
  background: #E5EFFF;
  border-radius: 0;
}

.cal-confirm-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: #3A43FF;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.cal-confirm-btn:hover {
  background: #2D35E0;
}

/* Calendar title clickable */
.cal-title-clickable {
  cursor: pointer;
  transition: color 0.2s;
}

.cal-title-clickable:hover {
  color: #3A43FF;
}

/* Year picker grid (Figma: 3 columns, 4 rows) */
.cal-year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 16px 0;
}

.cal-year-item {
  padding: 14px 8px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 400;
  color: #141414;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.cal-year-item:hover {
  background: #f5f7fa;
}

.cal-year-item.selected {
  border-color: #3A43FF;
  color: #3A43FF;
  font-weight: 600;
}

/* Select Dropdown */
.ph-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ph-select {
  padding: 13px 40px 13px 20px;
  border: 1px solid #E6E8EB;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 400;
  color: #141414;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  min-width: 120px;
  transition: border-color 0.2s;
}

.ph-select:hover {
  border-color: #8C8C8C;
}

.ph-select:focus {
  outline: none;
  border-color: #3A43FF;
}

.ph-select-chevron {
  position: absolute;
  right: 14px;
  pointer-events: none;
}

/* Text Input */
.ph-text-input {
  padding: 13px 20px;
  border: 1px solid #E6E8EB;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 400;
  color: #141414;
  min-width: 160px;
  transition: border-color 0.2s;
}

.ph-text-input:hover {
  border-color: #8C8C8C;
}

.ph-text-input:focus {
  outline: none;
  border-color: #3A43FF;
}

.ph-text-input::placeholder {
  color: #BFBFBF;
}

/* Filter Actions */
.ph-filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: flex-end;
}

.ph-btn-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 20px;
  background: #3A43FF;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.ph-btn-search:hover {
  background: #2D35E0;
}

.ph-btn-reset {
  padding: 13px 20px;
  background: transparent;
  color: #595959;
  border: 1px solid #E6E8EB;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.ph-btn-reset:hover {
  background: #F3F4F7;
}

/* Table Header Bar */
.ph-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ph-table-count {
  font-size: 14px;
  font-weight: 400;
  color: #141414;
  margin: 0;
}

.ph-count-num {
  color: #3A43FF;
  font-weight: 700;
}

.ph-btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  color: #595959;
  border: 1px solid #E6E8EB;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.ph-btn-delete:hover:not(:disabled) {
  background: #FEF2F2;
  border-color: #EF4444;
  color: #EF4444;
}

.ph-btn-delete:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Data Table */
.ph-table-wrapper {
  background: #fff;
  border: 1px solid #E6E8EB;
  border-radius: 12px;
  overflow: hidden;
}

.ph-table {
  width: 100%;
  border-collapse: collapse;
}

.ph-table th,
.ph-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #F0F0F0;
  font-size: 14px;
  white-space: nowrap;
}

.ph-table th {
  font-weight: 600;
  color: #595959;
  background: #F9FAFB;
  font-size: 14px;
}

.ph-table td {
  font-weight: 400;
  color: #141414;
}

.ph-sortable {
  cursor: pointer;
  user-select: none;
}

.ph-sortable:hover {
  color: #141414;
}

.ph-table tbody tr:hover {
  background: #FAFBFC;
}

.ph-row-clickable {
  cursor: pointer;
}

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

.ph-empty-row {
  text-align: center !important;
  color: #8C8C8C;
  padding: 48px 16px !important;
}

/* Status Badges */
.ph-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.ph-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.ph-badge-subscription {
  background: #E5EFFF;
  color: #3A43FF;
}

.ph-badge-subscription::before {
  background: #3A43FF;
}

.ph-badge-pending {
  background: #E8F4F8;
  color: #22B8CF;
}

.ph-badge-pending::before {
  background: #22B8CF;
}

.ph-badge-expired {
  background: #F3F4F6;
  color: #8C8C8C;
}

.ph-badge-expired::before {
  background: #8C8C8C;
}

.ph-badge-canceled {
  background: #FEF2F2;
  color: #EF4444;
}

.ph-badge-canceled::before {
  background: #EF4444;
}

.ph-badge-grace {
  background: #FFF3E0;
  color: #F59E0B;
}

.ph-badge-grace::before {
  background: #F59E0B;
}

/* Toggle Switch */
.ph-toggle {
  position: relative;
  width: 44px;
  height: 22px;
  display: inline-block;
}

.ph-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ph-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #B8BCC4;
  border-radius: 22px;
  transition: background 0.2s;
}

.ph-toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.ph-toggle input:checked + .ph-toggle-slider {
  background: #4B8BF5;
}

.ph-toggle input:checked + .ph-toggle-slider::before {
  transform: translateX(22px);
}

.ph-toggle-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.ph-toggle-disabled .ph-toggle-slider {
  background: #DDE1E6;
  cursor: not-allowed;
}

/* Copy Button */
.ph-btn-copy {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #8C8C8C;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s;
}

.ph-btn-copy:hover {
  color: #141414;
}

/* Checkbox Cell */
.ph-checkbox-cell {
  width: 44px;
  text-align: center !important;
}

.ph-checkbox-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3A43FF;
  border-radius: 4px;
}

/* Pagination */
.ph-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px 0;
}

.ph-pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #8C8C8C;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.ph-pagination button:hover:not(:disabled):not(.active) {
  background: #F3F4F7;
  color: #141414;
}

.ph-pagination button.active {
  background: transparent;
  color: #3A43FF;
  font-weight: 700;
}

.ph-pagination button:disabled {
  color: #D9D9D9;
  cursor: not-allowed;
}

.ph-pagination .ph-ellipsis {
  color: #8C8C8C;
  padding: 0 4px;
  font-size: 14px;
}

/* ========== 결제 생성 (Payment Create) ========== */
/* Figma: gap 155px, left 619px, right 626px */
.create-layout {
  display: flex;
  gap: 155px;
}

.preview-section {
  width: 619px;
  flex-shrink: 0;
}

.form-section {
  width: 626px;
  flex-shrink: 0;
}

/* Preview Section */
.preview-section h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 25px;
  letter-spacing: -0.36px;
  color: #141414;
  margin: 0;
}

.preview-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}

.preview-hint {
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: -0.28px;
  color: #8c8c8c;
}

/* Preview wrapper (Figma: bg #F7F9FD, rounded 12, padding 24, gap 8) */
.preview-wrapper {
  background: #f7f9fd;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Product card (Figma: white, border #3A43FF solid, rounded 12, padding 24, gap 20, shadow) */
.preview-product-card {
  background: #fff;
  border: 1px solid #3a43ff;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 2px 10px rgba(209, 221, 245, 0.7);
}

/* Product icon (Figma: 32x32, bg #EBF0FA, rounded 7) */
.preview-product-icon {
  width: 32px;
  height: 32px;
  background: #ebf0fa;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 7px;
}

.preview-product-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Product info (Figma: gap 4) */
.preview-product-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Title (Figma: 24px, SemiBold 600, #141414, line-height 28, tracking -0.6) */
.preview-product-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.6px;
  color: #141414;
  margin: 0;
}

/* Desc (Figma: 16px, Regular 400, #505050, line-height 20, tracking -0.32) */
.preview-product-desc {
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: -0.32px;
  color: #505050;
  margin: 0;
}

/* Price (Figma: 30px, SemiBold 600, #3A43FF, line-height 34, tracking -0.6) */
.preview-product-price {
  font-size: 30px;
  font-weight: 600;
  line-height: 34px;
  letter-spacing: -0.6px;
  color: #3a43ff;
}

/* Features area (Figma: gradient bg, rounded 6, padding 20, gap 12) */
.preview-features-area {
  background: linear-gradient(122.3deg, #f5f8ff 0%, #eef4ff 50%, #f0fcff 100%);
  border-radius: 6px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

/* Features badge (Figma: bg #3A43FF, px 10 py 6, rounded 4, 14px SemiBold) */
.preview-features-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  background: #3a43ff;
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: -0.28px;
  align-self: flex-start;
}

/* Features list (Figma: gap 8) */
.preview-features-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Feature item (Figma: gap 4, 16px Regular, #141414) */
.preview-feature-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.4px;
  color: #141414;
}

.preview-check-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Tax note (Figma: 15px Regular, rgba(80,80,80,0.6), tracking -0.375) */
.preview-tax-note {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.375px;
  color: rgba(80, 80, 80, 0.6);
}

/* Period card (Figma: white, rounded 12, padding 24, gap 16, shadow) */
.preview-period-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 2px 10px rgba(209, 221, 245, 0.7);
}

/* Period icon (Figma: 32x32, bg #EBF0FA, rounded 7) */
.preview-period-icon {
  width: 32px;
  height: 32px;
  background: #ebf0fa;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.preview-period-icon svg {
  width: 20px;
  height: 20px;
}

/* Period info (Figma: gap 2) */
.preview-period-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Period label (Figma: 16px Regular, #505050, tracking -0.4) */
.preview-period-label {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.4px;
  color: #505050;
}

/* Period value (Figma: 20px SemiBold, tracking -0.5, gap 4) */
.preview-period-value {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.5px;
  color: #141414;
}

.preview-period-prefix {
  color: #141414;
}

.preview-period-highlight {
  color: #3a43ff;
}

/* Form Section */
.form-section h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 25px;
  letter-spacing: -0.36px;
  color: #141414;
  margin: 0;
}

.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 15px;
  margin-bottom: 28px;
  border-bottom: 1px solid #e6e8eb;
}

/* Figma TextBtn: px-16 py-13, rounded-6, gap-6, 16px Medium, icon 22x22 */
.form-section-header .btn-primary {
  padding: 13px 16px;
  height: auto;
}

.form-section-header .btn-primary svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Figma IcnBtn: 48x48, p-13, rounded-6, border #E0E5F1, icon 22x22 */
.btn-copy-square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid #e0e5f1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  padding: 13px;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.btn-copy-square img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.btn-copy-square:hover {
  border-color: #3a43ff;
}

/* Form blocks (Figma: gap 70px between sections) */
.form-block {
  margin-bottom: 70px;
}

/* Form input (Figma: white, border #E6E8EB, rounded 10, px 24 py 15, 16px Regular #141414) */
.form-input {
  width: 100%;
  padding: 15px 24px;
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: -0.32px;
  color: #141414;
  background: #fff;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #8c8c8c;
}

.form-input:focus-within {
  border-color: #8c8c8c;
}

.form-input::placeholder {
  color: #bfbfbf;
}

/* Section label (Figma: 16px SemiBold #292F32, vertical line before) */
.section-label {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: -0.32px;
  color: #292f32;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: '';
  width: 3px;
  height: 16px;
  background: #bfbfbf;
  flex-shrink: 0;
}

.section-label-sub {
  font-weight: 400;
  color: #bfbfbf;
  font-size: 14px;
}

/* Inline row - 제목/설명 (Figma: gap 20, pl 10, label width 82) */
.form-inline-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-left: 10px;
  margin-bottom: 0;
}

.form-inline-row + .form-inline-row {
  margin-top: 20px;
}

.form-inline-label {
  width: 82px;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.32px;
  color: #595959;
  flex-shrink: 0;
}

.form-inline-row .form-input,
.form-inline-row .form-input-underline {
  flex: 1;
}

/* Underline input for 제목/설명 (Figma: bottom border only) */
.form-input-underline {
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-bottom: 1px solid #e6e8eb;
  border-radius: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: -0.32px;
  color: #141414;
  background: transparent;
  transition: border-color 0.2s;
}

.form-input-underline:focus {
  outline: none;
  border-bottom-color: #3a43ff;
}

.form-input-underline::placeholder {
  color: #bfbfbf;
}

.form-input-underline[readonly] {
  color: #141414;
  cursor: default;
}

/* Product tabs (Figma: rounded 10, px 24 py 16, width 202, gap 10) */
.product-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.product-tab {
  width: 202px;
  padding: 16px 24px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f3f4f7;
  color: #8c8c8c;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.32px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.product-tab.active {
  background: #e5efff;
  color: #3a43ff;
  border-color: #3a43ff;
}

.product-tab:hover:not(.active) {
  background: #eaebee;
}

/* Inline fields - 이용 기간 (Figma: pl 10, label width 82, gap 20 between groups) */
.inline-fields {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-left: 10px;
}

.inline-label {
  width: 82px;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.32px;
  color: #595959;
  white-space: nowrap;
  flex-shrink: 0;
}

.inline-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.inline-group .form-input {
  flex: 1;
  text-align: right;
}

.inline-unit {
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.32px;
  color: #292f32;
  white-space: nowrap;
  width: 28px;
  text-align: right;
}

/* Amount rows - 결제 금액 (Figma: pl 10, label width 82, gap 20) */
.amount-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-left: 10px;
  margin-bottom: 0;
}

.amount-row + .amount-row {
  margin-top: 10px;
}

.amount-label {
  width: 82px;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.32px;
  color: #595959;
  flex-shrink: 0;
}

.amount-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.amount-inner .form-input {
  flex: 1;
  text-align: right;
}

/* Feature tags (Figma: bg #F3F4F7, rounded 62, px 12 py 10, 16px Regular #595959) */
.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: #f3f4f7;
  color: #595959;
  border-radius: 62px;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: -0.32px;
}

.feature-tag-remove {
  background: none;
  border: none;
  color: #8c8c8c;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  width: 20px;
  height: 20px;
  justify-content: center;
  transition: color 0.2s;
}

.feature-tag-remove:hover {
  color: #333;
}

/* ========== Footer ========== */
.footer {
  background: #f8f9fa;
  border-top: 1px solid #eee;
  padding: 48px 40px 32px;
  margin-top: 60px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
}

.footer-brand .footer-logo .logo-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.footer-brand .footer-tagline {
  font-size: 0.8rem;
  color: #999;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 12px;
}

.footer-col a,
.footer-col p {
  display: block;
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 6px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #666;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: #bbb;
}

/* ========== Responsive ========== */
@media (max-width: 1600px) {
  .navbar {
    padding: 14px 80px;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 14px 16px;
  }

  .page-container {
    padding: 24px 16px;
  }

  .create-layout {
    flex-direction: column;
    gap: 40px;
  }

  .preview-section,
  .form-section {
    width: 100%;
  }

  .ph-search-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .ph-filter-actions {
    margin-left: 0;
  }

  .ph-date-picker-box {
    min-width: unset;
    width: 100%;
  }

  .ph-select {
    width: 100%;
  }

  .ph-text-input {
    width: 100%;
    min-width: unset;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   Billing Scheduler (bs-)
   ============================================ */

.bs-status-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.bs-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.bs-status-title {
  font-size: 16px;
  font-weight: 600;
  color: #141414;
}

.bs-run-btn {
  padding: 8px 20px;
  background: #3A43FF;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.bs-run-btn:hover:not(:disabled) {
  opacity: 0.85;
}

.bs-run-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.bs-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.bs-status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bs-status-label {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.bs-status-value {
  font-size: 14px;
  color: #141414;
  font-weight: 500;
}

.bs-running {
  color: #3A43FF;
}

.bs-idle {
  color: #6b7280;
}

.bs-text-success {
  color: #10b981;
  font-weight: 600;
}

.bs-text-fail {
  color: #ef4444;
  font-weight: 600;
}

/* Upcoming Section */
.bs-upcoming-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.bs-text-warn {
  color: #f59e0b;
  font-weight: 600;
}

.bs-text-today {
  color: #3A43FF;
  font-weight: 700;
}

/* Timeline */
.bs-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bs-timeline-section {
  margin-bottom: 8px;
}

.bs-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 0;
  border-bottom: 2px solid;
  margin-bottom: 4px;
}

.bs-section-past {
  color: #9ca3af;
  border-color: #e5e7eb;
}

.bs-section-today {
  color: #3A43FF;
  border-color: #3A43FF;
}

.bs-section-future {
  color: #059669;
  border-color: #d1fae5;
}

.bs-text-muted {
  color: #9ca3af;
  font-weight: 500;
}

.bs-timeline-row {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.bs-timeline-row:last-child {
  border-bottom: none;
}

.bs-timeline-date-col {
  flex-shrink: 0;
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
}

.bs-timeline-date-text {
  font-size: 13px;
  font-weight: 600;
  color: #141414;
}

.bs-timeline-dday {
  font-size: 11px;
  font-weight: 600;
}

.bs-timeline-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: #f9fafb;
  border-radius: 6px;
  font-size: 13px;
}

.bs-timeline-done .bs-timeline-content {
  background: #f3f4f6;
  opacity: 0.65;
}

.bs-timeline-empty {
  padding: 20px 0;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

.bs-timeline-event {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.bs-event-payment {
  background: #dbeafe;
  color: #1d4ed8;
}

.bs-event-cancel {
  background: #fef3c7;
  color: #92400e;
}

.bs-event-retry {
  background: #fee2e2;
  color: #991b1b;
}

.bs-event-retry-last {
  background: #991b1b;
  color: #fff;
}

.bs-event-expired {
  background: #e5e7eb;
  color: #6b7280;
}

.bs-event-canceled {
  background: #fecaca;
  color: #991b1b;
}

.bs-event-pending {
  background: #3A43FF;
  color: #fff;
}

.bs-event-cancel-pending {
  background: #f59e0b;
  color: #fff;
}

.bs-timeline-company {
  font-weight: 600;
  color: #141414;
  min-width: 80px;
}

.bs-timeline-product {
  color: #6b7280;
  flex: 1;
}

.bs-timeline-amount {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: #374151;
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .bs-timeline-group {
    flex-direction: column;
    gap: 8px;
  }

  .bs-timeline-date {
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .bs-timeline-item {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* Logs Section */
.bs-logs-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
}

.bs-logs-title {
  font-size: 16px;
  font-weight: 600;
  color: #141414;
  margin-bottom: 16px;
}

.bs-logs-empty {
  text-align: center;
  padding: 40px;
  color: #9ca3af;
  font-size: 14px;
}

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

.bs-logs-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid #e5e7eb;
  color: #6b7280;
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}

.bs-logs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  vertical-align: top;
}

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

.bs-row-expanded {
  background: #f0f4ff;
}

.bs-mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
}

.bs-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.bs-badge-first {
  background: #dbeafe;
  color: #1d4ed8;
}

.bs-badge-renewal {
  background: #d1fae5;
  color: #065f46;
}

.bs-badge-manual {
  background: #fef3c7;
  color: #92400e;
}

.bs-detail-btn {
  padding: 4px 10px;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}

.bs-detail-btn:hover {
  border-color: #3A43FF;
  color: #3A43FF;
}

.bs-detail-row td {
  padding: 0 12px 16px;
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.bs-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 12px;
}

.bs-detail-block h4 {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
}

.bs-detail-block pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 12px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
}

/* Pagination */
.bs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 13px;
  color: #6b7280;
}

.bs-pagination button {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.bs-pagination button:hover:not(:disabled) {
  border-color: #3A43FF;
  color: #3A43FF;
}

.bs-pagination button:disabled {
  color: #d1d5db;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .bs-status-grid {
    grid-template-columns: 1fr;
  }

  .bs-detail-grid {
    grid-template-columns: 1fr;
  }

  .bs-logs-table {
    font-size: 12px;
  }
}

/* ==========================================
   Payment Detail Modal
   ========================================== */
.pdm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.pdm-modal {
  width: 940px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

.pdm-loading {
  padding: 60px;
  text-align: center;
  color: #999;
}

.pdm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.pdm-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdm-header-title {
  font-size: 20px;
  font-weight: 600;
  color: #141414;
}

.pdm-header-sep {
  color: #d9d9d9;
  font-size: 18px;
}

.pdm-header-company {
  font-size: 18px;
  font-weight: 500;
  color: #141414;
}

.pdm-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #8c8c8c;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.pdm-close:hover { color: #141414; }

.pdm-body {
  padding: 0 40px 40px;
}

.pdm-section {
  margin-top: 32px;
}

.pdm-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #141414;
  margin: 0 0 14px;
}

/* Badges */
.pdm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.pdm-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pdm-badge-sub { background: #E5EFFF; color: #3A43FF; }
.pdm-badge-sub::before { background: #3A43FF; }
.pdm-badge-pending { background: #E8F4F8; color: #22B8CF; }
.pdm-badge-pending::before { background: #22B8CF; }
.pdm-badge-expired { background: #F3F4F6; color: #8C8C8C; }
.pdm-badge-expired::before { background: #8C8C8C; }
.pdm-badge-canceled { background: #FEF2F2; color: #EF4444; }
.pdm-badge-canceled::before { background: #EF4444; }

/* Info Grid */
.pdm-info-grid {
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
}

.pdm-info-row {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
}

.pdm-info-row:last-child { border-bottom: none; }

.pdm-info-cell {
  flex: 1;
  display: flex;
  min-height: 42px;
}

.pdm-info-cell-full {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 42px;
}

.pdm-info-label {
  width: 110px;
  flex-shrink: 0;
  padding: 10px 12px;
  font-size: 13px;
  color: #8c8c8c;
  background: #fafafa;
  display: flex;
  align-items: center;
}

.pdm-info-value {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  color: #141414;
  display: flex;
  align-items: center;
}

.pdm-link-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #595959;
}

.pdm-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
}

.pdm-copy-btn:hover svg { fill: #3A43FF; }

/* Total Bar */
.pdm-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f7f9fd;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #141414;
}

.pdm-total-amount {
  color: #3A43FF;
  font-size: 16px;
}

/* Table */
.pdm-table-scroll {
  overflow-x: auto;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
}

.pdm-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pdm-table thead th {
  padding: 12px 10px;
  background: #fafafa;
  color: #8c8c8c;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
}

.pdm-table tbody td {
  padding: 14px 10px;
  color: #141414;
  border-bottom: 1px solid #f5f5f5;
  white-space: nowrap;
  vertical-align: middle;
}

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

.pdm-mono {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 11px;
}

.pdm-empty {
  text-align: center;
  color: #999;
  padding: 24px !important;
}

.pdm-pay-status-done { color: #141414; }
.pdm-pay-status-cancel { color: #EF4444; }
.pdm-pay-status-fail { color: #EF4444; font-weight: 600; }

.pdm-cancel-btn {
  border: 1px solid #EF4444;
  color: #EF4444;
  background: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.pdm-cancel-btn:hover {
  background: #FEF2F2;
}

.pdm-receipt-btn {
  border: 1px solid #d9d9d9;
  color: #141414;
  background: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
}

.pdm-receipt-btn:hover {
  background: #fafafa;
}

/* Memo */
.pdm-memo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pdm-memo-header .pdm-section-title {
  margin: 0;
}

.pdm-memo-add-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 18px;
  color: #595959;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdm-memo-add-btn:hover { background: #fafafa; }

.pdm-memo-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.pdm-memo-input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}

.pdm-memo-input:focus { border-color: #3A43FF; }

.pdm-memo-save-btn {
  padding: 8px 16px;
  background: #3A43FF;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.pdm-memo-list {
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
}

.pdm-memo-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #f5f5f5;
  gap: 12px;
}

.pdm-memo-item:last-child { border-bottom: none; }

.pdm-memo-text {
  flex: 1;
  font-size: 13px;
  color: #141414;
}

.pdm-memo-date {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

.pdm-memo-del {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  opacity: 0.5;
}

.pdm-memo-del:hover { opacity: 1; }

.pdm-memo-empty {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 13px;
}
