/* 잇데이 v65 — 허브 카드 + 시트 폴리싱 (2026-04-30)
   AI 자동화 / 설정 / 스마트 캡처 등 hub 시트의 카드들에 통일된 인터랙션 + 그림자 + 타이포.
   디자인 토큰: css/tokens.css — --brand / --r-md / --space-4 / --shadow-md 등 사용. */

/* ── 시트 backdrop ────────────────────────────────────── */
#aiHubSheet,
#settingsHubSheet,
#smartCaptureSheet,
#undoHistorySheet,
#assistantFactsSheet,
#pricelistSheet {
  background: rgba(var(--bg-rgb,255,255,255),0.95);
}

/* ── 허브 카드 인터랙션 (AI hub) ───────────────────────── */
.aih-card,
.sc-mode-btn {
  position: relative;
  transition:
    transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.18s ease,
    border-color 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.aih-card:hover,
.sc-mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.aih-card:active,
.sc-mode-btn:active {
  transform: translateY(0) scale(0.98);
  transition: transform 0.06s ease;
}

/* ── 설정 허브 row ──────────────────────────────────── */
.sh-row {
  position: relative;
  transition:
    background 0.15s ease,
    transform 0.06s ease;
}
.sh-row:active {
  transform: scale(0.985);
  background: #EAEAEA !important;
}
.sh-row .sh-ic svg,
.sh-row .sh-chev svg {
  stroke: currentColor;
  fill: none;
}

/* ── 시트 카드 그림자·라운드 일관화 ──────────────────── */
#aihCard,
#shCard,
#scCard,
#uhsCard,
#afsCard,
#pricelistCard {
  box-shadow:
    0 -1px 0 rgba(0, 0, 0, 0.04),
    0 -4px 16px rgba(0, 0, 0, 0.08),
    0 -16px 48px rgba(0, 0, 0, 0.12);
}

/* ── 시트 닫기 버튼 hover ─────────────────────────────── */
#aihClose,
#shClose,
#scClose,
#uhsClose,
#afsClose,
#plClose {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
#aihClose:hover,
#shClose:hover,
#scClose:hover,
#uhsClose:hover,
#afsClose:hover,
#plClose:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* ── 어시스턴트 메모 row hover ───────────────────────── */
#afsList > div {
  transition: background 0.15s ease, transform 0.1s ease;
}
#afsList > div:hover {
  background: #F4F4F5 !important;
}

/* ── 토큰 정렬: 카드 텍스트 line-height + 자간 ───────── */
.aih-card,
.sc-mode-btn,
.sh-row {
  letter-spacing: -0.01em;
}

/* ── 다크 테마 backdrop ───────────────────────────────── */
html[data-theme="dark"] #aihCard,
html[data-theme="dark"] #shCard,
html[data-theme="dark"] #scCard,
html[data-theme="dark"] #uhsCard,
html[data-theme="dark"] #afsCard,
html[data-theme="dark"] #pricelistCard {
  background: var(--surface, #1A1F27);
  color: var(--text, #F3F5F7);
}
html[data-theme="dark"] .sh-row {
  background: var(--surface-2, #242A33);
  color: var(--text, #F3F5F7);
}
html[data-theme="dark"] .sh-row:active {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* ── 리듀스드 모션 (접근성) ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .aih-card,
  .sc-mode-btn,
  .sh-row,
  #aihCard,
  #shCard,
  #scCard,
  #uhsCard,
  #afsCard,
  #pricelistCard {
    transition: none !important;
  }
  .aih-card:hover,
  .sc-mode-btn:hover {
    transform: none;
  }
}

/* ── 고객 상세 패널 (06-customer.html) ───────────────────────── */
.cust-detail { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--r-md); padding: 18px; }
.cd-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cd-avatar-lg { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #F4C0D1, #BC6675); display: flex; align-items: center; justify-content: center; color: white; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.cd-name-row { flex: 1; }
.cd-name { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; display: flex; align-items: center; gap: 6px; }
.cd-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; font-weight: 500; }
.cd-edit { padding: 6px 12px; background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--r-sm); font-size: 11.5px; font-weight: 700; color: var(--text); cursor: pointer; }

.cd-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 12px 0; border-top: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border); margin-bottom: 14px; }
.cd-stat { text-align: center; }
.cd-stat-value { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.cd-stat-label { font-size: 10.5px; color: var(--text-3); margin-top: 2px; font-weight: 500; }

.cd-section { margin-bottom: 14px; }
.cd-sec-title { font-size: 11px; color: var(--text-3); font-weight: 700; letter-spacing: 0.3px; margin-bottom: 8px; text-transform: uppercase; }
.cd-info-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; }
.cd-info-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.cd-info-value { font-size: 12.5px; color: var(--text); font-weight: 600; text-align: right; }

.cd-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.cd-tag { font-size: 11px; padding: 3px 9px; background: var(--surface-2); border-radius: 999px; color: var(--text-2); font-weight: 500; }

.cd-history-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 0.5px solid var(--border); }
.cd-history-row:last-child { border-bottom: none; }
.cd-history-date { font-size: 10.5px; color: var(--text-3); font-weight: 600; min-width: 50px; }
.cd-history-text { font-size: 12px; color: var(--text); flex: 1; font-weight: 500; }
.cd-history-amount { font-size: 12px; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

.cd-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--border); }
.cd-act-btn { padding: 9px 0; background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--r-sm); font-size: 11.5px; font-weight: 700; color: var(--text); cursor: pointer; }
.cd-act-btn.primary { background: var(--text); color: white; border-color: var(--text); }

/* ── 재고 목록 (07-inventory.html) ────────────────────────── */
.inv-list { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 14px; margin-left: 16px; margin-right: 16px; }
.inv-list.danger { border-color: rgba(220,72,72,0.2); }
.inv-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 0.5px solid var(--border); transition: background 0.1s; }
.inv-item:last-child { border-bottom: none; }
.inv-item.low { background: rgba(220,72,72,0.08); }
.inv-item.low:last-child { border-bottom-left-radius: var(--r-md); border-bottom-right-radius: var(--r-md); }
.inv-item.editing { background: var(--surface-2); }
.inv-info { flex: 1; min-width: 0; }
.inv-name-row { display: flex; align-items: center; gap: 6px; }
.inv-name { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.inv-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.inv-low-badge { font-size: 9.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: white; }
.inv-forecast { font-size: 10.5px; color: var(--danger); font-weight: 600; }

.stepper { display: flex; align-items: center; gap: 0; background: var(--surface); border: 0.5px solid rgba(15,20,25,0.1); border-radius: 999px; padding: 2px; flex-shrink: 0; }
.stepper-btn { width: 26px; height: 26px; border-radius: 50%; background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 14px; font-weight: 700; }
.stepper-btn:hover { background: var(--surface-2); color: var(--text); }
.stepper-val { padding: 0 12px; font-size: 13px; font-weight: 700; color: var(--text); min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper-val.low { color: var(--danger); }

.inv-edit { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-3); flex-shrink: 0; margin-left: 4px; }
.inv-edit:hover { background: rgba(15,20,25,0.1); color: var(--text); }

