/* ═══ WING Design System ═══ */
/* 프로젝트 전체에서 공유하는 공통 컴포넌트 클래스 */

@layer components {
  /* ── Layout ── */
  .wing-panel {
    @apply flex flex-col h-full overflow-hidden;
  }

  .wing-panel-scroll {
    @apply flex-1 overflow-y-auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bdL) transparent;
  }

  .wing-header-bar {
    @apply flex items-center justify-between shrink-0 px-5 border-b border-border;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .wing-sidebar {
    @apply flex flex-col border-r border-border;
    background: var(--bg1);
  }

  /* ── Card / Section ── */
  .wing-card {
    @apply rounded-md p-4 border border-border;
    background: var(--bg3);
  }

  .wing-card-sm {
    @apply rounded-sm p-3 border border-border;
    background: var(--bg3);
  }

  .wing-section {
    @apply rounded-md p-4 mb-3 border border-border;
    background: var(--bg3);
  }

  .wing-section-header {
    @apply text-[13px] font-bold font-korean mb-2;
  }

  .wing-section-desc {
    @apply text-[10px] font-korean leading-relaxed;
    color: var(--t3);
  }

  /* ── Typography ── */
  .wing-title {
    @apply text-[15px] font-bold font-korean;
  }

  .wing-subtitle {
    @apply text-[10px] font-korean mt-0.5;
    color: var(--t3);
  }

  .wing-label {
    @apply text-[11px] font-semibold font-korean;
  }

  .wing-value {
    @apply text-[11px] font-mono font-semibold;
  }

  .wing-meta {
    @apply text-[9px] font-korean;
    color: var(--t3);
  }

  /* ── Icon Badge ── */
  .wing-icon-badge {
    @apply w-10 h-10 rounded-md flex items-center justify-center text-lg;
  }

  .wing-icon-badge-sm {
    @apply w-[38px] h-[38px] rounded-[9px] flex items-center justify-center;
  }

  /* ── Badge ── */
  .wing-badge {
    @apply inline-flex items-center px-2 py-0.5 rounded text-[9px] font-bold font-korean;
  }

  /* ── Button ── */
  .wing-btn {
    @apply px-3 py-1.5 rounded-sm text-[11px] font-semibold cursor-pointer font-korean border-none;
    transition: all 0.15s;
  }

  .wing-btn-primary {
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: #fff;
  }

  .wing-btn-primary:hover {
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.3);
  }

  .wing-btn-secondary {
    @apply border border-border;
    background: var(--bg3);
    color: var(--t2);
  }

  .wing-btn-secondary:hover {
    background: var(--bgH);
  }

  .wing-btn-outline {
    @apply bg-transparent border border-border;
    color: var(--t2);
  }

  .wing-btn-outline:hover {
    background: var(--bgH);
  }

  .wing-btn-pdf {
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.08);
    color: var(--blue);
  }

  .wing-btn-danger {
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
  }

  /* ── Input ── */
  .wing-input {
    @apply w-full rounded-sm text-[11px] font-korean outline-none;
    padding: 6px 10px;
    background: var(--bg0);
    border: 1px solid var(--bd);
    color: var(--t1);
  }

  .wing-input:focus {
    border-color: var(--cyan);
  }

  .wing-input::placeholder {
    color: var(--t3);
  }

  /* ── Table ── */
  .wing-table {
    @apply w-full text-[10px] font-korean;
    border-collapse: collapse;
  }

  .wing-th {
    @apply text-left font-semibold;
    padding: 8px 10px;
    color: var(--t3);
    background: var(--bg2);
    border-bottom: 1px solid var(--bd);
  }

  .wing-td {
    padding: 8px 10px;
    color: var(--t2);
    border-bottom: 1px solid var(--bd);
  }

  .wing-tr-hover:hover {
    background: var(--bgH);
    cursor: pointer;
  }

  /* ── Tab Bar ── */
  .wing-tab-bar {
    @apply flex gap-0.5 rounded-lg p-1 border border-border;
    background: var(--bg3);
  }

  .wing-tab {
    @apply flex-1 py-2 px-1 text-xs font-semibold rounded-md text-center cursor-pointer font-korean;
    transition: all 0.15s;
    color: var(--t3);
    background: transparent;
    border: 1px solid transparent;
  }

  .wing-tab:hover {
    color: var(--t2);
  }

  .wing-tab.active {
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.08);
    color: var(--cyan);
  }

  /* ── Modal ── */
  .wing-overlay {
    @apply fixed inset-0 flex items-center justify-center;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
  }

  .wing-modal {
    @apply rounded-xl overflow-hidden;
    background: var(--bg1);
    border: 1px solid var(--bd);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  }

  .wing-modal-header {
    @apply flex items-center justify-between px-5 border-b border-border;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  /* ── Utility ── */
  .wing-divider {
    @apply w-full;
    height: 1px;
    background: var(--bd);
  }

  .wing-kv-row {
    @apply flex items-center justify-between;
    padding: 6px 0;
  }

  .wing-kv-label {
    @apply text-[10px] font-korean;
    color: var(--t3);
  }

  .wing-kv-value {
    @apply text-[11px] font-semibold font-mono;
  }
}
