/* Custom properties for theme tokens */
:root {
  --font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Color Palette */
  --bg-app: #f5f5fa;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e4e4ee;

  --text-main: #1c1c28;
  --text-muted: #666680;
  --text-light: #9c9cb4;
  --text-white: #ffffff;

  /* Accent colors */
  --color-primary: #5b5bd6;
  --color-primary-hover: #4b4bc4;
  --color-primary-light: #eeeefc;

  --color-accent: #f59e0b;
  --color-danger: #ef4444;
  --color-danger-light: #fef2f2;
  --color-success: #10b981;
  --color-success-light: #ecfdf5;
  --color-info: #06b6d4;
  --color-info-light: #ecfeff;

  /* Job Rank Theme Colors */
  --color-rank-president: #94a3b8;
  /* 이대표 - 연한 회색 */
  --color-rank-president-bg: #f1f5f9;
  --color-rank-manager: #3b82f6;
  /* 이과장 - Vivid Blue */
  --color-rank-manager-bg: #eff6ff;
  --color-rank-shin: #0d9488;
  /* 신대리 - Teal */
  --color-rank-shin-bg: #f0fdfa;
  --color-rank-staff: #db2777;
  /* 송사원 - Pink */
  --color-rank-staff-bg: #fdf2f8;
  --color-rank-it_solution: #78716c;
  /* 아이티솔루션 - 차분한 웜그레이 */
  --color-rank-it_solution-bg: #fafaf9;
  --color-rank-unassigned: #8b5cf6;
  /* 미배정 - Violet */
  --color-rank-unassigned-bg: #f5f3ff;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Layout sizes */
  --sidebar-width: 280px;
  --header-height: 70px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* 움직임(2026-10-13): 화면 전환(features/page-transition.mjs)과 같은 곡선. 창·시트·서랍이 같은 느낌으로 열리고 닫힌다 */
  --motion-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --motion-sheet: 420ms;
  --motion-fade: 300ms;
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: auto;
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  touch-action: manipulation;
}

body.block-selection {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body.block-selection input,
body.block-selection textarea,
body.block-selection select {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Basic Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  color: var(--text-main);
}

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

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* App Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* 1. SIDEBAR STYLING */
.sidebar {
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  padding: 24px;
  display: flex;
  flex-direction: flex-direction;
  /* wait, column */
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--motion-sheet) var(--motion-ease);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fade) var(--motion-ease);
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* 로고: 앱 아이콘의 그림 부분(EXIT-PLAN 글자를 뺀 달력·시계, 2026-10-03) — 휴대폰 상단·PC 사이드바 */
.logo-mark {
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
}

.sidebar-brand .logo-mark {
  width: 48px;
  height: 36px;
  border-radius: 8px;
}

.sidebar-brand h1 {
  font-size: 20px;
  color: var(--text-white);
  line-height: 1.2;
}

.sidebar-brand p {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 1px;
  margin: 16px 0 8px 12px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-light);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  color: var(--text-white);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: var(--text-white);
  background-color: var(--color-primary);
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.4);
}

/* User Simulation Dropdown in Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.capture-mask-toggle {
  width: 100%;
  min-height: 40px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(250, 204, 21, 0.38);
  border-radius: var(--radius-md);
  background: rgba(250, 204, 21, 0.08);
  color: #fde68a;
  display: flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.capture-mask-toggle[hidden] {
  display: none !important;
}

.capture-mask-toggle:hover,
.capture-mask-toggle.active {
  background: #fef3c7;
  border-color: #facc15;
  color: #92400e;
}

.capture-mask-toggle i {
  width: 18px;
  text-align: center;
}

/* 소개 화면 캡처용 마스킹. 일정 문장 구조는 유지하고 렌더 단계에서 민감한 부분만 O로 치환한다. */
body.capture-mask-mode .capture-mask-content,
body.capture-mask-mode .card-title-text,
body.capture-mask-mode .card-memo-box,
body.capture-mask-mode .personal-schedule-memo-text {
  user-select: none;
}

/* 캘린더 항목의 원문 title 툴팁이 마우스 오버로 나타나지 않게 한다. */
body.capture-mask-mode .calendar-mini-event {
  pointer-events: none;
}

/* 수정 입력창은 원문을 직접 담고 있으므로 캡처 모드에서는 강한 블라인드를 유지한다. */
body.capture-mask-mode #form-title,
body.capture-mask-mode #form-memo,
body.capture-mask-mode #memo-input,
body.capture-mask-mode #global-calendar-search,
body.capture-mask-mode #mobile-calendar-search {
  color: transparent !important;
  text-shadow: 0 0 7px rgba(51, 65, 85, 0.9) !important;
  caret-color: transparent !important;
}

body.capture-mask-mode #telegram-admin-chat-id,
body.capture-mask-mode #telegram-chat-id,
body.capture-mask-mode #fb-db-url,
body.capture-mask-mode #fb-api-key,
body.capture-mask-mode #fb-project-id {
  color: transparent !important;
  text-shadow: 0 0 7px rgba(51, 65, 85, 0.9) !important;
  caret-color: transparent !important;
  user-select: none;
}

body.capture-mask-mode #diag-panel {
  filter: blur(6px);
  user-select: none;
}

body.capture-mask-mode #form-title::placeholder,
body.capture-mask-mode #form-memo::placeholder,
body.capture-mask-mode #memo-input::placeholder,
body.capture-mask-mode #global-calendar-search::placeholder,
body.capture-mask-mode #mobile-calendar-search::placeholder {
  color: var(--text-muted) !important;
  text-shadow: none !important;
}

.logout-btn:hover {
  background-color: rgba(239, 68, 68, 0.1) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(255, 255, 255, 0.04);
  padding: 12px;
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-white);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

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

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.user-role {
  font-size: 11px;
  color: var(--text-light);
}

/* 2. MAIN CONTENT AREA */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

/* Desktop Header */
.desktop-header {
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}





.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.current-date-display {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Content Sections */
.sections-container {
  padding: 16px 24px; /* 상하 32→16px, 좌우 32→24px */
  flex-grow: 1;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* 화면 전환(features/page-transition.mjs): 움직이는 동안만 붙는다. 위치·크기는 스크립트가 잰 값으로 넣는다. */
.content-section.page-ghost {
  display: block;
  position: fixed;
  z-index: 1;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

.content-section.page-cover {
  position: relative;
  z-index: 2;
  background-color: var(--bg-app);
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.12);
}

.content-section.page-ghost.page-cover {
  position: fixed;
  z-index: 3;
}

.main-content.is-page-moving {
  overflow-x: hidden;
}

/* 옆으로 나가 있는 화면이 가로 스크롤 거리를 만들지 않게 자른다(hidden과 달리 스크립트·커서로도 옆으로 밀리지 않는다).
   없으면 들어오는 화면의 입력칸에 커서를 넣을 때(검색 탭) 브라우저가 칸을 보이려고 본문을 옆으로 밀어 흔들린다(2026-10-14). */
.main-content.is-page-moving .sections-container {
  overflow-x: clip;
}

/* 같은 화면에서 날짜를 바꿀 때 옛 목록 복사본(features/ui-motion.mjs). 위치·크기는 스크립트가 넣는다. */
.motion-swap-copy {
  position: fixed;
  z-index: 1;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px; /* 24px → 12px */
  flex-wrap: wrap;
  gap: 12px; /* 16px → 12px */
}

.section-title-wrapper h2 {
  font-size: 18px; /* 24px → 18px */
  margin-bottom: 2px; /* 4px → 2px */
}

.section-title-wrapper p {
  color: var(--text-muted);
  font-size: 14px;
}

.memo-section-heading-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.memo-section-heading-row h2 {
  margin-bottom: 0;
}



/* Admin past delete indicator badge */

/* Button UI Components */
.primary-btn {
  background-color: var(--color-primary);
  color: var(--text-white);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.primary-btn:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn-circle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--text-white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  z-index: 999;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn-circle:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.primary-btn-circle:active {
  transform: scale(0.9);
}

.secondary-btn {
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.warning-btn {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.warning-btn:hover {
  background-color: var(--color-danger);
  color: var(--text-white);
}

.danger-btn-sm {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.danger-btn-sm:hover {
  background-color: var(--color-danger);
  color: var(--text-white);
  border-color: var(--color-danger);
}

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

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.icon-btn-large {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text-main);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.icon-btn-large:hover {
  background-color: #f8fafc;
  transform: translateY(-1px);
}

.text-btn {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.text-btn:hover {
  text-decoration: underline;
}

/* 3. FILTER BAR */
.filter-bar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Segmented Control Styling */
.segmented-control {
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  display: flex;
  position: relative;
}

.segmented-control input[type="radio"] {
  display: none;
}

.segmented-control label {
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.segmented-control input[type="radio"]:checked+label {
  background-color: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.form-control-sm {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  outline: none;
  font-size: 13px;
  font-weight: 500;
  background-color: var(--bg-card);
  cursor: pointer;
}

/* Active Date Filtering Info */
.date-filter-reset-wrapper {
  margin-left: auto;
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-filtered-info {
  font-size: 13px;
  font-weight: 600;
  color: #b45309;
}

/* 4. SCHEDULE CARDS & LIST */
.list-date-group {
  margin-bottom: 32px;
}

.list-date-header {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 4px solid var(--color-primary);
  padding-left: 10px;
}

.schedules-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Individual Schedule Card (Compact List View) */


/* Completed schedule visual changes */








/* Card Layout Rows */

.checkbox-custom-container {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.checkbox-custom-container input {
  display: none;
}

.checkbox-checkmark {
  width: 24px;
  height: 24px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background-color: var(--bg-card);
}

.checkbox-checkmark i {
  color: var(--text-white);
  font-size: 11px;
  transform: scale(0);
  transition: transform 0.2s ease;
}

.checkbox-custom-container input:checked+.checkbox-checkmark {
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.checkbox-custom-container input:checked+.checkbox-checkmark i {
  transform: scale(1);
}





/* Role Assignee Badge */
.assignee-badge {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  min-width: 60px;
}

.assignee-badge.rank-president {
  color: var(--color-rank-president);
  background-color: var(--color-rank-president-bg);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.assignee-badge.rank-manager {
  color: var(--color-rank-manager);
  background-color: var(--color-rank-manager-bg);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.assignee-badge.rank-shin {
  color: var(--color-rank-shin);
  background-color: var(--color-rank-shin-bg);
  border: 1px solid rgba(13, 148, 136, 0.15);
}

.assignee-badge.rank-staff {
  color: var(--color-rank-staff);
  background-color: var(--color-rank-staff-bg);
  border: 1px solid rgba(219, 39, 119, 0.15);
}

.assignee-badge.rank-it_solution {
  color: var(--color-rank-it_solution);
  background-color: var(--color-rank-it_solution-bg);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.assignee-badge.rank-unassigned {
  color: var(--color-rank-unassigned);
  background-color: var(--color-rank-unassigned-bg);
  border: 1px dashed rgba(139, 92, 246, 0.4);
}

/* Assignee Selector Dropdown (Quick Change) */
select.assignee-badge-select {
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-align-last: center;
  text-align: center;
  min-width: 60px;
  height: 30px;
  line-height: 30px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  box-sizing: border-box;
  vertical-align: middle;
}

select.assignee-badge-select:hover {
  filter: brightness(0.95);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

select.assignee-badge-select.rank-president {
  color: var(--color-rank-president);
  background-color: var(--color-rank-president-bg);
  border-color: rgba(148, 163, 184, 0.3);
}

select.assignee-badge-select.rank-manager {
  color: var(--color-rank-manager);
  background-color: var(--color-rank-manager-bg);
  border-color: rgba(59, 130, 246, 0.15);
}

select.assignee-badge-select.rank-shin {
  color: var(--color-rank-shin);
  background-color: var(--color-rank-shin-bg);
  border-color: rgba(13, 148, 136, 0.15);
}

select.assignee-badge-select.rank-staff {
  color: var(--color-rank-staff);
  background-color: var(--color-rank-staff-bg);
  border-color: rgba(219, 39, 119, 0.15);
}

select.assignee-badge-select.rank-it_solution {
  color: var(--color-rank-it_solution);
  background-color: var(--color-rank-it_solution-bg);
  border-color: rgba(16, 185, 129, 0.15);
}

select.assignee-badge-select.rank-unassigned {
  color: var(--color-rank-unassigned);
  background-color: var(--color-rank-unassigned-bg);
  border-color: rgba(139, 92, 246, 0.4);
  border-style: dashed;
}

/* Status Badges */










/* Card Memo Box */
.card-memo-box {
  background-color: #f8fafc;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid #f1f5f9;
}

/* 5. CALENDAR STYLING */
.calendar-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px; /* 24px → 16px */
  box-shadow: var(--shadow-md);
}

/* 캘린더 헤더 — 3-column grid로 수학적 정중앙 보장 */
.calendar-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 12px; /* 24px → 12px */
}

/* 좌측: 이전 버튼 */
.calendar-nav-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* 중앙: 월년 타이틀 + 오늘 버튼 수직 스택 */
.calendar-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}






/* 우측: 다음 버튼 */
.calendar-nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* 오늘 버튼 pill 스타일 */
.calendar-today-pill {
  height: 28px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.calendar-today-pill:hover {
  background-color: var(--color-primary);
  color: var(--text-white);
  border-color: var(--color-primary);
}

#calendar-month-year {
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  user-select: none;
}

#calendar-month-year:hover {
  color: var(--color-primary);
  transform: scale(1.03);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendar-day-label {
  background-color: #f8fafc;
  padding: 12px 6px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
}

.calendar-day-label.sunday {
  color: var(--color-danger);
}

.calendar-day-label.saturday {
  color: var(--color-primary);
}

.calendar-body-grid {
  display: contents;
  /* Grid cells placed directly in the calendar-grid */
}

/* Individual Calendar Day Cell */
.calendar-cell {
  background-color: var(--bg-card);
  height: 145px; /* 4개 이벤트 기준 최적화 */
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.calendar-cell:hover {
  background-color: #f8fafc;
}

.calendar-cell.other-month {
  background-color: #fafafa;
  opacity: 0.4;
  cursor: pointer;
  pointer-events: auto; /* 이전달/다음달 셀 클릭 허용 */
}

.calendar-cell.today-cell {
  background-color: var(--color-primary-light);
}

.calendar-cell.selected-cell {
  border: 2px solid var(--color-primary) !important;
  background-color: var(--color-primary-light);
}

.calendar-cell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.calendar-date-num {
  font-weight: 600;
  font-size: 13px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.calendar-cell.today-cell .calendar-date-num {
  background-color: var(--color-primary);
  color: var(--text-white);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.calendar-cell.sunday-cell .calendar-date-num {
  color: var(--color-danger);
}

.calendar-cell.today-cell.sunday-cell .calendar-date-num {
  color: var(--text-white);
}

.calendar-cell.saturday-cell .calendar-date-num {
  color: var(--color-primary);
}

.calendar-cell.today-cell.saturday-cell .calendar-date-num {
  color: var(--text-white);
}

/* Event micro badges in cells */
.calendar-events-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
  overflow-y: auto;
}

.calendar-mini-event {
  font-size: 11.5px; /* 가독성 개선 */
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.3;
  margin: 0;
  box-sizing: border-box;
}

.calendar-mini-event.rank-president {
  color: var(--color-rank-president);
  background-color: var(--color-rank-president-bg);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.calendar-mini-event.rank-manager {
  color: #1d4ed8;
  background-color: var(--color-rank-manager-bg);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.calendar-mini-event.rank-shin {
  color: #0f766e;
  background-color: var(--color-rank-shin-bg);
  border: 1px solid rgba(13, 148, 136, 0.2);
}

.calendar-mini-event.rank-staff {
  color: #be185d;
  background-color: var(--color-rank-staff-bg);
  border: 1px solid rgba(219, 39, 119, 0.2);
}

.calendar-mini-event.rank-it_solution {
  color: #57534e;
  background-color: var(--color-rank-it_solution-bg);
  border: 1px solid rgba(120, 113, 108, 0.2);
}

.calendar-mini-event.rank-unassigned {
  color: #475569;
  background-color: var(--color-rank-unassigned-bg);
  border: 1px dashed rgba(139, 92, 246, 0.4);
}


/* Completed event on calendar */
.calendar-mini-event.completed-task {
  text-decoration: line-through;
  opacity: 0.5;
}

/* Important event on calendar */
.calendar-mini-event.important-task {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.3) !important;
  font-weight: 700;
}

/* Attendance event on calendar: 최상단 고정 + 빨간 계열 */
.calendar-mini-event.attendance-task {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid rgba(220, 38, 38, 0.4) !important;
  font-weight: 700;
}

/* 긴급 일정: 주황/앰버 강조 (근태 빨강과 구분), 최우선 표시 */
.calendar-mini-event.urgent-task {
  background-color: #fff7ed !important;
  color: #c2410c !important;
  border: 1px solid #f59e0b !important;
  border-left: 3px solid #d97706 !important;
  font-weight: 800;
}

/* 현재 로그인한 사용자에게만 보이는 개인 일정 메모 */
.calendar-mini-event.personal-memo-event {
  color: #6d28d9 !important;
  background-color: #f5f3ff !important;
  border: 1px dashed rgba(109, 40, 217, 0.45) !important;
  cursor: pointer;
}

.calendar-mini-event.personal-memo-event.important-personal-memo {
  color: #a16207 !important;
  background-color: #fefce8 !important;
  border-color: rgba(202, 138, 4, 0.55) !important;
  font-weight: 800;
}

.calendar-mini-event.personal-memo-event.deadline-personal-memo {
  color: #b91c1c !important;
  background-color: #fef2f2 !important;
  border: 1px solid rgba(220, 38, 38, 0.45) !important;
  border-left: 3px solid #dc2626 !important;
  font-weight: 800;
}






.personal-schedule-memo-panel {
  margin-bottom: 20px;
  padding: 14px;
  border: 1px dashed rgba(109, 40, 217, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(245, 243, 255, 0.55);
}

.personal-schedule-memo-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: #6d28d9;
  font-size: 13px;
  font-weight: 800;
}

.personal-schedule-memo-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(109, 40, 217, 0.1);
  font-size: 11px;
}

.personal-schedule-memo-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(109, 40, 217, 0.2);
  border-left: 4px solid #7c3aed;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.personal-schedule-memo-card.completed {
  opacity: 0.58;
}

.personal-schedule-memo-card.overdue {
  border-left-color: #dc2626;
  background: #fff7f7;
}

.personal-schedule-memo-card.due-today {
  border-left-color: #ea580c;
  background: #fff7ed;
}

.personal-schedule-memo-card.upcoming {
  border-left-color: #d97706;
  background: #fffbeb;
}

.personal-schedule-memo-card.completed .personal-schedule-memo-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

.personal-memo-status-btn {
  flex-shrink: 0;
  padding: 1px;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.personal-schedule-memo-content {
  min-width: 0;
  flex: 1;
}

.personal-schedule-memo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.personal-private-badge,
.personal-important-badge,
.personal-recur-badge,
.personal-scheduled-badge,
.personal-deadline-badge {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 750;
}

.personal-private-badge {
  color: #6d28d9;
  background: #f5f3ff;
  border: 1px solid rgba(109, 40, 217, 0.25);
}

.personal-important-badge {
  color: #a16207;
  background: #fefce8;
}

.personal-recur-badge {
  color: #0f766e;
  background: #f0fdfa;
}

.personal-scheduled-badge {
  color: #6d28d9;
  background: #f5f3ff;
}

.personal-deadline-badge {
  font-weight: 800;
}

.personal-deadline-badge.overdue,
.personal-deadline-badge.due-today {
  color: #b91c1c;
  background: #fef2f2;
}

.personal-deadline-badge.upcoming {
  color: #a16207;
  background: #fefce8;
}


.memo-inline-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 3px;
  white-space: nowrap;
  vertical-align: middle;
}


.personal-schedule-memo-text {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card h3 {
  font-size: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

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

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

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

.form-row .col {
  flex: 1;
  min-width: 0;
}

.schedule-period-group {
  margin-bottom: 0;
}

.schedule-period-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.schedule-period-heading strong {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.schedule-period-heading span {
  color: var(--text-light);
  font-size: 11px;
}

.schedule-date-row {
  gap: 10px;
}

.schedule-date-row .form-group {
  min-width: 0;
}

.schedule-date-row .form-group label {
  font-size: 11px;
}

.schedule-date-row input[type="date"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
}

.schedule-date-separator {
  flex: 0 0 auto;
  margin-top: 35px;
  color: var(--text-light);
  font-size: 11px;
}

.form-control {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  font-size: 14px;
  background-color: var(--bg-card);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

textarea.form-control {
  height: auto;
  min-height: 90px;
  resize: vertical;
}


.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-wrapper label {
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
}

.w-full {
  width: 100%;
}

.mt-4 {
  margin-top: 16px;
}

.help-block {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Alerts System */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 13px;
}

.alert-info {
  background-color: var(--color-info-light);
  color: #0e7490;
  border: 1px solid rgba(6, 182, 212, 0.15);
}

.alert i {
  font-size: 18px;
  margin-top: 2px;
}

/* 7. ADMIN: SETTINGS SYSTEMS */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* ===== 관리자 알림 배너 (신대리 전용) ===== */
#admin-reminders:empty {
  display: none;
}

.admin-reminder-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.admin-reminder-banner i {
  margin-right: 4px;
}

.admin-reminder-banner.warn {
  background: #fff7ed;
  border-color: #fdba74;
  color: #b45309;
}

.admin-reminder-banner.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.admin-reminder-banner .reminder-action-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--color-primary, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.admin-reminder-banner .reminder-action-btn:hover {
  filter: brightness(0.95);
}

/* ===== System Settings: tabbed grouping ===== */




/* Tab panels: single-column stack, show only the active group */
#settings-cards {
  display: block;
}

#settings-cards > [data-sgroup] {
  display: none;
}

#settings-cards[data-active="perm"] > [data-sgroup="perm"],
#settings-cards[data-active="security"] > [data-sgroup="security"],
#settings-cards[data-active="data"] > [data-sgroup="data"],
#settings-cards[data-active="memos"] > [data-sgroup="memos"],
#settings-cards[data-active="audit"] > [data-sgroup="audit"] {
  display: block;
}

/* ===== Super-admin operations / audit log ===== */
.audit-log-card {
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.audit-log-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.audit-log-card-header > div {
  min-width: 0;
}

.audit-log-card-header .secondary-btn {
  flex-shrink: 0;
}

.audit-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 16px 0;
  padding: 12px 14px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
}

.audit-notice i {
  margin-top: 2px;
}

.audit-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.audit-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.audit-stat-item span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.audit-stat-item strong {
  color: var(--text-main);
  font-size: 20px;
}

.audit-stat-item.error { background: #fff7f7; border-color: #fecaca; }
.audit-stat-item.error strong { color: #dc2626; }
.audit-stat-item.sync { background: #fffbeb; border-color: #fde68a; }
.audit-stat-item.sync strong { color: #b45309; }
.audit-stat-item.delayed { background: #faf5ff; border-color: #e9d5ff; }
.audit-stat-item.delayed strong { color: #7e22ce; }
.audit-stat-item.late { background: #fff7ed; border-color: #fed7aa; }
.audit-stat-item.late strong { color: #c2410c; }

.audit-filter-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(130px, 0.7fr) minmax(150px, 0.8fr) minmax(220px, 1.5fr);
  gap: 10px;
  align-items: end;
}

.audit-filter-grid .form-group {
  margin-bottom: 0;
}

.audit-filter-grid label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.audit-log-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.audit-log-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 16px;
}

.audit-routine-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.audit-routine-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.audit-queue-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
}

.audit-queue-status.synced { color: #059669; }
.audit-queue-status.pending { color: #b45309; }

.audit-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 720px;
  overflow-y: auto;
  padding-right: 3px;
}

.audit-log-item {
  position: relative;
  flex: 0 0 auto;
  min-height: 154px;
  padding: 17px 18px;
  overflow: visible;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid #64748b;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.audit-log-item.action { border-left-color: #2563eb; }
.audit-log-item.sync { border-left-color: #d97706; }
.audit-log-item.error { border-left-color: #dc2626; background: #fffafa; }
.audit-log-item.session { border-left-color: #059669; }
.audit-log-item.delayed { box-shadow: inset 0 0 0 1px rgba(126, 34, 206, 0.2); }

.audit-log-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.audit-log-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.audit-log-title strong {
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.35;
}

.audit-log-topline time {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.audit-category-badge,
.audit-delay-badge,
.audit-late-action-badge,
.audit-batch-badge,
.audit-pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.audit-category-badge.action { color: #1d4ed8; background: #dbeafe; }
.audit-category-badge.sync { color: #92400e; background: #fef3c7; }
.audit-category-badge.error { color: #b91c1c; background: #fee2e2; }
.audit-category-badge.session { color: #047857; background: #d1fae5; }
.audit-category-badge.other { color: #475569; background: #e2e8f0; }
.audit-delay-badge { color: #7e22ce; background: #f3e8ff; }
.audit-late-action-badge { color: #c2410c; background: #ffedd5; }
.audit-batch-badge { color: #1d4ed8; background: #dbeafe; }
.audit-pending-badge { color: #b45309; background: #fef3c7; }

.audit-log-description {
  margin-top: 12px;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-log-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 7px 15px;
  margin-top: 12px;
  padding: 11px 12px;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.audit-log-facts span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  word-break: break-word;
}

.audit-log-facts strong {
  color: var(--text-main);
  font-size: inherit;
}

.audit-log-details {
  margin-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.audit-log-details summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 2px 2px;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.audit-log-details summary::-webkit-details-marker {
  display: none;
}

.audit-log-details summary i {
  transition: transform 0.2s ease;
}

.audit-log-details[open] summary i {
  transform: rotate(180deg);
}

.audit-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 11px 0 0;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.audit-detail-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  background: #ffffff;
}

.audit-detail-row.wide {
  grid-column: 1 / -1;
}

.audit-detail-row dt,
.audit-detail-row dd {
  margin: 0;
  line-height: 1.55;
}

.audit-detail-row dt {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
}

.audit-detail-row dd {
  min-width: 0;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-log-empty {
  padding: 34px 16px;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
}

.audit-log-empty.error {
  color: #b91c1c;
  background: #fff7f7;
  border-color: #fecaca;
}

@media (max-width: 900px) {
  .audit-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-search-group { grid-column: 1 / -1; }
  .audit-detail-grid { grid-template-columns: 1fr; }
  .audit-detail-row.wide { grid-column: auto; }
}

@media (max-width: 600px) {
  .audit-log-card-header { flex-direction: column; }
  .audit-log-card-header .secondary-btn { width: 100%; justify-content: center; }
  .audit-stat-grid, .audit-filter-grid { grid-template-columns: 1fr; }
  .audit-search-group { grid-column: auto; }
  .audit-log-toolbar, .audit-log-topline { align-items: flex-start; flex-direction: column; }
  .audit-log-toolbar-left { align-items: flex-start; flex-direction: column; }
  .audit-log-list { max-height: none; }
  .audit-log-item { min-height: 0; padding: 15px 14px; }
  .audit-log-title strong { font-size: 15px; }
  .audit-log-description { font-size: 14px; }
  .audit-log-facts { grid-template-columns: 1fr; font-size: 12px; }
  .audit-detail-row { grid-template-columns: 102px minmax(0, 1fr); padding: 9px 10px; }
}

.employee-memo-vault-card {
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
}

.employee-memo-vault-open-card {
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
}

.admin-memo-auth-card {
  width: 430px;
}

#admin-memo-auth-form {
  padding: 24px;
  overflow-y: auto;
}

.admin-memo-auth-help {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-memo-auth-error {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 700;
}

/* Numbered badge in card headers */

/* Detailed sub-option block (e.g. past-schedule delete role picker) */






































.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}

.toggle-wrapper:last-child {
  border-bottom: none;
}

.toggle-text {
  max-width: 80%;
}

.toggle-text strong {
  display: block;
  font-size: 14px;
  color: var(--text-main);
}

.toggle-text p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked+.slider {
  background-color: var(--color-primary);
}

input:checked+.slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}


/* Google Calendar Import UI */
.import-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.import-alert-box {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.import-alert-box.warning {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.import-alert-box i {
  font-size: 24px;
}

.file-drop-area {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  background-color: #f8fafc;
  transition: all 0.2s ease;
  margin: 16px 0;
}

.file-drop-area:hover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.cloud-icon {
  font-size: 40px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.file-name-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
}

.import-actions-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.import-progress-wrapper {
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.progress-bar-bg {
  width: 100%;
  height: 20px;
  background-color: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-size: 11px;
  font-weight: 700;
  transition: width 0.1s linear;
}

.progress-status {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
}

/* KakaoTalk log container */
.notification-log {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  background-color: #f8fafc;
}

.log-item {
  background: var(--bg-card);
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}

.log-time {
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
  display: block;
}

.log-text {
  color: var(--text-main);
  line-height: 1.4;
}

.schedule-history-section {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.schedule-history-section[hidden] {
  display: none;
}

.schedule-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.schedule-history-heading strong {
  color: var(--text-main);
  font-size: 13px;
}

.schedule-history-heading strong i {
  margin-right: 5px;
  color: #0d9488;
}

.schedule-history-heading span {
  color: var(--text-light);
  font-size: 10px;
}

.schedule-history-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
  padding: 9px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
}

.schedule-history-item {
  padding: 9px 10px;
  border: 1px solid var(--border-color);
  border-left: 3px solid #0d9488;
  border-radius: 6px;
  background: var(--bg-card);
}

.schedule-history-item.status-reopened {
  border-left-color: #f59e0b;
}

.schedule-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.schedule-history-action {
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.schedule-history-empty {
  padding: 16px 8px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

/* 8. POPUP MODALS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fade) var(--motion-ease);
}

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

.modal-card {
  background-color: var(--bg-card);
  width: 500px;
  max-width: 90%;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform var(--motion-sheet) var(--motion-ease);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 14px 20px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  /* 스크롤해도 항상 상단 고정 */
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 17px;
  flex: 1;
  text-align: center;
}

/* 헤더 우측 취소/저장 버튼 그룹 */
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#schedule-form,
#memo-form {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* modal-footer 제거됨 — 취소/저장은 modal-header로 통합 */

/* 모달 상단 액션 바 — 완전 제거됨 (modal-header로 통합) */


/* 10. SECURITY TOAST POPUP */
.security-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 2500;
  background-color: #1e293b;
  color: #f8fafc;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--color-danger);
  width: 380px;
  max-width: 90%;
  transform: translateY(150px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.security-toast.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sec-toast-content {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.security-lock-icon {
  font-size: 24px;
  color: var(--color-danger);
  margin-top: 2px;
}

.sec-toast-content strong {
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}

.sec-toast-content p {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

/* 11. MOBILE DISPLAY STYLING (RESPONSIVENESS) */
.mobile-header {
  display: none;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }

  .main-content {
    flex: 1;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Hide Desktop elements */
  .desktop-header {
    display: none;
  }

  /* Show Mobile Header */
  .mobile-header {
    height: var(--header-height);
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 500;
  }

  .mobile-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 22px;
  }

  /* Adapt Sidebar for Mobile Drawers */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .mobile-only {
    display: block;
  }

  .sidebar-brand {
    justify-content: space-between;
  }

  /* Sections Spacing */
  .sections-container {
    padding: 6px 4px;
  }

  /* Lists adjustments */
  .section-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px; /* 12px → 6px */
    width: 100%;
    margin-bottom: 8px; /* 모바일 추가 축소 */
  }

  .section-title-wrapper {
    text-align: center;
    width: 100%;
  }

  .section-title-wrapper h2 {
    font-size: 16px; /* 20px → 16px */
  }

  .memo-section-heading-row {
    justify-content: center;
  }

  /* Filter adjustments */
  .filter-bar {
    padding: 12px 16px;
    gap: 16px;
  }

  .filter-group {
    width: 100%;
    justify-content: space-between;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control label {
    flex: 1;
    text-align: center;
  }

  .form-control-sm {
    width: 100%;
  }

  .date-filter-reset-wrapper {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  /* Cards layout adjustments */



  .assignee-badge {
    padding: 2px 6px;
    font-size: 11px;
    min-width: 50px;
  }


  /* Calendar cells adjustments */
  .calendar-container {
    padding: 2px 2px; /* 4px → 2px */
  }

  /* 모바일 캘린더 헤더 — 3-col grid 유지, 크기만 축소 */
  .calendar-header {
    margin-bottom: 6px;
  }

  .calendar-header-center {
    gap: 3px;
  }




  #calendar-month-year {
    font-size: 14px; /* 모바일 전용 축소 */
  }

  .calendar-today-pill {
    height: 22px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 11px;
  }

  .calendar-day-label {
    padding: 6px 2px;
    font-size: 11px;
  }

  .calendar-cell {
    height: 88px; /* 모바일 4개 기준 */
    padding: 2.5px;
    overflow: hidden;
  }

  .calendar-cell-header {
    margin-bottom: 2px;
    overflow: hidden;
    white-space: nowrap;
  }

  .calendar-date-num {
    font-size: 11px;
    width: 20px;
    height: 20px;
  }


  .calendar-events-container {
    gap: 1.5px;
  }

  .calendar-mini-event {
    font-size: 8.5px;
    padding: 1px 3px;
    border-radius: 2px;
    line-height: 1.1;
    margin: 0.5px 0;
  }


  /* Admin Settings layout */
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Recurrence Selector Styles */
.recurrence-days-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.day-checkbox-label {
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: all 0.2s ease;
}

.day-checkbox-label:hover {
  background-color: #e2e8f0;
}

.day-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Sticky Dashboard Header Container (Freeze Pane for Batch actions & Navigation) */
#inline-order-panel[hidden] { display:none !important; }
.inline-order-help { color:var(--text-muted); font-size:12px; line-height:1.5; margin:0 0 4px; }
#dashboard-section.is-order-editing > .filter-bar,
#dashboard-section.is-order-editing > .schedules-wrapper { display:none; }
#dashboard-section.is-order-editing .sticky-dashboard-header { position:static; }
#inline-order-root { min-width:0; max-width:100%; }

.sticky-dashboard-header {
  position: sticky;
  top: -16px; /* -32px → -16px (sections-container padding과 동기화) */
  z-index: 100;
  background-color: var(--bg-app);
  padding-top: 16px; /* 32px → 16px */
  margin-top: -16px; /* -32px → -16px */
  margin-bottom: 16px; /* 24px → 16px */
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.sticky-dashboard-header .list-date-navigation-wrapper {
  margin-bottom: 0;
}

.list-date-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  width: 100%;
}

.schedule-view-shortcuts,
.schedule-view-shortcuts .workflow-shortcuts {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.schedule-view-shortcuts { align-self: start; }

.list-date-header-row .list-date-header {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.list-date-header-text { min-width: 0; overflow-wrap: anywhere; }


.calendar-shortcut-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  padding: 0;
  flex-shrink: 0;
}

.calendar-shortcut-btn:hover {
  background-color: var(--bg-app);
  border-color: #cbd5e1;
  color: var(--color-primary);
}

/* List Date Navigation Styles - Expanded & Center-aligned */
.list-date-navigation-wrapper {
  display: flex;
  flex-direction: column;
  /* Stack vertically to allow clean centering */
  align-items: center;
  /* Center content horizontally */
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  background-color: var(--bg-card);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.list-date-navigation-wrapper .list-date-header {
  font-size: 24px;
  /* Larger title as requested */
  font-weight: 700;
  color: var(--text-main);
  border-left: none;
  /* Remove left border since it is centered */
  padding-left: 0;
  margin-bottom: 0;
  text-align: center;
}

.date-nav-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 28px;
  /* Rounder style */
  padding: 4px 12px;
  box-shadow: var(--shadow-sm);
}

.date-nav-buttons .icon-btn {
  width: 36px;
  /* Slightly larger buttons */
  height: 36px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.date-nav-buttons .icon-btn:hover {
  background-color: #f8fafc;
}

.secondary-btn-sm {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border: none;
  padding: 6px 16px;
  font-size: 14px;
  /* Larger font */
  font-weight: 700;
  cursor: pointer;
  border-radius: 14px;
  transition: all 0.2s ease;
}

.secondary-btn-sm:hover {
  background-color: var(--color-primary);
  color: var(--text-white);
}

/* Premium Compact Card Layout (Highly optimized for mobile & desktop density) */




.icon-btn-compact {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.2s ease;
  font-size: 13px;
}

.icon-btn-compact:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.icon-btn-compact.delete-btn {
  color: var(--color-danger);
}

.icon-btn-compact.delete-btn:hover {
  background-color: var(--color-danger-light);
}

.icon-btn-compact:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background-color: transparent !important;
}


.card-title-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  word-break: break-all;
  white-space: pre-wrap;
}



/* 근태 카드: 빨간 계열 강조 */


/* 근태 배지 */
.attendance-badge {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* 긴급 카드: 주황/앰버 강조 — 근태·중요보다 우선 표시 */


/* 긴급 배지 */

.card-memo-box {
  background-color: #f8fafc;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid #f1f5f9;
  line-height: 1.4;
}

/* Extra overrides for compact items on mobile screen sizes */
@media (max-width: 768px) {



  .card-title-text {
    font-size: 13px;
  }

  /* Form row stacks on mobile for better input sizing */
  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .form-row.schedule-date-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 7px;
  }

  .schedule-period-heading span {
    display: none;
  }

  .schedule-date-row .form-group {
    flex: 1 1 0;
  }

  .schedule-date-row input[type="date"] {
    height: 48px;
    padding: 7px 8px;
  }

  .schedule-date-separator {
    margin-top: 38px;
  }
}

/* Status toggle button styling on card right side */
.status-toggle-btn {
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  line-height: 1;
  box-sizing: border-box;
}

.status-toggle-btn.completed {
  background-color: #10b981;
  border-color: #059669;
  color: #ffffff;
}

/* hover 색은 마우스 있는 기기(PC)에서만 적용 — 폰(터치)에서 마지막 탭 자리에 hover가
   달라붙어 진행중 뱃지가 진하게 눌린 것처럼 보이는 잔상을 방지 */
@media (hover: hover) {
  .status-toggle-btn.completed:hover {
    background-color: #059669;
    color: #ffffff;
    border-color: #047857;
  }
}

.status-toggle-btn.pending {
  background-color: #fff7ed;
  border-color: #fb923c;
  color: #ea580c;
  font-weight: 800;
}

@media (hover: hover) {
  .status-toggle-btn.pending:hover {
    background-color: #fb923c;
    color: #ffffff;
    border-color: #ea580c;
  }
}

.status-toggle-btn.important {
  background-color: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
  font-weight: 800;
}

@media (hover: hover) {
  .status-toggle-btn.important:hover {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #dc2626;
  }
}

/* Batch Action Bar Styling */
.batch-action-bar {
  background-color: var(--color-primary-light);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.batch-count-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
}

.batch-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}


.batch-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.batch-btn.clear-btn {
  background-color: #f1f5f9;
  color: var(--text-muted);
  border-color: #cbd5e1;
}

.batch-btn.clear-btn:hover {
  background-color: #e2e8f0;
  color: var(--text-main);
}

/* Mobile responsive styles for Batch Bar and Navigation Header */
@media (max-width: 768px) {
  .sticky-dashboard-header {
    position: sticky;
    top: -6px;
    /* Offset the parent padding on mobile */
    z-index: 100;
    background-color: var(--bg-app);
    padding-top: 6px;
    margin-top: -6px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .list-date-navigation-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
  }

  .list-date-navigation-wrapper .list-date-header {
    font-size: 15px;
    border-left-width: 0;
    padding-left: 0;
  }

  .date-nav-buttons {
    width: auto;
    justify-content: center;
    padding: 2px 6px;
  }

  .date-nav-buttons .icon-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .secondary-btn-sm {
    flex-grow: 0;
    text-align: center;
    padding: 4px 12px;
    font-size: 11px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .batch-action-bar {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .batch-info {
    justify-content: space-between;
    width: 100%;
  }

  .batch-actions-group {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }



  .batch-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* Holiday Display Styles */
.holiday-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: var(--shadow-sm);
}

.calendar-cell.holiday-cell .calendar-date-num {
  color: var(--color-danger);
  font-weight: 700;
}

.calendar-holiday-name {
  font-size: 9px;
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 700;
  max-width: 75px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .calendar-holiday-name {
    font-size: 7px;
    max-width: 45px;
    padding: 1px 2px;
  }
}

/* Firebase Connection card styling */
.status-badge-connection {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge-connection.offline {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.status-badge-connection.online {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #10b981;
}

.firebase-card .form-control:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.status-detail-text {
  flex-grow: 1;
  text-align: right;
}

@media (max-width: 768px) {
  .firebase-status-banner {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .status-detail-text {
    text-align: left;
    width: 100%;
  }
}

/* 14. SECURITY LOCK SCREEN OVERLAY */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.99));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  /* Ensure it overlays EVERYTHING, even modals */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px;
}

.lock-screen-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lock-screen-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 40px;
  width: 450px;
  max-width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  color: #f8fafc;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lock-screen-overlay.active .lock-screen-card {
  transform: scale(1) translateY(0);
}

.lock-icon-wrapper {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--color-primary), #1d4ed8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
  font-size: 28px;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  animation: pulse-lock 2s infinite;
}

@keyframes pulse-lock {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(37, 99, 235, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.lock-screen-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.lock-screen-card p {
  font-size: 13px;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 30px;
}

/* 15. MOBILE MOBILE-ONLY CUSTOM RESPONSIVE OVERRIDES */
@media (max-width: 768px) {
  #schedule-form,
  #memo-form {
    padding: 16px;
  }

  .lock-screen-card {
    padding: 24px 16px;
    border-radius: 16px;
  }

  .lock-icon-wrapper {
    width: 56px;
    height: 56px;
    font-size: 22px;
    margin-bottom: 16px;
  }

  .lock-screen-card p {
    margin-bottom: 20px;
  }
}

/* Mobile Calendar Search Card Responsive Override */


/* Search Results Scrollable Container */
#global-calendar-search-results,
#mobile-calendar-search-results {
  max-height: 60vh;
  overflow-y: auto;
  position: relative;
  padding-right: 4px;
}

@media (max-width: 768px) {

  /* Bottom Sheet Modal for Mobile - 완전 고정 */
  .modal-overlay {
    align-items: flex-end;
    /* iOS 키보드 올라와도 오버레이는 항상 전체 화면 고정 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    /* iOS Safari 100vh 버그 방지 */
    height: -webkit-fill-available;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    /* 화면의 최대 90%까지, 키보드 올라와도 내부 스크롤로 처리 */
    max-height: 90vh;
    max-height: 90dvh;
    /* 동적 뷰포트 높이 (최신 브라우저) */
    border-radius: 20px 20px 0 0;
    margin: 0;
    /* 바닥에 완전히 고정 */
    position: relative;
    transform: translateY(100%);
    transition: transform var(--motion-sheet) var(--motion-ease);
    /* iOS 안전 영역(홈 바) 여백 확보 */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* 내부 스크롤 안정화 */
    -webkit-overflow-scrolling: touch;
    /* 모달 자체가 흔들리지 않도록 */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  .modal-overlay.active .modal-card {
    transform: translateY(0);
  }

  /* 모바일에서 폼 내부 스크롤 안정화 */
  #schedule-form,
  #memo-form {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* 모바일에서 input 포커스시 화면이 튀는 현상 방지 */
  /* iOS가 키보드 올릴 때 뷰포트를 강제 스크롤하는 것을 차단 */
  .modal-overlay {
    /* 터치 이벤트가 배경으로 전파되지 않도록 */
    touch-action: none;
  }

  /* 모달 내부만 스크롤 허용 */
  .modal-card {
    touch-action: pan-y;
  }

  #schedule-form,
  #memo-form {
    touch-action: pan-y;
  }

  /* 모바일 전용: modal-header 버튼 크기 축소 */
  .modal-header {
    padding: 12px 16px;
  }

  .modal-header h3 {
    font-size: 15px;
  }

  .modal-header-actions .secondary-btn,
  .modal-header-actions .primary-btn {
    padding: 8px 14px;
    font-size: 13px;
    height: 36px;
  }

  #form-delete-btn {
    padding: 8px 10px;
    font-size: 12px;
    height: 36px;
  }

  /* modal-action-bar 완전 제거됨 — 표시 안 함 */

  /* 폼 안 input/select/textarea 클릭시 카드 자체가 움직이지 않도록 */
  .modal-card .form-control,
  .modal-card input,
  .modal-card select,
  .modal-card textarea {
    /* transform 사용 안 함 - 레이아웃 이동 최소화 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    position: relative;
    z-index: 1;
  }

  /* Form spacing normalization on mobile */

  /* Prevent iOS auto-zoom in on focus by making inputs 16px */
  input,
  select,
  textarea,
  .form-control {
    font-size: 16px !important;
  }
}

/* Workflow menu preparation */




#add-schedule-btn[hidden], [data-workflow-target][hidden] { display:none!important; }
.workflow-shortcuts { display:inline-flex; flex-wrap:wrap; gap:6px; vertical-align:middle; }
.notice-list { display:grid; gap:12px; }
.notice-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; width:100%; text-align:left; cursor:pointer; color:var(--text-main); }
.notice-row-title { font-weight:700; overflow-wrap:anywhere; }
.notice-row .notice-meta { grid-column:1; }
.notice-badge { grid-column:2; grid-row:1 / 3; align-self:center; font-size:12px; color:var(--text-muted); }
.notice-badge.unread { color:#b91c1c; font-weight:700; }
.notice-meta { font-size:13px; color:var(--text-muted); margin:8px 0; }
.notice-actions { display:flex; gap:8px; flex-wrap:wrap; }
.notice-status { min-height:24px; margin-bottom:8px; color:var(--text-muted); overflow-wrap:anywhere; }
.notice-status.is-error { color:#b91c1c; }
.notice-editor { display:flex; flex-direction:column; gap:12px; }
.notice-editor .form-control { box-sizing:border-box; width:100%; min-width:0; max-width:100%; }
.notice-editor textarea { resize:vertical; min-height:160px; }
.notice-pin { display:flex; align-items:center; gap:8px; }
.notice-pin input { flex:none; width:18px; height:18px; }
.notice-detail h3 { font-size:20px; margin:20px 0 8px; overflow-wrap:anywhere; }
.notice-body { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.8; margin:20px 0; }
.notice-readers { border-top:1px solid var(--border-color); margin-top:20px; padding-top:16px; }
.notice-readers ul { margin:12px 0; padding-left:20px; line-height:1.8; }
.notice-empty { text-align:center; color:var(--text-muted); }
#legacy-announcements-root, #legacy-announcements-root .card { min-width:0; max-width:100%; box-sizing:border-box; }
#legacy-order-root { min-width:0; max-width:100%; }
.workflow-page-heading { margin:0 0 12px; font-size:18px; text-align:center; }
.workflow-filter-card { margin:0 0 16px; padding:14px 16px; background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-md); box-shadow:var(--shadow-sm); min-width:0; }
.workflow-filter-card label { display:flex; align-items:center; gap:12px; min-width:0; font-size:13px; font-weight:600; color:var(--text-muted); }
.workflow-filter-card .form-control { flex:1; min-width:0; width:0; max-width:100%; height:40px; padding:8px 10px; }
.workflow-date-card { margin-bottom:12px; }
.workflow-date-picker { display:flex; align-items:center; justify-content:center; position:relative; min-width:0; min-height:32px; font-size:18px; font-weight:700; text-align:center; cursor:pointer; }
.workflow-date-picker > span { min-width:0; overflow-wrap:anywhere; }
.workflow-date-card .workflow-date-input { position:absolute; inset:0; width:100%; max-width:100%; min-width:0; height:100%; margin:0; padding:0; opacity:0; cursor:pointer; box-sizing:border-box; }
.workflow-date-picker:focus-within { outline:2px solid var(--color-primary); outline-offset:3px; border-radius:4px; }
.workflow-date-card .calendar-shortcut-btn[hidden] { display:none; }
.notice-header-actions { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
@media(max-width:768px) {
  .workflow-page-heading { font-size:16px; margin-bottom:12px; }
  .workflow-date-picker { font-size:15px; }
  .workflow-filter-card { padding:12px; }
}
.legacy-order-help { font-size:12px; line-height:1.6; color:var(--text-muted); margin:6px 0; }
@media(max-width:640px) { #legacy-announcements-root .section-header { flex-wrap:wrap; gap:12px; } .notice-row { padding:16px; } }
