/**
 * 노무관리 앱 - 프로그램형 UI 스타일
 * Topbar + Sidebar + Workspace 구조
 */

:root {
  /* Layout Architecture */
  --nomu-sidebar-width: 216px;
  --nomu-topbar-height: 60px;
  --nomu-radius: 12px;
  --nomu-radius-lg: 20px;
  --nomu-radius-xl: 30px;

  /* --- Default Theme (Noir / Black) --- */
  color-scheme: dark;
  --nomu-accent: #38bdf8;
  --nomu-accent-glow: rgba(56, 189, 248, 0.4);
  --nomu-bg: #000000;
  --nomu-body-bg: #000000;
  --nomu-card: #0a0a0a;

  /* Sidebar Noir */
  --nomu-sidebar-bg: #07090d;
  --nomu-sidebar-border: rgba(255, 255, 255, 0.08);
  --nomu-sidebar-hover: rgba(56, 189, 248, 0.05);
  --nomu-sidebar-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
  --nomu-sidebar-gradient: linear-gradient(180deg, rgba(7, 9, 13, 0.98) 0%, rgba(3, 5, 8, 0.98) 100%);

  /* Glass Systems */
  --nomu-glass: rgba(255, 255, 255, 0.03);
  --nomu-glass-strong: rgba(10, 10, 10, 0.7);
  --nomu-glass-border: rgba(255, 255, 255, 0.08);

  /* Typography & Borders */
  --nomu-border: rgba(255, 255, 255, 0.1);
  --nomu-text: rgba(255, 255, 255, 0.95);
  --nomu-text-rgb: 255, 255, 255;
  --nomu-muted: rgba(255, 255, 255, 0.6);
  --nomu-hover: rgba(255, 255, 255, 0.06);
  --nomu-accent-text: #0f172a;

  /* Components */
  --nomu-input-bg: rgba(0, 0, 0, 0.5);
  --nomu-input-border: rgba(255, 255, 255, 0.12);
  --nomu-modal-bg: rgba(10, 10, 10, 0.96);
  --nomu-overlay: rgba(0, 0, 0, 0.7);
  --nomu-table-header: rgba(255, 255, 255, 0.02);

  /* Semantic Colors */
  --nomu-success: #10b981;
  --nomu-warning: #f59e0b;
  --nomu-danger: #ef4444;

  /* Shadows */
  --nomu-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
  --nomu-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.6);
  --nomu-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.8);

  /* Scrollbars */
  --nomu-scroll-track: #000000;
  --nomu-scroll-thumb: rgba(255, 255, 255, 0.12);

  /* Sidebar Toggle */
  --nomu-toggle-bg: rgba(255, 255, 255, 0.03);
  --nomu-toggle-border: rgba(255, 255, 255, 0.08);
  --nomu-toggle-color: rgba(255, 255, 255, 0.75);
  --nomu-toggle-shadow: none;
}

html[data-theme="white"] {
  /* --- Premium White Theme (Slate / Ice) --- */
  color-scheme: light;
  --nomu-accent: #0284c7;
  --nomu-accent-glow: rgba(2, 132, 199, 0.15);
  --nomu-bg: #f1f5f9;
  /* Slate 100 */
  --nomu-body-bg: #f8fafc;
  /* Slate 50 */
  --nomu-card: #ffffff;

  /* Sidebar Slate */
  --nomu-sidebar-bg: #ffffff;
  --nomu-sidebar-border: rgba(0, 0, 0, 0.12);
  --nomu-sidebar-hover: #f1f5f9;
  --nomu-sidebar-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
  --nomu-sidebar-gradient: #ffffff;

  /* Glass Systems */
  --nomu-glass: rgba(255, 255, 255, 0.6);
  --nomu-glass-strong: rgba(255, 255, 255, 0.95);
  --nomu-glass-border: rgba(0, 0, 0, 0.12);

  /* Typography & Borders */
  --nomu-border: rgba(0, 0, 0, 0.15);
  --nomu-text: #020617;
  /* Slate 950 (Previously Slate 900 #0f172a) */
  --nomu-text-rgb: 2, 6, 23;
  --nomu-muted: #475569;
  /* Slate 600 (Previously Slate 500 #64748b) */
  --nomu-hover: #f1f5f9;
  --nomu-accent-text: #ffffff;

  /* Components */
  --nomu-input-bg: #ffffff;
  --nomu-input-border: #64748b;
  /* Slate 500 (Previously Slate 300 #94a3b8) */
  --nomu-modal-bg: #ffffff;
  --nomu-overlay: rgba(15, 23, 42, 0.4);
  --nomu-table-header: #f8fafc;

  /* Semantic Colors */
  --nomu-success: #059669;
  --nomu-warning: #d97706;
  --nomu-danger: #dc2626;

  /* Shadows */
  --nomu-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --nomu-shadow-md: 0 10px 25px rgba(0, 0, 0, 0.05);
  --nomu-shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.08);

  /* Scrollbars */
  --nomu-scroll-track: #f1f5f9;
  --nomu-scroll-thumb: #cbd5e1;

  /* Sidebar Toggle White (Premium Floating Look) */
  --nomu-toggle-bg: #ffffff;
  --nomu-toggle-border: rgba(0, 0, 0, 0.06);
  --nomu-toggle-color: #475569;
  --nomu-toggle-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);

  /* White Mode Glassmorphism Dropdown Variables */
  --nomu-glass-dropdown-bg: rgba(255, 255, 255, 0.8);
  --nomu-glass-dropdown-blur: blur(16px);
  --nomu-glass-dropdown-border: rgba(0, 0, 0, 0.08);
  --nomu-glass-dropdown-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --nomu-glass-dropdown-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.no-scroll {
  overflow: hidden !important;
}

/* 노무관리 앱 페이지에서 상단 헤더 숨기기 */
.nomu-app-shell {
  min-height: 100vh;
  background: var(--nomu-body-bg);
  color: var(--nomu-text);
  display: flex;
  flex-direction: column;
  margin-top: 0;
  padding-top: 0;
}

/* 노무관리 앱이 있는 페이지에서 헤더와 푸터 숨기기 (모달 및 스크롤 버튼 제외) */
body .nomu-app-shell~*:not(.modal):not([id*="Modal"]):not(.custom-modal-overlay):not(#scrollTopBtn),
body>header.main-header:has(~ .nomu-app-shell),
body>footer:has(~ .nomu-app-shell) {
  display: none !important;
}

/* Topbar */
.nomu-topbar {
  height: var(--nomu-topbar-height);
  background: var(--nomu-card);
  border-bottom: 1px solid var(--nomu-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 900;
  margin: 0;
  color: var(--nomu-accent);
}

.company-name {
  color: var(--nomu-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--nomu-border);
  background: var(--nomu-glass);
  color: var(--nomu-text);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon:hover {
  background: var(--nomu-hover);
  border-color: var(--nomu-accent);
  color: var(--nomu-accent);
  transform: translateY(-1px);
}

/* App Body */
.nomu-app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.nomu-sidebar {
  width: var(--nomu-sidebar-width);
  background: var(--nomu-sidebar-bg);
  background-image: var(--nomu-sidebar-gradient);
  border-right: 1px solid var(--nomu-sidebar-border);
  overflow-y: auto;
  overflow-x: hidden;
  /* prevent horizontal scrollbar in sidebar */
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: var(--nomu-sidebar-shadow);
}

.nomu-sidebar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.35), transparent);
  opacity: 0.9;
  pointer-events: none;
}

html[data-theme="white"] .nomu-sidebar::before {
  display: none;
}

.nomu-sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.25), transparent 40%, rgba(255, 255, 255, 0.08));
  pointer-events: none;
}

html[data-theme="white"] .nomu-sidebar::after {
  background: var(--nomu-border);
}

/* Sidebar scrollbar (premium) */
.nomu-sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--nomu-scroll-thumb) transparent;
}

.nomu-sidebar::-webkit-scrollbar {
  width: 8px;
}

.nomu-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.nomu-sidebar::-webkit-scrollbar-thumb {
  background: var(--nomu-scroll-thumb);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.nomu-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--nomu-accent);
  background-clip: padding-box;
}

/* Sidebar header (brand + collapse toggle) */
.nomu-sidebar-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px 10px;
  background: var(--nomu-sidebar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--nomu-sidebar-border);
}

.nomu-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nomu-sidebar-brand__dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 1), rgba(59, 130, 246, 0.8));
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
  flex-shrink: 0;
}

.nomu-sidebar-brand__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nomu-sidebar-brand__title {
  font-weight: 950;
  letter-spacing: -0.02em;
  color: var(--nomu-text);
  line-height: 1.1;
}

.nomu-sidebar-brand__sub {
  font-size: 0.78rem;
  color: var(--nomu-muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nomu-sidebar-collapse-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--nomu-toggle-border);
  background: var(--nomu-toggle-bg);
  color: var(--nomu-toggle-color);
  box-shadow: var(--nomu-toggle-shadow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  z-index: 5;
}

.nomu-sidebar-collapse-btn:hover {
  border-color: var(--nomu-accent);
  color: var(--nomu-accent);
  background: var(--nomu-sidebar-hover);
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.nomu-sidebar-collapse-btn:active {
  transform: scale(0.95);
}

.nomu-sidebar-collapse-btn i {
  transition: transform 0.2s ease;
}

/* Workspace needs left margin to account for fixed sidebar */
.nomu-workspace {
  margin-left: var(--nomu-sidebar-width);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 12px;
  overflow-x: hidden;
  /* defensive: ensure no horizontal scroll from children */
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 10px;
}

.sidebar-section-title {
  padding: 0 10px;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  color: var(--nomu-muted);
  text-transform: uppercase;
  opacity: 0.8;
}

.sidebar-section--end {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--nomu-border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  border-radius: 14px;
  color: var(--nomu-muted);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s;
  position: relative;
  border: 1px solid transparent;
  background: transparent;
}

.nav-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapsed (icon-only) mode */
.sidebar-collapsed .nomu-sidebar {
  width: 76px;
}

.sidebar-collapsed .nomu-workspace {
  margin-left: 76px;
}

.sidebar-collapsed .nomu-sidebar-brand__text,
.sidebar-collapsed .sidebar-section-title,
.sidebar-collapsed .nav-text,
.sidebar-collapsed .nav-item small {
  display: none !important;
}

.sidebar-collapsed .nomu-sidebar-collapse-btn i {
  transform: rotate(180deg);
}

.sidebar-collapsed .sidebar-nav {
  padding: 14px 10px;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 5px 10px;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.sidebar-collapsed .nav-item:hover,
.sidebar-collapsed .nav-item.active {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.sidebar-collapsed .nav-item.active::before {
  display: none !important;
}

.sidebar-collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--nomu-card);
  border: 1px solid var(--nomu-border);
  box-shadow: none;
  color: var(--nomu-text);
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: all 0.15s ease;
  z-index: 10;
}

.sidebar-collapsed .nav-item:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Smooth layout transitions */
.nomu-sidebar,
.nomu-workspace {
  transition: width 0.2s ease, margin-left 0.2s ease;
}

.nav-item i {
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1rem;
  color: var(--nomu-muted);
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: var(--nomu-hover);
  color: var(--nomu-text);
  border-color: var(--nomu-border);
}

.nav-item.active {
  background: var(--nomu-hover);
  color: var(--nomu-accent);
  border-color: var(--nomu-accent-glow);
  box-shadow: var(--nomu-shadow-sm);
}

.nav-item.active::before {
  display: none;
}

.nav-item.active i {
  color: rgba(56, 189, 248, 0.95);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.nav-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-item.disabled:hover {
  background: transparent;
}

.nav-item small {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--nomu-muted);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--nomu-border);
  background: var(--nomu-glass);
}

/* Workspace */
.nomu-workspace {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 32px 32px;
  background: var(--nomu-body-bg);
}

.workspace-header {
  margin-bottom: 24px;
  padding-top: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--nomu-border);
}

.workspace-header h2 {
  font-size: 1.75rem;
  font-weight: 950;
  margin: 0;
  line-height: 1.2;
  color: var(--nomu-text);
}

.workspace-header .muted {
  color: var(--nomu-muted);
  font-size: 0.95rem;
  margin: 0;
}

.workspace-content {
  width: 100%;
  max-width: 100%;
}

/* Cards */
.welcome-card,
.form-card {
  background: var(--nomu-card);
  border: 1px solid var(--nomu-border);
  border-radius: var(--nomu-radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--nomu-shadow-md);
  position: relative;
  overflow: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
  background: var(--nomu-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--nomu-glass-border);
  border-radius: var(--nomu-radius);
  box-shadow: var(--nomu-shadow-sm);
}

.glass-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--nomu-radius);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  background: var(--nomu-glass);
  border-color: var(--nomu-accent);
  transform: translateY(-4px);
  box-shadow: var(--nomu-shadow-md);
}

.welcome-card h3 {
  font-size: 1.5rem;
  font-weight: 950;
  margin: 0 0 12px 0;
}

.welcome-card p {
  color: var(--nomu-muted);
  margin: 0 0 24px 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.info-card {
  background: var(--nomu-card);
  border: 1px solid var(--nomu-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.info-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--nomu-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.info-content h4 {
  font-size: 1.1rem;
  font-weight: 900;
  margin: 0 0 8px 0;
}

.info-content p {
  font-size: 0.9rem;
  color: var(--nomu-muted);
  margin: 0;
  line-height: 1.5;
}

/* Forms */
.form-section {
  margin-bottom: 32px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row .form-group {
    margin-bottom: 20px;
  }
}

.form-section h3 {
  font-size: 1.25rem;
  font-weight: 950;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--nomu-border);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 850;
  color: var(--nomu-text);
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--nomu-border);
  background: var(--nomu-input-bg);
  color: var(--nomu-text);
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--nomu-accent);
  background: var(--nomu-input-bg);
  box-shadow: 0 0 0 3px var(--nomu-accent-glow);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--nomu-border);
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--nomu-accent);
  color: var(--nomu-accent-text) !important;
  box-shadow: var(--nomu-shadow-sm);
}

.btn-primary:hover {
  background: var(--nomu-accent);
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: var(--nomu-shadow-md);
}

.btn-secondary:hover {
  background: var(--nomu-hover);
  color: var(--nomu-accent);
  border-color: var(--nomu-accent);
  transform: translateY(-1px);
  box-shadow: var(--nomu-shadow-sm);
}

/* Premium Black Theme for Inputs and Selects (Global) */
.nomu-input,
.form-group input,
.form-group select,
.form-group textarea,
.date-selector input,
.attendance-controls input {
  background: var(--nomu-input-bg) !important;
  border: 1px solid var(--nomu-input-border) !important;
  color: var(--nomu-text) !important;
  border-radius: 10px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  font-family: inherit;
}

html[data-theme="black"] .nomu-input,
html[data-theme="black"] .form-group input,
/* etc */
[data-theme="black"] {
  color-scheme: dark;
}

html[data-theme="white"] .nomu-input,
html[data-theme="white"] .form-group input {
  color-scheme: light;
}

.nomu-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.date-selector input:focus,
.attendance-controls input:focus {
  border-color: var(--nomu-accent) !important;
  background: var(--nomu-input-bg) !important;
  box-shadow: 0 0 0 3px var(--nomu-accent-glow) !important;
}

/* Specific Select Styling */
select.nomu-input,
.form-group select {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px !important;
  padding-right: 36px !important;
  cursor: pointer;
}

.nomu-input option,
.form-group select option {
  background: var(--nomu-card);
  color: var(--nomu-text);
  padding: 12px;
}

/* Number inputs (years/months) */
input[type="number"].nomu-input,
.date-selector input[type="number"],
.attendance-controls input[type="number"] {
  text-align: center;
}

/* Premium Table Style */
.nomu-table-container {
  overflow-x: auto;
  border-radius: var(--nomu-radius);
  border: 1px solid var(--nomu-border);
  background: var(--nomu-card);
  box-shadow: var(--nomu-shadow-sm);
}

.nomu-table {
  width: 100%;
  border-collapse: collapse;
}

.nomu-table th {
  background: var(--nomu-table-header);
  padding: 14px 16px;
  font-weight: 950;
  text-align: center;
  font-size: 0.88rem;
  color: var(--nomu-accent);
  border-bottom: 1px solid var(--nomu-border);
}

.nomu-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--nomu-border);
  font-size: 0.9rem;
  color: var(--nomu-text);
  text-align: center;
}

.nomu-table tr:hover td {
  background: var(--nomu-hover);
}

/* Responsive */
@media (max-width: 768px) {
  .nomu-sidebar {
    width: 200px;
  }

  .nomu-workspace {
    padding: 20px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nomu-app-body {
    flex-direction: column;
  }

  .nomu-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--nomu-sidebar-border);
    max-height: 200px;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 12px;
  }

  .nav-item {
    white-space: nowrap;
    min-width: 120px;
  }
}

/* 블랙 테마 스크롤바 스타일 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--nomu-scroll-track);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Firefox 스크롤바 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--nomu-scroll-thumb) var(--nomu-scroll-track);
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--nomu-overlay);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.modal-content {
  background: var(--nomu-modal-bg);
  border: 1px solid var(--nomu-border);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  position: relative;
  overflow: hidden;
  /* 모서리 라운딩 침범 방지 */
  animation: modalSlideIn 0.3s ease-out forwards;
}

.modal-content h3 {
  color: var(--nomu-text) !important;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-form-scroll {
  overflow-y: auto;
  padding: 24px;
}

/* Premium Custom Time Picker Styles */
.nomu-timepicker-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--nomu-overlay);
  backdrop-filter: blur(10px);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nomu-timepicker-container.active {
  display: flex !important;
  opacity: 1;
}

.nomu-timepicker-modal {
  background: var(--nomu-modal-bg);
  border: 1px solid var(--nomu-border);
  border-radius: 24px;
  width: 320px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.nomu-timepicker-container.active .nomu-timepicker-modal {
  transform: translateY(0);
}

.nomu-timepicker-header {
  text-align: center;
  margin-bottom: 24px;
}

.nomu-timepicker-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--nomu-accent);
}

.nomu-timepicker-selectors {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  margin-bottom: 24px;
  position: relative;
}

.nomu-timepicker-wheel-container {
  flex: 1;
  height: 250px;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to bottom, transparent 10%, black 40%, black 60%, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 10%, black 40%, black 60%, transparent 90%);
}

.nomu-timepicker-wheel {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  padding: 100px 0;
}

.nomu-timepicker-item {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nomu-muted);
  transition: opacity 0.1s linear;
  /* Remove transform transition to avoid conflict with JS loop */
  transform-origin: center center;
}

.nomu-timepicker-item.active {
  color: var(--nomu-text);
  /* font-size handled by JS scale */
  font-weight: 900;
}

.nomu-timepicker-separator {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--nomu-accent);
  padding-bottom: 4px;
}

.nomu-timepicker-selection-overlay {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 48px;
  margin-top: -24px;
  border-top: 1px solid var(--nomu-border);
  border-bottom: 1px solid var(--nomu-border);
  background: rgba(255, 255, 255, 0.03);
  pointer-events: none;
  border-radius: 8px;
}

.nomu-timepicker-ampm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nomu-timepicker-ampm-btn {
  padding: 8px 12px;
  border: 1px solid var(--nomu-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--nomu-muted);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.nomu-timepicker-ampm-btn.active {
  background: var(--nomu-accent);
  color: #000;
  border-color: var(--nomu-accent);
}

.nomu-timepicker-footer {
  display: flex;
  gap: 12px;
}

.nomu-timepicker-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-weight: 950;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.nomu-timepicker-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--nomu-muted);
}

.nomu-timepicker-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--nomu-text);
}

.nomu-timepicker-btn-confirm {
  background: var(--nomu-accent);
  color: #000;
}

.nomu-timepicker-btn-confirm:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
}

/* Time Input Wrapper */
.nomu-time-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.nomu-time-input-wrapper input {
  flex: 1;
  padding-right: 36px !important;
}

.nomu-timepicker-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--nomu-accent);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  opacity: 0.8;
  z-index: 5;
}

.nomu-timepicker-toggle:hover {
  opacity: 1;
}

/* Hide native browser icons for time/date inputs to prevent duplicates */
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-inner-spin-button,
input[type="time"]::-webkit-clear-button,
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
  background: none !important;
}

input[type="time"],
input[type="date"] {
  -webkit-appearance: none !important;
  -moz-appearance: textfield !important;
  appearance: none !important;
  background-image: none !important;
}

input[type="time"]::-moz-calendar-picker-indicator,
input[type="date"]::-moz-calendar-picker-indicator {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
}

/* Mobile Responsiveness & Touch Optimization */
@media (max-width: 768px) {

  /* Layout Adjustments */
  .nomu-workspace {
    padding: 16px;
    margin-left: 0;
    width: 100%;
  }

  /* Grid Collapse - Force single column for most inputs */
  .form-row,
  .form-row-5,
  .form-row-6,
  .form-row-8,
  .form-row-9 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Touch Targets */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="time"],
  select,
  .nomu-input,
  .nomu-select {
    min-height: 50px;
    font-size: 16px;
  }

  button,
  .btn,
  .nomu-btn {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Card Padding */
  .labor-condition-card {
    padding: 20px;
  }

  /* Typography */
  .workspace-header h2 {
    font-size: 1.5rem;
  }

  /* Payroll Search Input */
  .payroll-search-input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--nomu-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--nomu-text);
    font-size: 0.9rem;
    outline: none;
    width: 200px;
    margin-left: 100px;
  }

  /* Timepicker Modal Mobile */
  .nomu-timepicker-modal {
    width: 90%;
    max-width: 340px;
  }

  .payroll-mobile-list {
    display: none;
  }

  /* Hide sidebar on mobile (if not already handled by JS, this is a safe default for "app" feel) */
  /* Sidebar Mobile: Hidden by default with slide effect */
  /* Sidebar Mobile: Top Dropdown (Popup Style) */
  .nomu-sidebar {
    display: block;
    position: fixed;
    top: 50px;
    /* Below the header/toggle */
    left: 0;
    width: 100%;
    /* Full width */
    height: auto;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--nomu-card);
    border-bottom: 1px solid var(--nomu-border);
    border-right: none;

    /* Transition: Slide Down */
    transform: translateY(-150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  }

  .nomu-sidebar.active {
    transform: translateY(0);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  }

  /* Workspace: Remove margin */
  .nomu-workspace {
    margin-left: 0 !important;
    padding: 80px 16px !important;
    /* Reverted to 80px per user request */
    width: 100%;
    margin-top: 0 !important;

    /* Utility: Force Column on Mobile */
    /* Stack Controls Vertically */
    .payroll-controls {
      flex-direction: column;
      align-items: stretch;
      gap: 16px;
    }

    .payroll-controls>div {
      flex-wrap: wrap;
      gap: 12px !important;
    }

    .payroll-controls .date-selector {
      justify-content: center;
      width: 100%;
    }

    .flex-column-mobile {
      display: flex;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 16px !important;
    }

    .flex-column-mobile>div,
    .flex-column-mobile>button {
      width: 100%;
      margin-left: 0 !important;
    }

    /* Reset overrides */
    .flex-column-mobile h2,
    .flex-column-mobile h3 {
      margin-bottom: 8px !important;
    }

    /* Search Input: Inline with Checkbox */
    .payroll-search-input {
      width: auto !important;
      flex: 1;
      /* Take remaining space */
      min-width: 120px;
      /* Prevent being too small */
      margin-left: 0 !important;
      margin-top: 0 !important;
      order: unset;
      /* Restore natural order */
    }

    /* Container adjustments */
    .payroll-controls>div {
      flex-wrap: wrap;
      gap: 8px !important;
      /* Reduced gap */
      justify-content: space-between;
      /* Spread items */
    }

    /* Action Group: Badge + Buttons on one line */
    .payroll-action-group {
      display: flex;
      align-items: center;
      justify-content: center;
      /* Center align items */
      gap: 8px;
      width: 100%;
      margin-top: 12px;
    }

    .payroll-action-group .badge-status {
      margin: 0 !important;
      /* Override auto margins */
      white-space: nowrap;
    }
  }
}

/* 테이블 행 등장 애니메이션 (사용자 요청: 급여 관리 페이지 스타일 적용) */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.attendance-table tbody tr,
.payroll-table tbody tr,
.data-table tbody tr,
.backup-table tbody tr,
.vacation-table tbody tr {
  animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

/* 순차적 등장 딜레이 (최대 15개 행) */
.attendance-table tbody tr:nth-child(1),
.payroll-table tbody tr:nth-child(1),
.data-table tbody tr:nth-child(1),
.backup-table tbody tr:nth-child(1),
.vacation-table tbody tr:nth-child(1) {
  animation-delay: 0.05s;
}

.attendance-table tbody tr:nth-child(2),
.payroll-table tbody tr:nth-child(2),
.data-table tbody tr:nth-child(2),
.backup-table tbody tr:nth-child(2),
.vacation-table tbody tr:nth-child(2) {
  animation-delay: 0.1s;
}

.attendance-table tbody tr:nth-child(3),
.payroll-table tbody tr:nth-child(3),
.data-table tbody tr:nth-child(3),
.backup-table tbody tr:nth-child(3),
.vacation-table tbody tr:nth-child(3) {
  animation-delay: 0.15s;
}

.attendance-table tbody tr:nth-child(4),
.payroll-table tbody tr:nth-child(4),
.data-table tbody tr:nth-child(4),
.backup-table tbody tr:nth-child(4),
.vacation-table tbody tr:nth-child(4) {
  animation-delay: 0.2s;
}

.attendance-table tbody tr:nth-child(5),
.payroll-table tbody tr:nth-child(5),
.data-table tbody tr:nth-child(5),
.backup-table tbody tr:nth-child(5),
.vacation-table tbody tr:nth-child(5) {
  animation-delay: 0.25s;
}

.attendance-table tbody tr:nth-child(6),
.payroll-table tbody tr:nth-child(6),
.data-table tbody tr:nth-child(6),
.backup-table tbody tr:nth-child(6),
.vacation-table tbody tr:nth-child(6) {
  animation-delay: 0.3s;
}

.attendance-table tbody tr:nth-child(7),
.payroll-table tbody tr:nth-child(7),
.data-table tbody tr:nth-child(7),
.backup-table tbody tr:nth-child(7),
.vacation-table tbody tr:nth-child(7) {
  animation-delay: 0.35s;
}

.attendance-table tbody tr:nth-child(8),
.payroll-table tbody tr:nth-child(8),
.data-table tbody tr:nth-child(8),
.backup-table tbody tr:nth-child(8),
.vacation-table tbody tr:nth-child(8) {
  animation-delay: 0.4s;
}

.attendance-table tbody tr:nth-child(9),
.payroll-table tbody tr:nth-child(9),
.data-table tbody tr:nth-child(9),
.backup-table tbody tr:nth-child(9),
.vacation-table tbody tr:nth-child(9) {
  animation-delay: 0.45s;
}

.attendance-table tbody tr:nth-child(10),
.payroll-table tbody tr:nth-child(10),
.data-table tbody tr:nth-child(10),
.backup-table tbody tr:nth-child(10),
.vacation-table tbody tr:nth-child(10) {
  animation-delay: 0.5s;
}

.attendance-table tbody tr:nth-child(11),
.payroll-table tbody tr:nth-child(11),
.data-table tbody tr:nth-child(11),
.backup-table tbody tr:nth-child(11),
.vacation-table tbody tr:nth-child(11) {
  animation-delay: 0.55s;
}

.attendance-table tbody tr:nth-child(12),
.payroll-table tbody tr:nth-child(12),
.data-table tbody tr:nth-child(12),
.backup-table tbody tr:nth-child(12),
.vacation-table tbody tr:nth-child(12) {
  animation-delay: 0.6s;
}

.attendance-table tbody tr:nth-child(13),
.payroll-table tbody tr:nth-child(13),
.data-table tbody tr:nth-child(13),
.backup-table tbody tr:nth-child(13),
.vacation-table tbody tr:nth-child(13) {
  animation-delay: 0.65s;
}

.attendance-table tbody tr:nth-child(14),
.payroll-table tbody tr:nth-child(14),
.data-table tbody tr:nth-child(14),
.backup-table tbody tr:nth-child(14),
.vacation-table tbody tr:nth-child(14) {
  animation-delay: 0.7s;
}

.attendance-table tbody tr:nth-child(15),
.payroll-table tbody tr:nth-child(15),
.data-table tbody tr:nth-child(15),
.backup-table tbody tr:nth-child(15),
.vacation-table tbody tr:nth-child(15) {
  animation-delay: 0.75s;
}

/* Hide Chrome/Webkit default time picker icon */
input[type="time"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}

input[type="time"]::-webkit-inner-spin-button,
input[type="time"]::-webkit-clear-button {
  display: none;
  -webkit-appearance: none;
}

input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
}

/* =========================================
   Premium Custom Datepicker Styles
   ========================================= */
.date-input-wrapper {
  position: relative;
  width: 100%;
}

.date-input-wrapper input {
  padding-right: 40px !important;
  /* Space for icon */
  cursor: text;
}

.calendar-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--nomu-muted);
  cursor: pointer;
  transition: color 0.2s;
  z-index: 5;
}

.calendar-icon:hover {
  color: var(--nomu-accent);
}

.premium-datepicker {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  background: rgba(15, 23, 42, 0.95);
  /* Deep dark blue-black */
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: dpSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dpSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.dp-title {
  font-weight: 800;
  color: white;
  font-size: 1rem;
}

.dp-nav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  color: var(--nomu-muted);
  transition: all 0.2s;
}

.dp-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dp-weekday {
  text-align: center;
  font-size: 0.75rem;
  color: var(--nomu-muted);
  font-weight: 600;
  padding-bottom: 8px;
}

.dp-day {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--nomu-text);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.dp-day:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dp-day.selected {
  background: var(--nomu-accent);
  color: black;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.dp-day.empty {
  cursor: default;
}

.dp-day.empty:hover {
  background: transparent;
}

/* --- [NEW] Global White Theme Button Overrides (Perfect White Theme) --- */
html[data-theme="white"] .btn-primary {
  background: var(--nomu-accent) !important;
  color: #ffffff !important;
  border: 1px solid var(--nomu-accent) !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2) !important;
  text-shadow: none !important;
}

html[data-theme="white"] .btn-primary:hover {
  background: #0ea5e9 !important;
  /* Sky 500 */
  border-color: #0ea5e9 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3) !important;
}

html[data-theme="white"] .btn-secondary {
  background: #ffffff !important;
  color: #475569 !important;
  /* Slate 600 */
  border: 1px solid #e2e8f0 !important;
  /* Slate 200 */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="white"] .btn-secondary:hover {
  background: #f8fafc !important;
  /* Slate 50 */
  color: #1e293b !important;
  /* Slate 800 */
  border-color: #cbd5e1 !important;
  /* Slate 300 */
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="white"] .btn-icon {
  background: #ffffff !important;
  color: #64748b !important;
  /* Slate 500 */
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="white"] .btn-icon:hover {
  background: #f0f9ff !important;
  /* Sky 50 */
  color: #0284c7 !important;
  /* Sky 600 */
  border-color: #7dd3fc !important;
  /* Sky 300 */
}

/* Toggle Buttons (Daily/Monthly View etc) */
html[data-theme="white"] .btn-toggle {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

html[data-theme="white"] .btn-toggle.active {
  background: #0ea5e9 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

/* Today Button */
html[data-theme="white"] .btn-today {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

html[data-theme="white"] .btn-today:hover {
  background: #f8fafc !important;
  color: #1e293b !important;
}

/* Form Actions Border */
html[data-theme="white"] .form-actions {
  border-top-color: #e2e8f0 !important;
}

/* Modal Buttons (Safety fallback) */
html[data-theme="white"] .modal .btn-secondary {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

html[data-theme="white"] .modal .btn-primary {
  background: var(--nomu-accent) !important;
  color: #ffffff !important;
}

/* ========================================
   White Mode Glassmorphism - Dropdown Fields
   ======================================== */

/* Native Select Elements */
html[data-theme="white"] select,
html[data-theme="white"] .nomu-select {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s ease !important;
}

html[data-theme="white"] select:hover,
html[data-theme="white"] .nomu-select:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="white"] select:focus,
html[data-theme="white"] .nomu-select:focus {
  outline: none !important;
  border-color: var(--nomu-accent) !important;
  box-shadow: 0 0 0 3px var(--nomu-accent-glow), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Custom Select Trigger (nomu-select-trigger) */
html[data-theme="white"] .nomu-select-trigger {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="white"] .nomu-select-wrapper:hover .nomu-select-trigger {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="white"] .nomu-select-wrapper.active .nomu-select-trigger {
  border-color: var(--nomu-accent) !important;
  box-shadow: 0 0 0 3px var(--nomu-accent-glow), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Custom Select Options (Glassmorphism Dropdown Menu) */
html[data-theme="white"] .nomu-select-options {
  background: var(--nomu-glass-dropdown-bg) !important;
  backdrop-filter: var(--nomu-glass-dropdown-blur) !important;
  -webkit-backdrop-filter: var(--nomu-glass-dropdown-blur) !important;
  border: 1px solid var(--nomu-glass-dropdown-border) !important;
  box-shadow: var(--nomu-glass-dropdown-shadow), var(--nomu-glass-dropdown-highlight) !important;
}

html[data-theme="white"] .nomu-select-item {
  color: #475569 !important;
}

html[data-theme="white"] .nomu-select-item:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #1e293b !important;
}

html[data-theme="white"] .nomu-select-item.active {
  background: var(--nomu-accent-glow) !important;
  color: var(--nomu-accent) !important;
}

/* Glassmorphism for select.nomu-input (Attendance, Payroll, etc.) */
html[data-theme="white"] select.nomu-input {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  color: #1e293b !important;
  transition: all 0.2s ease !important;
}

html[data-theme="white"] select.nomu-input:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.18) !important;
}

html[data-theme="white"] select.nomu-input:focus {
  outline: none !important;
  border-color: var(--nomu-accent) !important;
  box-shadow: 0 0 0 3px var(--nomu-accent-glow), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* --- PREMIUM DOCUMENT MODAL (Refined Design) --- */
#docModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  /* Cleaner dark overlay */
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 40px;
  /* More generous breathing room */
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#docModal.active {
  display: flex !important;
}

#docModal .modal-container {
  width: 95%;
  max-width: 1300px;
  /* Slightly wider for professional look */
  height: 92%;
  background: var(--nomu-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  /* Softer corners */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transform: translateY(0);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#docModal.active .modal-container {
  animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#docModal .modal-header {
  height: 72px;
  /* Taller header */
  padding: 0 32px;
  background: var(--nomu-glass-strong);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px);
}

#docModal .modal-title {
  font-size: 1.35rem;
  font-weight: 850;
  color: #fff;
  /* Always bright in premium header */
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

#docModal .modal-title i {
  color: var(--nomu-accent);
  font-size: 1.1em;
  filter: drop-shadow(0 0 8px var(--nomu-accent-glow));
}

#docModal .modal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  margin-right: 24px;
}

/* Premium Action Buttons in Header */
.modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.modal-btn-print {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.modal-btn-print:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
  filter: brightness(1.1);
}

.modal-btn-pdf {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

.modal-btn-pdf:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  transform: rotate(90deg) scale(1.1);
}

#docModal .modal-body {
  flex: 1;
  position: relative;
  background: #1e1e1e;
  /* Deep dark for document contrast */
}

#docModal iframe {
  width: 100%;
  height: 100%;
  border: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Theme Adaptation for Modal */
html[data-theme="white"] #docModal .modal-container {
  background: #ffffff;
  border-color: #e2e8f0;
}

html[data-theme="white"] #docModal .modal-header {
  background: rgba(255, 255, 255, 0.85);
  border-bottom-color: #e2e8f0;
}

html[data-theme="white"] #docModal .modal-title {
  color: #0f172a;
}

html[data-theme="white"] .modal-btn-pdf {
  background: #f1f5f9;
  color: #475569 !important;
  border-color: #e2e8f0;
}

html[data-theme="white"] .modal-btn-pdf:hover {
  background: #e2e8f0;
  color: #0f172a !important;
}

html[data-theme="white"] #docModal .modal-close {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

/* --- PREMIUM MODAL SYSTEM (Generic) --- */
.premium-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  z-index: 9500;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.premium-modal.active {
  display: flex !important;
}

.premium-modal-container {
  background: var(--nomu-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalScaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.premium-modal-header {
  padding: 24px 32px;
  background: var(--nomu-glass-strong);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.premium-modal-title {
  font-size: 1.15rem;
  /* Slightly smaller */
  font-weight: 800;
  color: var(--nomu-text);
  /* Theme-aware color */
  display: flex;
  align-items: center;
  gap: 12px;
}

.premium-modal-body {
  padding: 32px;
  overflow-y: auto;
  flex: 1;
}

.premium-modal-footer {
  padding: 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}

/* --- PREMIUM FORM RADIOS/CHECKBOXES --- */
/* --- PREMIUM SEGMENTED CONTROL (Toggle Switch) --- */
.premium-segmented-control {
  display: flex;
  position: relative;
  background: rgba(var(--nomu-accent-rgb, 56, 189, 248), 0.05);
  border: 1px solid rgba(var(--nomu-accent-rgb, 56, 189, 248), 0.1);
  border-radius: 14px;
  padding: 4px;
  width: 100%;
  margin: 12px 0 20px 0;
  user-select: none;
  overflow: hidden;
}

.segment-item {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-weight: 800;
  color: var(--nomu-muted);
  cursor: pointer;
  z-index: 2;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.92rem;
}

.segment-item.active {
  color: #ffffff !important;
}

.segment-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--nomu-accent);
  border-radius: 11px;
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px var(--nomu-accent-glow);
}

.premium-segmented-control[data-selected="selected"] .segment-indicator {
  transform: translateX(100%);
}

.premium-segmented-control input[type="radio"] {
  display: none;
  /* Hide original radios but they are logic-bound */
}

/* Theme Adaptation for Segmented Control */
html[data-theme="white"] .premium-segmented-control {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

html[data-theme="white"] .segment-item {
  color: #64748b;
}

html[data-theme="white"] .segment-item.active {
  color: #ffffff !important;
}

/* Premium List Container (Grid Optimized) */
.premium-list-container {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--nomu-border);
  border-radius: 12px;
  padding: 8px;
  margin-top: 12px;
  background: var(--nomu-input-bg);
}

.premium-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* 2-column grid */
  gap: 8px;
}

.premium-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 10px;
  background: rgba(var(--nomu-accent-rgb, 56, 189, 248), 0.02);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.premium-list-item:hover {
  background: rgba(var(--nomu-accent-rgb, 56, 189, 248), 0.08);
  border-color: rgba(var(--nomu-accent-rgb, 56, 189, 248), 0.2);
  transform: translateY(-1px);
}

/* Modal Search Bar */
.modal-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-search-input-wrapper {
  position: relative;
  flex: 1;
}

.modal-search-input-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--nomu-muted);
}

.modal-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px !important;
  border-radius: 10px !important;
  font-size: 0.88rem !important;
}

.select-all-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--nomu-accent);
  cursor: pointer;
  background: rgba(var(--nomu-accent-rgb, 56, 189, 248), 0.05);
  border-radius: 8px;
  transition: all 0.2s;
}

.select-all-wrapper:hover {
  background: rgba(var(--nomu-accent-rgb, 56, 189, 248), 0.12);
}

.premium-list-item input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Theme Adaptation for Premium Modal */
html[data-theme="white"] .premium-modal-container {
  background: #ffffff;
  border-color: #e2e8f0;
}

html[data-theme="white"] .premium-modal-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

html[data-theme="white"] .premium-modal-title {
  color: #0f172a;
}

html[data-theme="white"] .premium-segmented-control {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

html[data-theme="white"] .segment-item {
  color: #64748b;
  font-weight: 800;
}

html[data-theme="white"] .premium-list-container {
  background: #fff;
  border-color: #e2e8f0;
}

html[data-theme="white"] .premium-list-item {
  color: #334155;
}

html[data-theme="white"] .premium-list-item strong {
  color: #0f172a !important;
}

html[data-theme="white"] .premium-list-item:hover {
  background: #f8fafc;
}

/* ==========================================================================
   Mobile Updates (Requested)
   - Hide Document Modal Controls (PDF/Print) on Mobile
   ========================================================================== */
@media (max-width: 768px) {
  #docModal .modal-controls {
    display: none !important;
  }
}
