/* Admin 전용 — 테이블·필터·상태 뱃지 */

/* ---- Status badges ---- */
.yc-badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius);
  line-height: 1.6;
  white-space: nowrap;
}

.yc-badge--contracted  { background: #E8DAEF; color: #6C3483; }
.yc-badge--pending     { background: #FFF3CD; color: #856404; }
.yc-badge--in_progress { background: #D1ECF1; color: #0C5460; }
.yc-badge--completed   { background: #D4EDDA; color: #155724; }

/* ---- Stats cards ---- */
.yc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.yc-stat-card {
  background: var(--white);
  border: 1px solid var(--ink-30);
  border-radius: var(--radius);
  padding: var(--sp-3);
  text-align: center;
}

.yc-stat-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.yc-stat-card--link:hover {
  border-color: var(--navy);
}

.yc-stat-card__value {
  font-size: 1.75rem;
  font-weight: var(--fw-bold);
  color: var(--navy);
  line-height: 1.2;
}

.yc-stat-card__label {
  font-size: 0.8125rem;
  color: var(--ink-60);
  margin-top: var(--sp-1);
}

/* ---- Filter bar ---- */
.yc-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: flex-end;
  margin-bottom: var(--sp-5);
  padding: var(--sp-4);
  background: var(--white);
  border: 1px solid var(--ink-30);
  border-radius: var(--radius);
}

.yc-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.yc-filter-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-60);
}

.yc-filter-group .yc-select,
.yc-filter-group .yc-input {
  width: auto;
  min-width: 140px;
}

/* ---- Table ---- */
.yc-table-container {
  background: var(--white);
  border: 1px solid var(--ink-30);
  border-radius: var(--radius);
}

.yc-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.yc-table thead {
  background: var(--navy);
  color: var(--white);
}

.yc-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.yc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--cloud-dk);
  vertical-align: middle;
}

.yc-table tbody tr:hover {
  background: var(--cloud);
}

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

.yc-table .yc-cell-actions {
  text-align: center;
  white-space: nowrap;
  overflow: visible;
}

.yc-table .yc-cell-actions .yc-btn {
  padding: 6px 10px;
  font-size: 0.8125rem;
  min-width: 0;
}

/* Filter row — 헤더 아래 컬럼별 필터 컨트롤 */
.yc-filter-row td {
  padding: 4px 6px;
  background: var(--cloud);
  border-bottom: 2px solid var(--ink-30);
}
.yc-filter-input,
.yc-filter-select {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 0.75rem;
  border: 1px solid var(--ink-30);
  border-radius: 4px;
  background: var(--white);
  min-height: unset;
  height: auto;
}
.yc-filter-input:focus,
.yc-filter-select:focus {
  outline: none;
  border-color: var(--navy);
}

/* ---- Empty state ---- */
.yc-empty {
  text-align: center;
  padding: var(--sp-10) var(--sp-4);
  color: var(--ink-60);
}

.yc-empty__icon {
  font-size: 2.5rem;
  margin-bottom: var(--sp-3);
  opacity: 0.4;
}

.yc-empty__text {
  font-size: 1rem;
  margin-bottom: var(--sp-1);
}

/* ---- Error state ---- */
.yc-error {
  text-align: center;
  padding: var(--sp-10) var(--sp-4);
  color: #c0392b;
}

/* ---- Page header ---- */
.yc-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-5);
}

.yc-page-header h1 {
  margin: 0;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
  color: var(--ink);
}

.yc-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.yc-header-date-filters {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.yc-header-date-filters .yc-input {
  width: auto;
  min-width: 130px;
}

.yc-date-sep {
  color: var(--ink-60);
  font-size: 0.875rem;
  padding: 0 2px;
}

/* ---- Editable Lookup autocomplete ---- */
.yc-lookup {
  position: relative;
  display: block;
  width: 100%;
}

.yc-lookup .yc-input {
  width: 100%;
  box-sizing: border-box;
}

.yc-lookup-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: 240px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--ink-30);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.yc-lookup-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--ink);
  transition: background 0.15s;
}

.yc-lookup-item:hover,
.yc-lookup-item--hl {
  background: var(--navy);
  color: var(--white);
}

/* ---- Reservation mobile cards ---- */
.yc-reservation-cards {
  display: none; /* 데스크톱에서 숨김 */
  flex-direction: column;
  gap: var(--sp-3);
}

.yc-res-card {
  background: var(--white);
  border: 1px solid var(--ink-30);
  border-radius: var(--radius);
  overflow: hidden;
}

.yc-res-card__header {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--cloud-dk);
}

.yc-res-card__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.yc-res-card__service {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
}

.yc-res-card__hospital {
  font-size: 0.875rem;
  color: var(--ink-60);
}

.yc-res-card__info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3);
  border-bottom: 1px solid var(--cloud-dk);
}

.yc-res-card__info-label {
  font-size: 0.75rem;
  color: var(--ink-60);
  font-weight: 600;
  margin-bottom: 2px;
}

/* ---- Sortable table headers ---- */
.yc-th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.yc-th-sortable:hover {
  color: var(--champagne);
}

.yc-res-card__info-value {
  font-size: 0.875rem;
  color: var(--ink);
}

.yc-res-card__action {
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  gap: var(--sp-2);
}

.yc-res-card__action .yc-btn {
  flex: 1;
  min-width: unset;
}

/* ---- Detail page grid ---- */
.yc-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.yc-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--sp-4);
}

/* ---- Settlement mobile cards ---- */
.yc-settlement-cards {
  display: none;
}

.yc-settlement-card {
  background: var(--white);
  border: 1px solid var(--ink-30);
  border-radius: var(--radius);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.yc-settlement-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-2);
  border-bottom: 1px solid var(--cloud-dk);
  font-weight: 600;
  font-size: 0.875rem;
}

.yc-settlement-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.yc-settlement-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

.yc-settlement-card__row--total {
  padding-top: var(--sp-1);
  margin-top: var(--sp-1);
  border-top: 1px solid var(--cloud-dk);
}

.yc-settlement-card__label {
  color: var(--ink-60);
  font-weight: 600;
}

.yc-settlement-card__value {
  color: var(--ink);
  text-align: right;
}

/* ---- Scroll sentinel (lazy-load trigger) ---- */
.scroll-sentinel {
  height: 1px;
  text-align: center;
  padding: 16px 0;
  color: var(--ink-60, #888);
  font-size: 0.875rem;
}

/* ---- Mobile breakpoint (≤767px) ---- */
@media (max-width: 767px) {
  /* Page header */
  .yc-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
  }

  .yc-header-actions {
    flex-direction: column;
    gap: var(--sp-2);
  }

  .yc-header-date-filters {
    flex-wrap: wrap;
  }

  .yc-header-date-filters .yc-input {
    flex: 1;
    min-width: 0;
  }

  .yc-header-date-filters .yc-btn {
    width: 100%;
  }

  /* Filter bar: 전체 너비 */
  .yc-filter-bar {
    flex-direction: column;
    gap: var(--sp-2);
    padding: var(--sp-3);
    margin-bottom: var(--sp-3);
  }

  .yc-filter-group {
    width: 100%;
  }

  .yc-filter-group .yc-select,
  .yc-filter-group .yc-input {
    width: 100%;
    min-width: unset;
  }

  .yc-filter-group .yc-btn {
    width: 100%;
    min-width: unset;
  }

  /* 테이블: 모바일에서 숨김, 카드로 대체 */
  .yc-table-container {
    display: none;
  }

  .yc-reservation-cards {
    display: flex;
  }

  /* 정산: 모바일에서 테이블 숨김, 카드 표시 */
  .yc-settlement-cards {
    display: flex;
    flex-direction: column;
  }

  /* Detail grid: 1컬럼 */
  .yc-detail-grid {
    grid-template-columns: 1fr;
  }

  .yc-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }

  /* Card padding 축소 */
  .yc-card {
    padding: var(--sp-3);
  }
}
