/* SecureVault 디자인 시스템 — 공용 컴포넌트(버튼·폼·카드·테이블·배지·다이얼로그·드로어·토스트·탭·스켈레톤·빈상태 등). 시맨틱 토큰만 사용 */

/* ── 아이콘 ──────────────────────────────── */
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; stroke-width: 1.75; }

/* ── 버튼 ────────────────────────────────── */
.btn {
  --btn-h: var(--control-md);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--btn-h); padding: 0 var(--space-4);
  border-radius: var(--control-radius);
  border: 1px solid transparent;
  font-size: var(--text-base); font-weight: var(--weight-semibold);
  line-height: 1; white-space: nowrap;
  color: var(--text-strong);
  background: var(--surface-card);
  border-color: var(--border-default);
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
  user-select: none;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn .icon { width: 16px; height: 16px; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--text-on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-primary:active { background: var(--brand-active); }

.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary { background: transparent; border-color: var(--border-default); color: var(--text-strong); }
.btn-secondary:hover { background: var(--surface-hover); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-body); }
.btn-ghost:hover { background: var(--surface-hover); border-color: transparent; color: var(--text-strong); }

.btn-danger { background: transparent; border-color: var(--border-default); color: var(--danger-text); }
.btn-danger:hover { background: var(--danger-subtle); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { filter: brightness(.94); }

.btn-sm { --btn-h: var(--control-sm); padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { --btn-h: var(--control-lg); padding: 0 var(--space-6); font-size: var(--text-md); }
.btn-block { width: 100%; }
.btn-icon { width: var(--btn-h); padding: 0; }
.btn-icon.btn-sm { width: var(--control-sm); }

.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  color: var(--text-muted); animation: spin .7s linear infinite;
}
.btn-primary.is-loading::after, .btn-accent.is-loading::after, .btn-danger-solid.is-loading::after { color: rgba(255,255,255,.85); }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--control-radius) 0 0 var(--control-radius); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--control-radius) var(--control-radius) 0; }
.btn-group .btn.is-active { background: var(--brand-subtle); color: var(--text-brand); border-color: var(--border-brand); position: relative; z-index: 1; }

/* 세그먼트(기간 선택 등) */
.segmented { display: inline-flex; padding: 3px; background: var(--surface-sunken); border-radius: var(--control-radius); gap: 2px; }
.segmented button {
  height: 28px; padding: 0 var(--space-3); border-radius: calc(var(--control-radius) - 3px);
  font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-muted);
}
.segmented button:hover { color: var(--text-strong); }
.segmented button[aria-pressed="true"] { background: var(--surface-card); color: var(--text-strong); box-shadow: var(--shadow-xs); }

/* ── 폼 ──────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-strong); }
.label .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: var(--text-xs); color: var(--text-muted); }
.field-error { font-size: var(--text-xs); color: var(--danger-text); display: none; }
.field.has-error .field-error { display: block; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }

.input, .select, .textarea {
  width: 100%; min-width: 0;
  height: var(--control-md);
  padding: 0 var(--space-3);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--control-radius);
  color: var(--text-strong);
  font-size: var(--text-base);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.textarea { height: auto; min-height: 96px; padding: var(--space-2) var(--space-3); resize: vertical; line-height: var(--leading-normal); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--border-brand); box-shadow: 0 0 0 3px var(--focus-ring); outline: none; }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-sunken); color: var(--text-muted); cursor: not-allowed; }
.input.mono { font-family: var(--font-mono); font-size: var(--text-sm); }
.input-sm { height: var(--control-sm); font-size: var(--text-sm); }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 36px; }
.input-group > .icon { position: absolute; left: 11px; color: var(--text-faint); pointer-events: none; }
.input-group .input-suffix { position: absolute; right: 6px; }
.input-group.has-suffix .input { padding-right: 40px; }

/* 체크/라디오 */
.check { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: var(--text-base); color: var(--text-body); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.check input:disabled + span { color: var(--text-faint); }

/* 스위치 */
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 38px; height: 22px; border-radius: var(--radius-pill);
  background: var(--border-default); position: relative; flex-shrink: 0;
  transition: background var(--duration-base);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform var(--duration-base) var(--ease-standard);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--focus-ring); }
.switch input:disabled + .track { opacity: .5; cursor: not-allowed; }
.switch .switch-label { font-size: var(--text-base); color: var(--text-body); }

/* ── 카드 ────────────────────────────────── */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: var(--space-5); }
.card-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.card-head h3 { font-size: var(--text-md); font-family: var(--font-body); font-weight: var(--weight-semibold); letter-spacing: 0; }
.card-head .hint { margin-left: var(--space-1); }
.card-head .actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }
.card-body { padding: var(--space-5); }
.card-body.flush { padding: 0; }
.card-foot { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-subtle); display: flex; gap: var(--space-2); align-items: center; }
.card.is-interactive { transition: box-shadow var(--duration-base), transform var(--duration-base), border-color var(--duration-base); cursor: pointer; }
.card.is-interactive:hover { box-shadow: var(--shadow-md); border-color: var(--border-default); transform: translateY(-1px); }
.card.tone-danger { border-color: var(--danger); }
.card.tone-warning { border-color: var(--warning); }

/* KPI 타일 */
.kpi {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-1);
  min-height: 104px;
}
.kpi .kpi-label { font-size: var(--text-sm); color: var(--text-muted); font-weight: var(--weight-medium); display: flex; align-items: center; gap: var(--space-2); }
.kpi .kpi-value { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: var(--display-weight); letter-spacing: -0.02em; color: var(--text-strong); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .kpi-sub { font-size: var(--text-xs); color: var(--text-muted); margin-top: auto; display: flex; align-items: center; gap: 6px; }
.kpi.tone-success .kpi-value { color: var(--success-text); }
.kpi.tone-warning .kpi-value { color: var(--warning-text); }
.kpi.tone-danger .kpi-value { color: var(--danger-text); }
.kpi.tone-brand .kpi-value { color: var(--text-brand); }
.delta { font-weight: var(--weight-semibold); }
.delta.up { color: var(--success-text); } .delta.down { color: var(--danger-text); }

/* ── 배지/칩/상태 ────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1;
  white-space: nowrap;
  background: var(--neutral-chip); color: var(--neutral-chip-text);
}
.badge .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.badge-brand { background: var(--brand-subtle); color: var(--text-brand); }
.badge-accent { background: var(--accent-subtle); color: var(--accent-hover); }
.badge-success { background: var(--success-subtle); color: var(--success-text); }
.badge-warning { background: var(--warning-subtle); color: var(--warning-text); }
.badge-danger { background: var(--danger-subtle); color: var(--danger-text); }
.badge-info { background: var(--info-subtle); color: var(--info-text); }
.badge-outline { background: transparent; border: 1px solid var(--border-default); color: var(--text-body); }
.badge.mono { font-family: var(--font-mono); font-weight: var(--weight-medium); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); display: inline-block; flex-shrink: 0; }
.status-dot.ok { background: var(--success); }
.status-dot.warn { background: var(--warning); }
.status-dot.fail { background: var(--danger); }
.status-dot.busy { background: var(--info); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px 0 10px; border-radius: var(--radius-pill);
  background: var(--surface-sunken); border: 1px solid var(--border-subtle);
  font-size: var(--text-xs); font-family: var(--font-mono); color: var(--text-body);
}
.tag button { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--text-muted); }
.tag button:hover { background: var(--danger-subtle); color: var(--danger-text); }

.kbd {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--border-default); border-bottom-width: 2px;
  background: var(--surface-card); font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
}

/* ── 알림(인라인) ───────────────────────── */
.alert {
  display: flex; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  border-left-width: 4px;
  background: var(--surface-card);
  font-size: var(--text-sm); color: var(--text-body);
}
.alert .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert .alert-title { font-weight: var(--weight-semibold); color: var(--text-strong); margin-bottom: 2px; }
.alert .alert-actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; flex-shrink: 0; }
.alert-info { border-left-color: var(--info); background: var(--info-subtle); } .alert-info .icon { color: var(--info-text); }
.alert-success { border-left-color: var(--success); background: var(--success-subtle); } .alert-success .icon { color: var(--success-text); }
.alert-warning { border-left-color: var(--warning); background: var(--warning-subtle); } .alert-warning .icon { color: var(--warning-text); }
.alert-danger { border-left-color: var(--danger); background: var(--danger-subtle); } .alert-danger .icon { color: var(--danger-text); }

/* ── 테이블 ──────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--surface-card); }
.table { width: 100%; font-size: var(--text-sm); }
.table th, .table td { padding: 10px var(--space-4); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border-subtle); }
.table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-sunken);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-muted);
  letter-spacing: .02em; white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-hover); }
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-selected td { background: var(--brand-subtle); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.mono { font-family: var(--font-mono); font-size: var(--text-xs); }
.table td.actions, .table th.actions { text-align: right; white-space: nowrap; }
.table td .cell-main { color: var(--text-strong); font-weight: var(--weight-medium); }
.table td .cell-sub { color: var(--text-muted); font-size: var(--text-xs); margin-top: 1px; }
.table .col-check { width: 36px; padding-right: 0; }
.table-dense th, .table-dense td { padding: 7px var(--space-3); }
.table td.empty-cell { text-align: center; color: var(--text-muted); padding: var(--space-8) var(--space-4); }

.table-toolbar {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.table-toolbar .grow { flex: 1; min-width: 160px; }
.table-toolbar .input-group { min-width: 220px; }

.pagination { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text-muted); flex-wrap: wrap; }
.pagination .spacer { flex: 1; }
.pagination .page-info { font-variant-numeric: tabular-nums; }

/* 선택 바 (일괄 처리) */
.bulk-bar {
  display: none; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--brand-subtle); border: 1px solid var(--border-brand); border-radius: var(--radius-md);
  margin-bottom: var(--space-3); font-size: var(--text-sm); color: var(--text-brand);
}
.bulk-bar.is-visible { display: flex; }
.bulk-bar .actions { margin-left: auto; display: flex; gap: var(--space-2); }

/* 정의 목록 */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); font-size: var(--text-sm); }
.dl dt { color: var(--text-muted); white-space: nowrap; }
.dl dd { color: var(--text-strong); min-width: 0; word-break: break-all; }
.dl dd.mono { font-family: var(--font-mono); font-size: var(--text-xs); }

/* 코드 블록 */
.code-block {
  background: var(--surface-code); color: var(--text-code);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.6;
  overflow-x: auto; white-space: pre; position: relative;
}
.code-block .copy-btn { position: absolute; top: 8px; right: 8px; color: var(--text-code); opacity: .6; }
.code-block .copy-btn:hover { opacity: 1; background: rgba(255,255,255,.1); }
.secret-box {
  font-family: var(--font-mono); font-size: var(--text-sm); word-break: break-all;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--surface-sunken); border: 1px dashed var(--border-default); color: var(--text-strong);
  user-select: all;
}

/* ── 탭 ──────────────────────────────────── */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--space-4); overflow-x: auto; }
.tabs button, .tabs a {
  height: 38px; padding: 0 var(--space-3); margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-muted);
  white-space: nowrap; text-decoration: none;
}
.tabs button:hover, .tabs a:hover { color: var(--text-strong); text-decoration: none; }
.tabs [aria-selected="true"] { color: var(--text-brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; } .tab-panel.is-active { display: block; }

/* ── 드롭다운 메뉴 ──────────────────────── */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px;
  background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: var(--space-1); z-index: var(--z-dropdown);
  display: none;
}
.menu.is-open { display: block; animation: menu-in var(--duration-fast) var(--ease-out); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; padding: 8px 10px; border-radius: calc(var(--radius-md) - 4px);
  font-size: var(--text-sm); color: var(--text-body); text-align: left; text-decoration: none;
}
.menu-item:hover { background: var(--surface-hover); color: var(--text-strong); text-decoration: none; }
.menu-item.is-active { color: var(--text-brand); background: var(--brand-subtle); }
.menu-item.danger { color: var(--danger-text); }
.menu-item .icon { width: 16px; height: 16px; }
.menu-sep { height: 1px; background: var(--border-subtle); margin: var(--space-1) 0; }
.menu-head { padding: 8px 10px 4px; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }

/* 테마 스와치 */
.theme-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-default); flex-shrink: 0; background: var(--sw-bg, #fff); position: relative; overflow: hidden; }
.theme-swatch::after { content: ""; position: absolute; inset: 0 0 0 50%; background: var(--sw-brand, #000); }

/* 아바타 */
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--brand-subtle); color: var(--text-brand); font-weight: var(--weight-bold); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: .02em; flex-shrink: 0;
}
.avatar-lg { width: 44px; height: 44px; font-size: var(--text-base); }

/* ── 다이얼로그 ──────────────────────────── */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: var(--z-dialog);
  background: var(--surface-overlay);
  display: none; align-items: center; justify-content: center; padding: var(--space-4);
}
.dialog-backdrop.is-open { display: flex; animation: fade-in var(--duration-fast); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog {
  width: 100%; max-width: 460px;
  background: var(--surface-raised); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  animation: dialog-in var(--duration-base) var(--ease-out);
  display: flex; flex-direction: column; max-height: calc(100vh - 32px);
}
.dialog-lg { max-width: 680px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-head { padding: var(--space-5) var(--space-6) 0; display: flex; align-items: flex-start; gap: var(--space-3); }
.dialog-head h2 { font-size: var(--text-lg); }
.dialog-head .dialog-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--brand-subtle); color: var(--text-brand); }
.dialog-head .dialog-icon.danger { background: var(--danger-subtle); color: var(--danger-text); }
.dialog-head .dialog-icon.warning { background: var(--warning-subtle); color: var(--warning-text); }
.dialog-head .close { margin-left: auto; }
.dialog-body { padding: var(--space-3) var(--space-6) var(--space-2); color: var(--text-body); font-size: var(--text-base); overflow-y: auto; }
.dialog-body p + p { margin-top: var(--space-2); }
.dialog-foot { padding: var(--space-4) var(--space-6) var(--space-5); display: flex; justify-content: flex-end; gap: var(--space-2); }

/* ── 드로어(상세 패널) ─────────────────── */
.drawer-backdrop { position: fixed; inset: 0; z-index: var(--z-drawer); background: var(--surface-overlay); display: none; }
.drawer-backdrop.is-open { display: block; animation: fade-in var(--duration-fast); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: calc(var(--z-drawer) + 1);
  width: min(520px, 100vw);
  background: var(--surface-raised); border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform var(--duration-slow) var(--ease-out);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }
.drawer-head { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: flex-start; gap: var(--space-3); }
.drawer-head h2 { font-size: var(--text-lg); }
.drawer-head .close { margin-left: auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--space-5); }
.drawer-foot { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-subtle); display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }
.drawer-section { margin-bottom: var(--space-6); }
.drawer-section h3 { font-size: var(--text-sm); font-family: var(--font-body); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: var(--space-3); font-weight: var(--weight-semibold); }

/* ── 토스트 ──────────────────────────────── */
.toast-wrap { position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-2); max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-raised); border: 1px solid var(--border-subtle); border-left: 4px solid var(--info);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  font-size: var(--text-sm); color: var(--text-body);
  animation: toast-in var(--duration-base) var(--ease-out);
}
.toast .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--info-text); flex-shrink: 0; }
.toast .toast-title { font-weight: var(--weight-semibold); color: var(--text-strong); }
.toast .toast-msg { word-break: break-word; }
.toast .close { margin-left: auto; color: var(--text-faint); flex-shrink: 0; }
.toast.success { border-left-color: var(--success); } .toast.success .icon { color: var(--success-text); }
.toast.warning { border-left-color: var(--warning); } .toast.warning .icon { color: var(--warning-text); }
.toast.error { border-left-color: var(--danger); } .toast.error .icon { color: var(--danger-text); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity var(--duration-base), transform var(--duration-base); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── 스켈레톤 / 빈 상태 / 로딩 ──────────── */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--surface-sunken); border-radius: var(--radius-sm);
  min-height: 14px;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
[data-theme="vault"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-row { display: flex; gap: var(--space-3); padding: 12px var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.skeleton-row .skeleton { height: 14px; flex: 1; }
.skeleton-row .skeleton.w-s { flex: 0 0 60px; } .skeleton-row .skeleton.w-m { flex: 0 0 120px; }

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--text-muted);
}
.empty .empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-faint); margin-bottom: var(--space-3); }
.empty .empty-icon .icon { width: 22px; height: 22px; }
.empty h3 { font-size: var(--text-md); font-family: var(--font-body); font-weight: var(--weight-semibold); letter-spacing: 0; color: var(--text-strong); margin-bottom: var(--space-1); }
.empty p { font-size: var(--text-sm); max-width: 44ch; }
.empty .actions { margin-top: var(--space-4); display: flex; gap: var(--space-2); }
.empty.compact { padding: var(--space-6); }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-default); border-top-color: var(--brand); animation: spin .7s linear infinite; display: inline-block; }

/* 진행 바 */
.progress { height: 6px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width var(--duration-slow) var(--ease-standard); }
.progress.indeterminate > span { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.progress.tone-success > span { background: var(--success); }
.progress.tone-warning > span { background: var(--warning); }
.progress.tone-danger > span { background: var(--danger); }

/* 스텝퍼 (체크리스트/온보딩) */
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); align-items: flex-start; }
.step:last-child { border-bottom: 0; }
.step .step-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-default); display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; color: transparent; }
.step.is-done .step-mark { background: var(--success); border-color: var(--success); color: #fff; }
.step .step-mark .icon { width: 12px; height: 12px; stroke-width: 3; }
.step .step-title { font-weight: var(--weight-semibold); color: var(--text-strong); font-size: var(--text-base); }
.step.is-done .step-title { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.step .step-desc { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.step .step-action { margin-left: auto; flex-shrink: 0; }

/* 체크 리스트(시스템 상태) */
.check-list { display: flex; flex-direction: column; }
.check-item { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); align-items: flex-start; }
.check-item:last-child { border-bottom: 0; }
.check-item .check-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.check-item .check-icon .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.check-item.ok .check-icon { background: var(--success-subtle); color: var(--success-text); }
.check-item.warn .check-icon { background: var(--warning-subtle); color: var(--warning-text); }
.check-item.fail .check-icon { background: var(--danger-subtle); color: var(--danger-text); }
.check-item.unknown .check-icon { background: var(--neutral-chip); color: var(--text-muted); }
.check-item .check-title { font-weight: var(--weight-semibold); color: var(--text-strong); }
.check-item .check-detail { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.check-item .check-fix { font-size: var(--text-sm); color: var(--text-body); margin-top: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--surface-sunken); border-radius: var(--radius-sm); }
.check-item .check-fix code { font-size: 11px; }
.check-item .check-meta { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); white-space: nowrap; }

/* 업로드 드롭존 */
.dropzone {
  border: 2px dashed var(--border-default); border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-6); text-align: center;
  background: var(--surface-card); cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--brand); background: var(--brand-subtle); }
.dropzone .dz-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto var(--space-3); background: var(--brand-subtle); color: var(--text-brand); }
.dropzone .dz-title { font-weight: var(--weight-semibold); color: var(--text-strong); font-size: var(--text-md); }
.dropzone .dz-title span { color: var(--text-brand); }
.dropzone .dz-sub { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-1); }

/* 타임라인 */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { position: relative; padding-left: 26px; padding-bottom: var(--space-4); }
.timeline-item::before { content: ""; position: absolute; left: 7px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.timeline-item::after { content: ""; position: absolute; left: 11px; top: 18px; bottom: 0; width: 1px; background: var(--border-subtle); }
.timeline-item:last-child::after { display: none; }
.timeline-item.ok::before { background: var(--success); } .timeline-item.fail::before { background: var(--danger); } .timeline-item.warn::before { background: var(--warning); }
.timeline-item .tl-title { font-weight: var(--weight-medium); color: var(--text-strong); font-size: var(--text-sm); }
.timeline-item .tl-meta { font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }

/* 툴팁(제목 속성 대체, data-tip) */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  background: var(--surface-inverse); color: var(--text-inverse);
  padding: 4px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; z-index: var(--z-dropdown);
  pointer-events: none;
}

/* 배너(공지·대리접속) */
.banner { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--content-pad); font-size: var(--text-sm); }
.banner-info { background: var(--info-subtle); color: var(--info-text); border-bottom: 1px solid var(--border-subtle); }
.banner-warning { background: var(--warning-subtle); color: var(--warning-text); border-bottom: 1px solid var(--border-subtle); }
.banner .actions { margin-left: auto; display: flex; gap: var(--space-2); }

/* 미니 차트 컨테이너 */
.chart { width: 100%; height: 220px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-legend { display: flex; gap: var(--space-4); font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-2); }
.chart-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--lg, var(--chart-1)); vertical-align: -1px; }
