/* ─────────────────────────────────────────────
 * 고객관리 DB 연동 — 툴바, 테이블, 모달
 * ───────────────────────────────────────────── */

/* ── 툴바 ──────────────────────────────────── */
.cust-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.cust-search {
  flex: 1;
  min-width: 220px;
  position: relative;
}
.cust-search .ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 13px;
}
.cust-search input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 9px 12px 9px 36px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--gray-900);
}
.cust-search input:focus { outline: none; border-color: var(--primary); }

.cust-toolbar select {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: var(--gray-700);
  cursor: pointer;
}

/* ── 테이블 ────────────────────────────────── */
.cust-card { margin-top: 16px; }

.cust-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: inherit;
}
.cust-table thead th {
  position: sticky;
  top: 0;
  background: var(--gray-50);
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cust-table thead th.right { text-align: right; }
.cust-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.cust-table tbody td.right { text-align: right; }
.cust-table tbody tr.cust-row:hover {
  background: var(--gray-50);
}
.cust-table tabular { font-variant-numeric: tabular-nums; }
.cust-table .right { text-align: right; }

.cust-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--gray-900);
}
.cust-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  margin-top: 2px;
}
.cust-phone {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
}
.cust-na-date {
  font-size: 12px;
  font-weight: 800;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
}
.cust-na-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  margin-top: 2px;
}
.cust-last {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
}

.cust-actions-cell {
  white-space: nowrap;
}
.cust-act {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.12s;
  font-family: inherit;
}
.cust-act:hover { background: var(--gray-100); }
.cust-act.cust-danger { color: var(--danger); border-color: var(--danger-100); }
.cust-act.cust-danger:hover { background: var(--danger-50); }

/* ── 모달 ──────────────────────────────────── */
.cust-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 24, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: cmFadeIn 0.15s ease;
}

@keyframes cmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cust-modal-box {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cust-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
}
.cust-modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--gray-900);
}
.cust-modal-close {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 26px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.cust-modal-close:hover { background: var(--gray-100); color: var(--gray-700); }

.cust-modal-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cust-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cust-row-3 {
  display: grid;
  grid-template-columns: 1fr 110px 1fr;
  gap: 14px;
}

.cust-fld {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cust-fld > span {
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-500);
  letter-spacing: 0.02em;
}
.cust-fld input,
.cust-fld select,
.cust-fld textarea {
  width: 100%;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  font-family: inherit;
  transition: all 0.12s;
}
.cust-fld input:focus,
.cust-fld select:focus,
.cust-fld textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
}
.cust-fld textarea { resize: vertical; min-height: 60px; }

.cust-modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
}

/* 모바일 대응 */
@media (max-width: 720px) {
  .cust-row-2, .cust-row-3 { grid-template-columns: 1fr; }
}

/* chip 스타일 호환 (app.css 의 chip-* 사용) */
