/* ============================================
   BOT NOI BO — Design System
   Blue Light Theme / Nunito / SaaS Pro
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Primary */
  --primary: #2563EB;
  --primary-light: #3B82F6;
  --primary-dark: #1D4ED8;
  --primary-50: #EFF6FF;
  --primary-100: #DBEAFE;
  --primary-200: #BFDBFE;
  --accent: #0EA5E9;

  /* Backgrounds */
  --bg-base: #F0F7FF;
  --bg-surface: #FFFFFF;
  --bg-sidebar: #1E3A5F;
  --bg-sidebar-hover: rgba(255,255,255,0.08);
  --bg-sidebar-active: #2563EB;
  --bg-input: #FFFFFF;

  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-on-primary: #FFFFFF;
  --sidebar-text: #CBD5E1;
  --sidebar-text-active: #FFFFFF;

  /* Border */
  --border: #BFDBFE;
  --border-light: #DBEAFE;
  --border-input-focus: #2563EB;

  /* Status */
  --success: #10B981;
  --success-bg: #D1FAE5;
  --success-text: #065F46;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --warning-text: #92400E;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --danger-text: #991B1B;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(37,99,235,0.08);
  --shadow-md: 0 4px 24px rgba(37,99,235,0.12);
  --shadow-lg: 0 8px 40px rgba(37,99,235,0.18);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-pill: 999px;

  /* Transition */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ========== APP LAYOUT ========== */
.app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 20px 20px 16px;
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.logo-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #FFFFFF;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.nav-section {
  padding: 4px 12px;
}

.nav-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: rgba(203,213,225,0.5);
  letter-spacing: 0.1em;
  padding: 12px 12px 8px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #FFFFFF;
}

.nav-item.active {
  background: var(--bg-sidebar-active);
  color: var(--sidebar-text-active);
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item:hover svg,
.nav-item.active svg {
  opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 600; color: #FFFFFF; }
.user-role { font-size: 11px; color: rgba(203,213,225,0.6); }

/* ========== MAIN WRAPPER ========== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ========== HEADER / TOP BAR ========== */
.header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(37,99,235,0.04);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.menu-toggle:hover {
  background: var(--primary-50);
  color: var(--primary);
}

.header-left { flex: 1; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 700;
}

.breadcrumb-sep {
  color: var(--border);
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  width: 280px;
  transition: all var(--transition);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
  background: var(--bg-surface);
}

.search-box svg { color: var(--text-muted); flex-shrink: 0; }

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  width: 100%;
}

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

.search-kbd {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: box-shadow var(--transition);
}

.header-avatar:hover {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
}

/* ========== CONTENT ========== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }

/* Page Transitions */
.content.fade-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.content.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

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

/* Stagger animation for cards */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== WELCOME BANNER ========== */
.welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px;
  background: linear-gradient(135deg, #2563EB 0%, #0EA5E9 100%);
  border-radius: var(--radius);
  margin-bottom: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.welcome::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}

.welcome::after {
  content: '';
  position: absolute;
  bottom: -40%;
  right: 20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.welcome-text { position: relative; z-index: 1; }

.welcome-text h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.welcome-text p {
  font-size: 14px;
  opacity: 0.85;
  font-weight: 500;
}

.stats {
  display: flex;
  gap: 32px;
  position: relative;
  z-index: 1;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-number {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  opacity: 0.75;
}

.stat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 8px 0;
}

.stat-dot.active {
  background: #34D399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.5);
}

/* ========== SECTION HEADER ========== */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-100);
  color: var(--primary);
}

/* ========== CARD GRID ========== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Loading */
.loading-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== TOOL CARDS ========== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
  animation: slideUp 0.4s ease-out both;
}

.card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2) { animation-delay: 50ms; }
.card:nth-child(3) { animation-delay: 100ms; }
.card:nth-child(4) { animation-delay: 150ms; }
.card:nth-child(5) { animation-delay: 200ms; }
.card:nth-child(6) { animation-delay: 250ms; }
.card:nth-child(7) { animation-delay: 300ms; }
.card:nth-child(8) { animation-delay: 350ms; }

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

.card:active {
  transform: translateY(-2px) scale(0.995);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--card-shadow, rgba(37,99,235,0.2));
}

.card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--success-text);
  background: var(--success-bg);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.card-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.card-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.card-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-50);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.card:hover .card-btn {
  background: var(--primary-100);
}

.card-btn svg {
  transition: transform 0.15s ease;
}

.card:hover .card-btn svg {
  transform: translateX(3px);
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

/* ========== MODULE PAGE ========== */
.module-page {
  max-width: 1000px;
  animation: fadeIn 0.3s ease-out;
}

.module-header {
  margin-bottom: 20px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-back:hover {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Module Hero */
.module-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.module-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px var(--card-shadow, rgba(37,99,235,0.2));
}

.module-hero-info { flex: 1; }

.module-hero-info h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
}

.module-hero-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.module-hero-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--success-bg);
  color: var(--success-text);
}

.status-dot-lg {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Module Workspace */
.module-workspace {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 400px;
  box-shadow: var(--shadow-sm);
}

/* Module Placeholder */
.module-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 32px;
  text-align: center;
}

.placeholder-icon { color: var(--border); }

.module-placeholder h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}

.module-placeholder p {
  font-size: 13px;
  color: var(--text-muted);
}

.module-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 32px;
  text-align: center;
}

.module-empty h2 { font-size: 18px; font-weight: 700; }
.module-empty p { color: var(--text-muted); font-size: 14px; }

/* ========== CHAT (AI Tool) ========== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 480px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 16px;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-bubble {
  display: flex;
  gap: 10px;
  max-width: 75%;
  animation: bubbleIn 0.25s ease-out;
}

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

.chat-bubble.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
}

.chat-bubble.bot .chat-bubble-avatar {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.chat-bubble.user .chat-bubble-avatar {
  background: var(--primary-100);
  color: var(--primary);
}

.chat-bubble-content {
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.chat-bubble.user .chat-bubble-content {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.chat-input {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  transition: all var(--transition);
}

.chat-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
  background: var(--bg-surface);
}

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

.chat-send {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.chat-send:hover { background: var(--primary-dark); transform: scale(1.03); }
.chat-send:active { transform: scale(0.97); }

/* ========== FORMS ========== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group.full { grid-column: 1 / -1; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  transition: all var(--transition);
  resize: vertical;
}

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

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

/* Platform chips */
.platform-select {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-base);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.platform-chip input { display: none; }

.platform-chip.active,
.platform-chip:has(input:checked) {
  background: var(--primary-50);
  border-color: var(--primary);
  color: var(--primary);
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary);
}

/* Template grid */
.template-grid {
  display: flex;
  gap: 12px;
}

.template-card {
  flex: 1;
  cursor: pointer;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px;
  text-align: center;
  transition: all var(--transition);
}

.template-card.active { border-color: var(--primary); }
.template-card:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }

.template-preview {
  height: 80px;
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
}

.template-card span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover { background: var(--primary-dark); transform: scale(1.01); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.btn-sm { padding: 8px 14px; font-size: 13px; }

.btn-ghost {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover { background: var(--primary-50); color: var(--primary); border-color: var(--primary-200); }
.btn-ghost.btn-xs { padding: 4px 8px; font-size: 12px; }

/* ========== DATA TABLE ========== */
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.search-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  flex: 1;
  max-width: 320px;
  transition: all var(--transition);
}

.search-inline:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.search-inline svg { color: var(--text-muted); flex-shrink: 0; }

.search-inline input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  width: 100%;
}

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

.info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.info-banner svg { flex-shrink: 0; }

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

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

.data-table thead {
  background: var(--primary-50);
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  border-bottom: 1px solid var(--border-light);
}

.data-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  font-weight: 500;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover { background: var(--primary-50); }

.data-table .code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.status-badge.good { background: var(--success-bg); color: var(--success-text); }
.status-badge.warning { background: var(--warning-bg); color: var(--warning-text); }
.status-badge.danger { background: var(--danger-bg); color: var(--danger-text); }

.text-danger { color: var(--danger); font-weight: 600; }
.text-ok { color: var(--success); font-weight: 600; }
.text-muted { color: var(--text-muted); font-size: 12px; }

/* ========== OVERLAY (mobile) ========== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 90;
  backdrop-filter: blur(4px);
}

.overlay.active { display: block; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }

  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: flex; }
  .search-box { width: 220px; }
}

@media (max-width: 640px) {
  .content { padding: 16px; }

  .welcome {
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    align-items: flex-start;
  }

  .stats { width: 100%; justify-content: space-between; }
  .grid { grid-template-columns: 1fr; }
  .search-box { width: 160px; }
  .search-kbd { display: none; }
  .header { padding: 0 16px; }

  .module-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .module-hero-status { align-self: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .template-grid { flex-direction: column; }
}

/* ============================================
   XIN NGHI MODULE — Calendar & Leave
   ============================================ */

.xn-workspace {
  padding: 0 !important;
  overflow: visible;
}

/* Top bar */
.xn-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
}

.xn-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Stats bar */
.xn-stats-bar {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-light);
}

.xn-stats-bar::-webkit-scrollbar { height: 4px; }
.xn-stats-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.xn-stat-empty {
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.xn-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 180px;
  flex-shrink: 0;
}

.xn-stat-card:hover {
  border-color: var(--primary-200);
  background: var(--primary-50);
}

.xn-stat-card.active {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.xn-stat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.xn-stat-info {
  flex: 1;
  min-width: 0;
}

.xn-stat-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
}

.xn-stat-bar {
  height: 6px;
  background: #E2E8F0;
  border-radius: 3px;
  display: flex;
  overflow: hidden;
  margin-bottom: 4px;
}

.xn-bar-used {
  background: #F59E0B;
  border-radius: 3px 0 0 3px;
  transition: width 0.4s ease;
}

.xn-bar-pending {
  background: var(--primary-200);
  transition: width 0.4s ease;
}

.xn-stat-text {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Calendar header */
.xn-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-light);
}

.xn-cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.xn-cal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 140px;
  text-align: center;
}

/* Calendar grid */
.xn-cal-grid {
  padding: 0 8px 8px;
}

.xn-cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.xn-cal-dow {
  border-bottom: 1px solid var(--border-light);
}

.xn-cal-dow-cell {
  padding: 10px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.xn-cal-dow-cell.xn-sunday {
  color: var(--danger);
}

.xn-cal-cell {
  min-height: 90px;
  padding: 4px 6px;
  border: 1px solid var(--border-light);
  border-top: none;
  border-left: none;
  position: relative;
  transition: background 0.15s ease;
}

.xn-cal-row:last-child .xn-cal-cell {
  border-bottom: none;
}

.xn-cal-cell:first-child {
  border-left: none;
}

.xn-cal-cell:last-child {
  border-right: none;
}

.xn-cal-cell.xn-sunday,
.xn-cal-cell.xn-saturday {
  background: rgba(241, 245, 249, 0.5);
}

.xn-cal-cell.xn-other-month {
  opacity: 0.35;
}

.xn-cal-cell.xn-today {
  background: rgba(37, 99, 235, 0.04);
}

.xn-cal-cell.xn-today .xn-cal-num {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.xn-cal-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: inline-flex;
}

.xn-sunday .xn-cal-num {
  color: var(--danger);
}

.xn-cal-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Event cards */
.xn-event {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
}

.xn-event:hover {
  filter: brightness(0.95);
  transform: scale(1.02);
}

/* Trang thai don */
.xn-ev-pending {
  background: #DBEAFE;
  color: #1D4ED8;
  border-left: 2px solid #93C5FD;
}

.xn-ev-approved {
  background: #FFEDD5;
  color: #C2410C;
  border-left: 2px solid #FED7AA;
}

.xn-ev-rejected {
  background: #FEE2E2;
  color: #991B1B;
  border-left: 2px solid #FECACA;
}

.xn-ev-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.xn-ev-pending .xn-ev-dot { background: #3B82F6; }
.xn-ev-approved .xn-ev-dot { background: #EA580C; }
.xn-ev-rejected .xn-ev-dot { background: #DC2626; }

.xn-ev-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.xn-event-more {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  padding: 1px 4px;
}

.xn-event-more:hover { text-decoration: underline; }

/* Event animation khi moi them */
.xn-event.new {
  animation: xnPopIn 0.25s ease;
}

@keyframes xnPopIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Day popup */
.xn-day-popup {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 280px;
  animation: xnSlideDown 0.2s ease;
}

.xn-day-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.xn-day-popup-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.xn-day-popup-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.xn-day-popup-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s ease;
}

.xn-day-popup-item:hover { filter: brightness(0.97); }

.xn-day-popup-item.xn-ev-pending { background: #EFF6FF; }
.xn-day-popup-item.xn-ev-approved { background: #FFF7ED; }
.xn-day-popup-item.xn-ev-rejected { background: #FEF2F2; }

.xn-day-popup-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.xn-day-popup-info { flex: 1; min-width: 0; }
.xn-day-popup-name { font-size: 12px; font-weight: 700; color: var(--text-primary); display: block; }
.xn-day-popup-reason { font-size: 11px; color: var(--text-muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xn-day-popup-status { font-size: 10px; font-weight: 700; white-space: nowrap; }

/* Modal overlay + modal */
.xn-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
}

.xn-modal-overlay.active {
  display: flex;
}

.xn-modal {
  background: var(--bg-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  animation: xnSlideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes xnSlideDown {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.xn-modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.xn-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.xn-modal-close:hover {
  background: var(--bg-base);
  color: var(--text-primary);
}

.xn-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.xn-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

/* Leave type chips */
.xn-type-select {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.xn-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-base);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.xn-type-chip input { display: none; }

.xn-type-chip.active {
  background: var(--primary-50);
  border-color: var(--primary);
  color: var(--primary);
}

.xn-type-chip:hover {
  border-color: var(--primary-200);
}

/* Date row */
.xn-date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Calc info */
.xn-calc-info {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 10px 14px;
  background: var(--primary-50);
  border-radius: var(--radius-xs);
  border: 1px solid var(--primary-200);
  min-height: 0;
}

.xn-calc-info:empty {
  display: none;
}

.xn-calc-error {
  color: var(--danger);
  font-weight: 600;
}

.xn-calc-warning {
  color: #F59E0B;
  font-weight: 700;
}

/* Detail modal */
.xn-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.xn-detail-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.xn-detail-emp {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.xn-detail-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.xn-detail-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
}

.xn-badge-pending { background: #DBEAFE; color: #1D4ED8; }
.xn-badge-approved { background: #FFEDD5; color: #C2410C; }
.xn-badge-rejected { background: #FEE2E2; color: #991B1B; }

.xn-detail-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.xn-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
}

.xn-detail-label {
  font-weight: 700;
  color: var(--text-muted);
  min-width: 100px;
  flex-shrink: 0;
}

.xn-detail-row span:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* Reject button */
.xn-btn-reject {
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

.xn-btn-reject:hover {
  background: #FEE2E2 !important;
}

/* Delete button */
.xn-btn-delete {
  border-color: #9CA3AF !important;
  color: #6B7280 !important;
}

.xn-btn-delete:hover {
  border-color: var(--danger) !important;
  color: var(--danger) !important;
  background: #FEE2E2 !important;
}

/* Toast container */
.xn-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.xn-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: xnSlideInRight 0.3s ease;
  max-width: 400px;
}

.xn-toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.xn-toast-success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.xn-toast-error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.xn-toast-warning {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.xn-toast-out {
  animation: xnSlideOutRight 0.3s ease forwards;
}

@keyframes xnSlideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes xnSlideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

/* ====== XIN NGHI RESPONSIVE ====== */
@media (max-width: 768px) {
  .xn-cal-cell { min-height: 70px; }
  .xn-event { font-size: 9px; padding: 1px 4px; }
  .xn-cal-num { font-size: 11px; }
  .xn-stats-bar { padding: 12px 16px; }
  .xn-stat-card { min-width: 160px; }
  .xn-top-bar { padding: 16px; flex-wrap: wrap; gap: 8px; }
  .xn-cal-header { padding: 12px 16px; }
  .xn-date-row { grid-template-columns: 1fr; }
  .xn-modal { margin: 0 16px; max-width: calc(100vw - 32px); }
  .xn-modal-overlay { padding-top: 40px; }
}

@media (max-width: 480px) {
  .xn-cal-cell { min-height: 60px; padding: 2px; }
  .xn-ev-text { display: none; }
  .xn-event { padding: 2px 3px; justify-content: center; }
  .xn-ev-dot { width: 6px; height: 6px; }
  .xn-cal-dow-cell { font-size: 10px; padding: 8px 2px; }
}

/* ============================================
   NHAN VIEN MODULE
   ============================================ */

/* -- Layout -- */
.nv-workspace { position: relative; }
.nv-list-page, .nv-detail-page { padding: 0; }

/* -- Summary cards -- */
.nv-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.nv-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.nv-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.nv-summary-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nv-summary-info { display: flex; flex-direction: column; }
.nv-summary-num { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.nv-summary-label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }

/* -- Toolbar -- */
.nv-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.nv-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  flex: 1;
  min-width: 200px;
}
.nv-search-box input {
  border: none; outline: none; background: none;
  font-family: inherit; font-size: 0.9rem;
  color: var(--text-primary); width: 100%;
}
.nv-search-box svg { color: var(--text-muted); flex-shrink: 0; }
.nv-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-family: inherit; font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* -- Employee grid -- */
.nv-emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.nv-emp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  cursor: default;
}
.nv-emp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-200);
}
.nv-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.nv-avatar {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.nv-avatar-lg {
  width: 64px; height: 64px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1.3rem;
  flex-shrink: 0;
}
.nv-avatar-sm {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.65rem;
  flex-shrink: 0;
}
.nv-card-info { flex: 1; min-width: 0; }
.nv-card-info h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; }
.nv-card-pos { font-size: 0.82rem; color: var(--text-secondary); display: block; }
.nv-card-dept { font-size: 0.78rem; color: var(--text-muted); }

.nv-card-alert {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.nv-card-alert.warning { background: var(--warning-bg); color: var(--warning-text); }
.nv-card-alert.danger { background: var(--danger-bg); color: var(--danger-text); }

.nv-card-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
}
.nv-card-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.nv-card-stat-icon { font-size: 1rem; }

.nv-card-btn {
  width: 100%;
  padding: 10px;
  background: var(--primary-50);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}
.nv-card-btn:hover {
  background: var(--primary);
  color: #fff;
}
.nv-card-actions {
  display: flex;
  gap: 8px;
}
.nv-card-actions .nv-card-btn { flex: 1; }
.nv-card-cc-btn {
  padding: 10px 12px;
  background: #EFF6FF;
  color: #2563EB;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.nv-card-cc-btn:hover {
  background: #2563EB;
  color: #fff;
}
.nv-card-del-btn {
  width: 38px;
  padding: 10px 0;
  background: #FEF2F2;
  color: #EF4444;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nv-card-del-btn:hover {
  background: #EF4444;
  color: #fff;
}
.btn-danger-ghost {
  color: #EF4444 !important;
}
.btn-danger-ghost:hover {
  background: #FEF2F2 !important;
}

/* -- Section header -- */
.nv-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
}
.nv-section-header h3 { font-size: 1.05rem; font-weight: 700; }
.nv-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 20px 0 12px;
  color: var(--text-primary);
}

/* -- Salary table -- */
.nv-salary-table { font-size: 0.85rem; }
.nv-table-emp {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nv-text-bold { font-weight: 700; }
.text-right { text-align: right; }
.nv-tfoot-row {
  background: var(--primary-50);
  font-weight: 700;
}

/* -- Detail page -- */
.nv-back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 16px;
}
.nv-back-btn:hover { text-decoration: underline; }

.nv-profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.nv-profile-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nv-profile-info h2 { font-size: 1.4rem; font-weight: 800; }
.nv-profile-info span { font-size: 0.85rem; color: var(--text-secondary); }
.nv-profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* -- Tabs -- */
.nv-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
  overflow-x: auto;
}
.nv-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
}
.nv-tab:hover { color: var(--text-primary); }
.nv-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* -- Tab content animation -- */
.fade-slide-in {
  animation: nvFadeSlide 0.25s ease;
}
@keyframes nvFadeSlide {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* -- Profile tab -- */
.nv-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.nv-info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.nv-info-card-full { grid-column: 1 / -1; }
.nv-info-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.nv-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.85rem;
}
.nv-info-label { color: var(--text-secondary); }
.nv-info-total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 10px;
}

.nv-leave-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}
.nv-leave-progress {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.8s ease;
}

/* -- Attendance tab -- */
.nv-att-page { }
.nv-att-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.nv-cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nv-cal-title { font-weight: 700; font-size: 1rem; }
.nv-att-actions { display: flex; gap: 8px; }

.nv-att-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nv-att-stat {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
  box-shadow: var(--shadow-sm);
}
.nv-att-stat-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}
.nv-att-stat-num.good { color: var(--success); }
.nv-att-stat-num.danger { color: var(--danger); }
.nv-att-stat-num.warning { color: var(--warning); }
.nv-att-stat-num.info { color: var(--accent); }
.nv-att-stat span:last-child { font-size: 0.78rem; color: var(--text-muted); }

.nv-att-table tbody tr { cursor: pointer; transition: background var(--transition); }
.nv-att-table tbody tr:hover { background: var(--primary-50); }
.nv-weekend-row { background: #F8FAFC; }
.nv-weekend-row td { color: var(--text-muted); }

/* status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge.good { background: var(--success-bg); color: var(--success-text); }
.status-badge.warning { background: var(--warning-bg); color: var(--warning-text); }
.status-badge.danger { background: var(--danger-bg); color: var(--danger-text); }
.status-badge.info { background: #DBEAFE; color: #1E40AF; }
.status-badge.muted { background: #F1F5F9; color: #94A3B8; }

/* -- Salary tab -- */
.nv-salary-page {}
.nv-sal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.nv-sal-actions { display: flex; align-items: center; gap: 10px; }

.nv-sal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.nv-sal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.nv-sal-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.nv-sal-income h4 { color: var(--success); }
.nv-sal-deduct h4 { color: var(--danger); }

.nv-sal-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.nv-sal-row span:last-child { font-weight: 600; color: var(--text-primary); }
.nv-sal-total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 10px;
  font-weight: 700;
}
.nv-sal-total span { color: var(--text-primary) !important; font-weight: 700 !important; }

.nv-sal-net {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  margin-bottom: 20px;
}
.nv-sal-net span:first-child { font-size: 0.95rem; font-weight: 600; }
.nv-sal-net-amount { font-size: 1.8rem; font-weight: 800; }

.nv-sal-progress { margin-bottom: 20px; }
.nv-sal-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.nv-sal-progress-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.nv-sal-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.8s ease;
  animation: nvFillBar 0.8s ease-out;
}
.nv-sal-progress-fill.warning { background: var(--warning); }
@keyframes nvFillBar { from { width: 0; } }

/* -- Advance tab -- */
.nv-adv-page {}
.nv-adv-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.nv-adv-limit {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.nv-adv-limit-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.nv-adv-form {}
.nv-adv-info {
  background: var(--primary-50);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.nv-adv-info .nv-info-row { font-size: 0.85rem; }

/* -- KPI tab -- */
.nv-kpi-page {}
.nv-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.nv-kpi-score-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.nv-kpi-score { display: flex; align-items: baseline; }
.nv-kpi-score-num { font-size: 2.5rem; font-weight: 800; color: var(--text-primary); }
.nv-kpi-score-max { font-size: 1rem; color: var(--text-muted); margin-left: 4px; }
.nv-kpi-rank {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 1.1rem;
}
.nv-rank-sm { padding: 2px 10px; font-size: 0.75rem; }
.nv-rank-s { background: linear-gradient(135deg, #F59E0B, #EF4444); color: #fff; }
.nv-rank-a { background: #D1FAE5; color: #065F46; }
.nv-rank-b { background: #DBEAFE; color: #1E40AF; }
.nv-rank-c { background: #FEF3C7; color: #92400E; }
.nv-rank-d { background: #FEE2E2; color: #991B1B; }
.nv-kpi-bonus { font-size: 0.9rem; color: var(--text-secondary); }

.nv-kpi-criteria { margin-bottom: 20px; }
.nv-kpi-criterion {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 8px;
}
.nv-kpi-criterion-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.nv-kpi-criterion-header span:last-child { font-weight: 600; }
.nv-kpi-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.nv-kpi-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.nv-kpi-history { margin-bottom: 20px; }
.nv-kpi-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}
.nv-kpi-history-item span:first-child { width: 80px; color: var(--text-secondary); }
.nv-kpi-mini-bar { flex: 1; height: 6px; background: var(--border-light); border-radius: 999px; overflow: hidden; }
.nv-kpi-history-score { font-weight: 700; width: 30px; text-align: right; }

/* KPI modal form */
.nv-kpi-form-info { font-size: 0.88rem; margin-bottom: 16px; color: var(--text-secondary); }
.nv-kpi-criterion-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.nv-kpi-criterion-name { flex: 1; font-size: 0.85rem; }
.nv-kpi-slider {
  width: 120px;
  accent-color: var(--primary);
}
.nv-kpi-score-display { width: 40px; font-weight: 700; font-size: 0.85rem; text-align: center; }

/* -- Docs tab -- */
.nv-docs-list { }
.nv-doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all var(--transition);
}
.nv-doc-row:hover { box-shadow: var(--shadow-sm); }
.nv-doc-icon { font-size: 1.2rem; }
.nv-doc-name { flex: 1; font-size: 0.88rem; font-weight: 600; }
.nv-doc-date { font-size: 0.8rem; color: var(--text-muted); }

/* -- Empty state -- */
.nv-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* -- Modals -- */
.nv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding-top: 60px;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}
.nv-modal-overlay.active { display: flex; }
.nv-modal {
  background: var(--bg-surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: nvModalIn 0.2s ease;
}
.nv-modal-lg { max-width: 640px; }
@keyframes nvModalIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.nv-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
}
.nv-modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.nv-modal-close {
  background: none; border: none;
  font-size: 1.5rem; color: var(--text-muted);
  cursor: pointer; line-height: 1;
}
.nv-modal-close:hover { color: var(--text-primary); }
.nv-modal-body { padding: 24px; }
.nv-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

/* -- Form grid in modals -- */
.nv-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.nv-form-grid .full { grid-column: 1 / -1; }

/* -- Attendance form -- */
.nv-att-form .form-group { margin-bottom: 14px; }

/* -- Toast -- */
.nv-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nv-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  font-weight: 600;
  animation: nvToastIn 0.3s ease;
  border-left: 4px solid var(--success);
}
.nv-toast-success { border-left-color: var(--success); }
.nv-toast-error { border-left-color: var(--danger); }
.nv-toast-warning { border-left-color: var(--warning); }
.nv-toast-icon { font-size: 1.1rem; }
.nv-toast-out { animation: nvToastOut 0.3s ease forwards; }
@keyframes nvToastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes nvToastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* -- Confirm Dialog -- */
.nv-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.nv-confirm-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.nv-confirm-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 24px;
  width: 380px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: scale(0.9) translateY(10px);
  transition: transform .25s ease;
}
.nv-confirm-overlay.active .nv-confirm-box {
  transform: scale(1) translateY(0);
}
.nv-confirm-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
}
.nv-confirm-box h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--text-primary);
}
.nv-confirm-box p {
  margin: 0 0 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.nv-confirm-actions {
  display: flex;
  gap: 12px;
}
.nv-confirm-actions button {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.nv-confirm-actions button:active { transform: scale(0.97); }
.nv-confirm-actions .btn-ghost {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}
.nv-confirm-actions .btn-ghost:hover {
  background: var(--border-color);
}
.nv-confirm-actions .btn-danger {
  background: #EF4444;
  color: #fff;
}
.nv-confirm-actions .btn-danger:hover {
  background: #DC2626;
}

/* ============================================
   CHAM CONG V2 — Calendar Heatmap + Stats
   ============================================ */

/* -- Alerts -- */
.cc-alerts { margin-bottom: 16px; }
.cc-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: ccSlideDown 0.3s ease;
  border-left: 4px solid;
}
.cc-alert-warning { background: #FEF3C7; color: #92400E; border-left-color: #F59E0B; }
.cc-alert-danger { background: #FEE2E2; color: #991B1B; border-left-color: #EF4444; }
.cc-alert-info { background: #DBEAFE; color: #1E40AF; border-left-color: #2563EB; }
.cc-alert-icon { font-size: 1.2rem; }
@keyframes ccSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -- Month Nav -- */
.cc-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}
.cc-month-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* -- Stats Grid (4 cards) -- */
.cc-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.cc-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.cc-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.cc-stat-icon { font-size: 1.6rem; margin-bottom: 6px; }
.cc-stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.cc-stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; margin-bottom: 8px; }
.cc-stat-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.cc-stat-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}
.cc-stat-sub { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }
.cc-stat-sub-good { color: var(--success); }
.cc-stat-sub-danger { color: var(--danger); }

/* Animated fill */
.cc-fill-animate {
  width: 0;
  animation: ccFillWidth 1s ease-out 0.3s both;
}
@keyframes ccFillWidth { to { width: var(--fill-width); } }

/* -- Progress Section -- */
.cc-progress-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.cc-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.cc-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.cc-progress-label {
  width: 110px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
}
.cc-progress-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.cc-progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}
.cc-progress-bar-fill.cc-fill-green { background: var(--success); }
.cc-progress-bar-fill.cc-fill-blue { background: var(--accent); }
.cc-progress-bar-fill.cc-fill-orange { background: #F97316; }
.cc-progress-text {
  width: 180px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

/* -- Calendar Heatmap -- */
.cc-calendar-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.cc-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cc-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.cc-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.cc-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cc-cal-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 0;
}
.cc-cal-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  animation: ccCalDayIn 0.3s ease both;
  min-height: 60px;
}
.cc-cal-cell:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
  z-index: 2;
}
.cc-cal-empty { cursor: default; }
.cc-cal-empty:hover { transform: none; box-shadow: none; }
.cc-cal-day {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
}
.cc-cal-icon {
  font-size: 0.72rem;
  margin-top: 2px;
}
.cc-cal-label {
  font-size: 0.6rem;
  font-weight: 600;
  margin-top: 1px;
  opacity: 0.85;
}

/* Calendar Today */
.cc-cal-today {
  outline: 2.5px solid var(--primary);
  outline-offset: -2px;
}
.cc-cal-today .cc-cal-day { font-weight: 800; }

/* Calendar status backgrounds */
.cc-bg-present { background: #D1FAE5; color: #065F46; }
.cc-bg-late { background: #FEF3C7; color: #92400E; }
.cc-bg-absent { background: #FEE2E2; color: #991B1B; }
.cc-bg-leave { background: #DBEAFE; color: #1D4ED8; }
.cc-bg-holiday { background: #F3E8FF; color: #6B21A8; }
.cc-bg-weekend { background: #F1F5F9; color: #94A3B8; }
.cc-bg-overtime { background: #FFF7ED; color: #C2410C; }
.cc-bg-future { background: #FAFAFA; color: #CBD5E1; border: 1px dashed #E2E8F0; }

@keyframes ccCalDayIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Calendar Tooltip */
.cc-tooltip {
  position: absolute;
  background: #0F172A;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.78rem;
  line-height: 1.6;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-100%);
  z-index: 10;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  transition: opacity 0.15s ease;
}
.cc-tooltip-show { opacity: 1; }
.cc-tooltip-title { font-weight: 700; margin-bottom: 4px; }
.cc-tooltip-status { margin-bottom: 2px; }

/* Attendance status badges */
.cc-badge-holiday { background: #F3E8FF; color: #6B21A8; }
.cc-badge-overtime { background: #FFF7ED; color: #C2410C; }

/* -- Detail Accordion -- */
.cc-detail-section {
  margin-bottom: 24px;
}
.cc-accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}
.cc-accordion-btn:hover { background: var(--primary-50); }
.cc-accordion-arrow {
  transition: transform var(--transition);
}
.cc-accordion-open .cc-accordion-arrow { transform: rotate(180deg); }
.cc-accordion-body {
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  animation: ccSlideDown 0.2s ease;
}

/* -- Charts Grid -- */
.cc-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.cc-chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* Bar chart */
.cc-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding-bottom: 24px;
  position: relative;
}
.cc-bar-baseline {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(24px + 140px * 8 / 12);
  border-top: 2px dashed var(--accent);
  opacity: 0.4;
}
.cc-bar-baseline::after {
  content: '8h';
  position: absolute;
  right: 0;
  top: -16px;
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 700;
}
.cc-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.cc-bar {
  width: 100%;
  max-width: 20px;
  border-radius: 3px 3px 0 0;
  transition: height 0.6s ease;
  position: relative;
  min-height: 2px;
}
.cc-bar-normal { background: var(--success); }
.cc-bar-short { background: var(--warning); }
.cc-bar-overtime { background: #F97316; }
.cc-bar-zero { background: var(--danger); min-height: 4px; }
.cc-bar-val {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}
.cc-bar-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
}
.cc-chart-legend-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.cc-bar-normal-dot { background: var(--success); }
.cc-bar-short-dot { background: var(--warning); }
.cc-bar-overtime-dot { background: #F97316; }

/* Check-in trend chart */
.cc-checkin-chart {
  display: flex;
  gap: 4px;
  height: 120px;
}
.cc-checkin-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  width: 36px;
  flex-shrink: 0;
  padding: 4px 0;
}
.cc-checkin-area {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  position: relative;
}
.cc-checkin-threshold {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(100% * (9*60+30 - (8*60+15)) / (9*60+30 - 7*60-30));
  border-top: 2px dashed var(--danger);
  opacity: 0.3;
}
.cc-dot-col {
  flex: 1;
  position: relative;
  height: 100%;
}
.cc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.cc-dot-late { background: var(--danger); }
.cc-avg-checkin {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 10px;
}

/* -- Review Section -- */
.cc-review-section { margin-bottom: 24px; }
.cc-review-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.cc-review-list { margin-bottom: 14px; }
.cc-review-item {
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}
.cc-review-item:last-child { border-bottom: none; }
.cc-review-good span:first-child { color: var(--success); }
.cc-review-warning span:first-child { color: var(--warning); }
.cc-review-danger span:first-child { color: var(--danger); }
.cc-review-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 0.88rem;
  font-weight: 600;
}
.cc-stars { display: flex; gap: 2px; }
.cc-star {
  font-size: 1.3rem;
  color: #E2E8F0;
  animation: ccStarPop 0.3s ease both;
}
.cc-star-active { color: #F59E0B; }
@keyframes ccStarPop {
  0% { transform: scale(0) rotate(-30deg); }
  70% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
.cc-rating-text { font-size: 0.82rem; color: var(--text-muted); }
.cc-review-trend {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* -- Trend Section (6 months) -- */
.cc-trend-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.cc-trend-list { }
.cc-trend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.cc-trend-row:last-child { border-bottom: none; }
.cc-trend-month {
  width: 36px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.cc-trend-bar-wrap {
  flex: 1;
  height: 10px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.cc-trend-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.8s ease;
}
.cc-trend-pct {
  width: 45px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}
.cc-trend-stars {
  font-size: 0.72rem;
  color: #F59E0B;
  letter-spacing: 1px;
}

/* -- Admin Actions -- */
.cc-admin-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================
   CHAM CONG V2 — RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .cc-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cc-charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .cc-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cc-stat-card { padding: 12px; }
  .cc-stat-value { font-size: 1.2rem; }
  .cc-progress-row { flex-wrap: wrap; }
  .cc-progress-label { width: 100%; }
  .cc-progress-text { width: 100%; text-align: left; margin-top: 4px; }
  .cc-calendar-grid { gap: 2px; }
  .cc-cal-cell { min-height: 40px; }
  .cc-cal-label { display: none; }
  .cc-cal-icon { font-size: 0.9rem; }
  .cc-cal-day { font-size: 0.75rem; }
  .cc-month-nav { flex-wrap: wrap; gap: 8px; }
  .cc-bar-chart { height: 100px; }
  .cc-checkin-chart { height: 80px; }
  .cc-admin-actions { flex-direction: column; }
}
@media (max-width: 480px) {
  .cc-stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .cc-stat-card { padding: 10px; }
  .cc-stat-value { font-size: 1rem; }
  .cc-stat-icon { font-size: 1.2rem; }
  .cc-stat-bar { display: none; }
  .cc-legend { gap: 6px; }
  .cc-legend-item { font-size: 0.65rem; }
}

/* ============================================
   NHAN VIEN MODULE — RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .nv-summary-row { grid-template-columns: repeat(2, 1fr); }
  .nv-sal-grid { grid-template-columns: 1fr; }
  .nv-profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nv-summary-row { grid-template-columns: 1fr; }
  .nv-emp-grid { grid-template-columns: 1fr; }
  .nv-profile-header { flex-direction: column; text-align: center; }
  .nv-profile-actions { justify-content: center; }
  .nv-tabs { gap: 0; }
  .nv-tab { padding: 8px 12px; font-size: 0.8rem; }
  .nv-sal-net { flex-direction: column; gap: 8px; text-align: center; }
  .nv-sal-net-amount { font-size: 1.4rem; }
  .nv-kpi-score-card { flex-direction: column; text-align: center; }
  .nv-modal { margin: 0 12px; max-width: calc(100vw - 24px); }
  .nv-form-grid { grid-template-columns: 1fr; }
  .nv-toolbar { flex-direction: column; }
  .nv-search-box { width: 100%; }
}

/* ============================================
   SIDEBAR BADGE + LOGOUT
   ============================================ */
.nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-left: auto;
  animation: badgePulse 2s infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.sidebar-logout-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  margin-left: auto;
}
.sidebar-logout-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.sidebar-footer .sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   PENDING ACCOUNTS PANEL
   ============================================ */
.nv-pending-section {
  background: linear-gradient(135deg, #FEF3C7, #FFFBEB);
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.nv-pending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.nv-pending-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #92400E;
}
.nv-pending-count {
  background: #EF4444;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.nv-pending-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nv-pending-card {
  background: #fff;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  padding: 16px;
}
.nv-pending-card-top {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}
.nv-pending-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nv-pending-info h4 { font-size: 0.95rem; font-weight: 700; }
.nv-pending-info span { font-size: 0.82rem; color: var(--text-secondary); }
.nv-pending-rules {
  color: var(--success) !important;
  font-weight: 600;
}
.nv-pending-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #FDE68A;
}

/* ============================================
   PHAN QUYEN MODULE
   ============================================ */
.pq-container { display: flex; flex-direction: column; gap: 16px; }
.pq-legend {
  display: flex; flex-wrap: wrap; gap: 12px; padding: 14px 18px;
  background: var(--bg-surface); border-radius: var(--radius); border: 1px solid var(--border-color);
}
.pq-legend-item {
  display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600;
  color: var(--lc); white-space: nowrap;
}
.pq-toolbar {
  display: flex; gap: 12px; align-items: center;
}
.pq-search {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem;
  background: var(--bg-surface); outline: none; transition: border .2s;
}
.pq-search:focus { border-color: var(--primary); }
.pq-hint {
  font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap;
}
.pq-table-wrap {
  overflow-x: auto; background: var(--bg-surface);
  border-radius: var(--radius); border: 1px solid var(--border-color);
}
.pq-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.pq-table thead { background: var(--bg-secondary); }
.pq-table th {
  padding: 12px 10px; text-align: center; font-weight: 700; font-size: 0.78rem;
  color: var(--text-secondary); white-space: nowrap; border-bottom: 2px solid var(--border-color);
}
.pq-th-emp { text-align: left; min-width: 180px; position: sticky; left: 0; background: var(--bg-secondary); z-index: 1; }
.pq-th-mod { min-width: 80px; }
.pq-table tbody tr { border-bottom: 1px solid var(--border-color); transition: background .1s; }
.pq-table tbody tr:hover { background: var(--primary-50, #EFF6FF); }
.pq-td-emp {
  position: sticky; left: 0; background: var(--bg-surface); z-index: 1;
  padding: 10px 12px; cursor: pointer; transition: background .15s;
}
.pq-td-emp:hover .pq-emp-name { color: var(--primary); text-decoration: underline; }
.pq-table tbody tr:hover .pq-td-emp { background: var(--primary-50, #EFF6FF); }
.pq-emp-info { display: flex; align-items: center; gap: 10px; }
.pq-emp-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.pq-emp-name { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.pq-emp-code { font-size: 0.75rem; color: var(--text-secondary); }
.pq-cell {
  text-align: center; padding: 8px 6px; position: relative; cursor: pointer;
  transition: background .1s;
}
.pq-cell:hover { background: rgba(37,99,235,0.08); transform: scale(1.15); }
.pq-cell:active { transform: scale(0.95); }
.pq-cell-icon { font-size: 1.1rem; }
.pq-cell-lv { display: none; }

/* Dropdown chọn quyền */
.pq-dropdown {
  background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  z-index: 9999; min-width: 170px; padding: 6px; overflow: hidden;
  animation: pqDdIn .15s ease;
}
@keyframes pqDdIn { from { opacity: 0; } to { opacity: 1; } }
.pq-dd-header {
  padding: 8px 12px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color); margin-bottom: 4px;
}
.pq-dd-header small { font-weight: 400; color: var(--primary); }
.pq-dd-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 12px; border: none; background: none;
  font-family: inherit; font-size: 0.85rem; cursor: pointer; border-radius: 8px;
  transition: background .1s;
}
.pq-dd-item:hover { background: #F1F5F9; }
.pq-dd-item.active { background: #EFF6FF; font-weight: 700; }

/* Panel slide-in */
.pq-panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.pq-panel-overlay.open { opacity: 1; pointer-events: auto; }
.pq-panel {
  position: fixed; top: 0; right: -460px; width: 440px; max-width: 90vw;
  height: 100vh; background: #fff; z-index: 201;
  box-shadow: -4px 0 30px rgba(0,0,0,0.12);
  transition: right .3s ease; overflow-y: auto;
}
.pq-panel.open { right: 0; }
.pq-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.pq-panel-header h3 { margin: 0; font-size: 1rem; }
.pq-panel-close {
  width: 32px; height: 32px; border: none; background: var(--bg-secondary);
  border-radius: 50%; font-size: 1.2rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: background .15s;
}
.pq-panel-close:hover { background: var(--border-color); }
.pq-panel-body { padding: 20px 24px; }
.pq-panel-info {
  display: flex; gap: 12px; font-size: 0.85rem; color: var(--text-secondary);
}
.pq-panel-module {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid #F1F5F9;
}
.pq-panel-mod-name { font-weight: 600; font-size: 0.88rem; min-width: 120px; }
.pq-panel-mod-btns { display: flex; gap: 4px; }
.pq-lvl-btn {
  width: 36px; height: 32px; border: 2px solid transparent;
  border-radius: 8px; background: #F8FAFC; cursor: pointer;
  font-size: 0.9rem; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.pq-lvl-btn:hover { background: #EFF6FF; border-color: #BFDBFE; }
.pq-lvl-btn.active {
  background: color-mix(in srgb, var(--btn-c) 15%, white);
  border-color: var(--btn-c);
}

/* Lịch sử thay đổi */
.pq-log-item {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0;
  border-bottom: 1px solid #F8FAFC; font-size: 0.82rem;
}
.pq-log-date { color: var(--text-secondary); min-width: 120px; }
.pq-log-detail { font-weight: 600; flex: 1; }
.pq-log-by { color: var(--text-secondary); font-style: italic; }

/* Thông báo đổi quyền */
.perm-notif-list {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px;
  text-align: left;
}
.perm-notif-row {
  display: flex; justify-content: space-between; padding: 8px 12px;
  background: #F0FDF4; border-radius: 8px; font-size: 0.88rem;
}
.perm-notif-module { font-weight: 600; }
.perm-notif-change { color: var(--success); font-weight: 600; }

/* Toast container cho phan quyen (nếu ko có nvToast) */
.pq-container .nv-toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
}

@media (max-width: 768px) {
  .pq-panel { width: 100vw; right: -100vw; }
  .pq-th-mod { min-width: 60px; font-size: 0.7rem; }
  .pq-legend { gap: 8px; font-size: 0.75rem; }
}
