/* =================================================================
   VRECORD 사내 인트라넷 — Ver A (Conservative · Balanced)
   Design tokens 기반, Pretendard + Roboto 타이포그래피
   ================================================================= */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

:root {
  /* 시그니처 컬러 */
  --c-lime-500: #BBFF00;
  --c-lime-600: #8ACF1A;
  --c-lime-050: #EFFFBD;

  /* 칠판 */
  --c-chalk-900: #1F2924;
  --c-chalk-700: #267C57;
  --c-chalk-500: #5CB891;
  --c-chalk-100: #EAF4F0;

  /* 뉴트럴 */
  --c-ink-900: #16151A;
  --c-ink-700: #403B3B;
  --c-ink-500: #646464;
  --c-ink-300: #A7A7A7;
  --c-paper-100: #F1F4F5;
  --c-paper-050: #F8F9FA;
  --c-paper-000: #FFFFFF;

  /* Ver A 컴포넌트 색상 */
  --va-bg: #F8F9FA;
  --va-panel: #FFFFFF;
  --va-border: #E7EAEC;
  --va-border-strong: #D4D8DB;
  --va-hairline: #EEF0F1;
  --va-muted: var(--c-ink-500);
  --va-subtle: var(--c-ink-300);
  --va-ink: var(--c-ink-900);
  --va-ok: var(--c-chalk-700);
  --va-warn: #D97706;
  --va-danger: #DC2626;

  /* 상태 (근무/퇴근/휴가/미출근) */
  --c-status-working-bg: #E7F6ED;
  --c-status-working-fg: var(--c-chalk-700);
  --c-status-out-bg:     #EEF0F1;
  --c-status-out-fg:     var(--c-ink-500);
  --c-status-leave-bg:   #FFF4CC;
  --c-status-leave-fg:   #8A6D00;
  --c-status-none-bg:    #F4F5F6;
  --c-status-none-fg:    var(--c-ink-300);

  --r-sm: 4px;
  --r-md: 7px;
  --r-lg: 12px;
  --r-pill: 999px;

  --ff-body: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ff-mono: "Roboto", "Pretendard", ui-monospace, monospace;
}

/* ─── 다크 테마 — CSS 변수 오버라이드 ─────────────────────── */
html[data-theme="dark"] {
  color-scheme: dark;

  --va-bg: #0E1311;
  --va-panel: #161C1A;
  --va-border: #222A27;
  --va-border-strong: #2E3833;
  --va-hairline: #1E2523;
  --va-ink: #EAF4F0;
  --va-muted: #9AA7A2;
  --va-subtle: #65706B;

  --c-paper-100: #1E2523;
  --c-paper-050: #161C1A;
  --c-paper-000: #0E1311;

  --c-ink-900: #EAF4F0;
  --c-ink-700: #B8C4BF;
  --c-ink-500: #8A948F;
  --c-ink-300: #65706B;

  --c-chalk-100: rgba(92, 184, 145, 0.18);

  --c-status-working-bg: rgba(92, 184, 145, 0.18);
  --c-status-working-fg: #7ED8AE;
  --c-status-out-bg:     rgba(255,255,255,0.06);
  --c-status-out-fg:     #9AA7A2;
  --c-status-leave-bg:   rgba(230, 184, 0, 0.18);
  --c-status-leave-fg:   #F0C256;
  --c-status-none-bg:    rgba(255,255,255,0.04);
  --c-status-none-fg:    #65706B;
}

html[data-theme="dark"] body { background: var(--va-bg); }

/* 다크에서 lime 대신 좀 더 차분한 톤의 녹색을 CTA primary 로 사용해 시인성 확보 */
html[data-theme="dark"] .va-cta:not(.va-cta--out):not(.va-cta--done) {
  background: #8ACF1A;
  color: #0E1311;
  font-weight: 800;
}
html[data-theme="dark"] .va-cta:not(.va-cta--out):not(.va-cta--done):hover {
  background: #A8E332;
}
html[data-theme="dark"] .va-cta--out {
  background: #EAF4F0;
  color: #0E1311;
}
html[data-theme="dark"] .va-cta--out:hover { background: #fff; }
html[data-theme="dark"] .va-cta--done {
  background: rgba(255, 255, 255, 0.06);
  color: var(--va-subtle);
}

/* Chips — 다크에서 배경을 조금 더 진하게, 전경은 살짝 낮춰 가독성 유지 */
html[data-theme="dark"] .va-chip--good { background: rgba(92, 184, 145, 0.22); color: #90DFB5; }
html[data-theme="dark"] .va-chip--mid  { background: rgba(230,184,0,0.22);  color: #F0C256; }
html[data-theme="dark"] .va-chip--bad  { background: rgba(220,38,38,0.22);  color: #F38078; }

html[data-theme="dark"] .va-skeleton {
  background: linear-gradient(90deg, #1E2523 0%, #222A27 50%, #1E2523 100%);
}
html[data-theme="dark"] .login-card { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4); }

/* 활성 메뉴 — 배경 채도 낮추고 액션 라일 색상을 lime-600 으로 */
html[data-theme="dark"] .va-nav a.is-active {
  background: rgba(138, 207, 26, 0.14);
  color: #CDEB8A;
}
html[data-theme="dark"] .va-nav a.is-active .rail { background: #8ACF1A; }

/* 세그먼트 활성 상태: 배경만 살짝 밝게, 글자 lime 은 가독성 낮으니 ink */
html[data-theme="dark"] .va-seg button.is-active {
  background: var(--va-panel);
  color: var(--va-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .va-presence__more { background: rgba(255,255,255,0.04); }
html[data-theme="dark"] .va-presence__more:hover { background: rgba(255,255,255,0.08); }

/* 아바타 라임 링 살짝 낮은 채도로 */
html[data-theme="dark"] .va-avatar {
  box-shadow: 0 0 0 3px #8ACF1A, 0 0 0 5px var(--va-panel);
}

/* 캘린더 NOW 뱃지 다크에서 살짝 톤다운 */
html[data-theme="dark"] .va-cal__item .now-tag {
  background: #8ACF1A;
  color: #0E1311;
}

/* 로그인 버튼 라임 포커스 링 톤다운 */
html[data-theme="dark"] .login-card .btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(138, 207, 26, 0.40);
}

/* 토글 active seg 글자 톤다운 */
html[data-theme="dark"] .va-theme-toggle .seg[data-theme="dark"] {
  color: #CDEB8A;
}
html[data-theme="dark"] .va-field input,
html[data-theme="dark"] .va-field select,
html[data-theme="dark"] .va-inline-field input {
  background: #1E2523;
  border-color: #2E3833;
  color: var(--va-ink);
}
html[data-theme="dark"] .va-field input:focus,
html[data-theme="dark"] .va-field select:focus,
html[data-theme="dark"] .va-inline-field input:focus {
  border-color: var(--c-lime-500);
  box-shadow: 0 0 0 3px rgba(187, 255, 0, 0.22);
}
/* 다크에서 native date picker 아이콘 반전 */
html[data-theme="dark"] .va-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

* { box-sizing: border-box; }

/* 얇은 커스텀 스크롤바 — Webkit/Blink */
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(100, 100, 100, 0.25);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 100, 0.45);
}
html[data-theme="dark"] *::-webkit-scrollbar-thumb {
  background: rgba(234, 244, 240, 0.12);
}
html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background: rgba(234, 244, 240, 0.25);
}
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: rgba(100,100,100,0.25) transparent; }
html[data-theme="dark"] * { scrollbar-color: rgba(234,244,240,0.12) transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--va-bg);
  color: var(--va-ink);
  font-family: var(--ff-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; }
a { color: inherit; }

/* =================================================================
   LEGACY (base.html) — leaves/admin pages 유지
   ================================================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--va-panel);
  border-bottom: 1px solid var(--va-border);
  color: var(--va-ink);
}
.topbar .brand {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--va-ink);
}
.topbar nav a {
  color: var(--va-muted);
  text-decoration: none;
  margin-left: 20px;
  font-weight: 600;
  font-size: 13px;
}
.topbar nav a:hover { color: var(--va-ink); }
.topbar .user { margin: 0 12px 0 20px; color: var(--va-subtle); font-size: 13px; }

body:not(.dashboard-body) main { max-width: 1180px; margin: 28px auto; padding: 0 24px; }

.card {
  background: var(--va-panel);
  border: 1px solid var(--va-border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.today {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px 16px;
  margin: 12px 0 18px;
}
.today dt { color: var(--va-muted); font-size: 13px; }
.today dd { margin: 0; font-weight: 700; font-family: var(--ff-mono); }
.work-type-select { margin: 12px 0; display: flex; gap: 16px; font-size: 13px; color: var(--va-muted); }
.actions { display: flex; gap: 10px; margin-top: 10px; }
.btn {
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--va-border-strong);
  background: var(--va-panel);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--va-ink);
}
.btn.primary {
  background: var(--c-lime-500);
  color: var(--va-ink);
  border-color: var(--c-lime-500);
}
.btn:hover { transform: translateY(-0.5px); }
.message { margin-top: 10px; min-height: 18px; color: var(--va-ok); font-size: 13px; font-weight: 600; }
.message.error { color: var(--va-danger); }

/* Legacy pages — leave/admin tables */
.admin-header { display: flex; align-items: center; gap: 12px; }
.admin-header h2 { margin: 0; flex: 1; }
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.summary .kv {
  background: var(--va-bg);
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--va-hairline);
}
.summary .kv .k { color: var(--va-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.summary .kv .v { font-size: 20px; font-weight: 800; font-family: var(--ff-mono); margin-top: 3px; }

.stats-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.stats-table th, .stats-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--va-hairline);
}
.stats-table th {
  background: var(--va-bg);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--va-muted);
  font-weight: 700;
}

.presence-list { list-style: none; padding: 0; margin: 0; }
.presence-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--va-hairline);
}
.presence-item .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--va-subtle);
  flex-shrink: 0;
}
.presence-working .dot { background: var(--c-chalk-700); }
.presence-out .dot     { background: var(--va-muted); }
.presence-leave .dot   { background: #E6B800; }
.presence-none .dot    { background: #C9CED1; }
.presence-item .name { font-weight: 700; min-width: 110px; }
.presence-item .label { color: var(--va-muted); font-size: 13px; }

.leave-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.leave-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--va-muted); font-weight: 600;
}
.leave-form input, .leave-form select {
  padding: 9px 12px;
  border: 1px solid var(--va-border-strong);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  background: var(--va-panel);
}
.leave-form button { grid-column: 1 / -1; justify-self: start; }
.leave-form .message { grid-column: 1 / -1; }

.status { padding: 3px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; background: var(--va-bg); }
.status-pending  { background: #FFF4CC; color: #8A6D00; }
.status-approved { background: var(--c-status-working-bg); color: var(--c-status-working-fg); }
.status-rejected { background: #FADAD5; color: #A8342C; }
.muted { color: var(--va-subtle); }

.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 24px;
}
.login-card {
  background: var(--va-panel);
  border: 1px solid var(--va-border);
  border-radius: 18px;
  padding: 52px 56px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--c-lime-500), var(--c-chalk-500));
}
.login-card .login-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: 20px; color: var(--va-ink);
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.login-card p { margin: 0 0 28px; color: var(--va-muted); font-size: 13px; }
.login-card .btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 24px;
  background: var(--va-ink);
  color: #fff;
  border: 1px solid var(--va-ink);
  outline: none;
  font-weight: 700;
  text-decoration: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.login-card .btn:hover {
  background: #000;
  border-color: #000;
  transform: none;        /* 전역 .btn:hover translateY jitter 차단 */
}
.login-card .btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(187, 255, 0, 0.40);
}

/* =================================================================
   DASHBOARD — Ver A (전용 레이아웃)
   ================================================================= */
body.dashboard-body { background: var(--va-bg); overflow: hidden; }

.va-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  width: 100vw;
  background: var(--va-bg);
  color: var(--va-ink);
  font-family: var(--ff-body);
}

/* ─── Sidebar ──────────────────────────────────────────── */
.va-sidebar {
  background: var(--va-panel);
  border-right: 1px solid var(--va-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.va-brand {
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--va-hairline);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.12s;
}
a.va-brand:hover { opacity: 0.75; }
.va-brand__mark { color: var(--va-ink); flex-shrink: 0; }
.va-brand__name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.va-brand__tag {
  margin-left: auto;
  font-size: 10px;
  color: var(--va-subtle);
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* 유저 카드 */
.va-user {
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid var(--va-hairline);
  text-align: center;
}
.va-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--c-chalk-100);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 26px;
  color: var(--va-ink);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--c-lime-500), 0 0 0 5px var(--va-panel);
  overflow: hidden;
  position: relative;
}
.va-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.va-avatar .va-avatar__initials { line-height: 1; }
.va-avatar--sm {
  width: 32px; height: 32px;
  font-size: 12px;
  background: var(--c-paper-100);
  box-shadow: none;
}
.va-user__name { margin-top: 14px; font-size: 17px; font-weight: 700; }
.va-user__email { font-size: 12px; color: var(--va-muted); margin-top: 3px; }
.va-user__meta {
  display: flex; gap: 6px; align-items: center;
  margin-top: 10px; font-size: 11px; color: var(--va-subtle);
}
.va-user__meta span.dot-sep {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--va-subtle);
}
.va-user__badge { margin-top: 14px; }

/* Status badge */
.va-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
}
.va-status::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.va-status--working { background: var(--c-status-working-bg); color: var(--c-status-working-fg); }
.va-status--out     { background: var(--c-status-out-bg);     color: var(--c-status-out-fg); }
.va-status--leave   { background: var(--c-status-leave-bg);   color: var(--c-status-leave-fg); }
.va-status--none    { background: var(--c-status-none-bg);    color: var(--c-status-none-fg); }

/* Punch 영역 */
.va-punch {
  padding: 22px 24px;
  border-bottom: 1px solid var(--va-hairline);
}
.va-punch__label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--va-subtle);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.va-punch__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.va-punch__cell {
  padding: 12px;
  background: var(--va-bg);
  border-radius: 8px;
}
.va-punch__cell .k {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--va-subtle);
  font-weight: 600;
  text-transform: uppercase;
}
.va-punch__cell .v {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--ff-mono);
  margin-top: 3px;
  color: var(--va-ink);
}
.va-punch__cell .v.empty { color: var(--va-subtle); }

/* Work-type segmented */
.va-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  background: var(--va-bg);
  border-radius: 8px;
  margin-bottom: 14px;
}
.va-seg button {
  padding: 8px 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--va-muted);
  transition: all 0.14s ease;
}
.va-seg button.is-active {
  background: var(--va-panel);
  color: var(--va-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.va-seg button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.va-seg button:disabled:not(.is-active) { color: var(--va-subtle); }

/* CTA */
.va-cta {
  display: block;
  width: 100%;
  padding: 13px 0;
  border: none;
  border-radius: 8px;
  background: var(--c-lime-500);
  color: var(--va-ink);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: transform 0.08s, background 0.12s;
}
.va-cta:hover { background: var(--c-lime-600); }
.va-cta:active { transform: scale(0.98); }
.va-cta--out {
  background: var(--va-ink);
  color: #fff;
}
.va-cta--out:hover { background: #000; }
.va-cta--done {
  background: var(--va-hairline);
  color: var(--va-subtle);
  cursor: not-allowed;
}
.va-cta--done:hover { background: var(--va-hairline); transform: none; }

.va-punch__msg {
  margin-top: 10px;
  font-size: 12px;
  color: var(--va-ok);
  text-align: center;
  min-height: 16px;
  font-weight: 600;
}
.va-punch__msg.error { color: var(--va-danger); }

/* Nav */
.va-nav {
  padding: 16px 14px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
/* 사이드바 하단 빈 공간 — punch 영역을 위로 정렬 유지 */
.va-sidebar__spacer { flex: 1; min-height: 0; }
.va-nav__label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--va-subtle);
  font-weight: 700;
  padding: 4px 10px 8px;
  text-transform: uppercase;
}
.va-nav__label + .va-nav__label,
.va-nav > .va-nav__label:not(:first-child) { padding-top: 20px; }

.va-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 7px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--va-muted);
  margin-bottom: 2px;
  position: relative;
  transition: background 0.1s;
}
.va-nav a:hover { background: var(--va-bg); color: var(--va-ink); }
.va-nav a.is-active {
  background: #F3F5F6;
  color: var(--va-ink);
  font-weight: 700;
}
.va-nav a .rail {
  width: 3px; height: 16px; border-radius: 2px;
  background: transparent;
  flex-shrink: 0;
}
.va-nav a.is-active .rail { background: var(--c-lime-500); }
.va-nav a .admin-tag {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 6px;
  background: var(--c-chalk-100);
  color: var(--c-chalk-700);
  border-radius: 4px;
  letter-spacing: 0.06em;
  font-weight: 800;
}

/* Sidebar footer — 다크모드 토글 · 버전 · 로그아웃 */
.va-sidefoot {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--va-hairline);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.va-sidefoot .va-theme-toggle {
  width: 100%;
  justify-content: stretch;
}
.va-sidefoot .va-theme-toggle .seg {
  flex: 1;
  justify-content: center;
}
.va-sidefoot__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.va-sidefoot__version {
  font-size: 11px;
  font-weight: 700;
  color: var(--va-subtle);
  letter-spacing: 0.06em;
  padding: 3px 8px;
  background: var(--va-bg);
  border-radius: 6px;
  border: 1px solid var(--va-border);
}
.va-sidefoot__logout {
  font-size: 12px;
  font-weight: 700;
  color: var(--va-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 7px;
  border: 1px solid var(--va-border);
  background: var(--va-panel);
  transition: background 0.15s, color 0.15s;
}
.va-sidefoot__logout:hover {
  background: var(--va-bg);
  color: var(--va-ink);
}

/* ─── Main content area ──────────────────────────────── */
.va-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden; /* 내부 va-scroll 만 스크롤 */
}

/* 고정 헤더 — 페이지 네비 · 날짜 (좁은 폭에서 wrap) */
.va-topbar--fixed {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 24px;
  border-bottom: 1px solid var(--va-border);
  background: var(--va-panel);
  flex-shrink: 0;
  min-height: 34px;
  gap: 10px;
  flex-wrap: wrap;
  row-gap: 4px;
}
.va-topbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 4px;
}
.va-topbar__date {
  font-size: 12px;
  color: var(--va-muted);
  font-weight: 600;
}

/* 헤더 네비 (관리자 전용 링크) */
.va-topnav {
  display: inline-flex;
  gap: 2px;
}
.va-topnav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--va-muted);
  text-decoration: none;
  border-radius: 6px;
}
.va-topnav a:hover { background: var(--va-bg); color: var(--va-ink); }
.va-topnav a.is-active { background: var(--va-bg); color: var(--va-ink); }

/* 스크롤 영역 */
.va-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
/* 페이지 상단 인사말 + 페이지별 액션 — 스크롤과 함께 사라짐 */
.va-greeting {
  padding: 14px 32px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  row-gap: 8px;
}
.va-greeting h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--va-ink);
}
.va-greeting__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  row-gap: 6px;
}
.va-greeting__actions:empty { display: none; }
/* greeting 과 content 사이 간격은 greeting 하단 패딩이 담당 — content 상단 패딩 축소 */
.va-scroll > .va-grid,
.va-scroll > .va-content { padding-top: 10px; }

/* 하위 호환 — .va-topbar (다른 페이지에서 남아있을 수 있음) */
.va-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--va-border);
  background: var(--va-panel);
  flex-shrink: 0;
}
.va-topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--va-ink);
}
.va-topbar .date {
  margin-top: 4px;
  font-size: 13px;
  color: var(--va-muted);
}
.va-topbar .actions { display: flex; gap: 10px; align-items: center; }
.va-topbar__divider {
  width: 1px;
  height: 18px;
  background: var(--va-border);
  margin: 0 4px;
}
.va-topbar__version {
  font-size: 11px;
  font-weight: 700;
  color: var(--va-subtle);
  letter-spacing: 0.06em;
  padding: 2px 8px;
  background: var(--va-bg);
  border-radius: 6px;
  border: 1px solid var(--va-border);
}
.va-topbar__logout {
  font-size: 12px;
  font-weight: 700;
  color: var(--va-muted);
  text-decoration: none;
  padding: 3px 12px;
  border-radius: 7px;
  border: 1px solid var(--va-border);
  background: var(--va-panel);
  transition: background 0.15s, color 0.15s;
}
.va-topbar__logout:hover {
  background: var(--va-bg);
  color: var(--va-ink);
}

/* 라이트/다크 테마 토글 */
.va-theme-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--va-bg);
  border: 1px solid var(--va-border);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  gap: 2px;
}
.va-theme-toggle .seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--va-muted);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
html[data-theme="light"] .va-theme-toggle .seg[data-theme="light"],
html:not([data-theme="dark"]) .va-theme-toggle .seg[data-theme="light"] {
  background: var(--va-panel);
  color: var(--va-ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
html[data-theme="dark"] .va-theme-toggle .seg[data-theme="dark"] {
  background: var(--va-panel);
  color: var(--c-lime-500);
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.va-theme-toggle .seg svg { flex-shrink: 0; }

.va-grid {
  padding: 32px 32px 32px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  align-content: start;
}
.va-col-wide { grid-column: span 8; display: grid; gap: 20px; min-width: 0; }
.va-col-narrow { grid-column: span 4; display: grid; gap: 20px; min-width: 0; }

/* 대시보드 외 페이지의 기본 content 컨테이너 */
.va-content {
  padding: 32px 32px 32px;
  display: block;
}
.va-content--narrow {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* Form (연차 신청 등) */
.va-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.va-field { display: flex; flex-direction: column; gap: 6px; }
.va-field--wide { grid-column: 1 / -1; }
.va-field__label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--va-subtle);
}
.va-field__hint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--va-subtle);
  margin-left: 4px;
  opacity: 0.7;
}
.va-field input,
.va-field select,
.va-inline-field input {
  padding: 10px 12px;
  border: 1px solid var(--va-border-strong);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--va-panel);
  color: var(--va-ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.va-field input:focus,
.va-field select:focus,
.va-inline-field input:focus {
  outline: none;
  border-color: var(--c-lime-500);
  box-shadow: 0 0 0 3px rgba(187, 255, 0, 0.16);
}
.va-form__actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.va-form__message {
  font-size: 13px;
  color: var(--va-ok);
  font-weight: 600;
}
.va-form__message.error { color: var(--va-danger); }
.va-form__message a { color: inherit; font-weight: 700; }

/* CTA variants */
.va-cta--compact {
  width: auto;
  padding: 10px 20px;
  font-size: 13px;
  border-radius: 8px;
}

/* 인라인 필드 (상단바 actions 영역) */
.va-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--va-muted);
}
.va-inline-field[hidden] { display: none; }

/* Header seg filter (stats 주간/월간/커스텀) */
.va-seg--filter {
  display: inline-flex;
  grid-template-columns: none;
  width: auto;
  padding: 2px;
  gap: 2px;
  margin-right: 0;
  align-items: stretch;
  height: 30px;
}
.va-seg--filter button {
  padding: 0 12px;
  font-size: 12px;
  line-height: 26px;
  height: 26px;
  min-width: 56px;
}
/* greeting actions 안의 세그/버튼/인풋 높이 통일 */
.va-greeting__actions .va-seg--filter { height: 30px; }
.va-inline-field input[type="date"] { height: 30px; padding: 0 10px; font-family: var(--ff-mono); }
.va-greeting__actions .va-cta--compact {
  height: 30px;
  padding: 0 14px;
  line-height: 28px;
  display: inline-flex;
  align-items: center;
}
.va-inline-field input {
  width: 64px;
  padding: 6px 8px;
  font-size: 12px;
  text-align: center;
  font-family: var(--ff-mono);
  font-weight: 700;
}

/* ─── Cards ──────────────────────────────── */
.va-card {
  background: var(--va-panel);
  border: 1px solid var(--va-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.va-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 12px;
  gap: 12px;
}
.va-card__header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--va-ink);
  display: flex; align-items: center; gap: 6px;
}
.va-card__header .action {
  font-size: 12px;
  color: var(--va-muted);
  text-decoration: none;
}
.va-card__header .action strong {
  color: var(--va-ink);
  font-size: 14px;
  font-weight: 800;
}
.va-card__body { padding: 0 22px 20px; }

.va-admin-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--c-chalk-100);
  color: var(--c-chalk-700);
  border-radius: 4px;
  letter-spacing: 0.06em;
  font-weight: 800;
}

/* Presence card */
.va-presence__summary {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--va-hairline);
}
.va-stat { flex: 1; }
.va-stat .k {
  font-size: 10px;
  color: var(--va-subtle);
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
}
.va-stat .v {
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
  font-family: var(--ff-mono);
  color: var(--va-ink);
}
.va-stat--ok .v { color: var(--c-chalk-700); }
.va-stat--muted .v { color: var(--va-muted); }
.va-stat--warn .v { color: #D97706; }

.va-presence__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px 8px;
}
.va-presence__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 2px;
  min-width: 0;
}
.va-presence__item.is-none { opacity: 0.55; }
.va-presence__item .va-avatar--sm {
  width: 26px; height: 26px; font-size: 11px;
}
.va-presence__item .name {
  font-size: 12px;
  font-weight: 600;
  color: var(--va-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}
.va-presence__item .name.is-self::after {
  content: "나";
  display: inline-block;
  font-size: 10px;
  color: var(--c-chalk-700);
  margin-left: 4px;
  font-weight: 700;
}
.va-presence__item .meta {
  font-size: 10px;
  color: var(--va-subtle);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
  margin-top: 1px;
}
.va-presence__item .meta::before {
  content: "";
  width: 4px; height: 4px; border-radius: 50%;
  background: #D0D4D7;
  flex-shrink: 0;
}
.va-presence__item.is-working .meta::before { background: var(--c-chalk-700); }
.va-presence__item.is-out .meta::before     { background: #9AA0A6; }
.va-presence__item.is-leave .meta::before   { background: #E6B800; }

/* Calendar */
.va-cal__item {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--va-hairline);
  align-items: flex-start;
}
.va-cal__item:last-child { border-bottom: none; }
.va-cal__item.is-past { opacity: 0.5; }
.va-cal__item .rail {
  width: 4px;
  min-height: 36px;
  background: var(--c-chalk-500);
  border-radius: 2px;
  flex-shrink: 0;
}
.va-cal__item.is-shared .rail { background: var(--va-danger); }
.va-cal__item.is-shared .title { color: var(--va-danger); }
.va-cal__item .time {
  min-width: 78px;
  font-size: 13px;
  color: var(--va-muted);
  font-family: var(--ff-mono);
  font-weight: 600;
}
.va-cal__item .time .end {
  display: block; font-size: 11px; color: var(--va-subtle); font-weight: 500;
}
.va-cal__item .title {
  font-size: 13px; font-weight: 600; color: var(--va-ink);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.va-cal__item .now-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--c-lime-500);
  color: var(--va-ink);
  border-radius: 3px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.va-cal__item .loc { font-size: 11px; color: var(--va-subtle); margin-top: 2px; }

/* My stats */
.va-mystats__hero {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}
.va-mystats__big {
  font-size: 44px;
  font-weight: 800;
  font-family: var(--ff-mono);
  color: var(--va-ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.va-mystats__rate {
  font-size: 12px;
  color: var(--c-chalk-700);
  font-weight: 700;
  padding: 3px 7px;
  background: var(--c-status-working-bg);
  border-radius: 4px;
}
.va-mystats__kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--va-hairline);
}
.va-mystats__kv .k {
  font-size: 10px; color: var(--va-subtle); letter-spacing: 0.06em; font-weight: 600;
  text-transform: uppercase;
}
.va-mystats__kv .v {
  font-size: 16px; font-weight: 700; font-family: var(--ff-mono); margin-top: 2px;
}
.va-mystats__kv .v .light { font-size: 11px; color: var(--va-subtle); font-weight: 500; }

/* Admin stats */
.va-adstats__kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--va-hairline);
}
.va-adstats__kpi .k {
  font-size: 10px; color: var(--va-subtle); letter-spacing: 0.06em; font-weight: 600;
  text-transform: uppercase;
}
.va-adstats__kpi .v {
  font-size: 20px; font-weight: 800; color: var(--va-ink);
  margin-top: 3px; font-family: var(--ff-mono);
}

.va-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.va-table thead tr {
  font-size: 11px;
  color: var(--va-subtle);
  text-align: left;
}
.va-table th {
  padding: 8px 6px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.va-table th.num, .va-table td.num { text-align: right; }
.va-table tbody tr { border-top: 1px solid var(--va-hairline); }
.va-table td { padding: 10px 6px; color: var(--va-ink); }
.va-table td.muted { color: var(--va-muted); }
.va-table td.mono { font-family: var(--ff-mono); }

.va-chip {
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; display: inline-block;
}
.va-chip--good { background: var(--c-status-working-bg); color: var(--c-status-working-fg); }
.va-chip--mid  { background: #FFF4CC; color: #8A6D00; }
.va-chip--bad  { background: #FADAD5; color: #A8342C; }

.va-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--va-subtle);
  font-size: 13px;
}
.va-empty .hint { font-size: 11px; margin-top: 6px; color: var(--va-subtle); opacity: 0.8; }

/* Monthly calendar grid */
.va-month { display: flex; flex-direction: column; }
.va-month__header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--va-subtle);
  text-transform: uppercase;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--va-border);
}
.va-month__header > div { text-align: center; }
.va-month__header > div:first-child { color: #D9453C; }
.va-month__header > div:last-child { color: #2F6FEB; }
.va-month__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(110px, auto);
  gap: 0;
  border-top: 1px solid var(--va-hairline);
}
.va-month__cell {
  border-bottom: 1px solid var(--va-hairline);
  border-right: 1px solid var(--va-hairline);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 110px;
  background: var(--va-panel);
  overflow: hidden;
}
.va-month__cell:nth-child(7n) { border-right: none; }
.va-month__cell.is-other { background: var(--va-bg); opacity: 0.55; }
.va-month__cell.is-today { background: rgba(187, 255, 0, 0.08); }
html[data-theme="dark"] .va-month__cell.is-today { background: rgba(138, 207, 26, 0.10); }
.va-month__num {
  font-size: 12px;
  font-weight: 700;
  color: var(--va-muted);
}
.va-month__cell.is-today .va-month__num { color: var(--va-ink); }
.va-month__cell.is-sun .va-month__num { color: #D9453C; }
.va-month__cell.is-sat .va-month__num { color: #2F6FEB; }
.va-month__events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.va-month__ev {
  display: flex; gap: 4px;
  font-size: 10px;
  line-height: 1.3;
  padding: 2px 5px;
  background: var(--va-bg);
  border-radius: 4px;
  color: var(--va-ink);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid var(--c-chalk-500);
}
.va-month__ev.is-allday {
  background: rgba(92, 184, 145, 0.14);
  border-left-color: var(--c-chalk-700);
}
.va-month__ev.is-shared {
  background: rgba(220, 38, 38, 0.08);
  border-left-color: var(--va-danger);
  color: var(--va-danger);
}
.va-month__ev.is-shared.is-allday {
  background: rgba(220, 38, 38, 0.14);
}
.va-month__ev.is-shared .t { color: var(--va-danger); }
.va-month__ev .t { font-family: var(--ff-mono); color: var(--va-muted); font-weight: 700; }
.va-month__ev .s { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.va-month__more {
  font-size: 10px;
  color: var(--va-subtle);
  font-weight: 700;
  padding: 0 4px;
}

/* 주간 리스트 (대시보드용) */
.va-week { display: flex; flex-direction: column; gap: 12px; }
.va-week__day {
  padding: 8px 0;
  border-bottom: 1px solid var(--va-hairline);
}
.va-week__day:last-child { border-bottom: none; }
.va-week__day-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.08em; font-weight: 700;
  color: var(--va-subtle); text-transform: uppercase;
  margin-bottom: 6px;
}
.va-week__day-head .date-label { color: var(--va-ink); font-size: 13px; letter-spacing: -0.01em; text-transform: none; }
.va-week__day-head.is-today .date-label { color: var(--c-chalk-700); }
html[data-theme="dark"] .va-week__day-head.is-today .date-label { color: #90DFB5; }
.va-week__empty { font-size: 11px; color: var(--va-subtle); }

/* Ghost CTA variant (header 네비게이션 버튼용) */
.va-cta--ghost {
  background: var(--va-panel);
  color: var(--va-ink);
  border: 1px solid var(--va-border);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
}
.va-cta--ghost:hover {
  background: var(--va-bg);
  transform: none;
}
html[data-theme="dark"] .va-cta--ghost {
  background: var(--va-panel);
  color: var(--va-ink);
  border: 1px solid var(--va-border);
}
html[data-theme="dark"] .va-cta--ghost:hover { background: var(--va-bg); }

/* Skeleton placeholder */
.va-skeleton {
  background: linear-gradient(90deg, var(--va-hairline) 0%, var(--va-bg) 50%, var(--va-hairline) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Fade-in on load */
.va-fade-in { animation: va-fade 0.4s ease-out both; }
@keyframes va-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.va-col-wide > *:nth-child(1)   { animation-delay: 0.05s; }
.va-col-wide > *:nth-child(2)   { animation-delay: 0.12s; }
.va-col-wide > *:nth-child(3)   { animation-delay: 0.19s; }
.va-col-narrow > *:nth-child(1) { animation-delay: 0.08s; }
.va-col-narrow > *:nth-child(2) { animation-delay: 0.15s; }
.va-col-narrow > *:nth-child(3) { animation-delay: 0.22s; }

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 1100px) {
  .va-col-wide, .va-col-narrow { grid-column: span 12; }
}
@media (max-width: 860px) {
  .va-shell { grid-template-columns: 1fr; height: auto; overflow: visible; }
  body.dashboard-body { overflow: auto; }
  .va-sidebar { border-right: none; border-bottom: 1px solid var(--va-border); }
  .va-main { min-height: auto; }
  .va-topbar { position: static; padding: 16px 20px; }
  .va-grid { padding: 16px 20px 24px; gap: 14px; }
  .va-presence__list { grid-template-columns: repeat(2, 1fr); }
  .va-adstats__kpi { grid-template-columns: repeat(2, 1fr); }
  .va-table { font-size: 12px; }
}
@media (max-width: 520px) {
  .va-presence__list { grid-template-columns: 1fr; }
}

/* =================================================================
   CODE REVIEW — 대시보드 (코드리뷰 리포트 뷰어)
   ================================================================= */

.cr-root {
  display: grid;
  gap: 14px;
}

.cr-summary__body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 16px 22px;
}
.cr-summary__item .k {
  font-size: 10px;
  color: var(--va-subtle);
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
}
.cr-summary__item .v {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--ff-mono);
  margin-top: 3px;
  color: var(--va-ink);
  letter-spacing: -0.01em;
}
.cr-summary__item--high .v { color: var(--va-danger); }
.cr-summary__item--medium .v { color: var(--va-warn); }
.cr-summary__item--low .v { color: var(--c-chalk-700); }
html[data-theme="dark"] .cr-summary__item--low .v { color: #7ED8AE; }

.cr-filters {
  margin-bottom: 0;
}
.cr-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.cr-filter-row .va-field { flex: 1 1 140px; min-width: 0; }
.cr-filter-row > button { flex-shrink: 0; }

/* 코드리뷰 헤더 검색 input — 기본 va-inline-field 보다 넓게 */
.va-inline-field input#cr-query {
  width: 220px;
  padding: 6px 10px;
  font-family: var(--ff-body);
  font-weight: 500;
  text-align: left;
}
@media (max-width: 720px) {
  .va-inline-field input#cr-query { width: 160px; }
}

.cr-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 6px;
  margin-left: 4px;
  background: var(--c-lime-500);
  color: var(--va-ink);
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
}
html[data-theme="dark"] .cr-filter-count { background: #8ACF1A; color: #0E1311; }

.cr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: 14px;
  align-items: start;
}
body:not(.cr-detail-open) .cr-detail { display: none; }
body:not(.cr-detail-open) .cr-layout { grid-template-columns: 1fr; }

.cr-list-wrap { padding: 0; overflow: hidden; }
.cr-list-body { padding: 14px 14px 18px; }

.cr-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr-card {
  border: 1px solid var(--va-border);
  border-radius: var(--r-md);
  background: var(--va-panel);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.cr-card:hover {
  border-color: var(--c-chalk-500);
  background: var(--va-bg);
}
.cr-card.is-active {
  border-color: var(--c-lime-600);
  background: var(--va-bg);
  box-shadow: 0 0 0 1px var(--c-lime-600);
}
html[data-theme="dark"] .cr-card.is-active {
  border-color: #8ACF1A;
  box-shadow: 0 0 0 1px #8ACF1A;
}

.cr-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.cr-card__commit {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.cr-card__badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.cr-card__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: var(--va-muted);
  flex-wrap: wrap;
}

.cr-hash {
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--c-chalk-700);
}
html[data-theme="dark"] .cr-hash { color: #7ED8AE; }

.cr-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: var(--va-bg);
  color: var(--va-muted);
  border: 1px solid var(--va-hairline);
}
.cr-tag--repo {
  background: var(--c-chalk-100);
  color: var(--c-chalk-700);
  border-color: transparent;
}
html[data-theme="dark"] .cr-tag--repo {
  background: rgba(92, 184, 145, 0.18);
  color: #7ED8AE;
}

.cr-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.cr-badge--high { background: rgba(220, 38, 38, 0.12); color: var(--va-danger); }
.cr-badge--medium { background: #FFF4CC; color: #8A6D00; }
.cr-badge--low { background: var(--c-status-working-bg); color: var(--c-status-working-fg); }
html[data-theme="dark"] .cr-badge--high { background: rgba(220, 38, 38, 0.22); color: #F38078; }
html[data-theme="dark"] .cr-badge--medium { background: rgba(230, 184, 0, 0.22); color: #F0C256; }

.cr-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}
.cr-pagination button {
  background: var(--va-panel);
  border: 1px solid var(--va-border);
  color: var(--va-ink);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
}
.cr-pagination button:hover:not(:disabled) {
  border-color: var(--c-chalk-500);
}
.cr-pagination button.is-active {
  background: var(--va-ink);
  color: var(--va-panel);
  border-color: var(--va-ink);
}
.cr-pagination button:disabled { opacity: 0.4; cursor: default; }

/* ─── 디테일 사이드 ──────────────────────────────── */
.cr-detail {
  position: sticky;
  top: 4px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.cr-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--va-hairline);
}
.cr-detail__title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.cr-detail__close {
  background: none;
  border: none;
  color: var(--va-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.cr-detail__close:hover { color: var(--va-ink); }

.cr-detail__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 22px;
}
.cr-detail__commit {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.cr-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 11px;
  color: var(--va-muted);
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--va-hairline);
}
.cr-detail__meta strong {
  color: var(--va-ink);
  font-weight: 700;
  margin-left: 2px;
}

.cr-section-title {
  margin: 18px 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--va-subtle);
}
.cr-section-title:first-child { margin-top: 0; }

.cr-issue {
  background: var(--va-bg);
  border: 1px solid var(--va-hairline);
  border-left: 3px solid var(--va-border-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.cr-issue--high { border-left-color: var(--va-danger); }
.cr-issue--medium { border-left-color: var(--va-warn); }
.cr-issue--low { border-left-color: var(--c-chalk-700); }

.cr-issue__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.cr-issue__title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.cr-issue__file {
  font-size: 11px;
  color: var(--va-muted);
  font-family: var(--ff-mono);
  margin-bottom: 8px;
  word-break: break-all;
}
.cr-issue__loc { color: var(--va-subtle); }

.cr-code { margin-top: 6px; }
.cr-code__label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--va-subtle);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.cr-code__block {
  margin: 0;
  background: #0d1117;
  color: #e6edf3;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 10px;
  font-family: var(--ff-mono);
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.cr-code__block code.hljs {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.cr-issue__explain {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--va-hairline);
  font-size: 12px;
  color: var(--va-muted);
  line-height: 1.6;
}

.cr-good {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cr-good__item {
  background: var(--c-status-working-bg);
  color: var(--c-status-working-fg);
  border-radius: var(--r-md);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

/* ─── 반응형 ─────────────────────────────── */
@media (max-width: 1100px) {
  .cr-summary__body { grid-template-columns: repeat(4, 1fr); padding: 14px 18px; }
  .cr-layout { grid-template-columns: 1fr; }
  .cr-detail {
    position: fixed;
    inset: 0;
    z-index: 60;
    max-height: none;
    border-radius: 0;
  }
  body.cr-detail-open .va-sidebar { display: none; }
}
@media (max-width: 720px) {
  .cr-summary__body { grid-template-columns: repeat(2, 1fr); }
  .cr-filter-row .va-field { flex: 1 1 calc(50% - 6px); }
  .cr-filter-row > button { flex: 1 1 100%; }
}

/* admin_records — 인라인 필터 select (input 과 동일 룩) */
.va-inline-field select {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--va-border-strong);
  border-radius: 8px;
  background: var(--va-panel);
  color: var(--va-ink);
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.va-inline-field select:focus {
  outline: none;
  border-color: var(--c-lime-500);
  box-shadow: 0 0 0 3px rgba(187, 255, 0, 0.16);
}
html[data-theme="dark"] .va-inline-field select {
  background: #1E2523;
  border-color: #2E3833;
  color: var(--va-ink);
}
html[data-theme="dark"] .va-inline-field select:focus {
  border-color: var(--c-lime-500);
  box-shadow: 0 0 0 3px rgba(187, 255, 0, 0.22);
}

/* admin_records — 상단 필터바 날짜 입력: 텍스트(yyyy-mm-dd + 피커 인디케이터) 길이만큼 자라도록 */
.va-greeting__actions .va-inline-field input[type="date"] {
  width: auto;
  padding: 0 12px;
  font-size: 13px;
}

/* admin_records — 편집 모달 출/퇴근 입력: 사이드바 punch 그리드와 동일 룩
   (모달 패널 배경이 --va-bg 라 cell 을 --va-panel + 테두리로 분리) */
.va-punch__grid--edit { margin: 0; }
.va-punch__grid--edit .va-punch__cell {
  background: var(--va-panel);
  border: 1px solid var(--va-border);
  cursor: text;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.va-punch__grid--edit .va-punch__cell:focus-within {
  border-color: var(--c-lime-500);
  box-shadow: 0 0 0 3px rgba(187, 255, 0, 0.16);
}
.va-punch__input {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--va-ink);
  font-size: 20px;
  font-weight: 800;
  font-family: var(--ff-mono);
  letter-spacing: -0.01em;
}
.va-punch__input:focus { outline: none; }
.va-punch__input::-webkit-calendar-picker-indicator { opacity: 0.55; cursor: pointer; }
.va-punch__input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
html[data-theme="dark"] .va-punch__input::-webkit-calendar-picker-indicator { filter: invert(0.85); }

/* admin_records — 표 작업 컬럼 버튼: 한 줄 정렬 + 동일 사이즈 */
.va-row-actions { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.va-row-actions .va-cta {
  display: inline-flex; align-items: center; justify-content: center;
  width: auto; height: auto;
  padding: 6px 14px; font-size: 12px; line-height: 1.2;
}

/* admin_records — 모달 / 보조 위젯 */
.va-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.va-modal[hidden] { display: none; }
.va-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.va-modal__panel { position: relative; background: var(--va-bg, #fff); color: var(--va-fg, inherit); border-radius: 12px; min-width: 360px; max-width: 480px; box-shadow: 0 12px 48px rgba(0,0,0,0.3); display: flex; flex-direction: column; }
.va-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--va-border, #e5e7eb); }
.va-modal__head h3 { margin: 0; font-size: 16px; }
.va-modal__close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: inherit; }
.va-modal__body { padding: 16px 20px; display: grid; gap: 12px; }
.va-modal__row { display: flex; gap: 8px; }
.va-modal__row .k { color: var(--va-muted, #6b7280); min-width: 60px; }
.va-modal__msg { color: var(--va-danger, #dc2626); font-size: 13px; min-height: 18px; }
.va-modal__foot { padding: 12px 20px; border-top: 1px solid var(--va-border, #e5e7eb); display: flex; justify-content: flex-end; gap: 8px; }
.va-edit-mark { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--va-muted, #6b7280); }
