/* ==========================================================================
   CSS DESIGN SYSTEM & VARIABLES
   ========================================================================== */

:root {
  /* Dark Theme (Default) */
  --bg-app: #090d16;
  --bg-sidebar: #0f1524;
  --bg-card: rgba(20, 27, 45, 0.6);
  --bg-card-hover: rgba(28, 38, 62, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --glow-blue: 0 0 15px rgba(59, 130, 246, 0.3);
  
  /* Brand & Priority Colors */
  --color-primary: #3b82f6;      /* Blue */
  --color-primary-grad: linear-gradient(135deg, #3b82f6, #1d4ed8);
  --color-secondary: #64748b;    /* Slate */
  --color-success: #10b981;      /* Emerald */
  --color-warning: #f59e0b;      /* Amber */
  --color-danger: #ef4444;       /* Rose */
  --color-info: #06b6d4;         /* Cyan */
  --color-purple: #8b5cf6;       /* Violet */
  --color-purple-grad: linear-gradient(135deg, #8b5cf6, #6d28d9);
  --color-rose-grad: linear-gradient(135deg, #ef4444, #b91c1c);
  --color-emerald-grad: linear-gradient(135deg, #10b981, #047857);
  
  /* Statuses */
  --status-todo: #f59e0b;
  --status-inprogress: #3b82f6;
  --status-review: #8b5cf6;
  --status-done: #10b981;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s ease;
}

.light-theme {
  /* Light Theme Variables */
  --bg-app: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #3b82f6;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
  --glow-blue: 0 0 12px rgba(59, 130, 246, 0.15);
}

/* ==========================================================================
   RESET & GLOBALS
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', 'Noto Sans KR', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* ==========================================================================
   CUSTOM SCROLLBARS (theme-aware, subtle & rounded)
   ========================================================================== */
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
/* WebKit / Chromium */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  border: 3px solid transparent;   /* creates padding around the thumb */
  background-clip: padding-box;
  transition: background-color var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(148, 163, 184, 0.5);
}
::-webkit-scrollbar-thumb:active {
  background-color: rgba(148, 163, 184, 0.65);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* Light theme: slightly darker thumb for contrast on light backgrounds */
.light-theme, .light-theme * { scrollbar-color: rgba(100, 116, 139, 0.4) transparent; }
.light-theme *::-webkit-scrollbar-thumb { background-color: rgba(100, 116, 139, 0.3); }
.light-theme *::-webkit-scrollbar-thumb:hover { background-color: rgba(100, 116, 139, 0.55); }

/* Blue accent thumb for primary content areas */
.content-body ::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
  background-color: rgba(59, 130, 246, 0.3);
}
.content-body ::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
  background-color: rgba(59, 130, 246, 0.55);
}

/* ==========================================================================
   APP CONTAINER & LAYOUT
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
  white-space: nowrap;
  transition: width var(--transition-normal), background-color var(--transition-normal), border-right var(--transition-normal);
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.sidebar-toggle i { width: 18px; height: 18px; }

/* ===== Collapsed sidebar state ===== */
.app-container.sidebar-collapsed .sidebar { width: 76px; }
.app-container.sidebar-collapsed .main-content { margin-left: 76px; }

.app-container.sidebar-collapsed .logo-container,
.app-container.sidebar-collapsed .nav-link span,
.app-container.sidebar-collapsed .profile-info,
.app-container.sidebar-collapsed .profile-avatar { display: none; }

/* Collapsed footer: show a clean, centered logout icon (no cut-off initials) */
.app-container.sidebar-collapsed .btn-logout {
  display: flex !important;
  margin: 0 !important;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.app-container.sidebar-collapsed .btn-logout:hover { background-color: rgba(255, 255, 255, 0.06); }
.app-container.sidebar-collapsed .btn-logout i { width: 20px; height: 20px; }

.app-container.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 22px 0;
}

.app-container.sidebar-collapsed .sidebar-nav { padding: 24px 12px; }
.app-container.sidebar-collapsed .nav-link { justify-content: center; padding: 12px 0; }
.app-container.sidebar-collapsed .nav-link:hover i { transform: none; }

.app-container.sidebar-collapsed .sidebar-footer { padding: 16px 0; }
.app-container.sidebar-collapsed #sidebar-user-profile { justify-content: center !important; }
.app-container.sidebar-collapsed #sidebar-user-profile > div {
  justify-content: center !important;
  flex: unset !important;
  gap: 0 !important;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-box {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--color-primary-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-blue);
}

.logo-icon {
  color: #fff;
  width: 20px;
  height: 20px;
}

.logo-text-box {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  min-height: 0;        /* 메뉴가 많아도 푸터(사용자명)를 밀어내지 않도록 */
  overflow-y: auto;     /* 넘치면 메뉴 영역만 스크롤 */
  padding: 24px 16px;
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-link i {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-link:hover i {
  transform: translateX(2px);
}

.nav-link.active {
  background: var(--color-primary-grad);
  color: #ffffff;
  box-shadow: var(--glow-blue);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-purple-grad);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.profile-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Area Styling */
.main-content {
  flex: 1;
  margin-left: 260px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px;
  overflow: hidden;
  transition: margin-left var(--transition-normal);
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

#view-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.datetime-widget {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
}

.datetime-widget i {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}

/* ===== 완료 태스크: 전체 보기 버튼 + 모달 리스트 ===== */
.kanban-more-btn {
  width: 100%; margin-top: 8px; padding: 10px;
  background: transparent; border: 1px dashed var(--border-color);
  border-radius: 10px; color: var(--text-muted); cursor: pointer;
  font-size: 0.84rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.kanban-more-btn:hover { background: var(--bg-card-hover); color: var(--text-main); border-color: var(--color-primary, #6c8cff); }
.kanban-more-btn i { width: 15px; height: 15px; }
.done-tasks-list { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.done-task-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 10px;
  background: var(--color-surface, rgba(255,255,255,0.03));
}
.done-task-main { min-width: 0; flex: 1; }
.done-task-title { font-size: 0.9rem; font-weight: 600; color: var(--text-main); margin-bottom: 4px; word-break: break-word; }
.done-task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 0.76rem; color: var(--text-muted); }
.done-task-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ===== 도움말 ? 버튼 + 텔레그램 안내 ===== */
.help-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; margin-left: 2px;
  border-radius: 50%; border: 1px solid var(--color-primary, #6c8cff);
  background: transparent; color: var(--color-primary, #6c8cff);
  font-size: 0.72rem; font-weight: 700; line-height: 1; cursor: pointer;
  vertical-align: middle;
}
.help-btn:hover { background: var(--color-primary, #6c8cff); color: #fff; }
.tg-help-intro { font-size: 0.9rem; color: var(--text-main); margin: 0 0 14px; line-height: 1.5; }
.tg-help-steps { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.tg-help-steps > li { font-size: 0.9rem; color: var(--text-main); }
.tg-help-steps > li > strong { color: var(--color-primary, #6c8cff); }
.tg-help-steps p { margin: 4px 0 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.tg-help-warn { color: var(--color-danger, #e5484d); }
.tg-help-steps code, .tg-help-note code {
  background: rgba(108,140,255,0.12); color: var(--color-primary, #6c8cff);
  padding: 1px 6px; border-radius: 5px; font-size: 0.82em;
}
.tg-help-note {
  border: 1px solid var(--border-color); border-radius: 10px;
  padding: 12px 14px; background: rgba(0,0,0,0.03); font-size: 0.85rem; color: var(--text-main);
}
.light-theme .tg-help-note { background: rgba(0,0,0,0.02); }
.tg-help-note > div { margin-bottom: 6px; }
.tg-help-note ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; color: var(--text-muted); }

/* ===== 알림 (벨 + 드롭다운) ===== */
.noti-wrap { position: relative; }
.noti-bell {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px; height: 40px;
  border-radius: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.noti-bell:hover { background: var(--bg-card-hover); }
.noti-bell i { width: 18px; height: 18px; }
.noti-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--color-danger, #e5484d); color: #fff;
  border-radius: 9px; font-size: 0.68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-body, #0b0f19);
}
.noti-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; max-height: 440px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  z-index: 200; display: flex; flex-direction: column; overflow: hidden;
}
.noti-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border-color);
  font-weight: 700; font-size: 0.92rem;
}
.noti-panel-actions { display: flex; gap: 6px; }
.noti-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.noti-empty { padding: 24px 14px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.noti-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 11px 14px; border-bottom: 1px solid var(--border-color);
  cursor: pointer; transition: background var(--transition-fast);
}
.noti-item:hover { background: var(--bg-card-hover); }
.noti-item.unread { background: rgba(108, 140, 255, 0.08); }
.noti-item.unread .noti-msg { font-weight: 600; }
.noti-item.unread::before {
  content: ''; flex-shrink: 0; margin-top: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-primary, #6c8cff);
}
.noti-item.read::before { content: ''; flex-shrink: 0; width: 7px; }
.noti-item-body { flex: 1; min-width: 0; }
.noti-msg { font-size: 0.86rem; color: var(--text-main); line-height: 1.4; word-break: break-word; }
.noti-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; }
.noti-del {
  flex-shrink: 0; background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.noti-del:hover { background: rgba(255,0,0,0.08); color: var(--color-danger, #e5484d); }

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.dark-theme .sun-icon { display: block; }
.dark-theme .moon-icon { display: none; }
.light-theme .sun-icon { display: none; }
.light-theme .moon-icon { display: block; }

/* Content Body */
.content-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.view-section {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
}

.view-section.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

/* 설정 화면은 카드가 세로로 길게 쌓인다. .main-content 가 overflow:hidden 이라
   여기서 스크롤을 열어 주지 않으면 아래쪽 카드(연동·시놀로지·포털 사용자)가 잘려 닿지 않는다.
   (이전에는 존재하지 않는 .settings-body 를 대상으로 해서 규칙이 죽어 있었다) */
#settings-view.view-section.active {
  overflow-y: auto;
  min-height: 0;
  padding-right: 6px;
}

/* [내 계정] 도 카드가 세로로 쌓이기만 한다 — 설정 화면과 같은 이유로 여기서 스크롤을 연다.
   (안 열면 비밀번호 변경·2단계 인증 카드가 화면 아래로 잘려 닿지 않는다) */
#selfservice-view.view-section.active {
  overflow-y: auto;
  min-height: 0;
  padding-right: 6px;
  padding-bottom: 8px;
}

#dashboard-view {
  overflow-y: auto;
  padding-right: 6px;
}

#persons-view, #groups-view, #departments-view, #apps-view {
  overflow: hidden;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   GENERIC COMPONENTS & UTILITIES
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary-grad);
  color: #ffffff;
  box-shadow: var(--glow-blue);
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.btn-secondary.active {
  background: var(--color-primary-grad);
  border-color: var(--border-focus);
  color: #ffffff;
  box-shadow: var(--glow-blue);
}

.btn-danger {
  background: var(--color-rose-grad);
  color: #ffffff;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-success {
  background: var(--color-emerald-grad);
  color: #ffffff;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
  gap: 6px;
}

.btn-sm svg,
.btn-sm i {
  width: 14px;
  height: 14px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  padding: 0;
}

.btn-icon i {
  width: 18px;
  height: 18px;
}

/* Translucent Glass Panels */
.glass {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  transition: border-color var(--transition-normal), background-color var(--transition-normal);
}

.glass:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

/* Activity-log action pills (reuse status color codes) */
.logs-table .badge.count { padding: 4px 9px; border-radius: 6px; font-size: 0.74rem; }
.logs-table .badge.count.received { background-color: rgba(5, 182, 212, 0.15); color: var(--color-info); }
.logs-table .badge.count.assigned { background-color: rgba(139, 92, 246, 0.15); color: var(--color-purple); }
.logs-table .badge.count.in-progress { background-color: rgba(59, 130, 246, 0.15); color: var(--color-primary); }
.logs-table .badge.count.completed { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.logs-table .badge.count.hold { background-color: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.logs-table td { vertical-align: middle; }

.badge.priority-high { background-color: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.badge.priority-medium { background-color: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge.priority-low { background-color: rgba(59, 130, 246, 0.15); color: var(--color-primary); }

.badge.status-pending { background-color: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge.status-approved { background-color: rgba(5, 182, 212, 0.15); color: var(--color-info); }
.badge.status-inprogress { background-color: rgba(59, 130, 246, 0.15); color: var(--color-primary); }
.badge.status-review { background-color: rgba(139, 92, 246, 0.15); color: var(--color-purple); }
.badge.status-done { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge.status-rejected { background-color: rgba(239, 68, 68, 0.15); color: var(--color-danger); }

/* ===== Maintenance ledger (유지보수대장) ===== */
.maintenance-table { table-layout: fixed; }
/* Keep every maintenance row on a single, compact line; long text truncates with ellipsis.
   Use .data-table.maintenance-table for higher specificity than the generic .data-table td padding. */
.data-table.maintenance-table td {
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 9px 12px;
}
.data-table.maintenance-table th { padding: 11px 12px; }

/* Sortable headers (클릭하여 오름/내림 정렬) */
.maintenance-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 20px !important;
  transition: color var(--transition-fast);
}
.maintenance-table th.sortable:hover { color: var(--text-main); }
.maintenance-table th.sortable::after {
  content: '⇅';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  opacity: 0.35;
}
.maintenance-table th.sortable.sort-active { color: var(--color-primary); }
.maintenance-table th.sortable.sort-active::after { opacity: 1; color: var(--color-primary); }
.maintenance-table th.sortable[data-dir="asc"]::after { content: '↑'; }
.maintenance-table th.sortable[data-dir="desc"]::after { content: '↓'; }

.maint-datetime {
  font-family: 'Outfit', monospace;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.maint-content-cell {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.maint-type-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  background-color: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}
.maint-type-tag.type-new { background-color: rgba(59, 130, 246, 0.15); color: var(--color-primary); }
.maint-type-tag.type-improvement { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.maint-type-tag.type-error { background-color: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.maint-type-tag.type-etc { background-color: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

.ai-category-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  background-color: rgba(59, 130, 246, 0.12);
  color: var(--color-primary);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

/* 유지보수 대분류(시스템) 태그 */
.maint-system-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  background-color: rgba(139, 92, 246, 0.12);
  color: var(--color-purple);
  border: 1px solid rgba(139, 92, 246, 0.28);
}

.text-muted-cell { color: var(--text-muted); }

/* ===== Table pagination ===== */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 4px 4px;
  margin-top: 8px;
}

.pagination-left {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.page-size-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#maint-page-size {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text-main);
  font-size: 0.82rem;
  cursor: pointer;
}

.light-theme #maint-page-size { background-color: #f8fafc; }

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  background-color: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled):not(.active) {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.page-btn.active {
  background: var(--color-primary-grad);
  color: #fff;
  border-color: transparent;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--text-muted);
  padding: 0 2px;
}

/* ===== AI summary dot in list ===== */
.ai-summary-dot {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
  vertical-align: middle;
  margin-right: 4px;
}

/* ===== Rich text editor ===== */
.rich-editor-wrap {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.15);
}
.light-theme .rich-editor-wrap { background-color: #f8fafc; }

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.02);
}

.rich-toolbar button {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.rich-toolbar button:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-color);
}

.rich-editor {
  min-height: 90px;
  max-height: 260px;
  overflow-y: auto;
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.6;
  outline: none;
}
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}
.rich-editor:focus { box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.25); }
.rich-editor ul, .rich-editor ol { padding-left: 22px; margin: 4px 0; }
.rich-editor a { color: var(--color-primary); text-decoration: underline; }

/* Pasted content (Excel/Word/메일) often carries hard-coded black text
   (color: rgb(0,0,0) / #000000 / black / windowtext), which is invisible on the
   dark editor background. Force such black text to the theme color in dark mode.
   Other colors (red/blue highlights) are left untouched. */
.dark-theme .rich-editor [style*="rgb(0, 0, 0)"],
.dark-theme .rich-editor [style*="rgb(0,0,0)"],
.dark-theme .rich-editor [style*="color:#000000"],
.dark-theme .rich-editor [style*="color: #000000"],
.dark-theme .rich-editor [style*="color:black"],
.dark-theme .rich-editor [style*="color: black"],
.dark-theme .rich-editor [style*="windowtext"],
.dark-theme .rich-editor font[color="#000000"],
.dark-theme .rich-editor font[color="#000"],
.dark-theme .rich-editor font[color="black"] {
  color: var(--text-main) !important;
}

/* ===== Requester management ===== */
.requester-list { display: flex; flex-direction: column; gap: 6px; }
.requester-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.02);
}
.requester-info { display: flex; align-items: center; gap: 10px; }
.requester-name { font-weight: 600; color: var(--text-main); }
.requester-dept {
  font-size: 0.78rem;
  color: var(--text-muted);
  background-color: rgba(148, 163, 184, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
}

/* ===== Permission checklist & user management ===== */
.perm-checklist {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.12);
}
.light-theme .perm-checklist { background-color: #f8fafc; }

.perm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
}
.perm-item input { width: 16px; height: 16px; cursor: pointer; }

.menu-perm-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background-color: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  margin: 1px 0;
}

/* ===== Toast notifications (styled alert) ===== */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 48px));
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--bg-card, #131c31);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--color-primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  color: var(--text-main);
  font-size: 0.88rem;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.28s ease;
}
.toast.toast-in { transform: translateX(0); opacity: 1; }
.toast.toast-out { transform: translateX(120%); opacity: 0; }

.toast .toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast .toast-msg { flex: 1; line-height: 1.45; word-break: break-word; }
.toast .toast-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px; display: flex; flex-shrink: 0;
}
.toast .toast-close i { width: 15px; height: 15px; }
.toast .toast-close:hover { color: var(--text-main); }

.toast-success { border-left-color: var(--color-success); }
.toast-success .toast-icon { color: var(--color-success); }
.toast-error { border-left-color: var(--color-danger); }
.toast-error .toast-icon { color: var(--color-danger); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info { border-left-color: var(--color-primary); }
.toast-info .toast-icon { color: var(--color-primary); }

.light-theme .toast { background: #ffffff; }

/* ===== Security vulnerabilities ===== */
.badge.sev-critical { background-color: rgba(239, 68, 68, 0.18); color: #ef4444; font-weight: 700; }
.badge.sev-high { background-color: rgba(249, 115, 22, 0.16); color: #f97316; }
.badge.sev-medium { background-color: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge.sev-low { background-color: rgba(59, 130, 246, 0.15); color: var(--color-primary); }

.cve-tag {
  font-family: 'Outfit', monospace;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 5px;
  background-color: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Inline-editable vulnerability grid */
.vuln-grid td { padding: 8px 10px; vertical-align: middle; }
.grid-edit {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text-main);
  font-size: 0.82rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.light-theme .grid-edit { background-color: #f1f5f9; }
.grid-edit:hover { border-color: var(--border-color); }
.grid-edit:focus { border-color: var(--border-focus); background-color: rgba(0, 0, 0, 0.25); outline: none; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }
.light-theme .grid-edit:focus { background-color: #fff; }
select.grid-edit { cursor: pointer; }

/* Color the severity select text by row severity */
.sev-row-critical .sev-select { color: #ef4444; font-weight: 700; }
.sev-row-high .sev-select { color: #f97316; font-weight: 600; }
.sev-row-medium .sev-select { color: var(--color-warning); }
.sev-row-low .sev-select { color: var(--color-primary); }

/* ===== Asset management ===== */
.asset-type-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  background-color: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

/* 자원명 / 호스트 셀 — 호스트명이 길어도 열 폭을 넘기지 않도록 줄임표 처리 */
.asset-name-cell { max-width: 230px; }
.asset-name-cell .request-title-cell { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.asset-host-line {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-top: 2px;
}

/* Asset row accordion (설치 SW/버전) */
.asset-name-line { display: flex; align-items: center; gap: 6px; }
.asset-caret-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; border: none; border-radius: 4px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: transform var(--transition-fast), color var(--transition-fast);
}
.asset-caret-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.06); }
.asset-caret-spacer { flex: 0 0 auto; display: inline-block; width: 18px; }
.asset-comp-count {
  flex: 0 0 auto; cursor: pointer; font-size: 0.68rem; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  background: rgba(59, 130, 246, 0.15); color: var(--color-primary);
}
.asset-detail-row > td { background: rgba(0,0,0,0.12); padding: 8px 14px 10px 40px; }
.light-theme .asset-detail-row > td { background: rgba(15, 23, 42, 0.03); }
.asset-comp-detail { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.asset-comp-detail-label { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 600; color: var(--text-muted); margin-right: 4px; }
.asset-comp-chip {
  font-size: 0.76rem; padding: 2px 8px; border-radius: 6px;
  background: rgba(148, 163, 184, 0.14); border: 1px solid var(--border-color); color: var(--text-main);
}
.asset-comp-chip b { color: var(--color-primary); font-weight: 700; }

/* Asset modal: SW components accordion + editor */
.asset-components-accordion {
  border: 1px solid var(--border-color); border-radius: 10px;
  margin-bottom: 16px; background: rgba(0,0,0,0.10); overflow: hidden;
}
.light-theme .asset-components-accordion { background: #f8fafc; }
.asset-components-accordion > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 14px; font-weight: 600; font-size: 0.9rem; color: var(--text-main);
}
.asset-components-accordion > summary::-webkit-details-marker { display: none; }
.asset-components-accordion > summary svg { width: 15px; height: 15px; }
.asset-components-accordion > summary .acc-caret { color: var(--text-muted); transition: transform var(--transition-fast); }
.asset-components-accordion[open] > summary .acc-caret { transform: rotate(90deg); }
.asset-components-accordion .acc-count { color: var(--color-primary); font-size: 0.82rem; }
.asset-components-accordion .acc-hint { font-weight: 400; font-size: 0.76rem; color: var(--text-muted); flex-basis: 100%; padding-left: 23px; }
.asset-components-body { padding: 4px 14px 14px; border-top: 1px solid var(--border-color); }
.asset-components-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.asset-components-presets .preset-label { font-size: 0.78rem; color: var(--text-muted); margin-right: 2px; }
.asset-components-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.asset-component-row { display: flex; gap: 8px; align-items: center; }
.asset-component-row .comp-name { flex: 2; }
.asset-component-row .comp-version { flex: 1; }
.asset-component-row .comp-remove { flex: 0 0 auto; padding: 8px 10px; }

/* 대상 시스템 추가 — 기존 자원 선택 피커 */
.asset-picker-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px;
}
.asset-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.asset-picker-item:hover { background-color: rgba(148, 163, 184, 0.1); }
.asset-picker-item input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; cursor: pointer; }
.asset-picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-picker-item .asset-type-tag { flex: 0 0 auto; }
.asset-relevant-tag {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}
.asset-match-tag {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background-color: rgba(59, 130, 246, 0.18);
  color: var(--color-primary);
  white-space: nowrap;
}
.asset-picker-item.matched { background-color: rgba(59, 130, 246, 0.08); box-shadow: inset 2px 0 0 var(--color-primary); }
.asset-picker-empty { padding: 24px 12px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.asset-type-tag.type-server { background-color: rgba(59, 130, 246, 0.15); color: var(--color-primary); }
.asset-type-tag.type-system { background-color: rgba(139, 92, 246, 0.15); color: var(--color-purple); }
.asset-type-tag.type-solution { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.asset-type-tag.type-network { background-color: rgba(6, 182, 212, 0.15); color: var(--color-info); }
.asset-type-tag.type-db { background-color: rgba(245, 158, 11, 0.15); color: var(--color-warning); }

.asset-purpose-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  background-color: rgba(139, 92, 246, 0.14);
  color: var(--color-purple);
}

/* ===== Vulnerability → target asset impact panel ===== */
.vuln-impact-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background-color: rgba(59, 130, 246, 0.04);
  /* Bottom half of the split view: fill remaining space, scroll internally */
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.vuln-impact-panel .table-responsive {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
/* When the impact panel is open, cap the vuln list to the top half */
#security-view .requests-layout.split-active .requests-list-container {
  flex: 1 1 0;
}

.impact-add-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.08);
}
.impact-add-form input, .impact-add-form select { padding: 8px 10px; font-size: 0.85rem; }
.impact-add-form #impact-new-name { flex: 1; min-width: 180px; }
.impact-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.impact-panel-header h4 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.impact-panel-header h4 i { width: 18px; height: 18px; color: var(--color-primary); }

.impact-grid td { padding: 8px 10px; vertical-align: middle; }
.impact-grid tr.impact-affected { background-color: rgba(59, 130, 246, 0.06); }
.impact-toggle .insp-btn { padding: 5px 12px; font-size: 0.78rem; }
.impact-toggle .insp-btn.active[data-val="yes"] { background-color: var(--color-primary); color: #fff; }
.impact-toggle .insp-btn.active[data-val="no"] { background-color: rgba(148, 163, 184, 0.4); color: var(--text-main); }
.grid-edit:disabled { opacity: 0.4; cursor: not-allowed; }

.vuln-row-selected { box-shadow: inset 3px 0 0 var(--color-primary); }
.vuln-row-selected td:first-child { position: relative; }

.impact-count-badge {
  display: inline-block;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  padding: 0 4px;
  margin-right: 3px;
  border-radius: 8px;
  background-color: var(--color-danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}

/* ===== Daily inspection ===== */
.inspection-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  flex: 1;
  min-height: 0;
}
@media (max-width: 1100px) { .inspection-layout { grid-template-columns: 1fr; } }

.inspection-form-card, .inspection-history-card {
  padding: 20px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;       /* allow the card to fit within the viewport height */
  overflow: hidden;
}
.inspection-history-card { overflow: auto; }

/* The item list scrolls so 특이사항·점검자·저장 버튼이 항상 보이게 유지 */
.inspection-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
  flex: 1 1 auto;
  min-height: 60px;
  overflow-y: auto;
  padding-right: 4px;
}
.inspection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.02);
}
.inspection-item-label { font-size: 0.9rem; font-weight: 600; color: var(--text-main); }

.inspection-toggle { display: flex; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.insp-btn {
  padding: 6px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;   /* keep '비대상' on one line (CJK breaks mid-word otherwise) */
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.insp-btn:first-child { border-right: 1px solid var(--border-color); }
.insp-btn.active[data-val="normal"] { background-color: var(--color-success); color: #fff; }
.insp-btn.active[data-val="abnormal"] { background-color: var(--color-danger); color: #fff; }

.insp-dot {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.insp-dot.normal { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.insp-dot.abnormal { background-color: rgba(239, 68, 68, 0.15); color: var(--color-danger); }

/* Category-grouped check form */
.inspection-category { margin-bottom: 14px; }
.inspection-category-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 6px 0 8px;
  padding-left: 8px;
  border-left: 3px solid var(--color-primary);
}

.insp-abn-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background-color: rgba(239, 68, 68, 0.12);
  color: var(--color-danger);
  margin: 1px 0;
}

/* Named-template blocks in the management modal */
.tpl-template-block {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: rgba(59, 130, 246, 0.04);
}
.tpl-template-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.tpl-name-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 5px;
  background-color: rgba(59, 130, 246, 0.14);
  color: var(--color-primary);
  margin-top: 3px;
}

/* Template management list */
.tpl-group { margin-bottom: 12px; }
.tpl-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.tpl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.02);
  margin-bottom: 6px;
  font-size: 0.88rem;
  color: var(--text-main);
}

/* ===== AI report output ===== */
/* Saved reports bar (시점별 저장 목록) */
.saved-reports-bar {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
  background-color: rgba(255, 255, 255, 0.015);
}
.saved-reports-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.saved-reports-title i { width: 15px; height: 15px; }
.saved-reports-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.saved-report-card {
  position: relative;
  flex: 0 0 auto;
  min-width: 150px;
  max-width: 200px;
  padding: 10px 28px 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: rgba(59, 130, 246, 0.04);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.saved-report-card:hover { border-color: var(--border-focus); background-color: rgba(59, 130, 246, 0.1); }
.saved-report-card.active { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.saved-report-card .src-label { font-size: 0.85rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-report-card .src-meta { font-size: 0.72rem; color: var(--color-primary); margin-top: 2px; }
.saved-report-card .src-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; font-family: 'Outfit', monospace; }
.saved-report-del {
  position: absolute;
  top: 6px; right: 6px;
  width: 18px; height: 18px;
  border: none; border-radius: 5px;
  background: transparent; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.saved-report-del i { width: 13px; height: 13px; }
.saved-report-del:hover { background-color: rgba(239, 68, 68, 0.15); color: var(--color-danger); }

/* Prettier report document (in-app) */
.report-doc-head {
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 12px;
  margin-bottom: 18px;
}
.report-doc-title { font-size: 1.35rem; font-weight: 800; color: var(--text-main); }
.report-doc-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }

.report-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 700px) { .report-chips { grid-template-columns: repeat(2, 1fr); } }
.report-chip {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.02);
}
.report-chip .rc-val { display: block; font-size: 1.7rem; font-weight: 800; color: var(--text-main); }
.report-chip .rc-label { display: block; font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.report-chip.c-blue .rc-val { color: var(--color-primary); }
.report-chip.c-green .rc-val { color: var(--color-success); }
.report-chip.c-amber .rc-val { color: var(--color-warning); }
.report-chip.c-purple .rc-val { color: var(--color-purple); }

.report-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 720px) { .report-charts { grid-template-columns: 1fr; } }
.report-chart-box {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  background-color: rgba(255, 255, 255, 0.02);
}
.report-chart-title { font-size: 0.82rem; font-weight: 700; color: var(--text-main); margin-bottom: 8px; text-align: center; }
.report-chart-canvas { position: relative; height: 200px; }

.report-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background-color: rgba(59, 130, 246, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}
.report-bd-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.report-bd-item { display: inline-block; font-size: 0.82rem; color: var(--text-main); margin-right: 10px; }
.report-bd-item b { color: var(--color-primary); }

.report-body { color: var(--text-main); line-height: 1.7; }
.report-table-wrap { overflow-x: auto; margin: 12px 0; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.report-table th, .report-table td {
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.report-table th { background-color: rgba(59, 130, 246, 0.1); font-weight: 700; color: var(--text-main); white-space: nowrap; }
.report-table tbody tr:nth-child(even) td { background-color: rgba(255, 255, 255, 0.02); }
.light-theme .report-table tbody tr:nth-child(even) td { background-color: rgba(0, 0, 0, 0.02); }
.report-body h3, .report-body h4, .report-body h5 {
  margin: 18px 0 8px;
  font-weight: 700;
  color: var(--text-main);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}
.report-body h3 { font-size: 1.1rem; }
.report-body h4 { font-size: 1rem; }
.report-body p { margin: 6px 0; font-size: 0.9rem; }
.report-body ul { padding-left: 22px; margin: 6px 0; }
.report-body li { margin: 3px 0; font-size: 0.9rem; }
.report-body strong { color: var(--color-primary); }

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.light-theme .form-control {
  background-color: #f8fafc;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background-color: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   PRETTY <select> — custom chevron, no native OS styling
   ========================================================================== */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  padding-right: 32px !important;
  cursor: pointer;
}
/* Make plain (non .form-control) selects match the input look */
select.form-control,
select:not(.grid-edit):not(.insp-btn) {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  transition: all var(--transition-fast);
}
.light-theme select.form-control,
.light-theme select:not(.grid-edit) {
  background-color: #f8fafc;
}
select:hover { border-color: rgba(148, 163, 184, 0.4); }
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}
/* Compact selects inside grids/tables keep a tighter arrow */
select.grid-edit,
#maint-page-size,
.impact-add-form select,
#history-template-filter {
  background-position: right 7px center;
  background-size: 14px;
  padding-right: 26px !important;
}
/* dropdown options readable in both themes */
select option { background-color: var(--bg-sidebar); color: var(--text-main); }
.light-theme select option { background-color: #fff; color: #0f172a; }

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .col {
  flex: 1;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  padding: 14px 16px;
  background-color: rgba(0, 0, 0, 0.1);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Empty States */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 30px;
  font-style: italic;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   VIEW 1: DASHBOARD VIEW
   ========================================================================== */

/* Quick Stats Grid */
/* Dashboard toolbar (연도 필터) */
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.dashboard-scope-label { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
.dashboard-year-filter { display: flex; align-items: center; gap: 8px; }
.dashboard-year-filter svg { width: 16px; height: 16px; color: var(--text-muted); }
.dashboard-year-filter label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.dashboard-year-filter select {
  width: auto;
  min-width: 120px;
  padding: 8px 12px;
  font-size: 0.86rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.stat-card.blue::before { background: var(--color-primary-grad); }
.stat-card.purple::before { background: var(--color-purple-grad); }
.stat-card.green::before { background: var(--color-emerald-grad); }
.stat-card.amber::before { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card.teal::before { background: linear-gradient(135deg, #14b8a6, #0d9488); }

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card.blue .stat-icon { background-color: rgba(59, 130, 246, 0.1); color: var(--color-primary); }
.stat-card.purple .stat-icon { background-color: rgba(139, 92, 246, 0.1); color: var(--color-purple); }
.stat-card.green .stat-icon { background-color: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.stat-card.amber .stat-icon { background-color: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.stat-card.teal .stat-icon { background-color: rgba(20, 184, 166, 0.1); color: #14b8a6; }

.stat-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.05);
}

.progress-bar {
  height: 100%;
  transition: width var(--transition-slow);
}

.stat-card.blue .progress-bar { background-color: var(--color-primary); }
.stat-card.purple .progress-bar { background-color: var(--color-purple); }
.stat-card.green .progress-bar { background-color: var(--color-success); }
.stat-card.amber .progress-bar { background-color: var(--color-warning); }

/* Dashboard Cards Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.dashboard-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;   /* allow grid item to shrink so wide tables scroll instead of breaking layout */
}

/* Recent maintenance list: keep the content cell bounded so it ellipsis-truncates */
#recent-maint-table .maint-content-cell {
  max-width: 260px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-body {
  flex: 1;
}

/* Charts Card */
.charts-container {
  display: flex;
  gap: 20px;
}

.chart-wrapper {
  flex: 1;
  height: 200px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Upcoming Schedules List */
.upcoming-schedules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.02);
  border-left: 4px solid var(--color-secondary);
}

.upcoming-item .date-badge {
  text-align: center;
  min-width: 48px;
  padding: 4px 6px;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.04);
  font-size: 0.75rem;
  font-weight: 600;
}

.upcoming-item .date-day {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.upcoming-item .date-month {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.upcoming-details {
  flex: 1;
}

.upcoming-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.upcoming-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.upcoming-time i {
  width: 12px;
  height: 12px;
}

/* Recent Documents list */
.recent-docs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.02);
}

.doc-info-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-icon-wrapper i {
  width: 16px;
  height: 16px;
}

.doc-details {
  display: flex;
  flex-direction: column;
}

.doc-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.doc-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.doc-action-block .btn {
  padding: 6px;
  border-radius: 6px;
}

/* ==========================================================================
   SEARCH / FILTER CONTROLS
   ========================================================================== */

.search-filter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.search-box {
  position: relative;
  width: 260px;
}

.search-box i,
.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px 10px 36px;
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.light-theme .search-box input {
  background-color: #f8fafc;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background-color: rgba(0, 0, 0, 0.2);
}

.light-theme .search-box input:focus {
  background-color: #fff;
}

.filter-group {
  display: flex;
  gap: 8px;
}

.filter-group select {
  min-width: 140px;
}

/* ==========================================================================
   LIST VIEW LAYOUT (header row, status tabs, table container)
   ========================================================================== */

.requests-layout {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.requests-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.status-tabs {
  display: flex;
  gap: 4px;
}

.status-tab {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.status-tab:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
}

.status-tab.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.status-tab .badge.count {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.status-tab.active .badge.count {
  background-color: var(--color-primary);
  color: #fff;
}

.requests-list-container {
  margin-top: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.main-requests-table td {
  vertical-align: middle;
}

.request-title-cell {
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.request-title-cell:hover {
  color: var(--color-primary);
}

.action-cell {
  display: flex;
  justify-content: center;
  gap: 4px;
}

/* ==========================================================================
   MODALS SYSTEM
   ========================================================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 7, 12, 0.6);
  backdrop-filter: blur(8px);
}

.modal-container {
  width: 90%;
  max-width: 550px;
  position: relative;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
  max-height: 90vh;
}

.modal.active .modal-container {
  transform: scale(1);
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-close-modal:hover {
  color: var(--text-main);
}

/* Modals wrap body+footer in a <form>; make it a flex column so the body scrolls
   and the footer (저장 버튼) stays pinned & visible even when content is tall. */
.modal-container > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;   /* allow body to shrink & scroll so the footer (저장 버튼) stays visible */
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.1);
  flex-shrink: 0;   /* never let the footer be squeezed out */
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 70px;
  }
  .sidebar-header {
    padding: 15px;
  }
  .logo-text-box, .profile-info {
    display: none;
  }
  .sidebar-nav {
    padding: 16px 10px;
  }
  .nav-link {
    padding: 12px;
    justify-content: center;
  }
  .nav-link span {
    display: none;
  }
  .main-content {
    margin-left: 70px;
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .requests-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
}

/* Auth Screen Overlay Styling */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  /* Opaque designed background so the app/dashboard is NOT visible behind the login */
  background-color: #0a0f1e;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M44 0H0v44' fill='none' stroke='%23ffffff' stroke-opacity='0.05'/%3E%3C/svg%3E"),
    radial-gradient(circle at 16% 20%, rgba(59, 130, 246, 0.30), transparent 45%),
    radial-gradient(circle at 84% 78%, rgba(139, 92, 246, 0.26), transparent 45%),
    linear-gradient(135deg, #0a0f1e 0%, #121a30 50%, #0a0f1e 100%);
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-size: 44px 44px, cover, cover, cover;
}

/* Decorative glow accents */
.login-screen::before,
.login-screen::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
.login-screen::before { width: 320px; height: 320px; background: #3b82f6; top: -80px; left: -80px; }
.login-screen::after { width: 360px; height: 360px; background: #8b5cf6; bottom: -100px; right: -100px; }

.light-theme .login-screen {
  background-color: #eef2f9;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M44 0H0v44' fill='none' stroke='%230f172a' stroke-opacity='0.05'/%3E%3C/svg%3E"),
    radial-gradient(circle at 16% 20%, rgba(59, 130, 246, 0.18), transparent 45%),
    radial-gradient(circle at 84% 78%, rgba(139, 92, 246, 0.16), transparent 45%),
    linear-gradient(135deg, #eef2f9 0%, #e2e8f5 50%, #eef2f9 100%);
}
.light-theme .login-screen::before,
.light-theme .login-screen::after { opacity: 0.25; }

.login-card { position: relative; z-index: 1; }

.login-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.light-theme .login-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.login-brand {
  margin-bottom: 32px;
}

.auth-toggle-text a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.auth-toggle-text a:hover {
  text-decoration: underline;
  color: var(--color-primary-hover);
}

.btn-logout:hover {
  color: var(--color-danger) !important;
}

/* Spinning icon (e.g. refresh button while loading).
   Applied to the stable button element so re-rendered lucide <svg> icons
   still animate and reliably stop when the class is removed. */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin {
  animation: spin 0.8s linear infinite;
}
.btn.is-refreshing svg,
.btn.is-refreshing i {
  animation: spin 0.8s linear infinite;
}

/* 모달 내 접이식 섹션 (details/summary 기반 아코디언) */
.modal-accordion {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.light-theme .modal-accordion { background: rgba(0, 0, 0, 0.02); }
.modal-accordion > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
}
.modal-accordion > summary::-webkit-details-marker { display: none; }
.modal-accordion > summary .acc-caret {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}
.modal-accordion[open] > summary .acc-caret { transform: rotate(90deg); }
.modal-accordion > summary .acc-hint {
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.modal-accordion-body {
  padding: 8px 14px 2px;
  border-top: 1px solid var(--border-color);
}


/* ==========================================================================
   GLICENSE — 라이선스 관리 전용 컴포넌트
   ========================================================================== */

/* ----- 공통 표 (라이선스/직원/제품 일람) ----- */
.data-table.lic-table td { vertical-align: middle; padding: 10px 12px; }
.data-table.lic-table th { padding: 11px 12px; white-space: nowrap; }

.lic-product-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

/* 제품 아이콘 뱃지 (제품명 첫 글자) */
.product-avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  background: var(--color-primary-grad);
}

/* 계정/비밀번호 셀 — 값은 기본 마스킹, 눈 아이콘으로 표시 */
.secret-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.secret-value {
  min-width: 84px;
  letter-spacing: 0.06em;
  color: var(--text-main);
}
.secret-value.masked { letter-spacing: 0.18em; color: var(--text-muted); }

.icon-mini-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.icon-mini-btn:hover { background: rgba(59, 130, 246, 0.12); color: var(--color-primary); }
.icon-mini-btn i, .icon-mini-btn svg { width: 14px; height: 14px; }

/* 사용자 칩 목록 */
.user-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-primary);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.user-chip.empty {
  background: transparent;
  border-style: dashed;
  border-color: var(--border-color);
  color: var(--text-muted);
  font-weight: 500;
}
.user-chip .chip-del {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  opacity: 0.65;
}
.user-chip .chip-del:hover { opacity: 1; color: var(--color-danger); }
.user-chip .chip-del i, .user-chip .chip-del svg { width: 12px; height: 12px; }

/* 좌석 사용량 미터 */
.seat-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}
.seat-bar {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}
.seat-bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--color-emerald-grad);
  transition: width var(--transition-normal);
}
.seat-bar.warn span { background: linear-gradient(135deg, #f59e0b, #b45309); }
.seat-bar.over span { background: var(--color-rose-grad); }
.seat-text { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }

/* 금액 셀 */
.amount-cell { text-align: right; font-weight: 700; white-space: nowrap; }
.amount-cell .cycle { font-size: 0.72rem; font-weight: 500; color: var(--text-muted); margin-left: 3px; }

/* 갱신 D-day */
.badge.dday-safe { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge.dday-soon { background-color: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge.dday-over { background-color: rgba(239, 68, 68, 0.15); color: var(--color-danger); }

/* 사용/미사용 상태 */
.badge.use-on { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge.use-off { background-color: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

/* ----- 배정 매트릭스 (직원 × 제품) ----- */
.matrix-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}
.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}
.matrix-table th, .matrix-table td {
  border-bottom: 1px solid var(--border-color);
  padding: 9px 10px;
  text-align: center;
  white-space: nowrap;
}
.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-sidebar);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.matrix-table tbody tr:hover td { background-color: var(--bg-card-hover); }
.matrix-table .matrix-emp {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-sidebar);
  text-align: left;
  font-weight: 600;
  min-width: 150px;
}
.matrix-table thead .matrix-emp { z-index: 4; }
.matrix-table .matrix-dept { font-size: 0.74rem; color: var(--text-muted); font-weight: 500; display: block; }
.matrix-cell { cursor: pointer; transition: background-color var(--transition-fast); }
.matrix-cell:hover { background-color: rgba(59, 130, 246, 0.1) !important; }
.matrix-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.12);
  color: transparent;
}
.matrix-mark.on { background: rgba(16, 185, 129, 0.18); color: var(--color-success); }
.matrix-mark.multi { background: rgba(139, 92, 246, 0.18); color: var(--color-purple); }
.matrix-total { font-weight: 700; color: var(--color-primary); }

/* ----- 비용 분석 ----- */
.cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.cost-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 110px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
}
.cost-bar-row:last-child { border-bottom: none; }
.cost-bar-name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-bar-track { height: 10px; border-radius: 99px; background: rgba(148, 163, 184, 0.15); overflow: hidden; }
.cost-bar-track span { display: block; height: 100%; border-radius: 99px; background: var(--color-primary-grad); }
.cost-bar-value { text-align: right; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.cost-bar-value small { display: block; font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }

/* ----- 라이선스 상세 모달 ----- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-bottom: 16px;
}
.detail-item { min-width: 0; }
.detail-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}
.detail-value {
  font-size: 0.88rem;
  color: var(--text-main);
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-value a { color: var(--color-primary); }
.detail-value a:hover { text-decoration: underline; }

.assign-picker {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.assign-picker select { flex: 1; }

/* ----- 임직원 카드 ----- */
.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.emp-card { padding: 18px; border-radius: 14px; }
.emp-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.emp-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-purple-grad);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.emp-name { font-weight: 700; font-size: 0.98rem; }
.emp-meta { font-size: 0.76rem; color: var(--text-muted); }
.emp-card-cost {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.emp-card-cost strong { color: var(--text-main); }

/* 툴바 우측 액션 묶음 */
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* 보안 안내 배너 */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--color-warning);
  font-size: 0.82rem;
  margin-bottom: 16px;
}
.notice-bar i, .notice-bar svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 배정 모달 — 제품별 계정 목록 */
.matrix-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.light-theme .matrix-account-row { background: rgba(0, 0, 0, 0.02); }
.matrix-account-row .btn { flex-shrink: 0; }
.matrix-account-id {
  font-size: 0.86rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 컬럼이 많은 표는 좁은 화면에서 찌그러지지 않도록 최소 폭을 주고 가로 스크롤한다. */
#persons-view .lic-table { min-width: 1280px; }
#groups-view .lic-table { min-width: 1000px; }
#authlog-view .lic-table { min-width: 900px; }
.user-chip { white-space: nowrap; }
/* 사용자(칩) 컬럼은 여러 명이 한 줄에 보이도록 넉넉히 확보 */
#persons-view .lic-table th:nth-child(6),
#persons-view .lic-table td:nth-child(6) { min-width: 260px; }

.badge { white-space: nowrap; }

/* 금액 카드는 자릿수가 길어 폰트를 한 단계 줄여 한 줄에 담는다 */
.stat-card.money .stat-value { font-size: 1.6rem; }

/* ----- 통화 표기 ----- */
.amount-cell .amount-krw {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ----- 변경 이력 ----- */
.data-table.history-table td { vertical-align: top; padding: 11px 12px; }

.change-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.change-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 0.75rem;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  max-width: 100%;
}
.change-chip b { color: var(--text-main); font-weight: 600; }
.change-chip i, .change-chip svg { width: 12px; height: 12px; flex-shrink: 0; }
.change-chip .chg-before { text-decoration: line-through; opacity: 0.75; }
.change-chip .chg-after { color: var(--color-primary); font-weight: 600; }

/* 라이선스 상세 모달의 이력 타임라인 */
.history-timeline {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.history-item {
  padding: 9px 11px;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--color-primary);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}
.light-theme .history-item { background: rgba(0, 0, 0, 0.02); }
.history-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.history-time { font-size: 0.73rem; color: var(--text-muted); }
.history-actor { font-size: 0.73rem; color: var(--text-muted); margin-left: auto; }
.history-summary { font-size: 0.84rem; color: var(--text-main); line-height: 1.45; word-break: break-word; }

#history-view .lic-table { min-width: 1100px; }

/* ==========================================================================
   토폴로지 — [접속 장비·앱] ↔ [GLDAP] ↔ [그룹·계정]
   ========================================================================== */
.stat-card.rose::before { background: var(--color-rose-grad); }
.stat-card.rose .stat-icon { background-color: rgba(239, 68, 68, 0.1); color: var(--color-danger); }
.stat-card.rose .progress-bar { background-color: var(--color-danger); }
.topo-stat-sub { font-size: 0.72rem; color: var(--text-muted); }

.topo-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 14px;
}
.topo-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topo-filters label { font-size: 0.82rem; color: var(--text-muted); }
.topo-filters .form-control { width: auto; min-width: 130px; }
.topo-check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.topo-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 0.76rem; color: var(--text-muted); }
.topo-legend span { display: flex; align-items: center; gap: 6px; }
.topo-dot { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.topo-dot.ok { background: var(--color-success); }
.topo-dot.fail { background: var(--color-danger); }
.topo-dot.plain { background: var(--color-warning); border-top: 2px dashed var(--color-warning); height: 0; }
.topo-dot.warn { background: var(--color-warning); }

.topo-canvas {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(200px, 260px) minmax(240px, 1fr);
  gap: 24px;
  padding: 22px;
  border-radius: 16px;
  margin: 18px 0;
  align-items: start;
  /* .main-content 가 overflow:hidden 이라 화면 밖 내용은 잘린다.
     다른 화면들처럼 이 영역이 남는 높이를 차지하고 안에서만 스크롤하게 한다. */
  flex: 1 1 auto;
  min-height: 240px;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.topo-toolbar, .topo-stats, .topo-detail { flex: 0 0 auto; }
.topo-links { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 0; }
.topo-link { fill: none; stroke: var(--color-secondary); opacity: 0.75; transition: opacity var(--transition-fast); }
.topo-link.ok { stroke: var(--color-success); }
.topo-link.warn { stroke: var(--color-warning); }
.topo-link.fail { stroke: var(--color-danger); }
.topo-link.group { stroke: var(--color-purple); opacity: 0.5; }
.topo-link.muted { stroke: var(--color-secondary); opacity: 0.3; }
.topo-link.dashed { stroke-dasharray: 6 5; }
.topo-link.dim { opacity: 0.12; }

.topo-col { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* 스크롤해도 가운데 GLDAP 노드는 늘 보이게 붙여 둔다 (연결선은 scroll 때마다 다시 그린다) */
.topo-col-center {
  justify-content: center; align-items: center;
  align-self: start; position: sticky; top: 50%;
  transform: translateY(-50%); z-index: 2;
}
.topo-col-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 2px;
}
.topo-col-title i { width: 15px; height: 15px; }
.topo-nodes { display: flex; flex-direction: column; gap: 10px; }

.topo-node {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-left: 3px solid var(--color-secondary);
  border-radius: 12px; padding: 11px 13px; cursor: pointer;
  transition: all var(--transition-fast); min-width: 0;
}
.topo-node:hover { background: var(--bg-card-hover); transform: translateX(2px); }
.topo-node.selected { border-color: var(--color-primary); box-shadow: var(--glow-blue); }
.topo-node.state-ok { border-left-color: var(--color-success); }
.topo-node.state-warn { border-left-color: var(--color-warning); }
.topo-node.state-fail { border-left-color: var(--color-danger); }
.topo-node.group { border-left-color: var(--color-purple); }
.topo-node-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topo-node-head i { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.topo-node-head strong { font-size: 0.88rem; color: var(--text-main); word-break: break-all; }
.topo-node-sub { font-size: 0.76rem; color: var(--text-muted); margin-top: 4px; word-break: break-word; }
.topo-node-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.72rem; color: var(--text-muted); margin-top: 5px; }
.topo-node-meta .ok { color: var(--color-success); }
.topo-node-meta .fail { color: var(--color-danger); }

.topo-badge {
  font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.16); color: var(--text-muted); white-space: nowrap;
}
.topo-badge.ldaps, .topo-badge.ok { background: rgba(16, 185, 129, 0.14); color: var(--color-success); }
.topo-badge.ldap, .topo-badge.warn { background: rgba(245, 158, 11, 0.16); color: var(--color-warning); }
.topo-badge.fail { background: rgba(239, 68, 68, 0.16); color: var(--color-danger); }
.topo-badge.portal { background: rgba(59, 130, 246, 0.14); color: var(--color-primary); }
.topo-badge.app { background: rgba(139, 92, 246, 0.16); color: var(--color-purple); }
.topo-badge.posix { background: rgba(6, 182, 212, 0.14); color: var(--color-info); }
.topo-badge.local, .topo-badge.off { background: rgba(148, 163, 184, 0.14); color: var(--text-muted); }

.topo-server-node {
  background: var(--bg-card-hover); border: 1px solid var(--color-primary);
  border-radius: 18px; padding: 20px 18px; text-align: center; cursor: pointer;
  box-shadow: var(--glow-blue); transition: all var(--transition-fast); width: 100%;
}
.topo-server-node:hover { transform: translateY(-2px); }
.topo-server-icon {
  width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-grad); color: #fff;
}
.topo-server-icon i { width: 24px; height: 24px; }
.topo-server-node strong { display: block; font-size: 1rem; color: var(--text-main); }
.topo-server-node code { font-size: 0.74rem; color: var(--text-muted); word-break: break-all; }
.topo-ports { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.topo-server-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 8px; }

.topo-detail { border-radius: 16px; padding: 18px 20px; max-height: 34vh; overflow-y: auto; }
.topo-detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.topo-detail-head i { width: 18px; height: 18px; color: var(--color-primary); }
.topo-detail-head h4 { font-size: 0.95rem; color: var(--text-main); }
.topo-detail-sub { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 12px; }
.topo-notes { margin: 4px 0 0 18px; font-size: 0.82rem; color: var(--text-muted); line-height: 1.7; }
.topo-empty { font-size: 0.8rem; color: var(--text-muted); padding: 6px 2px; }
.topo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.topo-chip {
  font-size: 0.74rem; padding: 4px 9px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.12); color: var(--text-main);
}
.topo-chip.off { opacity: 0.5; text-decoration: line-through; }
.topo-chip code { color: var(--color-info); }

@media (max-width: 1100px) {
  .topo-canvas { grid-template-columns: 1fr; }
  .topo-links { display: none; }
  .topo-col-center { order: -1; }
}

/* 서버 조인 링크 */
.join-result {
  margin-top: 16px; padding: 14px 16px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--color-primary);
}
.join-result-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.join-result-head i { width: 16px; height: 16px; color: var(--color-primary); }
.join-cmd {
  display: flex; align-items: center; gap: 8px; margin: 6px 0 10px;
  padding: 9px 11px; border-radius: 9px; background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
}
.light-theme .join-cmd { background: rgba(15, 23, 42, 0.05); }
.join-cmd code { font-size: 0.78rem; color: var(--color-info); word-break: break-all; flex: 1; }
.join-list-title {
  margin: 18px 0 6px; font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em;
}
.topo-badge.cat { background: rgba(139, 92, 246, 0.16); color: var(--color-purple); }
.topo-node.state-muted { border-left-color: var(--color-secondary); opacity: 0.75; }
.topo-node-sub code { color: var(--color-info); }

/* 임직원 일괄 선택 */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px; border-radius: 12px;
  background: rgba(59, 130, 246, 0.1); border: 1px solid var(--color-primary);
}
.bulk-bar > span:first-child { font-size: 0.84rem; font-weight: 600; color: var(--text-main); margin-right: auto; }
.data-table tbody tr.row-selected { background: rgba(59, 130, 246, 0.08); }
.bulk-preview {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border-color); font-size: 0.84rem;
}
/* 확인 대화상자에서 줄바꿈을 살린다 (가져오기 요약 등) */
#confirm-message { white-space: pre-line; }

/* ===== 사용법 도움말 (탑메뉴 ? ) ===== */
.help-btn i { width: 19px; height: 19px; }

.modal-container.modal-help { max-width: 1080px; width: 94vw; height: 86vh; }
.modal-help .modal-body.help-body {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 0;
  padding: 0;
  min-height: 0;
  overflow: hidden;
}

/* 왼쪽 목차 */
.help-nav {
  border-right: 1px solid var(--border-color);
  padding: 14px 10px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.help-nav-group {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  opacity: 0.75;
  padding: 12px 10px 4px;
}
.help-nav-group:first-child { padding-top: 2px; }
.help-nav-item {
  text-align: left;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.83rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.help-nav-item:hover { background: rgba(59, 130, 246, 0.12); color: var(--text-main); }
.help-nav-item.current {
  background: rgba(59, 130, 246, 0.18);
  color: var(--color-primary);
  font-weight: 700;
}

/* 오른쪽 본문 */
.help-content {
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.7;
  overflow-y: auto;
  padding: 18px 22px 24px;
}
.help-head { margin-bottom: 16px; }
.help-head h4 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; }
.help-lead { color: var(--text-muted); margin: 0; }

.help-section { margin-bottom: 18px; }
.help-section:last-child { margin-bottom: 0; }
.help-section > h5 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  text-transform: none;
}
.help-section ol,
.help-section ul { margin: 0; padding-left: 20px; }
.help-section li { margin-bottom: 6px; }
.help-section li:last-child { margin-bottom: 0; }
.help-section code {
  background: rgba(59, 130, 246, 0.12);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.85em;
}

/* 화면 구성 — 이름/설명 두 칸 */
.help-parts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.help-parts dt { color: var(--text-main); font-weight: 600; }
.help-parts dd { margin: 0; color: var(--text-muted); }

/* 이럴 땐 — 증상과 해결 */
.help-faq { display: flex; flex-direction: column; gap: 8px; }
.help-faq-item {
  border-left: 3px solid var(--color-primary);
  background: rgba(59, 130, 246, 0.07);
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
}
.help-faq-q { font-weight: 600; margin-bottom: 2px; }
.help-faq-a { color: var(--text-muted); font-size: 0.86rem; }

.help-note {
  border-left: 3px solid var(--color-warning, #f59e0b);
  background: rgba(245, 158, 11, 0.09);
  border-radius: 0 8px 8px 0;
  padding: 9px 12px;
  color: var(--text-muted);
  font-size: 0.86rem;
}
.help-foot-note { color: var(--text-muted); font-size: 0.78rem; margin-right: auto; }

@media (max-width: 900px) {
  .modal-container.modal-help { max-width: 96vw; height: 92vh; }
  /* 좁으면 목차를 위쪽 가로 칩으로 내린다 */
  .modal-help .modal-body.help-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .help-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 10px;
  }
  .help-nav-group { display: none; }
  .help-nav-item { white-space: nowrap; border: 1px solid var(--border-color); border-radius: 999px; padding: 5px 12px; }
  .help-content { padding: 14px 16px 20px; }
  .help-parts { grid-template-columns: 1fr; gap: 2px; }
  .help-parts dd { margin-bottom: 6px; }
  .help-foot-note { display: none; }
}

/* 입·퇴사 처리 진행판 */
.onboard-card {
  border: 1px solid var(--border-color); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px; background: var(--bg-card);
}
.onboard-card.is-closed { opacity: .65; }
.onboard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.onboard-progress {
  display: inline-block; width: 120px; height: 6px; border-radius: 99px;
  background: var(--bg-hover); overflow: hidden;
}
.onboard-progress > span { display: block; height: 100%; background: var(--primary-color); }
.onboard-steps {
  margin-top: 12px; display: grid; gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.onboard-step {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px; font-size: 0.86rem; cursor: pointer;
}
.onboard-step:hover { background: var(--bg-hover); }
.onboard-step.done .onboard-step-label { text-decoration: line-through; opacity: .6; }
.onboard-step-label { flex: 1; }
.badge.onboard-app { font-size: 0.66rem; margin-left: 4px; opacity: .75; }
.onboard-go { margin-left: auto; opacity: .6; display: inline-flex; }
.onboard-go:hover { opacity: 1; }
.onboard-go i { width: 14px; height: 14px; }

/* ==========================================================================
   GNOTES 전용 — 회의록 화면
   위쪽은 사내 공통 디자인시스템(gldap 판)을 그대로 가져온 것이고,
   여기부터는 회의록에만 있는 것들이다: 녹음 올리는 자리, 녹취록, 화자, 재생기.
   공통 부분을 고칠 일이 생기면 위쪽만 다시 받아 오면 된다.
   ========================================================================== */

/* 회의록·녹취록은 길다. 공통 껍데기는 화면을 넘치면 잘라 버리므로 본문에 스크롤을 준다. */
.content-body { overflow-y: auto; padding-right: 6px; }
.view-section.active { flex: 0 0 auto; }
/* 재생기가 화면 아래에 떠 있으므로 마지막 줄이 가리지 않게 자리를 비워 둔다 */
.content-body { padding-bottom: 88px; }

/* ----- 목록 카드 ----- */
.meeting-list { display: flex; flex-direction: column; gap: 12px; }
.meeting-card {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 18px;
  padding: 18px 20px; cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.meeting-card:hover { border-color: var(--border-focus); transform: translateY(-1px); }
.meeting-card h3 { font-size: 1rem; font-weight: 700; color: var(--text-main); margin-bottom: 6px; }
.meeting-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.78rem; color: var(--text-muted); }
.meeting-card .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

/* ----- 진행 상태 뱃지 ----- */
.status { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; line-height: 1; white-space: nowrap;
  background: rgba(148, 163, 184, 0.18); color: var(--text-muted); }
.status.draft   { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
.status.queued  { background: rgba(245, 158, 11, 0.18);  color: var(--color-warning); }
.status.running { background: rgba(59, 130, 246, 0.18);  color: var(--color-primary); }
.status.done    { background: rgba(16, 185, 129, 0.18);  color: var(--color-success); }
.status.error   { background: rgba(239, 68, 68, 0.18);   color: var(--color-danger); }

/* ----- 진행바 (--p 로 퍼센트를 넣는다) ----- */
.progress { display: flex; align-items: center; gap: 10px; margin-top: 10px;
  font-size: 0.76rem; color: var(--text-muted); }
.progress .bar { flex: 1; height: 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.2); overflow: hidden; }
.progress .bar::after { content: ''; display: block; height: 100%; width: var(--p, 0%);
  background: var(--color-primary-grad); border-radius: 999px; transition: width var(--transition-normal); }

/* ----- 녹음 올리는 자리 ----- */
.dropzone {
  margin: 18px 0 8px; padding: 34px 20px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border-color); border-radius: 14px;
  background: rgba(0, 0, 0, 0.12); transition: all var(--transition-fast);
}
.dropzone:hover, .dropzone.over { border-color: var(--border-focus); background: rgba(59, 130, 246, 0.08); }
.dz-inner { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.dz-inner strong { color: var(--text-main); font-size: 0.95rem; }
.dz-inner span { font-size: 0.78rem; color: var(--text-muted); }

/* ----- 상세 머리 · 탭 ----- */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.detail-head h2 { font-size: 1.35rem; font-weight: 700; margin: 8px 0 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); }
/* 아래쪽 '클래스 없는 버튼' 규칙보다 뒤에 오면 안 되므로 선택자를 한 단계 좁혀 둔다 */
.content-body .tab, .tab {
  background: none; border: 0; border-radius: 0; border-bottom: 2px solid transparent; cursor: pointer;
  padding: 11px 16px; font-size: 0.88rem; font-weight: 600; color: var(--text-muted);
  transition: all var(--transition-fast);
}
.content-body .tab:hover, .tab:hover { background: none; color: var(--text-main); }
.content-body .tab.active, .tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-body { display: flex; flex-direction: column; gap: 16px; }

/* ----- 내용 묶음 (공통 .glass 카드와 같은 톤) ----- */
.block-section {
  background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px;
  box-shadow: var(--shadow-md); backdrop-filter: blur(16px); padding: 20px;
}
.block-section + .block-section { margin-top: 16px; }
.block-section h3 { font-size: 0.98rem; font-weight: 700; margin-bottom: 12px; color: var(--text-main); }
.block-section h3 input { font-size: 0.98rem; font-weight: 700; }

/* ----- 줄 단위로 고치는 목록 ----- */
.list-edit { display: flex; flex-direction: column; gap: 6px; }
.list-edit .item { display: flex; align-items: flex-start; gap: 8px; }
.list-edit .item span { padding: 4px 0; line-height: 1.6; }
.list-edit .item textarea { min-height: 38px; overflow: hidden; }

/* ----- 녹취록 ----- */
.seg { display: grid; grid-template-columns: 62px 130px 1fr; gap: 10px; align-items: start;
  padding: 7px 8px; border-radius: 8px; }
.seg:hover { background: rgba(255, 255, 255, 0.04); }
.seg .at { color: var(--text-muted); font-size: 0.76rem; font-variant-numeric: tabular-nums;
  cursor: pointer; padding-top: 3px; }
.seg .at:hover { color: var(--color-primary); text-decoration: underline; }
.seg .txt { line-height: 1.65; font-size: 0.88rem; }
.seg .txt[contenteditable="true"]:focus { outline: 2px solid rgba(59, 130, 246, 0.35); border-radius: 6px; padding: 2px 4px; }
.who { font-size: 0.76rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
select.who { width: 100%; }

/* 화자별 색 — 여덟 명까지 서로 구분되게 */
.sp0 { background: rgba(59, 130, 246, .16);  color: #93c5fd; }
.sp1 { background: rgba(16, 185, 129, .16);  color: #6ee7b7; }
.sp2 { background: rgba(245, 158, 11, .16);  color: #fcd34d; }
.sp3 { background: rgba(139, 92, 246, .16);  color: #c4b5fd; }
.sp4 { background: rgba(236, 72, 153, .16);  color: #f9a8d4; }
.sp5 { background: rgba(6, 182, 212, .16);   color: #67e8f9; }
.sp6 { background: rgba(239, 68, 68, .16);   color: #fca5a5; }
.sp7 { background: rgba(132, 204, 22, .16);  color: #bef264; }

/* ----- 화자 확인 ----- */
.speaker-row { display: grid; grid-template-columns: 120px 1fr 190px auto; gap: 14px;
  align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.speaker-row:last-child { border-bottom: 0; }
.share-bar { height: 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.2); overflow: hidden; }
.share-bar i { display: block; height: 100%; background: var(--color-primary-grad); }

/* ----- 표 (회의록 안의 간단한 표) ----- */
table.grid { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.grid th { padding: 10px 12px; text-align: left; font-weight: 600; color: var(--text-muted);
  background: rgba(0, 0, 0, 0.12); border-bottom: 1px solid var(--border-color); }
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
table.grid tr.done td { opacity: .5; text-decoration: line-through; }
table.grid input[type="text"], table.grid input[type="date"] { padding: 6px 9px; font-size: 0.83rem; }
table.grid input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--color-primary); }

/* ----- 통합 검색 결과 ----- */
.search-results {
  position: absolute; top: calc(100% + 6px); right: 0; width: 420px; max-height: 60vh; overflow-y: auto;
  background: var(--bg-sidebar); border: 1px solid var(--border-color); border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 500; padding: 6px;
}
.search-results .hit { padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 0.84rem; line-height: 1.5; }
.search-results .hit:hover { background: var(--bg-card-hover); }
.search-results .hit b { color: var(--color-primary); }

/* ----- 내보내기 메뉴 ----- */
.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 500; min-width: 210px; padding: 6px;
  background: var(--bg-sidebar); border: 1px solid var(--border-color);
  border-radius: 12px; box-shadow: var(--shadow-lg);
}
.menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--text-main); padding: 9px 11px; border-radius: 8px; font-size: 0.85rem; cursor: pointer; }
.menu-list button:hover { background: var(--bg-card-hover); }
.menu-list label { display: flex; align-items: center; gap: 7px; padding: 9px 11px;
  border-top: 1px solid var(--border-color); margin-top: 4px; font-size: 0.8rem; color: var(--text-muted); }

/* ----- 녹음 재생기 (화면 아래 고정) ----- */
.player {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 900;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  width: min(760px, calc(100vw - 48px));
  background: var(--bg-sidebar); border: 1px solid var(--border-color);
  border-radius: 14px; box-shadow: var(--shadow-lg);
}
.player .at { font-size: 0.76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.player input[type="range"] { flex: 1; accent-color: var(--color-primary); }
.player .name { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 0.76rem; color: var(--text-muted); max-width: 220px; }

/* ----- 작은 조각들 ----- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; margin: 2px 4px 2px 0;
  border-radius: 999px; background: rgba(59, 130, 246, 0.14); color: #93c5fd;
  font-size: 0.75rem; font-weight: 600; cursor: default; }
.chip[data-share] { cursor: pointer; }
.chip[data-share]:hover { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.row-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-gap.end { justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 0.83rem;
  color: var(--text-muted); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--color-primary); }
.muted { color: var(--text-muted); }
.small { font-size: 0.78rem; }
.error { color: var(--color-danger); font-size: 0.83rem; min-height: 1em; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px;
  height: 18px; padding: 0 5px; border-radius: 999px; background: var(--color-danger);
  color: #fff; font-size: 0.66rem; font-weight: 700; margin-left: auto; }

/* 회의록 안의 입력칸은 공통 .form-control 과 같은 모양으로 (클래스 없이 써도 맞게) */
.content-body input[type="text"], .content-body input[type="date"], .content-body input[type="time"],
.content-body input[type="search"], .content-body input[type="password"], .content-body input[type="number"],
.content-body select, .content-body textarea {
  width: 100%; background-color: rgba(0, 0, 0, 0.15); border: 1px solid var(--border-color);
  border-radius: 10px; padding: 9px 12px; color: var(--text-main); font-size: 0.87rem;
  transition: all var(--transition-fast);
}
.content-body input:focus, .content-body select:focus, .content-body textarea:focus {
  border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}
.content-body input[type="checkbox"] { width: auto; }
.content-body label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.content-body label > input, .content-body label > select, .content-body label > textarea {
  margin-top: 5px; font-weight: 400; color: var(--text-main);
}
.content-body label.check { display: inline-flex; }
.content-body textarea { resize: vertical; line-height: 1.65; }

/* 클래스 없이 쓰인 버튼도 공통 버튼과 같은 모양으로 맞춘다 */
.content-body button, .detail-head button, .player button, .menu > button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; font-size: 0.86rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border-color); background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main); transition: all var(--transition-fast);
}
.content-body button:hover, .detail-head button:hover, .player button:hover, .menu > button:hover {
  background-color: rgba(255, 255, 255, 0.09);
}
.content-body button.primary, .detail-head button.primary {
  background: var(--color-primary-grad); border-color: transparent; color: #fff; box-shadow: var(--glow-blue);
}
.content-body button.primary:hover, .detail-head button.primary:hover { opacity: .9; }
.content-body button.ghost, .detail-head button.ghost, .player button, .menu-list button {
  background: transparent; border-color: transparent; color: var(--text-muted);
}
.content-body button.ghost:hover, .detail-head button.ghost:hover, .player button:hover {
  background-color: rgba(255, 255, 255, 0.07); color: var(--text-main);
}
.content-body button.danger:hover, .detail-head button.danger:hover {
  background: rgba(239, 68, 68, 0.14); color: #fca5a5;
}
.content-body button.small, .detail-head button.small { padding: 5px 10px; font-size: 0.76rem; }
.content-body button:disabled { opacity: .45; cursor: not-allowed; }

/* 밝은 테마 보정 — 공통 시스템이 배경을 흰색으로 바꾸면 반투명 검정이 너무 흐려진다 */
.light-theme .content-body input, .light-theme .content-body select,
.light-theme .content-body textarea, .light-theme .dropzone { background-color: rgba(0, 0, 0, 0.04); }
.light-theme .content-body button, .light-theme .detail-head button { background-color: rgba(0, 0, 0, 0.04); }
.light-theme .seg:hover { background: rgba(0, 0, 0, 0.03); }

@media (max-width: 900px) {
  .seg { grid-template-columns: 54px 1fr; }
  .seg .txt { grid-column: 1 / -1; }
  .speaker-row { grid-template-columns: 1fr; }
  .search-results { width: min(420px, calc(100vw - 32px)); }
}

/* ----- 뱃지 기본 색 ----- */
/* 종류만 주면 되도록 짧은 이름도 함께 둔다. (예: badge("운영","danger"))
   없으면 클래스만 붙고 색이 안 바뀌어 전부 회색으로 보인다. */
.badge.success { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge.warning { background-color: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge.danger  { background-color: rgba(239, 68, 68, 0.15);  color: var(--color-danger); }
.badge.info    { background-color: rgba(6, 182, 212, 0.15);  color: var(--color-info); }
.badge.primary { background-color: rgba(59, 130, 246, 0.15); color: var(--color-primary); }
.badge.purple  { background-color: rgba(139, 92, 246, 0.15); color: var(--color-purple); }
.badge.muted   { background-color: rgba(148, 163, 184, 0.15); color: var(--text-muted); }


/* ==========================================================================
   좁은 화면에서 로그아웃이 잘려 나가던 문제
   --------------------------------------------------------------------------
   폭이 992px 이하가 되면 사이드바가 70px 로 줄어드는데, 아래 프로필 칸은
   [아바타][이름][로그아웃] 을 가로로 늘어놓은 채였다. 70px 안에 다 들어가지 못하고
   사이드바가 overflow:hidden 이라 로그아웃 단추가 그대로 잘려 눌리지 않았다.
   (휴대폰에서 로그아웃을 못 한다는 신고가 여기서 나왔다)
   세로로 쌓아 아바타와 로그아웃이 둘 다 보이게 한다.
   ========================================================================== */
@media (max-width: 992px) {
  .sidebar-footer { padding: 14px 6px; }
  .sidebar-footer .user-profile {
    flex-direction: column !important;
    justify-content: center !important;
    gap: 10px;
  }
  .sidebar-footer .user-profile > div {
    flex: unset !important;
    justify-content: center !important;
    gap: 0 !important;
    overflow: visible !important;
  }
  .btn-logout {
    display: flex !important;
    margin: 0 !important;
    width: 40px; height: 40px; border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.05) !important;
  }
  .btn-logout:hover { background-color: rgba(239, 68, 68, 0.18) !important; color: #fca5a5 !important; }
  .btn-logout i { width: 19px; height: 19px; }
}

/* ==========================================================================
   회의록 문서 서식 · 녹취록 고치기 · 공유 대상
   ========================================================================== */

/* ----- 회의록 문서 -----
   결재·회람에 그대로 쓸 수 있게 종이 문서처럼 보이게 한다. */
.minutes-doc {
  background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px;
  box-shadow: var(--shadow-md); padding: 34px 42px;
  /* 폭을 재지 않는다 — 화면을 넓게 쓰는 편이 표(후속 조치)와 논의 내용을 보기 좋다.
     대신 본문 글줄만 너무 길어지지 않게 아래에서 개별로 잡아 준다. */
  width: 100%; max-width: none; margin: 0;
}
.doc-head { text-align: center; padding-bottom: 18px; border-bottom: 2px solid var(--text-main); margin-bottom: 0; }
.doc-head h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: .22em; color: var(--text-main); }
.doc-no-line { margin-top: 6px; font-size: 0.76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.doc-meta { width: 100%; border-collapse: collapse; margin: 0 0 26px; font-size: 0.87rem; }
.doc-meta th, .doc-meta td { border-bottom: 1px solid var(--border-color); padding: 9px 12px; text-align: left; vertical-align: top; }
.doc-meta th { width: 108px; font-weight: 600; color: var(--text-muted); background: rgba(0, 0, 0, .10); white-space: nowrap; }

.doc-sec { margin-bottom: 22px; }
.doc-sec h4 { display: flex; align-items: baseline; gap: 8px; font-size: 0.98rem; font-weight: 700;
  color: var(--text-main); margin-bottom: 9px; padding-bottom: 6px; border-bottom: 1px solid var(--border-color); }
.doc-no { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px;
  background: var(--color-primary-grad); color: #fff; font-size: 0.72rem; font-weight: 700; }
.doc-summary { font-size: 0.9rem; line-height: 1.85; }
.doc-keys { margin-top: 8px; }
.doc-list { margin: 0; padding-left: 20px; }
.doc-list li { font-size: 0.88rem; line-height: 1.85; margin-bottom: 3px; }
.doc-topic { margin-bottom: 14px; }
.doc-topic h5 { font-size: 0.88rem; font-weight: 700; color: var(--text-main); margin-bottom: 5px; }
.doc-actions { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.doc-actions th, .doc-actions td { border: 1px solid var(--border-color); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc-actions thead th { background: rgba(0, 0, 0, .10); color: var(--text-muted); font-weight: 600; }
.doc-foot { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 14px;
  border-top: 1px solid var(--border-color); font-size: 0.82rem; color: var(--text-muted); }

/* 인쇄하면 회의록만 나오게 한다 — 사이드바·단추가 같이 찍히면 문서로 못 쓴다 */
@media print {
  body { background: #fff; overflow: visible; height: auto; }
  .sidebar, .main-header, .tabs, .player, .no-print, #toast-container, .detail-head .row-gap { display: none !important; }
  .app-container, .main-content, .content-body { display: block !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; height: auto !important; }
  .minutes-doc { border: 0; box-shadow: none; padding: 0; max-width: none; background: #fff; color: #000; }
  .minutes-doc * { color: #000 !important; }
  .doc-meta th { background: #f1f1f1 !important; }
  .doc-actions thead th { background: #f1f1f1 !important; }
  .doc-no { background: #333 !important; color: #fff !important; }
}

/* ----- 녹취록 고치기 상자 ----- */
.fix-box { border-color: rgba(59, 130, 246, .28); }
.fix-line { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; }
.fix-label { flex: 0 0 76px; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); padding-top: 8px; }
.speaker-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.speaker-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px;
  border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.speaker-chip input { width: 92px; padding: 3px 8px !important; font-size: 0.78rem !important;
  border-radius: 999px !important; background: rgba(0, 0, 0, .25) !important; }

.preview-list { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .16); }
.preview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 5px 0;
  border-top: 1px solid var(--border-color); font-size: 0.8rem; line-height: 1.6; }
.preview-row:first-of-type { border-top: 0; }
.preview-row .before { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(239, 68, 68, .55); }
.preview-row .after { color: var(--text-main); }

/* ----- 공유 대상 ----- */
.count-tag { margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem;
  background: rgba(59, 130, 246, .16); color: #93c5fd; font-weight: 700; }
.share-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.share-row:hover { background: rgba(255, 255, 255, .04); }
.share-avatar { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--color-primary-grad); color: #fff; font-size: 0.72rem; font-weight: 700; }
.share-who { flex: 1; min-width: 0; }
.share-who b { display: block; font-size: 0.86rem; color: var(--text-main); }
.share-who small { display: block; font-size: 0.73rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-add { position: relative; margin-top: 12px; }
.share-results { position: absolute; left: 0; right: 0; top: calc(100% + 5px); z-index: 400;
  max-height: 260px; overflow-y: auto; padding: 6px;
  background: var(--bg-sidebar); border: 1px solid var(--border-color);
  border-radius: 12px; box-shadow: var(--shadow-lg); }
.share-hit { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; cursor: pointer; }
.share-hit:hover { background: var(--bg-card-hover); }
.share-hit.muted { cursor: default; font-size: 0.8rem; color: var(--text-muted); }

.light-theme .speaker-chip input { background: rgba(0, 0, 0, .06) !important; }
.light-theme .preview-list { background: rgba(0, 0, 0, .04); }

/* 공통 리셋이 ul 의 점을 없애 두어 회의록 항목이 그냥 들여쓰기처럼 보인다 — 문서에서는 되살린다 */
.doc-list { list-style: disc outside; padding-left: 22px; }
.doc-list li::marker { color: var(--text-muted); }

/* ==========================================================================
   공통 대화상자 — 브라우저 기본 confirm·prompt 를 대신한다
   ========================================================================== */
.gn-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; }
.gn-modal.hidden { display: none; }
.gn-modal-back { position: absolute; inset: 0; background: rgba(4, 8, 18, .62); backdrop-filter: blur(3px); }
.gn-modal-card {
  position: relative; width: min(460px, calc(100vw - 32px)); padding: 24px 26px;
  background: var(--bg-sidebar); border: 1px solid var(--border-color);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  animation: gn-pop .16s ease-out;
}
@keyframes gn-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.gn-modal-card h3 { font-size: 1.02rem; font-weight: 700; color: var(--text-main); margin-bottom: 10px; }
.gn-modal-card p { font-size: 0.88rem; line-height: 1.75; color: var(--text-muted); }
.gn-modal-card p.hidden, .gn-modal-body.hidden { display: none; }
.gn-modal-body { margin-top: 14px; }

/* 대화상자는 .content-body 밖이라 그쪽 입력·단추 규칙이 닿지 않는다. 여기서 같은 모양을 준다. */
.gn-modal-card input, .gn-modal-card textarea, .gn-modal-card select {
  width: 100%; background-color: rgba(0, 0, 0, 0.22); border: 1px solid var(--border-color);
  border-radius: 10px; padding: 10px 12px; color: var(--text-main); font-size: 0.88rem;
  transition: all var(--transition-fast);
}
.gn-modal-card input:focus, .gn-modal-card textarea:focus {
  border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}
.gn-modal-card button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: 10px; font-size: 0.87rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border-color); background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main); transition: all var(--transition-fast);
}
.gn-modal-card button:hover { background-color: rgba(255, 255, 255, 0.1); }
.gn-modal-card button.primary {
  background: var(--color-primary-grad); border-color: transparent; color: #fff; box-shadow: var(--glow-blue);
}
.gn-modal-card button.primary:hover { opacity: .9; }
.gn-modal-card button.ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.gn-modal-card button.ghost:hover { background-color: rgba(255, 255, 255, 0.07); color: var(--text-main); }
.light-theme .gn-modal-card input { background-color: rgba(0, 0, 0, 0.05); }
.light-theme .gn-modal-card button { background-color: rgba(0, 0, 0, 0.04); }
.gn-modal-card button.danger-btn { background: var(--color-rose-grad); box-shadow: 0 0 14px rgba(239, 68, 68, .28); }
.gn-modal-card button.hidden { display: none; }

/* 사람 고르기 목록 */
.pick-list { margin-top: 10px; max-height: 300px; overflow-y: auto; }
.pick-list .share-hit { border-radius: 10px; }

/* 미리보기 — 어디가 바뀌는지(녹취록·회의록·할 일) 함께 보여 준다 */
.preview-row { grid-template-columns: 58px 1fr 1fr; }
.preview-row .where { font-size: 0.7rem; font-weight: 700; color: var(--color-primary); padding-top: 1px; }

/* 내 할 일로 가져온 항목 — 눌러 둔 상태가 한눈에 보이게 */
button.mine-on {
  background: rgba(16, 185, 129, .16) !important;
  border-color: rgba(16, 185, 129, .45) !important;
  color: #6ee7b7 !important;
}
button.mine-on:hover { background: rgba(239, 68, 68, .14) !important; border-color: rgba(239, 68, 68, .4) !important; color: #fca5a5 !important; }

/* 표 안의 머리글·단추는 줄바꿈하지 않는다 — "내 할 일 / 로" 처럼 잘려 읽혔다 */
table.grid th { white-space: nowrap; }
table.grid td button { white-space: nowrap; }

/* ----- 링크로 공유 ----- */
.link-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: rgba(0, 0, 0, .14); margin-bottom: 6px; }
.link-row.dead { opacity: .5; }
.link-main { flex: 1; min-width: 0; }
.link-main b { font-size: 0.86rem; color: var(--text-main); margin-right: 6px; }
.link-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.74rem;
  color: #93c5fd; margin: 4px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-main small { font-size: 0.72rem; }
.light-theme .link-row { background: rgba(0, 0, 0, .04); }

/* ==========================================================================
   좁은 화면(≤992px)의 왼쪽 메뉴 — 화면 밖에 두고, 부를 때만 나온다
   --------------------------------------------------------------------------
   390px 짜리 화면에서 메뉴가 늘 자리를 차지하면 정작 볼 것이 안 보인다.
   평소에는 화면 밖으로 밀어 두고 본문이 폭을 다 쓰게 한다.
   머리말의 ☰ 를 누르면 서랍처럼 덮으며 나오고, 메뉴를 고르거나 바깥을 누르면 닫힌다.
   ========================================================================== */
.nav-open-btn {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-right: 10px; flex: 0 0 auto;
  border: 1px solid var(--border-color); border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.05); color: var(--text-main); cursor: pointer;
}
.nav-open-btn:hover { background-color: rgba(255, 255, 255, 0.1); }
.nav-open-btn i { width: 19px; height: 19px; }

@media (max-width: 992px) {
  .nav-open-btn { display: inline-flex; }
  .main-header { align-items: flex-start; }

  /* 메뉴는 화면 밖에 대기한다 */
  .sidebar {
    width: 268px; transform: translateX(-100%);
    transition: transform .22s ease-out;
    z-index: 200;
  }
  .app-container.nav-open .sidebar {
    transform: none; box-shadow: 14px 0 44px rgba(0, 0, 0, .55);
  }
  /* 열렸을 때는 이름까지 보인다 — 아이콘만 있는 좁은 띠를 부를 이유가 없다 */
  .sidebar .logo-text-box, .sidebar .profile-info { display: block; }
  .sidebar .nav-link span { display: inline; }
  .sidebar .nav-link { justify-content: flex-start; padding: 12px 16px; }
  .sidebar-nav { padding: 16px 12px; }
  .sidebar-footer .user-profile { flex-direction: row !important; gap: 12px; }
  .sidebar-footer .user-profile > div { flex: 1 !important; justify-content: flex-start !important; gap: 12px !important; }

  /* 본문이 화면을 다 쓴다 */
  .main-content,
  .app-container.sidebar-collapsed .main-content { margin-left: 0 !important; padding: 16px 14px; }

  /* 열려 있을 때 바깥을 눌러 닫을 수 있게 */
  .app-container.nav-open::after {
    content: ""; position: fixed; inset: 0; z-index: 150;
    background: rgba(4, 8, 18, .5);
  }
}

/* 글 속에 섞이는 버튼 — 링크처럼 보이되 실제로는 버튼이다 */
.linklike {
  background: none; border: 0; padding: 0;
  color: var(--color-primary); font: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.linklike:hover { color: var(--text-main); }

/* 회의 개요 — 한 문장에 한 줄.
   줄이 길어 접힐 때는 안쪽으로 들여써서 어디서 새 문장이 시작하는지 바로 보이게 한다.
   (나누는 자리는 서버가 정한다 — lib/minutes.js 의 summaryLines) */
.doc-summary { padding-left: 15px; text-indent: -15px; line-height: 1.95; }

/* 좁은 화면에서는 페이지 전체가 흐르며 스크롤한다.
   넓은 화면에서는 .main-content 가 100vh 를 잡고 그 안의 층이 스크롤을 맡는데,
   좁은 화면에서 그대로 두면 그 층이 몇 줄로 눌리고 바깥 내용은 잘려 나간다. */
@media (max-width: 992px) {
  /* 뿌리부터 푼다. body 가 100vh 에 overflow:hidden 이면 그 아래에서 무엇을 하든
     넘친 부분은 잘려 나간다 — 화면이 아예 안 굴러가는 원인이 여기였다. */
  /* 버튼에 매달려 '오른쪽 끝 맞춤' 으로 펼쳐지는 메뉴들.
     좁은 화면에서는 버튼이 왼쪽으로 오는데 메뉴는 여전히 왼쪽으로 펼쳐져
     화면 밖으로 나가 누를 수가 없다. 화면을 기준으로 놓는다.
     (검색 결과는 420px 라 390px 화면에서는 반드시 넘친다) */
  .search-results,
  .menu-list {
    position: fixed;
    top: 64px; left: 12px; right: 12px;
    width: auto; min-width: 0; max-width: none;
    max-height: calc(100vh - 88px); overflow-y: auto;
  }
  html, body { height: auto; min-height: 100vh; overflow: visible; }
  .app-container { min-height: 100vh; height: auto; }
  .main-content { height: auto; min-height: 100vh; overflow: visible; }
  .view-section.active { min-height: 0; }
  .requests-layout,
  .requests-list-container,
  .content-body,
  .help-content,
  .history-timeline {
    flex: 0 0 auto;
    min-height: 0;
    overflow-y: visible;
  }

  /* ── 넘침 ── */
  /* flex 자식은 기본이 min-width:auto 라 '내용보다 작아지기'를 거부한다.
     안에 넓은 것이 하나만 있어도 본문 전체가 화면 밖으로 밀려 화면이 옆으로 흐른다
     (gworks 는 390px 안에서 506px 로 벌어져 있었다). 이 사슬을 모두 0 으로 푼다. */
  .main-content, .content-body, .view-section, .view-section.active,
  .requests-layout, .requests-header-row, .filters-row,
  .dashboard-grid, .dashboard-card, .card-body, .card-header, .card-header > *,
  .form-row, .form-group, .search-box, .status-tabs, .toolbar-actions { min-width: 0; }

  /* 한 줄에 우겨넣지 말고 접히게 한다 */
  .card-header, .filters-row, .toolbar-actions { flex-wrap: wrap; }

  /* 세로로 쌓이는 줄에서는 '가로 폭' 을 align-items 가 정한다.
     stretch 가 아니면 자식이 제 내용만큼 넓어져 화면 밖으로 나간다. 폭을 못 박아 묶는다. */
  .requests-header-row { flex-wrap: nowrap; align-items: stretch; }
  .requests-header-row > * { width: 100%; max-width: 100%; }
  .search-box { width: 100%; flex: 1 1 100%; }
  .search-box input { width: 100%; min-width: 0; box-sizing: border-box; }
  /* 탭이 많으면 접지 말고 옆으로 밀어 본다 — 접으면 화면을 다 먹는다 */
  .status-tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}

/* ==========================================================================
   GGATE 전용 — 대기열 화면
   ==========================================================================
   위쪽은 사내앱 8종이 함께 쓰는 디자인 시스템이고, 여기부터가 이 앱의 것이다.
   대기열은 "지금 이 순간" 이 전부인 화면이라, 숫자가 살아 움직이는 느낌을 만드는 데
   대부분을 쓴다 — 멈춘 것처럼 보이면 사람은 새로고침을 누르기 시작한다.
   ========================================================================== */

/* ---- 대기열 카드 (대시보드) ---- */
.gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.gate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.gate-card:hover { transform: translateY(-2px); border-color: rgba(59,130,246,.4); box-shadow: var(--shadow-md); }

/* 왼쪽 색띠 — 지금 상태를 글자보다 먼저 알려 준다 */
.gate-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--color-success);
}
.gate-card.busy::before { background: var(--color-warning); }
.gate-card.queued::before { background: var(--color-danger); }
.gate-card.off::before { background: var(--color-secondary); }

.gate-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.gate-name { font-size: 1.05rem; font-weight: 700; }
.gate-key { font-size: .74rem; color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* 상태 뱃지 */
.gate-state {
  font-size: .7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex: none;
}
.gate-state.ok    { background: rgba(16,185,129,.15); color: #10b981; }
.gate-state.busy  { background: rgba(245,158,11,.15); color: #f59e0b; }
.gate-state.queue { background: rgba(239,68,68,.15);  color: #ef4444; }
.gate-state.off   { background: rgba(100,116,139,.18); color: var(--text-muted); }

/* ---- 정원 게이지 ---- */
.gauge {
  height: 10px;
  border-radius: 99px;
  background: rgba(148,163,184,.18);
  overflow: hidden;
  margin: 6px 0 4px;
  display: flex;
}

.gauge-fill {
  height: 100%;
  background: var(--color-emerald-grad);
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.gauge-fill.warn { background: linear-gradient(135deg,#f59e0b,#b45309); }
.gauge-fill.full { background: var(--color-rose-grad); }

.gauge-legend {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--text-muted);
}

/* ---- 숫자 세 칸 ---- */
.gate-nums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 4px;
  text-align: center;
}

.gate-num { background: rgba(148,163,184,.07); border-radius: 11px; padding: 10px 4px; }
.gate-num b { display: block; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.gate-num span { font-size: .68rem; color: var(--text-muted); }
.gate-num.hot b { color: var(--color-danger); }

/* 살아 있음 표시 — 이 점이 뛰면 화면이 죽지 않았다는 뜻이다 */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  margin-right: 6px;
  animation: gate-pulse 1.8s ease-in-out infinite;
}
.live-dot.stale { background: var(--color-warning); animation: none; }

@keyframes gate-pulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
  50%     { opacity: .6; box-shadow: 0 0 0 5px transparent; }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* 원 사이트 건강도 */
.health-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
.health-line.bad { color: var(--color-danger); }

/* ---- 설정 폼 ---- */
.setting-group {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.setting-group > h3 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.setting-group > .hint { font-size: .78rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.field > .note { font-size: .72rem; color: var(--text-muted); opacity: .85; line-height: 1.5; }
.field.wide { grid-column: 1 / -1; }

.field input[type="text"], .field input[type="number"], .field input[type="url"],
.field input[type="password"], .field select, .field textarea {
  background: rgba(148,163,184,.08);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--text-main);
  font-size: .88rem;
  width: 100%;
  transition: border-color var(--transition-fast);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--border-focus); }
.field textarea { resize: vertical; min-height: 76px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; line-height: 1.6; }

.field-check { display: flex; align-items: flex-start; gap: 9px; font-size: .84rem; }
.field-check input { margin-top: 3px; flex: none; }

/* ---- 연동 설정 보여 주기 ---- */
.snippet {
  background: #0b1220;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .76rem;
  line-height: 1.7;
  color: #cbd5e1;
  white-space: pre;
  overflow-x: auto;
  max-height: 520px;
  overflow-y: auto;
}
.light-theme .snippet { background: #0f172a; }

.tab-row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab-row button {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 9px;
  padding: 7px 14px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.tab-row button:hover { color: var(--text-main); }
.tab-row button.on { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ---- 줄 서 있는 사람 목록 ---- */
.queue-row-priority { color: var(--color-purple); font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }

/* ---- 그래프 ---- */
.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.chart-box h3 { font-size: .92rem; font-weight: 700; margin-bottom: 14px; }
.chart-box canvas { max-height: 260px; }

@media (max-width: 640px) {
  .gate-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
}

/* ---- 시험 도구 ----
   운영 화면에 시험용 단추를 두는 것은 조심스럽다. 그래서 색을 죽이고 점선으로 둘러
   "여기는 평소에 쓰는 곳이 아니다" 를 눈으로 알 수 있게 했다. */
.sim-bar {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px dashed rgba(148,163,184,.35);
  border-radius: 12px;
  background: rgba(148,163,184,.05);
}
.sim-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; font-size: .85rem;
}
.sim-head b { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.sim-head i { width: 15px; height: 15px; }
.sim-on {
  background: rgba(139,92,246,.18); color: #a78bfa;
  border: 1px solid rgba(139,92,246,.4);
  border-radius: 99px; padding: 3px 10px; font-size: .74rem; font-weight: 700;
}
.sim-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sim-row label { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-muted); }
.sim-row input[type="number"] {
  width: 76px; background: rgba(148,163,184,.1);
  border: 1px solid var(--border-color); border-radius: 7px;
  padding: 6px 9px; color: var(--text-main); font-size: .82rem;
}
.sim-sep { width: 1px; height: 22px; background: var(--border-color); }
.sim-note { margin-top: 11px; font-size: .74rem; color: var(--text-muted); line-height: 1.65; }
.sim-note b { color: var(--text-main); font-weight: 600; }
@media (max-width: 640px) { .sim-sep { display: none; } }

/* ==========================================================================
   모바일 — 손가락으로 쓰는 화면
   ==========================================================================
   마우스는 1px 도 정확히 찍지만 손가락은 그렇지 않다. 애플·구글이 권하는
   최소 터치 크기는 44px 인데, 관리 화면의 작은 단추(.btn-sm)는 그보다 작다.
   좁은 화면에서만 키운다 — 넓은 화면에서까지 커지면 정보가 밀려난다. */
@media (max-width: 640px) {
  .btn, .btn-sm, .tab-row button, .gn-modal button, button.primary, button.ghost {
    min-height: 42px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  /* 시험 도구 — 한 줄에 욱여넣지 않고 세로로 쌓는다 */
  .sim-row { flex-direction: column; align-items: stretch; gap: 8px; }
  /* 라벨과 입력칸만 양끝으로 벌리고, 뒤에 붙는 단위(초)는 입력칸에 붙여 둔다 */
  .sim-row label { justify-content: space-between; gap: 8px; }
  .sim-row label input { margin-left: auto; }
  .sim-row input[type="number"] {
    width: 110px;
    min-height: 42px;          /* 숫자 칸도 손가락으로 찍는다 */
    font-size: 16px;           /* 16px 미만이면 iOS 가 화면을 확대해 버린다 */
  }
  .sim-row .btn { width: 100%; justify-content: center; }
  .sim-sep { display: none; }

  /* 입력칸 전반 — iOS 자동 확대 방지 */
  .field input, .field select, .field textarea,
  .form-control, #global-search { font-size: 16px; }

  /* 표는 가로로 흐르게 두고, 화면을 밀어 보게 한다 */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 520px; }

  /* 머리말의 단추들이 줄바꿈되며 겹치지 않게 */
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head .row-gap { flex-wrap: wrap; }
  .row-gap.end { justify-content: stretch; }
  .row-gap.end .btn { flex: 1; }
}

/* 손가락으로 누를 때 파란 사각형이 번쩍이지 않게 (안드로이드 크롬) */
button, .btn, .nav-link, .gate-card, .tab-row button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;      /* 더블탭 확대 대기시간(300ms) 제거 */
}
