:root {
  /* ═════ JPK ERP — Design Tokens (freepasserp 동일 규격) ═════ */

  /* ── 간격 (4pt 기반) ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* ── 곡률 (freepasserp 동일) ── */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --radius-circle: 50%;
  --radius-ui: var(--radius-xs);

  /* ── 타이포그래피 ── */
  --font-size-xs: 10px;
  --font-size-sm: 11px;
  --font-size-base: 12px;
  --font-size-md: 14px;
  --font-size-lg: 15px;
  --font-size-xl: 17px;
  --font-size-2xl: 20px;
  --font-size-3xl: 28px;
  --font-weight-base: 300;
  --font-weight-strong: 400;
  --font-weight-heavy: 500;
  --letter-spacing-base: -0.03em;
  --font-size-main: var(--font-size-base);
  --font-size-sub: var(--font-size-xs);
  --font-size-title: var(--font-size-base);

  /* ── 높이 ── */
  --height-xs: 26px;
  --height-sm: 32px;
  --height-md: 38px;
  --height-lg: 42px;
  --height-xl: 46px;
  --height-2xl: 50px;

  /* ── 텍스트 컬러 ── */
  --text-main: #1e293b;
  --text-subtle: #64748b;
  --text-muted: #94a3b8;

  /* ── 보더 / 표면 ── */
  --border-main: #cbd5e1;
  --border-soft: #e2e8f0;
  --border-strong: #94a3b8;
  --surface-base: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-hover: #f1f5f9;
  --surface-selected: #eff6ff;
  --surface-sidebar: #f6f7f9;
  --surface-muted: #f1f5f9;

  /* ── 인터랙션 ── */
  --interactive-hover-bg: #f1f5f9;
  --interactive-hover-border: #cbd5e1;
  --interactive-active-bg: #e2e8f0;
  --interactive-active-border: #94a3b8;
  --interactive-selected-bg: #eff6ff;
  --interactive-selected-border: #93c5fd;
  --interactive-shadow-hover: 0 1px 2px rgba(15, 23, 42, 0.05);
  --interactive-shadow-focus: 0 0 0 2px rgba(59, 130, 246, 0.15);
  --transition-fast: 0.12s ease;
  --transition-normal: 0.15s ease;

  /* ── 버튼 ── */
  --btn-height: var(--height-sm);
  --btn-min-width: 58px;
  --btn-padding-x: 10px;
  --btn-font-size: var(--font-size-main);
  --btn-border-width: 1px;
  --btn-panel-height: var(--height-xs);
  --btn-gap: 4px;

  /* ── 패널 헤드 폰트 (전역 통일 — 그리드와 동일) ── */
  --panel-head-font: 12px;

  /* ── 패널 (freepasserp 동일 규격) ── */
  --panel-gap: var(--space-2);
  --panel-head-height: var(--height-md);
  --panel-head-py: 0;
  --panel-head-px: var(--space-3);
  --panel-body-pad: var(--space-3);
  --panel-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  --right-panel-width: 360px;
  --sidebar-width: 200px;

  /* ── 테이블 ── */
  --table-cell-py: 6px;
  --table-cell-px: var(--space-2);
  --table-head-bg: var(--surface-subtle);
  --table-head-color: var(--text-muted);

  /* ── 리스트 ── */
  --list-row-min-h: var(--height-lg);
  --list-row-px: var(--panel-head-px);
  --list-row-py: var(--space-2);

  /* ── 배지 ── */
  --badge-height: 22px;
  --badge-padding-x: 8px;
  --badge-font-size: var(--font-size-xs);
  --badge-radius: var(--radius-xs);
  --badge-min-width: 54px;

  /* ── 폼 ── */
  --form-label-size: 10px;
  --form-label-line-height: 1.35;
  --form-control-height: 42px;
  --form-control-px: 14px;
  --form-control-border: 1.5px solid transparent;
  --form-control-bg: #f2f3f7;
  --form-control-radius: 8px;
  --form-control-py: 6px;
  --form-control-textarea-min-h: 80px;
  --form-control-select-pr: 32px;
  --form-field-gap: 5px;
  --form-label-min-h: auto;
  --form-check-gap: 8px;
  --form-checkbox-size: 14px;

  /* ── 모바일 ── */
  --mobile-topbar-height: 46px;
  --mobile-tabbar-height: 56px;
}

html, body { height: 100%; }

body {
  margin: 0;
  background: #f5f6f8;
  color: var(--text-main);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--font-size-main);
  font-weight: var(--font-weight-base);
  letter-spacing: var(--letter-spacing-base);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

@media (prefers-color-scheme: dark) {
  :root {
    --text-main: #e2e8f0;
    --text-subtle: #94a3b8;
    --text-muted: #64748b;
    --border-main: #334155;
    --border-soft: #1e293b;
    --border-strong: #475569;
    --surface-base: #0f172a;
    --surface-subtle: #1e293b;
    --surface-hover: #334155;
    --surface-selected: #1e3a5f;
    --surface-sidebar: #0f172a;
    --surface-muted: #1e293b;
    --interactive-hover-bg: #334155;
    --interactive-selected-bg: #1e3a5f;
    --interactive-selected-border: #3b82f6;
  }
  body { background: #020617; }
}

html.no-transition,
html.no-transition *,
html.no-transition *::before,
html.no-transition *::after {
  transition: none !important;
  animation: none !important;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

.empty-block,
.manage-idle-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 120px;
  height: 100%;
  padding: var(--space-6);
  font-size: var(--font-size-sub);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
/* hidden 속성은 클래스 specificity 에 묻히므로 명시적으로 풀어줘야 함 */
.empty-block[hidden],
.manage-idle-hint[hidden] { display: none !important; }

/* ── 스크롤바 (호버 시 표시) ── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; }
*:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); }
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover { scrollbar-color: rgba(0,0,0,0.1) transparent; }
