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

/* =========================================================
   css/variables.css - Design System Tokens & Animations
   ========================================================= */

:root {
  color-scheme: dark;
  /* Color palette */
  --bg-primary: #0b0b14;
  --bg-secondary: #131322;
  --bg-card: rgba(22, 22, 38, 0.85);
  --bg-card-hover: rgba(32, 32, 54, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-strong: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(255, 255, 255, 0.06);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(99, 102, 241, 0.35);

  --text-primary: #f1f1f8;
  --text-secondary: rgba(232, 232, 240, 0.7);
  --text-muted: rgba(232, 232, 240, 0.4);

  --accent-primary: #6366f1;
  --accent-primary-glow: rgba(99, 102, 241, 0.25);
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.25);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.25);

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.25);

  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 10px 36px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 24px var(--accent-primary-glow);

  /* Border radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --header-height: 60px;
  --bottom-nav-height: 64px;
  --max-content-width: 1400px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}


/* =========================================================
   css/base.css - Reset, Typography, Layout, Navbar, Filters
   ========================================================= */

/* Reset & Utility */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

/* Role-based display enforcement */
body.employee-mode [data-tab="report"],
body.employee-mode .admin-only,
body.employee-mode #btnDesktopAdd,
body.employee-mode #fabAdd,
body.employee-mode #dbStatusBadge,
body.employee-mode #personFilter {
  display: none !important;
}

body:not(.employee-mode) #employeeTaskScope {
  display: none !important;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

select option,
select optgroup {
  color: #111827;
  background: #ffffff;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + var(--safe-bottom));
}

@media (min-width: 768px) {
  body {
    padding-bottom: var(--space-xl);
  }
}

/* Ambient Background Light */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 90% 60% at 15% 5%, rgba(99, 102, 241, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 95%, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ===== HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 20, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px var(--space-md);
  padding-top: calc(12px + var(--safe-top));
}

.header-container {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.brand-icon {
  font-size: 1.4rem;
  background: var(--bg-glass-strong);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-medium);
}

.app-title {
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.header-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Desktop Navigation in Header */
.desktop-nav {
  display: none;
  gap: 6px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

@media (min-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .header-brand {
    order: 1;
  }

  .header-actions {
    order: 2;
    margin-left: auto;
  }

  .desktop-nav {
    display: flex;
    order: 3;
    flex: 0 0 100%;
    justify-content: center;
    border-radius: var(--radius-md);
  }
}

.desktop-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.desktop-nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.desktop-nav-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

.nav-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--bg-glass-strong);
  color: var(--text-primary);
}

.desktop-nav-btn.active .nav-counter {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

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

.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-medium);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-glass);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-add-desktop {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent-gradient);
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-add-desktop:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

@media (min-width: 768px) {
  .btn-add-desktop {
    display: flex;
  }
}

/* Database Status Badge */
.db-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.db-status-badge.connected {
  color: var(--success);
  border-color: var(--success-border);
  background: var(--success-bg);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  max-width: 1560px;
  margin: 0 auto;
  padding: var(--space-md);
  position: relative;
  z-index: 1;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* ===== TOP CONTROLS & FILTER BAR ===== */
.top-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

@media (max-width: 768px) {
  .filter-bar {
    flex-wrap: wrap;
  }
}

.employee-task-scope {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
}

.employee-scope-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.employee-scope-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass-strong);
}

.employee-scope-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-select {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.filter-select:hover {
  border-color: var(--accent-primary);
  background: var(--bg-glass-strong);
}

.filter-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

.search-wrapper {
  position: relative;
  min-width: 220px;
  flex: 1 1 240px;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 8px 14px 8px 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-glow);
  background: var(--bg-card);
}

.search-wrapper::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  opacity: 0.5;
  pointer-events: none;
}

/* ===== MOBILE BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 11, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  padding-bottom: var(--safe-bottom);
}

@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  min-height: 56px;
}

.bottom-nav-item .icon {
  font-size: 1.25rem;
  margin-bottom: 2px;
  transition: transform var(--transition-fast);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--text-primary);
}

.bottom-nav-item.active .icon {
  transform: scale(1.1);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* FAB for Mobile */
.fab-add {
  position: fixed;
  bottom: calc(70px + var(--safe-bottom));
  right: var(--space-md);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: white;
  border: none;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-primary-glow), var(--shadow-lg);
  z-index: 99;
  transition: all var(--transition-fast);
}

.fab-add:hover {
  transform: scale(1.05);
}

@media (min-width: 768px) {
  .fab-add {
    display: none;
  }
}


/* =========================================================
   css/components.css - Task Groups, Cards, Chips, Badges
   ========================================================= */

/* Grid of Task Groups */
.task-groups-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .task-groups-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1400px) {
  .task-groups-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== TASK GROUP CARD CONTAINER ===== */
.task-group {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: all var(--transition-normal);
  position: relative;
  display: flex;
  flex-direction: column;
}

.task-group:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.group-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.group-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.group-title {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.group-title .emoji {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.group-dept-pill {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.group-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.group-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.progress-bar {
  width: 50px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--bg-glass-strong);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width var(--transition-slow);
}

.progress-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 32px;
  text-align: right;
}

.group-bulk-btn {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.group-bulk-btn:hover {
  background: var(--accent-primary-glow);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.group-copy-btn {
  padding: 4px 9px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.group-copy-btn:hover {
  background: rgba(139, 92, 246, 0.28);
  border-color: rgba(139, 92, 246, 0.7);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}

.group-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subgroup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 4px 0;
  padding: 5px 10px;
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.subgroup-header:first-child {
  margin-top: 0;
}

.subgroup-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #c7d2fe;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subgroup-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-glass-strong);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* ===== TASK ITEM CARD ===== */
.task-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.task-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.task-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.task-card:hover::before {
  opacity: 1;
}

.task-card.info-only {
  cursor: default;
}

.task-card.info-only:hover::before {
  opacity: 0;
}

.task-card.completed {
  opacity: 0.5;
}

.task-card.completed::before {
  background: var(--success);
  opacity: 1;
}

.task-card.completed .task-name {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.task-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-checkbox {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-medium);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-top: 1px;
  color: transparent;
  font-size: 0.72rem;
  font-weight: 700;
}

.task-checkbox:hover {
  border-color: var(--accent-primary);
  background: var(--accent-primary-glow);
}

.task-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
  animation: checkBounce 0.3s ease;
}

.meta-tag.info-only {
  background: rgba(56, 189, 248, 0.12);
  color: var(--info);
}

@keyframes checkBounce {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

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

.task-name {
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 6px;
  transition: all var(--transition-fast);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
}

.meta-tag.badge-daily {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.meta-tag.badge-once {
  background: rgba(236, 72, 153, 0.15);
  color: #f9a8d4;
  border: 1px solid rgba(236, 72, 153, 0.32);
}

.meta-tag.badge-weekly {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.meta-tag.badge-monthly {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.meta-tag.person {
  background: var(--info-bg);
  color: var(--info);
}

.meta-tag.support-person {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-secondary);
}

.meta-tag.photo {
  background: var(--warning-bg);
  color: var(--warning);
}

.meta-tag.department {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
}

.meta-tag.mine {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.meta-tag.support-role {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.meta-tag.overdue {
  background: var(--danger-bg);
  color: var(--danger);
  animation: pulse-tag 2s infinite;
}

@keyframes pulse-tag {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.task-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.task-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
}

.task-action-btn:hover {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
}

.task-action-btn.delete:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ===== WEEKLY DAYS GRID ===== */
.weekly-days {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.day-chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.day-chip.scheduled {
  border-color: var(--border-accent);
  color: var(--accent-primary);
  background: var(--accent-primary-glow);
}

.day-chip.today {
  border-color: var(--warning);
  color: var(--warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.day-chip.completed {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* ===== SUMMARY STRIP ===== */
.summary-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.summary-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.summary-chip .dot.green { background: var(--success); box-shadow: 0 0 6px var(--success); }
.summary-chip .dot.red { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.summary-chip .dot.yellow { background: var(--warning); box-shadow: 0 0 6px var(--warning); }


/* =========================================================
   css/calendar.css - Daily Date Navigator & Custom Glass Calendar
   ========================================================= */

/* ===== DAILY TOOLBAR (Date Navigator + View Mode Switcher) ===== */
.daily-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.date-navigator-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.view-mode-bar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.view-mode-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass-strong);
}

.view-mode-btn.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.daily-date-navigator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.daily-date-btn-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.daily-date-btn-box:hover {
  background: var(--bg-glass-strong);
  border-color: var(--accent-primary);
}

.daily-date-label {
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
}

.daily-date-arrow {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  pointer-events: none;
}

.daily-date-btn-box.open .daily-date-arrow {
  transform: rotate(180deg);
}

.daily-date-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  pointer-events: none;
}

/* Custom In-App Glassmorphic Calendar Popup */
.custom-datepicker-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  width: 290px;
  padding: 14px;
  background: #171728;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(16px);
  animation: calFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

@keyframes calFadeIn {
  from { opacity: 0; transform: translate(-50%, -8px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.cal-month-title {
  font-size: 0.92rem;
  font-weight: 750;
  color: var(--text-primary);
}

.cal-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-glass);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all var(--transition-fast);
}

.cal-nav-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  margin-bottom: 6px;
}

.cal-weekday {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cal-day:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
}

.cal-day.other-month {
  color: rgba(232, 232, 240, 0.2);
}

.cal-day.today {
  border: 1px solid var(--accent-primary);
  color: #a5b4fc;
  font-weight: 700;
}

.cal-day.selected {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 10px var(--accent-primary-glow);
}

.cal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.cal-footer-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.cal-footer-btn.today {
  color: #34d399;
}
.cal-footer-btn.today:hover {
  background: rgba(16, 185, 129, 0.15);
}

.cal-footer-btn.close {
  color: var(--text-muted);
}
.cal-footer-btn.close:hover {
  color: var(--text-primary);
  background: var(--bg-glass-strong);
}

/* Modal Date Picker Box */
.modal-date-picker-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.modal-date-picker-box:hover {
  background: var(--bg-glass-strong);
  border-color: var(--accent-primary);
}

.modal-date-picker-box.open {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

.modal-date-picker-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  pointer-events: none;
}

.modal-cal-popup {
  top: calc(100% + 6px);
  left: 0;
  transform: none;
  width: 280px;
}

.btn-today {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-today:hover {
  background: var(--accent-primary-glow);
  border-color: var(--accent-primary);
  color: #fff;
}

/* ===== WEEK & MONTH SELECTOR ===== */
.week-selector, .month-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: var(--space-sm) 0;
}

.week-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-glass);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.week-nav-btn:hover {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
}

.week-label, .month-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 200px;
  text-align: center;
}


/* =========================================================
   css/select.css - Searchable Multi-Select Dropdown
   ========================================================= */

.employee-search-select {
  position: relative;
  width: 100%;
}

.employee-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: .82rem;
  text-align: left;
  cursor: pointer;
}

.employee-search-select.open .employee-select-trigger {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

.employee-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-select-arrow {
  color: var(--text-muted);
  transition: transform .15s ease;
}

.employee-search-select.open .employee-select-arrow {
  transform: rotate(180deg);
}

.employee-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1100;
  display: none;
  padding: 8px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: #171727;
  box-shadow: var(--shadow-lg);
}

.employee-search-select.open .employee-select-dropdown {
  display: block;
}

.employee-select-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  outline: none;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: .82rem;
}

.employee-select-search:focus {
  border-color: var(--accent-primary);
}

.employee-select-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 6px;
  margin-top: 4px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.72rem;
}

.employee-select-clear-btn,
.employee-select-done-btn {
  background: transparent;
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.employee-select-clear-btn {
  color: var(--text-muted);
}
.employee-select-clear-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.employee-select-done-btn {
  color: var(--accent-primary);
}
.employee-select-done-btn:hover {
  color: white;
  background: var(--accent-primary);
}

.employee-select-count {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
}

.employee-select-options {
  max-height: 200px;
  margin-top: 6px;
  overflow-y: auto;
}

.employee-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: .8rem;
  text-align: left;
  cursor: pointer;
}

.employee-select-option .option-check {
  font-size: 0.88rem;
  color: var(--text-muted);
  min-width: 16px;
}

.employee-select-option.selected .option-check {
  color: var(--accent-primary);
}

.employee-select-option:hover,
.employee-select-option.selected {
  color: white;
  background: rgba(99, 102, 241, .2);
}

.employee-select-empty {
  padding: 12px 8px;
  color: var(--text-muted);
  font-size: .78rem;
  text-align: center;
}

.employee-select-value.placeholder {
  color: var(--text-muted);
}

.zalo-employee-select {
  flex: 1;
  min-width: 0;
}

.zalo-employee-select .employee-select-dropdown {
  min-width: min(360px, 80vw);
}

.zalo-employee-select .employee-select-option {
  min-height: 38px;
}

.zalo-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zalo-option-status {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.zalo-option-status.connected {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.zalo-option-status.missing {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
}

@media (max-width: 520px) {
  .employee-select-options { max-height: 180px; }
}


/* =========================================================
   css/modal.css - Modals, Dialogs, Toast, Forms, Admin Tab
   ========================================================= */

/* ===== MODAL OVERLAY & CONTAINER ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 620px;
  max-height: 94vh;
  overflow-y: auto;
  padding: 16px 20px;
  padding-bottom: calc(16px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  border: 1px solid var(--border-medium);
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-content {
    border-radius: var(--radius-xl);
    transform: translateY(20px);
    max-height: 92vh;
    padding: 18px 24px;
  }
  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }
}

.modal-handle {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border-medium);
  margin: 0 auto 10px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Forms inside modal */
.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-hint {
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  font-size: 0.68rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-glow);
  background: var(--bg-card);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-days {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.form-day-btn {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-day-btn.selected {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* ===== TASK GROUP MULTISELECT IN MODAL ===== */
.task-group-multiselect {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
}

.task-group-family {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.task-group-choice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.task-group-choice input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  margin: 0;
}

.task-group-choice:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: var(--bg-glass-strong);
}

.task-group-choice:has(input:checked),
.task-group-choice.checked {
  background: rgba(99, 102, 241, 0.25) !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
}

.task-group-root {
  font-weight: 650;
  color: var(--text-primary);
}

.task-group-children {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 6px;
  border-left: 2px solid rgba(99, 102, 241, 0.35);
  margin-left: 2px;
}

.task-group-child {
  font-size: 0.74rem;
  padding: 3px 8px;
}

/* Modal Date Picker Box */
.modal-date-picker-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-date-picker-box:hover {
  border-color: var(--accent-primary);
}

.modal-date-picker-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  pointer-events: none;
}

.modal-cal-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1200;
}

/* ===== SEARCHABLE MULTI-SELECT DROPDOWN ===== */
.employee-search-select {
  position: relative;
  width: 100%;
}

.employee-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.employee-search-select.open .employee-select-trigger {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

.employee-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-select-arrow {
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.employee-search-select.open .employee-select-arrow {
  transform: rotate(180deg);
}

.employee-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1100;
  display: none;
  padding: 8px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: #171727;
  box-shadow: var(--shadow-lg);
}

.employee-search-select.open .employee-select-dropdown {
  display: block;
}

.employee-select-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  outline: none;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
}

.employee-select-search:focus {
  border-color: var(--accent-primary);
}

.employee-select-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 6px;
  margin-top: 4px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.72rem;
}

.employee-select-clear-btn,
.employee-select-done-btn {
  background: transparent;
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.employee-select-clear-btn {
  color: var(--text-muted);
}
.employee-select-clear-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.employee-select-done-btn {
  color: var(--accent-primary);
}
.employee-select-done-btn:hover {
  color: white;
  background: var(--accent-primary);
}

.employee-select-count {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
}

.employee-select-options {
  max-height: 200px;
  margin-top: 6px;
  overflow-y: auto;
}

.employee-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.employee-select-option .option-check {
  font-size: 0.88rem;
  color: var(--text-muted);
  min-width: 16px;
}

.employee-select-option.selected .option-check {
  color: var(--accent-primary);
}

.employee-select-option:hover,
.employee-select-option.selected {
  color: white;
  background: rgba(99, 102, 241, 0.2);
}

.employee-select-empty {
  padding: 12px 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.employee-select-value.placeholder {
  color: var(--text-muted);
}

.form-checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 0;
}

.form-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.form-checkbox-row label {
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-row {
  display: flex;
  gap: var(--space-sm);
  margin-top: 10px;
}

.btn {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px var(--accent-primary-glow);
}

.btn-secondary {
  background: var(--bg-glass-strong);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

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

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

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 420px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.84rem;
  font-weight: 500;
  pointer-events: auto;
  animation: slideDown 0.3s ease;
  backdrop-filter: blur(12px);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }

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

/* ===== CONFIRM DIALOG ===== */
.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

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

.confirm-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  width: calc(100% - 48px);
  max-width: 400px;
  text-align: center;
}

.confirm-box p {
  font-size: 0.92rem;
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(99, 102, 241, 0.2), transparent 35%),
    radial-gradient(circle at 80% 90%, rgba(16, 185, 129, 0.12), transparent 35%),
    #090b14;
}

.login-screen.active {
  display: grid;
}

.auth-locked > :not(.login-screen):not(.toast-container) {
  visibility: hidden;
}

.login-card {
  width: min(100%, 420px);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  background: rgba(20, 23, 38, .96);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}

.login-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 16px;
  color: white;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #22c55e);
}

.login-card h1 { margin: 0 0 8px; font-size: 1.65rem; }
.login-card > p { margin: 0 0 26px; color: var(--text-secondary); line-height: 1.55; }
.login-card .form-label { display: block; margin: 15px 0 8px; }
.login-card .form-input { width: 100%; }
.login-submit { width: 100%; margin-top: 20px; justify-content: center; }
.login-error { min-height: 20px; margin-top: 12px; color: var(--danger, #ef4444); font-size: .88rem; }
.internal-auth-card { text-align: center; }
.internal-auth-card .login-mark { margin-inline: auto; }
.internal-portal-link { width: 100%; justify-content: center; text-decoration: none; }

.current-user {
  text-align: right;
  white-space: nowrap;
}
.current-user-name { color: var(--text-primary); font-weight: 700; font-size: .82rem; }
.current-user-role { color: var(--text-muted); font-size: .7rem; margin-top: 2px; }

/* ===== EMPLOYEE MANAGEMENT & POSITION STYLES ===== */
.employee-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.employee-toolbar h2 { margin: 0 0 6px; }
.employee-toolbar p { margin: 0; color: var(--text-secondary); }
.employee-toolbar-actions { display: flex; gap: 10px; }
.employee-toolbar-actions .search-input { min-width: 300px; }
.employee-list { display: grid; gap: 14px; }
.position-create {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(160px, .7fr) minmax(220px, 1.2fr) auto;
  gap: 10px;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-glass);
}
.employee-card {
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-card);
}
.employee-card.employee-hidden { opacity: .62; }
.employee-card-head { display: flex; align-items: center; gap: 14px; }
.position-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.position-edit-form {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(160px, .8fr) minmax(210px, 1.2fr) auto;
  gap: 9px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  background: rgba(99, 102, 241, .06);
}
.position-edit-actions { display: flex; align-items: center; gap: 7px; }
.employee-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.employee-identity { min-width: 0; flex: 1; }
.employee-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.employee-name { font-weight: 750; color: var(--text-primary); }
.employee-edit-btn {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-glass);
  color: #c7d2fe;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.employee-edit-btn:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: var(--accent-primary);
  color: white;
}
.employee-shortname-badge {
  color: #a5b4fc;
}
.employee-shortname-badge strong {
  color: #ffffff;
}
.employee-meta { margin-top: 4px; color: var(--text-muted); font-size: .78rem; }
.admin-pill {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fbbf24;
  background: rgba(245, 158, 11, .14);
  font-size: .67rem;
  vertical-align: middle;
}
.department-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.position-family {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 5px;
  border-radius: 12px;
}
.position-family:has(.position-children) {
  flex-basis: 100%;
  border: 1px solid rgba(99, 102, 241, .18);
  background: rgba(99, 102, 241, .045);
}
.position-children {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-left: 10px;
  border-left: 2px solid rgba(139, 92, 246, .35);
}
.position-parent-option span { font-weight: 700; }
.position-parent-option small {
  margin-left: 7px;
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 500;
}
.position-child-option span { border-style: dashed; }
.position-child-card {
  margin-left: 34px;
  border-left: 3px solid rgba(139, 92, 246, .45);
}
.department-option { position: relative; cursor: pointer; }
.department-option input { position: absolute; opacity: 0; pointer-events: none; }
.department-option span {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: .78rem;
  transition: .15s ease;
}
.department-option input:checked + span {
  border-color: #6366f1;
  color: #c7d2fe;
  background: rgba(99, 102, 241, .16);
}

/* ===== REPORT STYLES ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

@media (min-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-number.danger {
  background: linear-gradient(135deg, #ef4444, #f87171);
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-number.success {
  background: linear-gradient(135deg, #10b981, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-number.warning {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-split-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

@media (min-width: 1024px) {
  .report-split-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    align-items: start;
  }
}

.report-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.report-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.staff-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.staff-card:hover {
  border-color: var(--border-medium);
}

.staff-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.staff-stats {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.staff-stat {
  text-align: center;
}

.staff-stat-num {
  font-size: 1.05rem;
  font-weight: 700;
}

.staff-stat-label {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* ===== REPORT INCOMPLETE TASKS BY PERSON & REMINDERS ===== */
.person-incomplete-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: all var(--transition-fast);
}

.person-incomplete-block:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.person-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.person-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-copy-reminder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-copy-reminder:hover {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 12px var(--accent-primary-glow);
}

.btn-copy-all {
  padding: 6px 14px;
  font-size: 0.78rem;
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #c7d2fe;
}

.btn-copy-all:hover {
  background: var(--accent-gradient);
  color: white;
}

.person-task-mini-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.person-task-mini-item:last-child {
  margin-bottom: 0;
}

.person-task-mini-item:hover {
  background: var(--bg-glass-strong);
  border-color: var(--border-medium);
}

.person-task-bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  font-size: 0.72rem;
  font-weight: 750;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== ADMIN DROPDOWN MENU ===== */
.admin-menu {
  position: relative;
  display: inline-block;
}

.admin-menu-toggle {
  font-size: 1.1rem;
}

.admin-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1100;
  display: none;
  min-width: 220px;
  padding: 8px;
  background: #171728;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.15s ease-in-out;
}

.admin-menu.open .admin-menu-dropdown {
  display: block;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-menu-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}

.admin-menu-item span:first-child {
  font-size: 1.1rem;
}

.admin-menu-item strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
}

.admin-menu-item small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===== ZALO OA REMINDER SETTINGS STYLES ===== */
.zalo-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 1024px) {
  .zalo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }
}

.zalo-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.zalo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.zalo-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.zalo-card-title {
  font-size: 0.98rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

/* Switch Toggle */
.zalo-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.zalo-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.16);
  transition: 0.25s ease;
  border-radius: 24px;
}

.zalo-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s ease;
  border-radius: 50%;
}

.zalo-switch input:checked + .zalo-slider {
  background: var(--accent-gradient);
  box-shadow: 0 0 10px var(--accent-primary-glow);
}

.zalo-switch input:checked + .zalo-slider:before {
  transform: translateX(20px);
}

/* Times Container & Chips */
.zalo-times-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.zalo-time-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-full);
  color: #c7d2fe;
  font-size: 0.78rem;
  font-weight: 600;
}

.btn-remove-time {
  background: transparent;
  border: none;
  color: #f87171;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.btn-remove-time:hover {
  color: #ef4444;
  transform: scale(1.2);
}

.zalo-tags-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.zalo-tags-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-primary);
  font-family: monospace;
  font-size: 0.72rem;
}

.zalo-test-box {
  margin-top: 14px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
}

.zalo-test-box .form-label {
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Logs Table */
.zalo-logs-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.zalo-logs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.zalo-logs-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.zalo-logs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.zalo-logs-table tr:last-child td {
  border-bottom: none;
}

.zalo-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
}

.zalo-status-pill.ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.zalo-status-pill.err {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-zalo-person {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn-zalo-person:hover {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}
