/* ============================================================
   beelERP Design System
   Based on beelERP mockup design tokens
   ============================================================ */

/* Design Tokens */
:root {
  --gnb-height: 60px;
  --sidebar-width: 200px;

  --navy: #1E2A3B;
  --navy-mid: #2D3F55;
  --blue: #4F7FFA;
  --blue-action: #1E88E5;
  --blue-light: #EFF6FF;

  --bg-page: #F0F2F5;
  --bg-finance: #F5F7FA;
  --bg-card: #FFFFFF;
  --bg-sidebar-header: #F8F9FA;
  --bg-row-alt: #FAFBFC;
  --bg-table-head: #F8F9FA;

  --text-primary: #1E2A3B;
  --text-dark: #1F2937;
  --text-body: #374151;
  --text-dim: #4A5568;
  --text-secondary: #7A92A9;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;

  --border: #DFE3EA;
  --border-light: #EEF1F5;
  --border-table: #F0F2F5;

  --shadow-card: 0 2px 8px rgba(0,0,0,0.063);
  --radius-card: 12px;
  --radius-sm: 8px;
  --radius-badge: 12px;

  --income: #166534;
  --expense: #C62828;
}

/* Base Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden 속성은 어떤 display 값보다 우선 — display:flex/grid 등이 덮어쓰는 것을 방지 */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ============================================================
   PAGE SHELL
   ============================================================ */

.erp-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   GNB (Global Navigation Bar)
   ============================================================ */

.gnb {
  height: var(--gnb-height);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
  position: relative;
  z-index: 200;
}

.gnb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.gnb-logo-box {
  width: 32px;
  height: 32px;
  background: var(--blue);
  border-radius: 7px;
  flex-shrink: 0;
}

.gnb-logo-text {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.gnb-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.gnb-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 20px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s;
}

.gnb-tab svg { width: 16px; height: 16px; color: var(--text-secondary); transition: color 0.15s; flex-shrink: 0; }

.gnb-tab.active {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(79,127,250,0.2) 0%, transparent 100%);
}

.gnb-tab.active svg { color: var(--blue); }

.gnb-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--blue);
  border-radius: 2px 2px 0 0;
}

.gnb-right { display: flex; align-items: center; gap: 16px; }

.gnb-bell {
  width: 36px;
  height: 36px;
  background: var(--navy-mid);
  border: none;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}

.gnb-bell svg { width: 16px; height: 16px; }

.gnb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  background: var(--navy-mid);
  border-radius: var(--radius-sm);
  padding: 0 12px 0 8px;
  cursor: pointer;
}

.gnb-user-avatar {
  width: 24px;
  height: 24px;
  background: var(--blue);
  border-radius: 50%;
  flex-shrink: 0;
}

.gnb-user-name { color: #fff; font-size: 13px; font-weight: 600; }
.gnb-user svg { width: 14px; height: 14px; color: var(--text-secondary); }

/* ============================================================
   BODY / CONTENT AREAS
   ============================================================ */

.erp-body { flex: 1; display: flex; overflow: hidden; }

/* Dashboard-style: full content, no sidebar */
.erp-content {
  flex: 1;
  background: var(--bg-page);
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Finance-style sidebar */
.erp-sidebar {
  width: var(--sidebar-width);
  background: #fff;
  box-shadow: 1px 0 0 var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-top {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--bg-sidebar-header);
  flex-shrink: 0;
}

.sidebar-top-title { font-size: 14px; font-weight: 700; color: var(--text-dark); }

.sidebar-divider { height: 1px; background: var(--border); flex-shrink: 0; }

.sidebar-group-label {
  padding: 10px 16px 2px;
  font-size: 11px;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 1px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  color: var(--text-body);
  font-size: 13px;
  font-weight: 400;
  transition: background 0.1s;
}

.sidebar-nav-item svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }

.sidebar-nav-item:hover { background: #F1F5F9; }

.sidebar-nav-item.active {
  background: var(--blue-light);
  color: #1E40AF;
  font-weight: 600;
  border-left: 3px solid var(--blue-action);
  padding-left: 13px;
}

.sidebar-nav-item.active svg { color: var(--blue-action); }

/* 하위(자식) 사이드바 항목 — 상위 메뉴에 종속됨을 트리 형태로 표시 */
.sidebar-nav-item.sub {
  height: 34px;
  padding-left: 38px;
  font-size: 12.5px;
  color: var(--text-muted);
  position: relative;
}
.sidebar-nav-item.sub svg { width: 12px; height: 12px; }
/* 트리 연결선 (└) */
.sidebar-nav-item.sub::before {
  content: '';
  position: absolute;
  left: 23px;
  top: -2px;
  height: calc(50% + 2px);
  width: 1px;
  background: var(--border);
}
.sidebar-nav-item.sub::after {
  content: '';
  position: absolute;
  left: 23px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--border);
}
.sidebar-nav-item.sub.active {
  padding-left: 35px;
  color: #1E40AF;
}

/* 비활성(준비중) 사이드바 항목 */
.sidebar-nav-item--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* "준비중" 배지 */
.sidebar-badge-soon {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  background: #94A3B8;
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Finance main content area */
.erp-main {
  flex: 1;
  background: var(--bg-finance);
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================================
   PAGE HEAD
   ============================================================ */

.page-head { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.page-title { font-size: 20px; font-weight: 700; color: var(--text-dark); }
.page-subtitle { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   KPI CARDS — Dashboard style (large, shadow)
   ============================================================ */

.kpi-row { display: flex; gap: 14px; }

.kpi-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 96px;
}

.kpi-card-top { display: flex; justify-content: space-between; align-items: center; }
.kpi-card-label { font-size: 12px; color: var(--text-secondary); }

.kpi-icon-bg {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-bg svg { width: 14px; height: 14px; }
.kpi-icon-bg--blue  { background: #EEF3FF; color: var(--blue); }
.kpi-icon-bg--orange { background: #FFF3E0; color: #E65100; }
.kpi-icon-bg--red   { background: #FCE4EC; color: var(--expense); }
.kpi-icon-bg--green  { background: #E8F5E9; color: #2E7D32; }
.kpi-icon-bg--purple { background: #F3E8FF; color: #7C3AED; }
.kpi-icon-bg--teal   { background: #E0F7FA; color: #00796B; }

.kpi-card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.kpi-card-bottom--contract { flex-direction: column; gap: 6px; align-items: stretch; }

.kpi-contract-stats { display: flex; align-items: center; gap: 0; }
.kpi-contract-stat  { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.kpi-contract-num   { font-size: 22px; font-weight: 700; color: var(--navy); line-height: 1; }
.kpi-contract-num--warn   { color: var(--text-muted); }
.kpi-contract-num--warn.is-active   { color: #E65100; }
.kpi-contract-num--danger { color: var(--text-muted); }
.kpi-contract-num--danger.is-active { color: var(--expense); }
.kpi-contract-lbl   { font-size: 10px; color: var(--text-muted); }
.kpi-contract-divider { width: 1px; height: 26px; background: var(--border-table); flex-shrink: 0; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1; }

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.kpi-trend svg { width: 12px; height: 12px; }
.kpi-trend--up   { background: #E8F5E9; color: #2E7D32; }
.kpi-trend--down { background: #FFEBEE; color: var(--expense); }

.kpi-value--alert { color: var(--expense); }
.kpi-sub  { font-size: 12px; color: var(--text-secondary); }
.kpi-link { font-size: 12px; color: var(--blue-action); text-decoration: none; font-weight: 600; }
.kpi-link:hover { text-decoration: underline; }

.kpi-card--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.kpi-card--link:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.kpi-goto {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.15s;
}
.kpi-card--link:hover .kpi-goto { opacity: 1; }

/* ============================================================
   DASHBOARD GRID
   ============================================================ */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 20px;
  margin-top: 0;
}

.dash-card { overflow: hidden; grid-column: span 5; }   /* 기본 = 반칸(5/10) */
.dash-card--full { grid-column: 1 / -1; }               /* 전체폭 */
.dash-card--wide { grid-column: span 6; }               /* 넓은 칸 (60%) */
.dash-card--narrow { grid-column: span 4; }             /* 좁은 칸 (40%) */

/* ============================================================
   DASHBOARD CALENDAR (일정 카드)
   ============================================================ */
.dash-cal-wrap {
  display: flex;
  align-items: flex-start;
}
.dash-cal-mini {
  width: 252px;
  flex-shrink: 0;
  padding: 10px 14px 12px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-cal-header { display: flex; align-items: center; }
.dash-cal-month  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.dash-cal-grid   { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.dash-cal-dow    { font-size: 10px; color: var(--text-secondary); text-align: center; padding: 2px 0 4px; font-weight: 500; }
.dash-cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0 1px;
  border-radius: 4px;
  cursor: default;
}
.dash-cal-day[data-date]       { cursor: pointer; }
.dash-cal-day[data-date]:hover { background: var(--border-light); }
.dash-cal-day--out             { visibility: hidden; }
.dash-cal-day--today .dash-cal-num {
  background: var(--blue-action);
  color: #fff;
  border-radius: 50%;
}
.dash-cal-day--selected { background: var(--blue-light); }
.dash-cal-num {
  font-size: 11px;
  color: var(--text-primary);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.dash-cal-dots { display: flex; gap: 2px; margin-top: 1px; height: 5px; }
.dash-cal-dot  { width: 4px; height: 4px; border-radius: 50%; flex-shrink: 0; }
/* 중앙 리스트 패널 (Turbo Frame 래퍼) */
.dash-sch-list-frame {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px 12px;
  border-right: 1px solid var(--border);
  min-width: 0;
  display: block;
}

/* 우측 상세 패널 (슬라이드인) */
.dash-sch-detail-panel {
  width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.25s ease;
  flex-shrink: 0;
}
.dash-sch-detail-panel.is-open { width: 340px; }

/* 상세 패널 내부 */
.dash-det-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.dash-det-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-det-close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
}
.dash-det-close:hover { color: var(--text-primary); }
.dash-det-body { padding: 8px 14px 12px; }
.dash-det-row {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}
.dash-det-row:last-child { border-bottom: none; }
.dash-det-label {
  width: 44px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 11px;
  padding-top: 1px;
}
.dash-det-row--memo span:last-child { white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word; }

/* 리스트 아이템 클릭 가능 / 선택 상태 */
.dash-sch-item--clickable { cursor: pointer; border-radius: 6px; padding: 7px 6px; }
.dash-sch-item--clickable:hover { background: var(--border-light); }
.dash-sch-item--clickable.is-selected { background: var(--blue-light); }

/* 리스트 타이틀 빈 힌트 */
.dash-cal-list-empty-hint { font-weight: 400; margin-left: 8px; color: var(--text-muted); font-size: 12px; }
.dash-cal-list-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.dash-sch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
}
.dash-sch-item:last-child { border-bottom: none; }
.dash-sch-info  { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-sch-title {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dash-sch-date { font-size: 11px; color: var(--text-muted); }

.dash-empty {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.text-em   { font-weight: 600; color: var(--text-dark); }
.text-muted { color: var(--text-secondary); }
.text-overdue { color: var(--expense); font-weight: 600; }

.dash-row--overdue td { background: #FFF5F5 !important; }
.dash-row--mine td   { background: #EEF3FF !important; }
.dash-mine-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--blue-light);
  color: var(--blue-action);
}

.dash-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   KPI CARDS — Finance style (small, border)
   ============================================================ */

.finance-kpi-row { display: flex; gap: 12px; }

.finance-kpi-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.finance-kpi-label { font-size: 11px; color: var(--text-muted); }
.finance-kpi-value { font-size: 17px; font-weight: 700; }
.finance-kpi-sub   { font-size: 10px; color: var(--text-faint); }

.finance-kpi-value--income  { color: var(--income); }
.finance-kpi-value--expense { color: var(--expense); }
.finance-kpi-value--neutral { color: var(--blue-action); }

/* ============================================================
   CARD (generic white shadow card)
   ============================================================ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-table);
  flex-shrink: 0;
}

.card-title { font-size: 16px; font-weight: 700; color: var(--navy); }

.card-more-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-page);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
  border: none;
  cursor: pointer;
}

/* ============================================================
   ERP TABLE — Dashboard style
   ============================================================ */

.erp-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.erp-table th {
  background: var(--bg-table-head);
  height: 40px;
  padding: 0 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--border-table);
}

.erp-table td {
  height: 52px;
  padding: 0 20px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-table);
  vertical-align: middle;
}

.erp-table tr:nth-child(even) td { background: var(--bg-row-alt); }
.erp-table tbody tr:last-child td { border-bottom: none; }

.table-name-cell { display: flex; align-items: center; gap: 10px; }

.table-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 24px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge--green  { background: #E8F5E9; color: #2E7D32; }
.badge--orange { background: #FFF3E0; color: #E65100; }
.badge--red    { background: #FFEBEE; color: var(--expense); }
.badge--blue   { background: #DBEAFE; color: #1E40AF; }
.badge--gray   { background: #F1F5F9; color: #64748B; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  text-decoration: none;
}

.btn svg { width: 14px; height: 14px; }
.btn--primary  { background: var(--blue-action); color: #fff; font-weight: 600; }
.btn--outline  { background: #fff; color: var(--blue-action); border: 1px solid var(--blue-action); }
.btn--secondary { background: var(--bg-page); color: var(--text-dim); }

/* ============================================================
   FINANCE TABLE PANEL
   ============================================================ */

.table-panel {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.toolbar-spacer { flex: 1; }
.toolbar-year { font-size: 13px; font-weight: 600; color: var(--text-dark); }

.seg-control {
  display: flex;
  align-items: center;
  height: 32px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.seg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 32px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-body);
  border: none;
  background: transparent;
  cursor: pointer;
}

.seg-btn.active { background: var(--blue-action); color: #fff; font-weight: 600; }

/* Finance table (column borders) */
.finance-table { width: 100%; border-collapse: collapse; font-size: 12px; }

.finance-table th,
.finance-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  vertical-align: middle;
}

.finance-table th:last-child, .finance-table td:last-child { border-right: none; }
.finance-table tbody tr:last-child td { border-bottom: none; }

.finance-table thead th {
  background: #F1F5F9;
  height: 30px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-body);
  text-align: center;
}

.finance-table thead .th-income  { background: #DBEAFE; }
.finance-table thead .th-expense { background: #FCE7F3; }

.finance-table tbody td { height: 36px; color: var(--text-body); text-align: left; }
.finance-table tbody tr:nth-child(even) td { background: #F8FAFC; }
.finance-table .sum-row td { background: #FFFBE6; font-weight: 700; }
.finance-table .col-income  { text-align: right; color: var(--income); }
.finance-table .col-expense { text-align: right; color: var(--expense); }
.finance-table .col-right   { text-align: right; }
.finance-table .col-center  { text-align: center; }

/* ============================================================
   BOTTOM ROW — Dashboard (table + activity side-by-side)
   ============================================================ */

.bottom-row { display: flex; gap: 20px; flex: 1; min-height: 300px; }
.bottom-row .card--main { flex: 1; overflow: hidden; }
.bottom-row .card--side { width: 320px; flex-shrink: 0; overflow: hidden; }

.activity-list { padding: 8px 20px; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 68px;
  border-bottom: 1px solid var(--border-table);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon svg { width: 16px; height: 16px; }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-time { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ============================================================
   AUTH PAGES (로그인 / OTP 인증)
   ============================================================ */

.auth-body {
  min-height: 100vh;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
  padding: 24px 16px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 24px rgba(0,0,0,0.09);
  padding: 40px 40px 36px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.auth-logo-box {
  width: 32px;
  height: 32px;
  background: var(--blue-action);
  border-radius: 7px;
  flex-shrink: 0;
}

.auth-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.auth-form { display: flex; flex-direction: column; gap: 20px; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }

.auth-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
}

.auth-input {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-dark);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
  border-color: var(--blue-action);
  box-shadow: 0 0 0 3px rgba(30,136,229,0.12);
}

.auth-otp-input {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 14px;
  text-align: center;
  height: 64px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-body);
  cursor: pointer;
  user-select: none;
  margin-top: -6px;
}

.auth-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-action);
  cursor: pointer;
}

.auth-btn {
  width: 100%;
  height: 48px;
  background: var(--blue-action);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}

.auth-btn:hover { background: #1565C0; }

.auth-notice {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  color: #1E40AF;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 4px;
}

.auth-alert {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  color: #B91C1C;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 4px;
}

.auth-back { margin-top: 20px; text-align: center; }

.auth-back-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: underline;
}

/* ============================================================
   2차 인증(TOTP) — QR / 복구 코드
   ============================================================ */

/* 수동 입력 시크릿·복구 코드 등 monospace 텍스트 */
.auth-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dark);
}

/* QR — 인라인 SVG 를 그대로 감싼다 */
.auth-qr {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.auth-qr svg {
  display: block;
  width: 200px;
  height: 200px;
}

/* 복구 코드 목록 + 복사/다운로드 액션(Stimulus recovery-codes) */
.auth-recovery-codes { margin-bottom: 20px; }

.auth-recovery-codes ul {
  list-style: none;
  margin: 0 0 14px;
  padding: 16px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.auth-recovery-codes li { text-align: center; }

.auth-recovery-codes li code {
  font-size: 15px;
}

.auth-recovery-codes > div {
  display: flex;
  gap: 10px;
}

.auth-recovery-codes button {
  flex: 1;
  height: 40px;
  background: #fff;
  color: var(--blue-action);
  border: 1px solid var(--blue-action);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-recovery-codes button:hover { background: #EFF6FF; }

.auth-recovery-codes p[data-recovery-codes-target] {
  min-height: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
   GNB DROPDOWN (로그아웃)
   ============================================================ */

.gnb-user-wrap { position: relative; }

.gnb-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 140px;
  z-index: 999;
  overflow: hidden;
}

.gnb-dropdown-item {
  display: block;
  width: 100%;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

.gnb-dropdown-item:hover { background: var(--bg-page); }

.gnb-logout-btn { color: var(--expense); }

/* ============================================================
   EMPLOYEE MANAGEMENT (직원 관리)
   ============================================================ */

.emp-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 6px;
  background: var(--blue-light);
  color: var(--blue-action);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  margin-left: 8px;
}

.emp-me-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 7px;
  background: #EFF6FF;
  color: #1E40AF;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  margin-left: 4px;
}

.emp-row { cursor: pointer; transition: background 0.1s; }
.emp-row:hover td { background: var(--blue-light) !important; }

.emp-empty {
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  padding: 40px 0;
}

.emp-flash {
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
}

.emp-flash--notice { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.emp-flash--alert  { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }

/* 모달 */
.emp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emp-modal {
  background: #fff;
  border-radius: var(--radius-card);
  width: 440px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

.emp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}

.emp-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
}

.emp-modal-close {
  width: 28px;
  height: 28px;
  background: var(--bg-page);
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}

.emp-modal-close svg { width: 14px; height: 14px; }

.emp-modal-form { padding: 24px; display: flex; flex-direction: column; gap: 18px; }

.emp-form-field { display: flex; flex-direction: column; gap: 6px; }
.emp-form-field--row { flex-direction: row; align-items: center; justify-content: space-between; }

.emp-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
}

.emp-form-input,
.emp-form-select {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.emp-form-input:focus,
.emp-form-select:focus { border-color: var(--blue-action); }

.emp-form-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* 토글 스위치 */
.emp-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.emp-toggle-input { display: none; }

.emp-toggle-slider {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.emp-toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.emp-toggle-input:checked + .emp-toggle-slider { background: #22C55E; }
.emp-toggle-input:checked + .emp-toggle-slider::after { transform: translateX(18px); }

.emp-toggle-label { font-size: 13px; color: var(--text-body); }

.emp-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
}

.emp-modal-footer--split { justify-content: space-between; }

/* ============================================================
   계약서 최종본 미리보기 모달 (docx/PDF)
   ============================================================ */

.doc-preview-modal {
  background: #fff;
  border-radius: var(--radius-card);
  width: min(920px, calc(100vw - 32px));
  height: min(88vh, 1000px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  overflow: hidden;
}

.doc-preview-body {
  flex: 1;
  overflow: auto;
  background: #e9ecef;
  padding: 20px;
}

.doc-preview-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

/* docx-preview 가 렌더한 페이지를 가운데 정렬 */
.doc-preview-body .docx-wrapper {
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.doc-preview-body .docx-wrapper > section.docx {
  box-shadow: 0 1px 6px rgba(0,0,0,0.16);
  margin: 0;
}

.doc-preview-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================================
   ACTIVITY LOG
   ============================================================ */

.act-filter-form { padding: 16px 20px; }

.act-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.act-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.act-filter-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.act-filter-select,
.act-filter-input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
  color: var(--text-body);
  font-family: inherit;
  outline: none;
}

.act-filter-select:focus,
.act-filter-input:focus {
  border-color: var(--blue);
}

.act-filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.act-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--border-light);
}

.act-page-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-body);
  background: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.act-page-btn:hover { background: var(--bg-page); }

.act-page-info {
  font-size: 13px;
  color: var(--text-muted);
}
