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

/* Color Theme & Core Tokens */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-rgb: 37, 99, 235;
  --secondary: #1e293b;
  --bg: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(226, 232, 240, 0.8);
  
  /* Status Colors */
  --success: #16a34a;
  --success-light: rgba(22, 163, 74, 0.1);
  --danger: #dc2626;
  --danger-light: rgba(220, 38, 38, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  
  /* Glassmorphism System */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
  --blur: blur(12px);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Layout Sizing */
  --sidebar-width: 260px;
  --navbar-height: 70px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Tokens */
:root.dark-mode {
  --bg: #0f172a;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(51, 65, 85, 0.6);
  
  /* Glassmorphism System for Dark Mode */
  --glass-bg: rgba(30, 41, 59, 0.65);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
  --secondary: #0f172a;
}

/* Reset & Base Elements */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 10px;
  opacity: 0.5;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Glassmorphism Styles */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* Layout Wrapper */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--glass-border);
  transition: var(--transition);
}

.sidebar-logo {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo i {
  font-size: 24px;
  color: var(--primary);
}

.sidebar-logo span {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-menu {
  flex: 1;
  padding: 20px 12px;
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
  gap: 12px;
}

.sidebar-menu li a i {
  font-size: 18px;
  width: 24px;
  display: flex;
  justify-content: center;
  transition: var(--transition);
}

.sidebar-menu li a:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}

.sidebar-menu li a:hover i {
  transform: translateX(2px);
  color: var(--primary);
}

.sidebar-menu li.active a {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.2);
}

.sidebar-menu li.active a i {
  color: white;
}

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

/* Top Navbar */
.navbar {
  height: var(--navbar-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid var(--glass-border);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.nav-search {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.nav-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.nav-search input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

:root.dark-mode .nav-search input {
  background: rgba(30, 41, 59, 0.4);
}

.nav-search input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

:root.dark-mode .nav-search input:focus {
  background: rgba(30, 41, 59, 0.8);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Quote and Weather Widgets */
.nav-widgets {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.widget-quote {
  max-width: 250px;
  font-style: italic;
  text-align: right;
  border-right: 1px solid var(--border-color);
  padding-right: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.widget-weather {
  display: flex;
  align-items: center;
  gap: 6px;
  border-right: 1px solid var(--border-color);
  padding-right: 16px;
}

.widget-clock {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.nav-icon-btn:hover {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}

.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-lg);
  transition: var(--transition);
  position: relative;
}

.nav-user:hover {
  background: rgba(var(--primary-rgb), 0.06);
}

.nav-user img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

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

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

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 180px;
  border-radius: var(--radius-md);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 120;
}

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

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.user-dropdown a:hover {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}

/* Notification Panel */
.notification-panel {
  position: absolute;
  top: 60px;
  right: 80px;
  width: 320px;
  max-height: 400px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  display: none;
  flex-direction: column;
  z-index: 120;
  overflow: hidden;
}

.notification-panel.show {
  display: flex;
}

.notif-header {
  padding: 14px 18px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-clear-btn {
  font-size: 12px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
}

.notif-list {
  overflow-y: auto;
  flex: 1;
}

.notif-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  font-size: 13px;
  transition: var(--transition);
  cursor: pointer;
}

.notif-item:hover {
  background: rgba(var(--primary-rgb), 0.04);
}

.notif-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-icon.success {
  background: var(--success-light);
  color: var(--success);
}

.notif-icon.danger {
  background: var(--danger-light);
  color: var(--danger);
}

.notif-icon.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.notif-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-text {
  font-weight: 500;
  line-height: 1.3;
}

.notif-time {
  font-size: 10px;
  color: var(--text-muted);
}

.notif-empty {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
}

/* Page Layout */
.content-body {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Page Headers */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

/* Grid & Cards Container */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.kpi-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.kpi-blue { background: rgba(37, 99, 235, 0.1); color: var(--primary); }
.kpi-green { background: rgba(22, 163, 74, 0.1); color: var(--success); }
.kpi-red { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.kpi-orange { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.kpi-purple { background: rgba(147, 51, 234, 0.1); color: #9333ea; }
.kpi-cyan { background: rgba(8, 145, 178, 0.1); color: #0891b2; }

/* Dashboard Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.dashboard-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.card-title i {
  color: var(--primary);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  outline: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(var(--primary-rgb), 0.05);
  border-color: var(--primary);
}

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

.btn-success:hover {
  opacity: 0.9;
}

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

.btn-danger:hover {
  opacity: 0.9;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Charts Containers */
.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
}

/* Tables System */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

thead th {
  background: rgba(var(--primary-rgb), 0.04);
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text);
  font-weight: 500;
}

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

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: rgba(var(--primary-rgb), 0.02);
}

/* Profile Photo cells & tags */
.emp-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.emp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: rgba(37, 99, 235, 0.1); color: var(--primary); }

/* Tabs Layout */
.tab-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

.tab-content {
  display: none;
}

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

/* Forms Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

:root.dark-mode .form-group input,
:root.dark-mode .form-group select,
:root.dark-mode .form-group textarea {
  background: rgba(30, 41, 59, 0.5);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

:root.dark-mode .form-group input:focus,
:root.dark-mode .form-group select:focus,
:root.dark-mode .form-group textarea:focus {
  background: rgba(30, 41, 59, 0.9);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.modal-box {
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.modal-overlay.show .modal-box {
  transform: scale(1);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--danger);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Notifications Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(120%);
  animation: slideIn 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.toast-success { background-color: var(--success); }
.toast.toast-danger { background-color: var(--danger); }
.toast.toast-warning { background-color: var(--warning); }
.toast.toast-info { background-color: var(--primary); }

@keyframes slideIn {
  to { transform: translateX(0); }
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  gap: 14px;
  position: relative;
}

.activity-item::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: -16px;
  width: 2px;
  background-color: var(--border-color);
}

.activity-item:last-child::before {
  display: none;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--border-color);
  color: var(--text);
  flex-shrink: 0;
  z-index: 10;
}

.activity-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}

.activity-title {
  font-size: 14px;
  font-weight: 600;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* Scrolling Notice Board */
.news-board {
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
}

.news-badge {
  background: var(--danger);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.news-marquee {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.news-marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 25s linear infinite;
  font-size: 14px;
  font-weight: 500;
}

.news-marquee span:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* Calendar Widget */
.calendar-widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 13px;
}

.cal-day-label {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 11px;
  padding: 6px 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.cal-day:hover {
  background: rgba(var(--primary-rgb), 0.08);
}

.cal-day.today {
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.cal-day.has-event {
  box-shadow: inset 0 -3px 0 var(--warning);
}

/* Floating AI Chat Assistant & Support Widget */
.ai-chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chatbot-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-btn:hover {
  transform: scale(1.1);
}

.chatbot-btn i {
  transition: transform 0.3s ease;
}

.chatbot-btn.active i {
  transform: rotate(90deg);
}

.chatbot-window {
  width: 350px;
  height: 480px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  margin-bottom: 16px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-window.show {
  display: flex;
}

.chatbot-header {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-header img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  padding: 2px;
}

.chatbot-header-info {
  flex: 1;
}

.chatbot-name {
  font-weight: 700;
  font-size: 14px;
}

.chatbot-status {
  font-size: 11px;
  opacity: 0.8;
}

.chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(var(--bg), 0.5);
}

.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-msg.bot {
  background: var(--border-color);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-msg.user {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chatbot-input {
  display: flex;
  padding: 12px;
  border-top: 1px solid var(--border-color);
  gap: 8px;
}

.chatbot-input input {
  flex: 1;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.5);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 13px;
}

:root.dark-mode .chatbot-input input {
  background: rgba(30, 41, 59, 0.5);
  color: white;
}

.chatbot-input button {
  background: var(--primary);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Page Spec: Employee Directory Grid & Profiles */
.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.emp-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease;
}

.emp-card:hover {
  transform: translateY(-4px);
}

.emp-card-menu {
  position: absolute;
  top: 14px;
  right: 14px;
  cursor: pointer;
  color: var(--text-muted);
}

.emp-card-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(var(--primary-rgb), 0.1);
  margin-bottom: 12px;
}

.emp-card-name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.emp-card-role {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.emp-card-dept {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.emp-card-details {
  width: 100%;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.emp-card-detail-item {
  display: flex;
  justify-content: space-between;
}

.emp-card-detail-item span:last-child {
  color: var(--text);
  font-weight: 600;
}

/* ID Card Generator Layout */
.id-card-generator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 16px;
}

.id-card-layout {
  width: 290px;
  height: 440px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.id-card-layout::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.15);
  z-index: 1;
}

.id-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  z-index: 2;
}

.id-card-header i {
  color: var(--primary);
}

.id-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  width: 100%;
}

.id-card-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  margin-bottom: 14px;
}

.id-card-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.id-card-title {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
}

.id-card-meta {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 12px;
}

.id-card-meta-row {
  display: flex;
  justify-content: space-between;
  color: #94a3b8;
}

.id-card-meta-row span:last-child {
  color: white;
  font-weight: 600;
}

.id-card-barcode {
  font-family: 'Libre Barcode 39', cursive, monospace;
  font-size: 36px;
  margin-top: 10px;
  letter-spacing: 3px;
  opacity: 0.8;
}

/* Biometric Simulation CSS (QR & Face Scan) */
.scan-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.scan-box {
  width: 260px;
  height: 260px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--primary);
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-animation {
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  position: absolute;
  top: 0;
  left: 0;
  animation: scanLine 2.5s linear infinite;
  box-shadow: 0 0 10px var(--primary);
  z-index: 10;
}

.face-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.4) 100%);
  z-index: 5;
}

.face-outline {
  width: 140px;
  height: 180px;
  border: 2px dashed rgba(255,255,255,0.5);
  border-radius: 50% 50% 45% 45%;
  position: absolute;
  top: 40px;
  left: 60px;
  z-index: 6;
}

.qr-placeholder {
  width: 160px;
  height: 160px;
  z-index: 4;
}

.scan-video-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

@keyframes scanLine {
  0% { top: 0; }
  50% { top: 100%; }
  100% { top: 0; }
}

/* Payslip Formatting & Printable Styling */
.payslip-container {
  padding: 30px;
  background: white;
  color: black;
  border-radius: var(--radius-md);
  border: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.payslip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2563eb;
  padding-bottom: 16px;
}

.payslip-company {
  display: flex;
  align-items: center;
  gap: 10px;
}

.payslip-company i {
  font-size: 28px;
  color: #2563eb;
}

.payslip-company-details h2 {
  font-size: 20px;
  font-weight: 800;
}

.payslip-company-details p {
  font-size: 11px;
  color: #555;
}

.payslip-title {
  text-align: right;
}

.payslip-title h3 {
  font-size: 18px;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
}

.payslip-title p {
  font-size: 12px;
  color: #555;
}

.payslip-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  font-size: 12px;
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.payslip-meta-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.payslip-meta-row {
  display: flex;
  justify-content: space-between;
}

.payslip-meta-row span:first-child {
  color: #64748b;
  font-weight: 500;
}

.payslip-meta-row span:last-child {
  font-weight: 600;
}

.payslip-table {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-collapse: collapse;
}

.payslip-table th, 
.payslip-table td {
  border: 1px solid #cbd5e1;
  padding: 10px 14px;
  font-size: 12px;
  text-align: left;
}

.payslip-table th {
  background: #f1f5f9;
  font-weight: 700;
}

.payslip-table td {
  background: white;
}

.payslip-totals {
  display: flex;
  justify-content: flex-end;
}

.payslip-net-box {
  background: #2563eb;
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payslip-net-box span:first-child {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.9;
}

.payslip-net-box span:last-child {
  font-size: 22px;
  font-weight: 800;
}

.payslip-footer {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #555;
  border-top: 1px dashed #cbd5e1;
  padding-top: 20px;
}

.payslip-signature {
  text-align: center;
  width: 150px;
}

.payslip-signature-line {
  border-top: 1px solid #000;
  margin-top: 40px;
  padding-top: 4px;
}

/* Printing styles for browser print window */
@media print {
  body * {
    visibility: hidden;
  }
  .payslip-modal-overlay,
  .payslip-modal-overlay * {
    visibility: visible;
  }
  .payslip-modal-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
  }
  .modal-close,
  .modal-footer {
    display: none !important;
  }
  .payslip-container {
    border: none;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
}

/* Animated Login Page layout */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 20px;
}

.login-card {
  width: 440px;
  border-radius: var(--radius-xl);
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(30, 41, 59, 0.7);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.login-logo {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 6px;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  color: white;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.pwd-container {
  position: relative;
}

.pwd-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.pwd-toggle:hover {
  color: var(--primary);
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  cursor: pointer;
}

.login-remember input {
  cursor: pointer;
}

.forgot-pwd-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.forgot-pwd-link:hover {
  color: var(--primary-hover);
}

/* Password reset panel animation states */
.login-view {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.login-view.hidden {
  display: none !important;
}

/* Custom UI styling helpers */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
