/* Typography: Loaded via <link> in HTML with system-ui fallback */

/* CSS Variables - Official EVN-EC White & Emerald Corporate Theme */
:root {
  --primary: #10B981;
  --primary-dark: #047857;
  --primary-glow: rgba(16, 185, 129, 0.25);
  --secondary: #65A30D;
  --accent-solar: #15803D;
  --accent-solar-glow: rgba(21, 128, 61, 0.15);
  --accent-green: #059669;
  --accent-green-glow: rgba(5, 150, 105, 0.15);
  --accent-vinfast: #059669;
  --accent-vinfast-glow: rgba(5, 150, 105, 0.15);
  --danger: #DC2626;
  --warning: #D97706;
  --success: #10B981;
  --info: #0284C7;

  /* Background - Crisp White Base & Soft Canvas */
  --bg-base: #F4F7F5;
  --bg-dark: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F0FDF4;
  --bg-modal: #FFFFFF;
  --bg-input: #F8FAFC;

  /* Text - High Contrast Deep Slate & Emerald */
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;

  /* Borders */
  --border: #E2E8F0;
  --border-active: #10B981;

  /* Sidebar */
  --sidebar-width: 268px;
  --sidebar-collapsed: 68px;
  --header-height: 64px;

  /* Animations */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

button { cursor: pointer; border: none; outline: none; }

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

/* ===========================
   Scrollbar
   =========================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===========================
   Login Page
   =========================== */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(ellipse at 20% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
              var(--bg-base);
}

#login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 0 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,212,255,0.05) inset;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 30px var(--primary-glow);
}

.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===========================
   Layout
   =========================== */
#app {
  display: none;
  min-height: 100vh;
}

#app.visible { display: flex; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  max-height: 100vh;
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-slow), transform var(--transition-slow);
  overflow: visible;
}

.sidebar-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  background: #FFFFFF;
}

.sidebar-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #10B981, #059669);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.sidebar-toggle-btn {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #334155;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: #ECFDF5;
  border-color: #10B981;
  color: #047857;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  color: #0F172A;
}

.sidebar-title span {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-secondary);
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0 5.5rem;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #10B981;
}


/* Accordion Collapsible Nav Groups (Sắp xếp menu thu gọn / xổ ra chuẩn ảnh 1789208691572) */
.nav-group {
  margin-bottom: 0.25rem;
}

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  margin: 0.1rem 0.35rem;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  font-size: 0.79rem;
  font-weight: 800;
  color: #1E293B;
  background: transparent;
  letter-spacing: 0.1px;
}

.nav-group-header:hover {
  background: #F8FAFC;
  color: #0F172A;
}

.nav-group-header .group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.nav-group-header .group-title .group-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-group-header .group-title .group-icon {
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-group-header .group-arrow {
  font-size: 0.6rem;
  color: #94A3B8;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 0.35rem;
  display: inline-block;
  opacity: 0.75;
  flex-shrink: 0;
}

.nav-group.open > .nav-group-header {
  color: #047857;
}

.nav-group.open > .nav-group-header .group-arrow {
  transform: rotate(90deg);
  color: #10B981;
  opacity: 1;
  font-size: 0.65rem;
}

.nav-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.nav-group.open > .nav-group-items {
  max-height: 1200px;
  transition: max-height 0.35s ease-in-out;
}

.nav-group-items .nav-item {
  padding: 0.38rem 0.65rem 0.38rem 1.8rem;
  font-size: 0.81rem;
  font-weight: 600;
  margin: 0.1rem 0.3rem;
  border-radius: 8px;
  min-height: 32px;
}

.nav-group-items .nav-item.active {
  background: #E8FBF2 !important;
  color: #047857 !important;
  border: 1.5px solid #A7F3D0 !important;
  border-left: 1.5px solid #A7F3D0 !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12) !important;
}

.sidebar.collapsed .nav-group-header {
  display: none !important;
}

.sidebar.collapsed .nav-group {
  width: 100% !important;
  margin: 0 0 0.25rem 0 !important;
  padding: 0 0 0.25rem 0 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.sidebar.collapsed .nav-group-items {
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.sidebar.collapsed .dept-nav-sub {
  display: none !important;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0.55rem 0.75rem 0.15rem;
  margin-top: 0.4rem;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem;
  margin: 0.05rem 0.3rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  min-height: 34px;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: #ECFDF5;
  color: #047857;
  border-left: 4px solid #10B981;
  border: 1px solid #A7F3D0;
  font-weight: 700;
}

.nav-item.active .nav-icon { color: #047857; }

.nav-icon {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  transition: background var(--transition);
  cursor: pointer;
}

.user-info:hover { background: var(--bg-card-hover); }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-details { overflow: hidden; }
.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Sidebar Collapsed Mode */
#sidebar.collapsed,
.sidebar.collapsed {
  width: var(--sidebar-collapsed) !important;
}

#sidebar.collapsed .sidebar-header,
.sidebar.collapsed .sidebar-header {
  padding: 0.75rem 0 !important;
  justify-content: center !important;
  position: relative !important;
}

#sidebar.collapsed .sidebar-brand-wrapper,
.sidebar.collapsed .sidebar-brand-wrapper {
  gap: 0 !important;
  justify-content: center !important;
  width: 100% !important;
}

#sidebar.collapsed .sidebar-toggle-btn,
.sidebar.collapsed .sidebar-toggle-btn {
  display: flex !important;
  position: absolute;
  right: -12px;
  top: 20px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10B981 !important;
  color: #FFFFFF !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  cursor: pointer;
  z-index: 101;
  border: 2px solid #FFFFFF !important;
  font-size: 0.65rem !important;
  padding: 0 !important;
}
#sidebar.collapsed .sidebar-toggle-btn span,
#sidebar.collapsed #sidebar-toggle-icon,
.sidebar.collapsed .sidebar-toggle-btn span,
.sidebar.collapsed #sidebar-toggle-icon {
  display: inline-block;
  transform: none !important;
  line-height: 1;
}

#sidebar.collapsed .sidebar-nav,
.sidebar.collapsed .sidebar-nav {
  padding: 0.35rem 0 0.5rem !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

#sidebar.collapsed .sidebar-nav::-webkit-scrollbar,
.sidebar.collapsed .sidebar-nav::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

#sidebar.collapsed .sidebar-nav > div[style],
.sidebar.collapsed .sidebar-nav > div[style] {
  padding: 0 0 0.25rem 0 !important;
  margin: 0 0 0.25rem 0 !important;
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
}

#sidebar.collapsed .sidebar-title,
#sidebar.collapsed .logo-text-box,
#sidebar.collapsed .nav-text,
#sidebar.collapsed .nav-section-label,
#sidebar.collapsed .nav-item > :not(.nav-icon),
#sidebar.collapsed .sidebar-footer .user-info-trigger > :not(.user-avatar),
#sidebar.collapsed .sidebar-footer .sidebar-footer-text,
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .logo-text-box,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item > :not(.nav-icon),
.sidebar.collapsed .sidebar-footer .user-info-trigger > :not(.user-avatar),
.sidebar.collapsed .sidebar-footer .sidebar-footer-text {
  display: none !important;
}

#sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-footer {
  padding: 0.5rem 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#sidebar.collapsed .sidebar-footer .user-dropdown-container,
.sidebar.collapsed .sidebar-footer .user-dropdown-container {
  justify-content: center !important;
  width: 44px !important;
  margin: 0 auto !important;
}

#sidebar.collapsed .sidebar-footer .user-info-trigger,
.sidebar.collapsed .sidebar-footer .user-info-trigger {
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  margin: 0 auto !important;
}

#sidebar.collapsed .sidebar-nav .nav-item,
.sidebar.collapsed .nav-item {
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  margin: 1px auto !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
}

#sidebar.collapsed .sidebar-nav .nav-item.dept-nav-sub,
.sidebar.collapsed .nav-item.dept-nav-sub {
  display: none !important;
}

#app.sidebar-is-collapsed .header {
  padding-left: 1.85rem !important;
}

#sidebar.collapsed .sidebar-nav .nav-item .nav-icon,
.sidebar.collapsed .nav-icon {
  margin: 0 !important;
  width: 22px !important;
  height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.08rem !important;
  line-height: 1 !important;
}

#app.sidebar-is-collapsed .main-content {
  margin-left: var(--sidebar-collapsed) !important;
}

/* Topbar Action Buttons */
.btn-topbar-action {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-topbar-action:hover {
  background: #ECFDF5;
  border-color: #10B981;
  color: #047857;
  transform: translateY(-1px);
}

/* Official EVN-EC White & Emerald Corporate Theme Overrides */
.sidebar {
  background: #FFFFFF;
  border-right: 1px solid #E2E8F0;
  box-shadow: 2px 0 12px rgba(0,0,0,0.03);
}

.header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.card,
.dept-card,
.kanban-col,
.unit-banner,
.user-dropdown-menu,
.modal-content,
.login-card,
.task-card {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  color: #0F172A !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.05) !important;
}

/* Force override any dark background inline styles */
[style*="background:rgba(15,23,42"],
[style*="background: rgba(15,23,42"],
[style*="background:rgba(10,15,30"],
[style*="background: rgba(10,15,30"],
[style*="background:rgba(10,31,22"],
[style*="background: rgba(10,31,22"],
[style*="background:#0F172A"],
[style*="background: #0F172A"],
[style*="background:#080E1A"],
[style*="background: #080E1A"],
[style*="background:#0D1526"],
[style*="background: #0D1526"] {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  color: #0F172A !important;
}

[style*="color:var(--text-primary)"],
[style*="color: var(--text-primary)"] {
  color: #0F172A !important;
}

[style*="color:var(--text-secondary)"],
[style*="color: var(--text-secondary)"] {
  color: #334155 !important;
}

[style*="color:var(--text-muted)"],
[style*="color: var(--text-muted)"] {
  color: #64748B !important;
}

/* Sub-box panels & progress bars - Semantic Colors Restored */
[style*="background:rgba(16, 185, 129, 0.12)"],
[style*="background: rgba(16, 185, 129, 0.12)"],
.alert-success {
  background: #F0FDF4 !important;
  border-color: #A7F3D0 !important;
  color: #047857 !important;
}

[style*="background:rgba(239, 68, 68, 0.12)"],
[style*="background: rgba(239, 68, 68, 0.12)"],
.alert-danger, .badge-danger {
  background: #FEF2F2 !important;
  border-color: #FECACA !important;
  color: #DC2626 !important;
}

[style*="background:rgba(245, 158, 11, 0.12)"],
[style*="background: rgba(245, 158, 11, 0.12)"],
.alert-warning, .badge-warning {
  background: #FFFBEB !important;
  border-color: #FDE68A !important;
  color: #D97706 !important;
}

[style*="background:rgba(59, 130, 246, 0.12)"],
[style*="background: rgba(59, 130, 246, 0.12)"],
.alert-info, .badge-info {
  background: #EFF6FF !important;
  border-color: #BFDBFE !important;
  color: #1D4ED8 !important;
}

[style*="background:rgba(255,255,255,0.03)"],
[style*="background: rgba(255,255,255,0.03)"] {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

.table-wrapper table th {
  background: #F0FDF4;
  color: #047857;
  border-bottom: 2px solid #CBD5E1;
  font-weight: 700;
}

.table-wrapper table td {
  border-bottom: 1px solid #F1F5F9;
  color: #0F172A;
}

.form-control {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #0F172A;
}

.form-control:focus {
  background: #FFFFFF;
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  transition: margin var(--transition-slow);
}

/* Header Topbar - Official Crisp White & Emerald Corporate */
.header {
  height: var(--header-height);
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2E8F0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0F172A !important;
  flex: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-dropdown-container {
  position: relative;
  display: flex;
  align-items: center;
}

.user-info-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

/* =====================================================
   NOTIFICATION SYSTEM (BELL DROPDOWN & FB POPUP TOAST)
   ===================================================== */
.notif-dropdown-container {
  position: relative;
  display: flex;
  align-items: center;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 20px;
  padding: 1px 5px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  border: 1px solid #FFFFFF;
  animation: pulseNotif 2s infinite;
}

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

.notif-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: -60px;
  width: 380px;
  max-width: 90vw;
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12) !important;
  display: none;
  flex-direction: column;
  z-index: 1100;
  overflow: hidden;
}

.notif-dropdown-menu.show {
  display: flex;
}

.notif-header {
  padding: 0.85rem 1rem 0.5rem 1rem;
  background: #F8FAFC;
  border-bottom: 1px solid #F1F5F9;
}

.notif-tabs {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.notif-tab {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.notif-tab:hover {
  background: #F0FDF4;
  border-color: #10B981;
  color: #047857;
}

.notif-tab.active {
  background: #10B981;
  border-color: #059669;
  color: #FFFFFF;
  font-weight: 700;
}

.notif-list {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.notif-item:hover {
  background: #F0FDF4;
}

.notif-item.unread {
  background: #ECFDF5;
}

.notif-item.unread::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
}

.notif-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.notif-icon-box.chat { background: #E0F2FE; color: #0284C7; }
.notif-icon-box.task { background: #FEF3C7; color: #D97706; }
.notif-icon-box.attendance { background: #FEE2E2; color: #DC2626; }
.notif-icon-box.fine { background: #FEE2E2; color: #B91C1C; }
.notif-icon-box.reward { background: #D1FAE5; color: #047857; }
.notif-icon-box.event { background: #EDE9FE; color: #7C3AED; }

.notif-content {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.35;
}

.notif-title {
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 0.15rem;
}

.notif-desc {
  color: #334155;
  font-size: 0.78rem;
}

.notif-time {
  font-size: 0.7rem;
  color: #64748B;
  margin-top: 0.25rem;
}

.notif-footer {
  padding: 0.5rem 1rem;
  background: #F8FAFC;
  border-top: 1px solid #F1F5F9;
  text-align: center;
}

/* Facebook-Style Live Toast Popup Container */
.fb-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
  width: calc(100vw - 40px);
  pointer-events: none;
}

.fb-toast {
  pointer-events: auto;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-left: 5px solid #10B981;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.fb-toast.chat { border-left-color: #0284C7; }
.fb-toast.task { border-left-color: #D97706; }
.fb-toast.warning { border-left-color: #EF4444; }
.fb-toast.fine { border-left-color: #DC2626; }
.fb-toast.reward { border-left-color: #10B981; }
.fb-toast.event { border-left-color: #8B5CF6; }

.fb-toast-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ECFDF5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.fb-toast-body {
  flex: 1;
}

.fb-toast-header {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fb-toast-text {
  font-size: 0.78rem;
  color: #334155;
  margin-top: 0.2rem;
  line-height: 1.3;
}

.fb-toast-time {
  font-size: 0.68rem;
  color: #64748B;
  margin-top: 0.3rem;
}

.fb-toast-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #94A3B8;
  cursor: pointer;
  padding: 0 0 0 0.5rem;
  line-height: 1;
}

.fb-toast-close:hover {
  color: #0F172A;
}

.user-info-trigger:hover {
  background: #ECFDF5;
  border-color: #10B981;
}

.user-dropdown-container {
  position: relative;
}

.sidebar-footer .user-dropdown-container {
  width: 100%;
}

.sidebar-footer .user-info-trigger {
  width: 100%;
  justify-content: flex-start;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
}

.sidebar-footer .user-details,
.sidebar-footer .user-details-box {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 270px;
  width: max-content;
  max-width: 330px;
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16) !important;
  padding: 0 0 0.4rem 0;
  display: none;
  flex-direction: column;
  z-index: 10050;
  overflow: hidden;
}

.sidebar-footer .user-dropdown-menu,
#sidebar .user-dropdown-menu {
  top: auto !important;
  bottom: calc(100% + 10px) !important;
  left: 0 !important;
  right: auto !important;
}

.user-dropdown-menu.show {
  display: flex;
}

.dropdown-header {
  padding: 0.85rem 1rem;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar.lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #FFFFFF;
  flex-shrink: 0;
}

.menu-user-name, .dropdown-header strong {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  color: #0F172A;
  line-height: 1.2;
}

.menu-user-email, #dropdown-user-email {
  font-size: 0.76rem;
  color: #64748B;
  margin-top: 0.15rem;
  font-weight: 500;
  white-space: nowrap;
}

.dropdown-divider {
  height: 1px;
  background: #E2E8F0;
  margin: 0.3rem 0;
  border: none;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  margin: 0.12rem 0.35rem;
  border-radius: 8px;
  color: #0F172A;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: #ECFDF5;
  color: #047857;
}

.dropdown-item.text-danger, .dropdown-item.danger {
  color: #DC2626;
}

.dropdown-item.text-danger:hover, .dropdown-item.danger:hover {
  background: #FEF2F2;
  color: #DC2626;
}

.dropdown-item.text-danger:hover {
  background: #FEE2E2;
}

/* Page content */
.page-content {
  padding: 1rem 0.5rem;
  width: 100%;
  max-width: 100% !important;
  margin: 0;
  box-sizing: border-box;
}

/* ===========================
   Cards & Glassmorphism
   =========================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

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

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===========================
   Stats Grid
   =========================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--primary));
}

.stat-card:hover {
  border-color: rgba(0,212,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  display: block;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.stat-change {
  font-size: 0.7rem;
  margin-top: 0.5rem;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
  font-weight: 600;
}
.btn-secondary:hover { background: #E2E8F0; color: #0F172A; border-color: #94A3B8; }

.btn-danger {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
  font-weight: 700;
}
.btn-danger:hover { background: #FCA5A5; color: #7F1D1D; }

.btn-solar {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
  font-weight: 700;
}
.btn-solar:hover { background: #FDE68A; color: #78350F; }

.btn-vinfast {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #6EE7B7;
  font-weight: 700;
}
.btn-vinfast:hover { background: #D1FAE5; color: #064E3B; }

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-active); }

/* ===========================
   Forms
   =========================== */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(0,212,255,0.05);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control option {
  background: var(--bg-modal);
  color: var(--text-primary);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 0 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

/* ===========================
   Tables
   =========================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: rgba(0,212,255,0.05);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }

tbody td {
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  vertical-align: middle;
}

/* ===========================
   Badges & Status
   =========================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-planning   { background: rgba(148,163,184,0.15); color: #94A3B8; }
.badge-survey     { background: rgba(245,158,11,0.15);  color: #F59E0B; }
.badge-approved   { background: rgba(59,130,246,0.15);  color: #3B82F6; }
.badge-in_progress{ background: rgba(0,212,255,0.15);   color: #00D4FF; }
.badge-testing    { background: rgba(168,85,247,0.15);  color: #A855F7; }
.badge-completed  { background: rgba(16,185,129,0.15);  color: #10B981; }
.badge-suspended  { background: rgba(249,115,22,0.15);  color: #F97316; }
.badge-cancelled  { background: rgba(239,68,68,0.15);   color: #EF4444; }

.badge-pending    { background: rgba(148,163,184,0.15); color: #94A3B8; }
.badge-blocked    { background: rgba(239,68,68,0.15);   color: #EF4444; }

.badge-solar      { background: rgba(245,158,11,0.15);  color: #F59E0B; }
.badge-vinfast    { background: rgba(16,185,129,0.15);  color: #10B981; }

.badge-low    { background: rgba(148,163,184,0.1); color: #64748B; }
.badge-medium { background: rgba(59,130,246,0.15); color: #3B82F6; }
.badge-high   { background: rgba(245,158,11,0.15); color: #F59E0B; }
.badge-urgent { background: rgba(239,68,68,0.15);  color: #EF4444; }

/* ===========================
   Modal
   =========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 10500 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-slow);
}

.modal-overlay.open, .modal-overlay.active, .modal-overlay[style*="display:flex"], .modal-overlay[style*="display: flex"] {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal {
  position: relative;
  z-index: 10501 !important;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,212,255,0.05) inset;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-slow);
}

.modal-overlay.open .modal, .modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-large { max-width: 900px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-modal);
  z-index: 1;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close {
  width: 34px;
  height: 34px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 9px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #1E293B !important;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.modal-header[style*="background: rgb(6, 78, 59)"] .modal-close,
.modal-header[style*="background:#059669"] .modal-close,
.modal-header[style*="background: #059669"] .modal-close,
.modal-header[style*="background:#111827"] .modal-close,
.modal-header[style*="background: #111827"] .modal-close,
.modal-header[style*="gradient"] .modal-close {
  background: rgba(255,255,255,0.2) !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  color: #FFFFFF !important;
}
