/* =====================================================
   팀 업무 관리 대시보드 - 메인 스타일시트
   ===================================================== */

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #dbeafe;
  --secondary:     #64748b;
  --success:       #059669;
  --success-light: #d1fae5;
  --warning:       #d97706;
  --warning-light: #fef3c7;
  --danger:        #dc2626;
  --danger-light:  #fee2e2;
  --info:          #0891b2;
  --info-light:    #cffafe;

  --bg-body:       #f1f5f9;
  --bg-white:      #ffffff;
  --bg-sidebar:    #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #2563eb;

  --text-primary:  #0f172a;
  --text-secondary:#64748b;
  --text-muted:    #94a3b8;
  --text-white:    #ffffff;

  --border:        #e2e8f0;
  --border-dark:   #cbd5e1;

  --radius-sm:     4px;
  --radius:        8px;
  --radius-lg:     12px;
  --radius-xl:     16px;

  --shadow-sm:     0 1px 2px rgba(0,0,0,.05);
  --shadow:        0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl:     0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);

  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --header-height: 64px;
  --transition:    all .2s ease;
}

/* ─── 리셋 ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-body);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── 사이드바 ──────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  transition: width .25s ease;  /* overflow:hidden 제거 → 툴팁이 바깥으로 나올 수 있게 */
  overflow: visible;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

/* 사이드바 내부 스크롤 영역만 clip */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-x: hidden;   /* 가로 클리핑만 */
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  min-height: var(--header-height);
  transition: padding .25s ease;
  overflow: hidden;     /* 헤더 내부만 clip */
  flex-shrink: 0;
}
/* 접힌 상태: 헤더 중앙 정렬 → 토글 버튼만 보이게 */
.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 0 8px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-white);
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  transition: opacity .2s ease, flex .25s ease;
}
.sidebar-logo i { font-size: 1.2rem; color: #60a5fa; flex-shrink: 0; }

/* 접힌 상태: 로고 텍스트 영역 자체를 축소 */
.sidebar.collapsed .sidebar-logo {
  flex: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  width: 0;
  min-width: 0;
  padding: 0;
  margin: 0;
}

.sidebar-title {
  white-space: nowrap;
  overflow: hidden;
}

/* nav-text, footer 텍스트 숨김 */
.sidebar.collapsed .nav-text { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
.sidebar.collapsed .sidebar-footer-text { opacity: 0; pointer-events: none; }

.sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: all .2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  cursor: pointer;
}
.sidebar-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,.15);
}
/* 접힌 상태: 버튼 강조 */
.sidebar.collapsed .sidebar-toggle {
  color: #60a5fa;
  background: rgba(96,165,250,.15);
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  border-radius: var(--radius);
}
.sidebar.collapsed .sidebar-toggle:hover {
  color: #fff;
  background: rgba(96,165,250,.35);
}

.nav-list { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.nav-item { border-radius: var(--radius); }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  color: #94a3b8;
  border-radius: var(--radius);
  transition: background .2s, color .2s;
  white-space: nowrap;
  overflow: hidden;   /* 펼친 상태에서만 클리핑, 접힌 상태에서는 override */
  width: 100%;
}
.nav-link:hover { background: var(--bg-sidebar-hover); color: #fff; }

/* ── 접힌 상태 nav ── */
.sidebar.collapsed .nav-list { padding: 0 6px; }
.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 12px 0;
  overflow: visible;       /* 툴팁이 바깥으로 나오도록 */
  position: relative;
}

/* 호버 툴팁 (접힌 상태) */
.sidebar.collapsed .nav-link::after {
  content: attr(data-label);
  position: fixed;
  left: calc(var(--sidebar-collapsed) + 10px);
  top: var(--tip-top, 50%);
  transform: translateY(-50%);
  background: #334155;
  color: #f1f5f9;
  padding: 5px 11px;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.08);
  z-index: 9999;
}
.sidebar.collapsed .nav-link:hover::after { opacity: 1; }

.sidebar.collapsed .nav-icon { font-size: 1.15rem; }

.nav-item.active .nav-link {
  background: var(--bg-sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}
.nav-icon { font-size: 1rem; min-width: 20px; text-align: center; }
.nav-text { font-size: .875rem; transition: opacity .15s, width .25s; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--text-muted);
  font-size: .75rem;
  text-align: center;
  transition: padding .25s;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar.collapsed .sidebar-footer {
  padding: 12px 4px;
}
.sidebar.collapsed .sidebar-footer-text { display: none !important; }
.sidebar.collapsed .sidebar-footer-icon { display: inline-block !important; }

/* ─── 메인 콘텐츠 ───────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}
.main-content.expanded { margin-left: var(--sidebar-collapsed); }

/* ─── 상단 헤더 ─────────────────────────────────── */
.top-header {
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-left { display: flex; flex-direction: column; gap: 2px; }
.page-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.breadcrumb { font-size: .75rem; color: var(--text-muted); }
.header-right { display: flex; align-items: center; gap: 12px; }

.edit-mode-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #a7f3d0;
  transition: var(--transition);
}
.edit-mode-indicator.editing {
  background: var(--warning-light);
  color: var(--warning);
  border-color: #fcd34d;
}
.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-muted);
}

/* ─── API 설정 배너 ─────────────────────────────── */
.api-config-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-bottom: 2px solid #f59e0b;
  padding: 10px 24px;
  display: none;
}
.api-config-banner.show { display: block; }
.api-config-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #92400e;
  font-weight: 500;
}
.api-config-content i { font-size: 1.1rem; }

/* ─── 콘텐츠 영역 ───────────────────────────────── */
.content-area { padding: 24px; flex: 1; }

/* ─── 카드 ─────────────────────────────────────── */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 20px; }

/* ─── 툴바 ─────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }

/* ─── 검색창 ────────────────────────────────────── */
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  gap: 8px;
  min-width: 240px;
  transition: var(--transition);
}
.search-box:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-light);
}
.search-box i { color: var(--text-muted); font-size: .9rem; }
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: .875rem;
  color: var(--text-primary);
  width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }

/* ─── 버튼 ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--primary);   color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: #f8fafc; color: var(--text-secondary); border-color: var(--border-dark); }
.btn-secondary:hover:not(:disabled) { background: #f1f5f9; }
.btn-success   { background: var(--success);   color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled) { background: #047857; }
.btn-danger    { background: var(--danger);    color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled)  { background: #b91c1c; }
.btn-warning   { background: var(--warning);   color: #fff; border-color: var(--warning); }
.btn-warning:hover:not(:disabled) { background: #b45309; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 10px 20px; font-size: 1rem; }
.btn-icon { padding: 7px; min-width: 34px; justify-content: center; }

/* ─── 배지 ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-secondary{ background: #f1f5f9; color: var(--text-secondary); }

/* ─── 테이블 ────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: .8rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--primary); }
thead th .sort-icon { margin-left: 4px; opacity: .4; }
thead th.sort-asc .sort-icon,
thead th.sort-desc .sort-icon { opacity: 1; color: var(--primary); }
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: pointer;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 11px 14px; color: var(--text-primary); vertical-align: middle; }
.table-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.table-empty i { font-size: 2.5rem; margin-bottom: 12px; display: block; opacity: .3; }
.table-empty p { font-size: .9rem; }

/* ─── 진행율 바 ─────────────────────────────────── */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  transition: width .4s ease;
}
.progress-fill.high   { background: var(--success); }
.progress-fill.medium { background: var(--warning); }
.progress-fill.low    { background: var(--danger); }
.progress-text { font-size: .78rem; font-weight: 600; color: var(--text-secondary); min-width: 32px; text-align: right; }

/* ─── 폼 ────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-label.required::after {
  content: ' *';
  color: var(--danger);
}
.form-control {
  padding: 8px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control:disabled, .form-control[readonly] {
  background: #f8fafc;
  color: var(--text-muted);
  cursor: default;
}
.form-control.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-light); }
.form-hint { font-size: .75rem; color: var(--text-muted); }
.form-error { font-size: .75rem; color: var(--danger); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

/* 체크박스 그룹 */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: #fff;
  min-height: 42px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: .85rem;
}
.checkbox-item input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); }

/* 체크리스트 (진행상태) */
.checklist-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: .85rem;
}
.checklist-item:hover { border-color: var(--primary); background: var(--primary-light); }
.checklist-item input[type="checkbox"] { accent-color: var(--primary); }
.checklist-item.checked { background: var(--success-light); border-color: #6ee7b7; color: var(--success); }

/* ─── 모달 ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(.98);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg-body); color: var(--text-primary); }
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 상세 뷰어 */
.detail-view { display: flex; flex-direction: column; gap: 0; }
.detail-section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.detail-section:last-child { border-bottom: none; }
.detail-section-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; }
.detail-value { font-size: .9rem; color: var(--text-primary); font-weight: 500; }
.detail-value.empty { color: var(--text-muted); font-style: italic; }
.detail-full { grid-column: 1 / -1; }

/* ─── 탭 ────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 9px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  bottom: -2px;
  border-bottom: 2px solid transparent;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── 캘린더 ────────────────────────────────────── */
.calendar-wrap { background: var(--bg-white); border-radius: var(--radius-lg); border: 1px solid var(--border); }
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-title { font-size: 1.1rem; font-weight: 700; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.calendar-day-header {
  text-align: center;
  padding: 10px 4px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: #f8fafc;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.calendar-day-header.sun { color: var(--danger); }
.calendar-day-header.sat { color: var(--primary); }
.calendar-cell {
  min-height: 110px;
  padding: 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
  vertical-align: top;
  position: relative;
}
.calendar-cell.other-month .cell-date { color: #cbd5e1; }
.calendar-cell.today .cell-date {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cell-date {
  font-weight: 600;
  margin-bottom: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-cell.sun .cell-date { color: var(--danger); }
.calendar-cell.sat .cell-date { color: var(--primary); }
.calendar-events { display: flex; flex-direction: column; gap: 2px; }
.cal-event {
  padding: 2px 5px;
  border-radius: 3px;
  font-size: .7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 500;
}
.cal-event.type-press   { background: #dbeafe; color: #1e40af; }
.cal-event.type-blog    { background: #d1fae5; color: #065f46; }
.cal-event.type-sns     { background: #fce7f3; color: #9d174d; }
.cal-event.type-video   { background: #fef3c7; color: #92400e; }
.cal-event.type-default { background: #f3f4f6; color: #374151; }

/* ─── 영상 마스터 / 언어 패널 ──────────────────── */
.video-panel {
  display: block;
}
.lang-list { display: flex; flex-direction: column; gap: 8px; }
.lang-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition);
}
.lang-card:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.lang-card.selected { border-color: var(--primary); background: var(--primary-light); }
.lang-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.lang-name { font-weight: 600; font-size: .9rem; }
.lang-states { display: flex; gap: 4px; flex-wrap: wrap; }
.lang-state-badge {
  font-size: .68rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.state-done    { background: var(--success-light); color: var(--success); }
.state-ing     { background: var(--warning-light); color: var(--warning); }
.state-waiting { background: #f1f5f9; color: var(--text-muted); }

/* ─── 알림 / 배너 ───────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-info    { background: var(--info-light);    color: #164e63; border: 1px solid #a5f3fc; }
.alert-success { background: var(--success-light); color: #064e3b; border: 1px solid #6ee7b7; }
.alert-warning { background: var(--warning-light); color: #78350f; border: 1px solid #fcd34d; }
.alert-danger  { background: var(--danger-light);  color: #7f1d1d; border: 1px solid #fca5a5; }

/* ─── 통계 카드 (대시보드) ──────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-info { flex: 1; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }

/* ─── 로딩 오버레이 ─────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.loading-overlay.show { opacity: 1; pointer-events: all; }
.loading-spinner { text-align: center; color: var(--primary); }
.loading-spinner p { margin-top: 12px; font-weight: 600; color: var(--text-secondary); }

/* ─── 토스트 ────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9998;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  font-weight: 500;
  color: #fff;
  min-width: 280px;
  max-width: 380px;
  animation: slideInRight .3s ease;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info    { background: var(--info); }
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  font-size: .9rem;
  padding: 2px;
}

/* ─── 페이지네이션 ──────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.pagination-info { font-size: .82rem; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── 이력 탭 ───────────────────────────────────── */
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.log-item:last-child { border-bottom: none; }
.log-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; flex-shrink: 0; }
.log-icon.reg { background: var(--success-light); color: var(--success); }
.log-icon.edit { background: var(--warning-light); color: var(--warning); }
.log-icon.del { background: var(--danger-light); color: var(--danger); }
.log-content { flex: 1; }
.log-action { font-weight: 600; margin-bottom: 3px; }
.log-detail { color: var(--text-muted); }
.log-time { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }

/* ─── 반응형 ────────────────────────────────────── */
@media (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .video-panel { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .top-header { padding: 0 16px; }
  .content-area { padding: 16px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { min-width: auto; }
  .calendar-cell { min-height: 70px; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .modal { max-width: 100%; max-height: 95vh; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .header-right .edit-mode-indicator { display: none; }
}

/* ─── 기타 유틸 ─────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.sticky-top { position: sticky; top: 0; z-index: 10; background: var(--bg-white); }

/* ─── 코드관리 탭 버튼 ──────────────────────────── */
.code-tab-btn {
  display: inline-block;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.code-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.code-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ─── btn-outline (업로드 버튼 등) ─────────────── */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

/* ─── 업로드 모달 파일 input ────────────────────── */
#_upload-modal input[type="file"] {
  padding: 8px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--bg-hover);
  cursor: pointer;
  transition: border-color .2s;
}
#_upload-modal input[type="file"]:hover {
  border-color: var(--primary);
}

/* ─── 로그인 화면 ───────────────────────────────── */
.login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.login-box {
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0,0,0,.4);
  animation: loginFadeIn .4s ease;
}
@keyframes loginFadeIn {
  from { opacity:0; transform: translateY(20px) scale(.97); }
  to   { opacity:1; transform: translateY(0)    scale(1);   }
}
.login-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37,99,235,.4);
}
.login-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
}
.login-sub {
  font-size: .875rem;
  color: #94a3b8;
  margin-bottom: 28px;
}
.login-input-wrap {
  position: relative;
}
.login-input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: .9rem;
  z-index: 1;
}
.login-input {
  padding-left: 40px !important;
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #f1f5f9 !important;
  font-size: 1rem !important;
  height: 48px;
}
.login-input::placeholder { color: #64748b !important; }
.login-input:focus {
  border-color: #2563eb !important;
  background: rgba(255,255,255,.1) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.3) !important;
}
.login-hint {
  margin-top: 14px;
  font-size: .75rem;
  color: #475569;
}
.login-hint code {
  background: rgba(255,255,255,.08);
  padding: 1px 6px;
  border-radius: 4px;
  color: #93c5fd;
}

/* 로그아웃 버튼 */
.logout-text { display: inline; }
@media (max-width: 640px) {
  .logout-text { display: none; }
  .login-box { padding: 36px 24px; }
}

/* ═══════════════════════════════════════════════
   Presence (실시간 공동작업 표시)
═══════════════════════════════════════════════ */
.presence-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: .78rem;
  max-width: 480px;
  overflow-x: auto;
}
.presence-label {
  color: var(--text-muted);
  font-size: .72rem;
  white-space: nowrap;
  margin-right: 2px;
}
.presence-user {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2px 8px 2px 3px;
  transition: box-shadow .2s;
}
.presence-user.is-editing {
  border-color: var(--warning);
  background: var(--warning-light);
  box-shadow: 0 0 0 2px rgba(217,119,6,.15);
}
.presence-user.other-menu {
  opacity: .55;
  padding: 2px 6px 2px 2px;
}
.presence-name {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.presence-name-small {
  font-size: .68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.presence-status {
  font-size: .65rem;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.presence-status.editing {
  background: var(--warning-light);
  color: var(--warning);
}
.presence-status.viewing {
  background: var(--success-light);
  color: var(--success);
}
.presence-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}
.presence-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  cursor: default;
}
.presence-editing-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background: var(--warning);
  border-radius: 50%;
  border: 1.5px solid #fff;
}

/* 내 배지 */
.my-presence-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 행 하이라이트 (다른 사람이 편집 중인 행) */
tr.presence-row-highlight {
  outline: 2px solid var(--presence-color, #3b82f6);
  outline-offset: -1px;
  background: color-mix(in srgb, var(--presence-color, #3b82f6) 6%, white) !important;
  position: relative;
}
.presence-row-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  font-size: .58rem;
  font-weight: 700;
  margin-right: 4px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════
   Skeleton Loading UI
═══════════════════════════════════════════════ */
.skel {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  display: block;
}
@keyframes skelShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-text {
  height: 14px;
  width: 100%;
  border-radius: 3px;
}
.skel-circle {
  border-radius: 50%;
}

/* ═══════════════════════════════════════════════
   반응형
═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .presence-bar { max-width: 220px; }
  .presence-name, .presence-status { display: none; }
}

/* ═══════════════════════════════════════════════
   메인 대시보드 (홈페이지 모듈)
═══════════════════════════════════════════════ */

/* 전체 래퍼 */
#dash-root {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── 월 선택 바 ────────────────────────────── */
.dash-month-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.dash-month-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 140px;
  text-align: center;
  letter-spacing: -.3px;
}
.dash-month-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  transition: var(--transition);
}
.dash-month-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.dash-today-btn {
  padding: 5px 14px;
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
}
.dash-today-btn:hover {
  background: var(--primary);
  color: #fff;
}
.dash-refresh-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  transition: var(--transition);
}
.dash-refresh-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.dash-print-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  transition: var(--transition);
}
.dash-print-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* ── 대시보드 본문 패딩 ────────────────────── */
#dashboard-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── 상단 2열 그리드 ───────────────────────── */
.dash-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── 대시보드 카드 ──────────────────────────── */
.dash-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.dash-full { grid-column: 1 / -1; }

.dash-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  flex-wrap: wrap;
}
.dash-card-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

/* ── 배지 ───────────────────────────────────── */
.dash-ym-badge {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
}
.dash-count-badge {
  font-size: .75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 20px;
  padding: 2px 10px;
}

/* 홈페이지 제작 상태 칩 */
.dash-hp-status-bar {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}
.dash-status-chip {
  font-size: .72rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 10px;
}
.chip-done     { background: var(--success-light); color: var(--success); }
.chip-progress { background: var(--warning-light); color: var(--warning); }
.chip-maint    { background: #f1f5f9;              color: var(--secondary); }

/* ── 요약 테이블 ────────────────────────────── */
.dash-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.dash-summary-table thead th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.dash-summary-table tbody td {
  padding: 9px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  vertical-align: middle;
}
.dash-summary-table tbody tr:last-child td {
  border-bottom: none;
}
.dash-summary-table tbody tr:hover td {
  background: #f8fafc;
}
.dash-total-row td {
  font-weight: 700;
  background: #fafbff !important;
}

/* ── 상세 리스트 테이블 ─────────────────────── */
.dash-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.dash-table thead th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 8px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  text-align: left;
}
.dash-table tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  vertical-align: middle;
}
.dash-table tbody tr:last-child td {
  border-bottom: none;
}
.dash-table tbody tr:hover td {
  background: #f5f8ff;
}

/* ── 테이블 셀 유틸 ─────────────────────────── */
.dash-no {
  color: var(--text-muted);
  font-size: .78rem;
  width: 36px;
  text-align: center;
}
.dash-date {
  color: var(--text-secondary);
  font-size: .8rem;
  white-space: nowrap;
}
.dash-ellipsis {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-muted {
  color: var(--text-muted);
  font-size: .8rem;
}
.dash-num {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text-primary);
}

/* ── 빈 상태 ────────────────────────────────── */
.dash-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: .85rem;
}
.dash-empty i { font-size: 1rem; }

/* ── 펼침 버튼 ──────────────────────────────── */
.dash-expand-wrap {
  display: flex;
  justify-content: center;
  padding: 10px;
  border-top: 1px dashed var(--border);
  background: #fafbfc;
}
.dash-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 20px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}
.dash-expand-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── code-row-dup (관리자 중복 행 강조) ─────── */
.code-row-dup td {
  background: #fff8f8 !important;
}
.code-row-dup:hover td {
  background: #fee2e2 !important;
}

/* ── 반응형 ─────────────────────────────────── */
@media (max-width: 768px) {
  .dash-top-grid {
    grid-template-columns: 1fr;
  }
  #dashboard-body {
    padding: 12px;
    gap: 12px;
  }
  .dash-month-title { min-width: 110px; font-size: 1rem; }
  .dash-hp-status-bar { display: none; }
  .dash-card-title { font-size: .85rem; }
  .dash-table { font-size: .78rem; }
  .dash-table thead th,
  .dash-table tbody td { padding: 7px 10px; }
}

/* ═══════════════════════════════════════════════
   대시보드 모듈 (dashboard.js) 전용 스타일
═══════════════════════════════════════════════ */

/* ── 본문 래퍼 ──────────────────────────────── */
#dash-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── 비교 그래프 2열 그리드 ─────────────────── */
.dash-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── 언론보도+블로그 / 영상+협조 가로 2열 ─────── */
.dash-side-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── 차트 카드 내부 바디 ─────────────────────── */
.dash-chart-body {
  display: flex;
  flex-direction: column;
}

/* ── KPI 행 (그래프 위 수치 요약) ───────────── */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.dash-kpi-box {
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.dash-kpi-box:last-child { border-right: none; }
.dash-kpi-label {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
}
.dash-kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.dash-kpi-diff {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 3px;
  font-size: .72rem;
}
.dash-kpi-prev {
  color: var(--text-muted);
  font-size: .7rem;
}

/* ── 전월 비교 diff 색상 ────────────────────── */
.dash-diff-up {
  color: var(--success);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.dash-diff-down {
  color: var(--danger);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.dash-diff-zero {
  color: var(--text-muted);
  font-weight: 600;
}

/* ── 전월 비교 범례 ─────────────────────────── */
.dash-compare-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: .73rem;
  font-weight: 400;
  color: var(--text-muted);
}
.leg-cur, .leg-prev {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 3px;
  vertical-align: middle;
}
.leg-cur  { background: rgba(37,99,235,0.75); }
.leg-prev { background: rgba(148,163,184,0.55); border: 1px solid #cbd5e1; }

/* ── 반응형 ─────────────────────────────────── */
@media (max-width: 1024px) {
  .dash-compare-grid { grid-template-columns: 1fr; }
  .dash-side-grid     { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  #dash-body { padding: 12px; gap: 12px; }
  .dash-compare-grid { grid-template-columns: 1fr; }
  .dash-side-grid     { grid-template-columns: 1fr; }
  .dash-kpi-row       { grid-template-columns: repeat(2, 1fr); }
  .dash-kpi-box:nth-child(2) { border-right: none; }
  .dash-kpi-box:nth-child(3) { border-top: 1px solid var(--border); }
  .dash-kpi-box:nth-child(4) { border-top: 1px solid var(--border); }
  .dash-compare-legend { display: none; }
}

/* ═══════════════════════════════════════════════
   그래프 섹션 (테이블 아래 전월 비교 추가 영역)
═══════════════════════════════════════════════ */

/* 테이블과 그래프 사이 구분 영역 */
.dash-graph-section {
  border-top: 2px dashed var(--border);
  padding: 12px 16px 14px;
  background: #fafbff;
}

/* 그래프 범례 행 */
.dash-graph-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: .76rem;
  color: var(--text-secondary);
  font-weight: 500;
  flex-wrap: wrap;
}

/* 범례 색상 점 */
.leg-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.leg-cur-dot  { background: rgba(37,99,235,0.8); }
.leg-prev-dot { background: rgba(148,163,184,0.6); border: 1px solid #cbd5e1; }

/* 전월 대비 diff 칩 */
.dash-diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.dash-diff-chip .dash-diff-up   { font-size: .72rem; }
.dash-diff-chip .dash-diff-down { font-size: .72rem; }
.dash-diff-chip .dash-diff-zero { font-size: .72rem; }

/* 반응형 */
@media (max-width: 768px) {
  .dash-graph-section { padding: 10px 12px; }
  .dash-graph-legend  { font-size: .7rem; gap: 6px; }
}

/* ════════════════════════════════════════════════
   서비스 활용 현황 - 표+그래프 레이아웃
   ════════════════════════════════════════════════ */

/* 표 + 그래프 2열 레이아웃 */
.dash-service-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 0 20px 20px;
  align-items: start;
}

/* 왼쪽: 표 영역 */
.dash-service-table-wrap {
  overflow-x: auto;
}

/* 서비스 활용 현황 전용 테이블 */
.dash-service-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}
.dash-service-tbl thead tr th {
  background: var(--primary);
  color: #fff;
  padding: 8px 10px;
  text-align: center;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.15);
  white-space: nowrap;
}
.dash-service-tbl tbody tr td {
  padding: 7px 10px;
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}
.dash-service-tbl tbody tr:hover td {
  background: #f8faff;
}

/* 그룹 병합 셀 */
.svc-group-cell {
  background: #f0f4ff;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.4;
  font-size: .78rem;
  min-width: 56px;
}

/* 서브 항목 셀 */
.svc-sub-cell {
  text-align: left !important;
  padding-left: 14px !important;
  color: var(--text-secondary);
  background: #fafbff;
}

/* 단독 항목 셀 */
.svc-single-cell {
  text-align: left !important;
  font-weight: 500;
  background: #fafbff;
  padding-left: 12px !important;
}

/* 숫자 셀 */
.svc-val-cell {
  font-weight: 600;
  font-size: .9rem;
  min-width: 60px;
}

/* diff 셀 */
.svc-diff-cell {
  min-width: 64px;
  font-size: .8rem;
}

/* 합계 행 */
.svc-total-row td {
  background: #e8f0fe !important;
  font-weight: 700 !important;
}
.svc-total-label {
  text-align: center !important;
  color: var(--primary) !important;
  font-size: .85rem;
}

/* 오른쪽: 차트 영역 */
.dash-service-chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* diff 칩 묶음 */
.dash-graph-diff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}

/* 반응형: 모바일에서 세로 전환 */
@media (max-width: 900px) {
  .dash-service-layout {
    grid-template-columns: 1fr;
  }
}

/* ── 영상 언어 행 추가 테이블 ──────────────────── */
.vid-lang-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin-top: 4px;
}
.vid-lang-table thead th {
  background: var(--bg-light);
  padding: 7px 10px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
}
.vid-lang-table tbody tr.vid-lang-row td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  vertical-align: middle;
}
.vid-lang-table .form-control-sm {
  padding: 4px 8px;
  font-size: .82rem;
  height: auto;
}

/* ── 목록 언어 태그 ──────────────────────────── */
.vid-lang-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .73rem;
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.vid-lang-tag.done {
  background: #d1fae5;
  color: #059669;
  border-color: #6ee7b7;
}

/* ── 언어 상태 배지 ─────────────────────────────── */
.lang-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.lang-state-waiting { background: #f1f5f9; color: #94a3b8; }   /* 접수 */
.lang-state-ing     { background: #fef3c7; color: #d97706; }   /* 진행중, 수정중 */
.lang-state-work    { background: #ede9fe; color: #7c3aed; }   /* 검수중 */
.lang-state-done    { background: #d1fae5; color: #059669; }   /* 제작완료 */

/* ── 목록 언어 진행률 배지 ──────────────────────── */
.vid-lang-progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.vid-lang-progress-name {
  font-weight: 700;
}
.vid-lang-progress-pct {
  opacity: .85;
}
.vid-lang-progress-label {
  opacity: .9;
}
/* 접수 (0%) */
.vid-lang-progress-badge.waiting {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}
/* 진행중 (33%) */
.vid-lang-progress-badge.ing {
  background: #fef3c7;
  color: #d97706;
  border-color: #fde68a;
}
/* 검수중 (66%) */
.vid-lang-progress-badge.review {
  background: #ede9fe;
  color: #7c3aed;
  border-color: #ddd6fe;
}
/* 제작완료 (100%) */
.vid-lang-progress-badge.done {
  background: #d1fae5;
  color: #059669;
  border-color: #6ee7b7;
}
/* 수정중 */
.vid-lang-progress-badge.revising {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
}

/* ── 영상 목록 행 레이아웃 ───────────────────────── */
.vid-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
  cursor: pointer;
  transition: background .15s;
}
.vid-list-row:last-child { border-bottom: none; }
.vid-list-row:hover { background: #f8fafc; }

/* 왼쪽: 제목 + 메타 */
.vid-list-col-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vid-list-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vid-list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--text-muted, #94a3b8);
}
.vid-list-meta .badge { font-size: .72rem; }
.vid-list-meta i { width: 12px; }
.vid-list-status { color: var(--primary, #2563eb); font-weight: 500; }

/* 오른쪽: 언어 배지 + 완료 카운트 */
.vid-list-col-langs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.vid-list-lang-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.vid-list-done-cnt {
  font-size: .75rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  flex-shrink: 0;
}
.vid-list-no-lang {
  font-size: .75rem;
  color: #cbd5e1;
  font-style: italic;
}

/* 반응형: 좁은 화면에서 세로 배치 */
@media (max-width: 640px) {
  .vid-list-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
