/* style.css - Modern HRM UI Design */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --accent-color: #ec4899;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --dark-bg: #1e293b;
  --light-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #677fe7 0%, #21073c 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
}

#app {
  min-height: 100vh;
  position: relative;
}

.card {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  margin: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  padding: 25px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg);
  border-bottom: 3px solid var(--accent-color);
}

.header h1 {
  margin: 0;
  font-size: 2em;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.menu-btn {
  position: absolute;
  left: 15px;
  top: 15px;
  background: none;
  border: none;
  color: white;
  font-size: 1.5em;
  cursor: pointer;
  display: none; /* Ẩn trên desktop */
}

/* Mobile Menu Toggle Button */
.mobile-menu-btn {
  position: fixed;
  left: 20px;
  top: 20px;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  z-index: 1001;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:active {
  transform: scale(0.95);
}

.mobile-menu-btn:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

#sidebar {
  width: 280px;
  float: none;
  background: linear-gradient(180deg, var(--dark-bg) 0%, #0f172a 100%);
  color: white;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  opacity: 0.1;
  pointer-events: none;
}

#sidebar ul {
  list-style: none;
  padding: 20px 10px;
  margin-top: 20px;
}

#sidebar li {
  margin-bottom: 8px;
}

#sidebar li a {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

#sidebar li a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: linear-gradient(
    180deg,
    var(--primary-color),
    var(--accent-color)
  );
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

#sidebar li a:hover {
  background: rgba(99, 102, 241, 0.2);
  color: white;
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

#sidebar li a:hover::before {
  transform: scaleY(1);
}

#sidebar li a.active {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  box-shadow: var(--shadow-lg);
}

.content-card,
#content {
  margin-left: 280px;
  padding: 40px;
  min-height: 100vh;
  background: var(--light-bg);
  transition: margin-left 0.3s ease;
}

#dashboard {
  position: relative;
  min-height: 100vh;
}

/* Module Header Styles */
.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.module-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.8em;
  font-weight: 700;
}

.module-header button {
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.module-header button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Stats Overview Grid */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.stat-info h3 {
  margin: 0;
  font-size: 2em;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-info p {
  margin: 4px 0 0 0;
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* Departments Grid */
.departments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.department-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.department-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dept-card-header {
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  align-items: center;
  gap: 16px;
}

.dept-icon {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dept-title h3 {
  margin: 0;
  font-size: 1.3em;
  color: var(--text-primary);
}

.dept-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 600;
  margin-top: 6px;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-inactive {
  background: #f8d7da;
  color: #721c24;
}

.dept-card-body {
  padding: 20px;
}

.dept-description {
  color: var(--text-secondary);
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 16px;
}

.dept-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dept-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--light-bg);
  border-radius: 8px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.dept-card-footer {
  padding: 16px 20px;
  background: var(--light-bg);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border-color);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-icon.btn-danger:hover {
  background: #dc3545;
  color: white;
}

/* Positions Container */
.positions-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.position-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.section-title {
  margin: 0 0 20px 0;
  font-size: 1.4em;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.positions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.position-card {
  background: white;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s ease;
}

.position-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.position-header {
  padding: 16px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  align-items: center;
  gap: 12px;
}

.position-icon {
  width: 45px;
  height: 45px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.position-title h4 {
  margin: 0;
  font-size: 1.1em;
  color: var(--text-primary);
}

.position-level {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  margin-top: 4px;
}

.position-body {
  padding: 16px;
}

.position-description {
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.5;
  margin-bottom: 12px;
  min-height: 40px;
}

.position-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--light-bg);
  border-radius: 6px;
}

.detail-icon {
  font-size: 16px;
}

.detail-text {
  font-size: 0.9em;
  color: var(--text-primary);
}

.position-footer {
  padding: 12px 16px;
  background: var(--light-bg);
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  border-top: 1px solid var(--border-color);
}

/* Salary Table Styles */
.salary-table-container {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.table-header h3 {
  margin: 0;
  font-size: 1.3em;
  color: var(--text-primary);
}

.table-actions {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  padding: 10px 20px;
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.salary-table {
  overflow-x: auto;
}

.salary-table table {
  width: 100%;
  border-collapse: collapse;
}

.salary-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9em;
  white-space: nowrap;
}

.salary-table th:first-child {
  border-top-left-radius: 8px;
}

.salary-table th:last-child {
  border-top-right-radius: 8px;
}

.salary-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9em;
}

.salary-table tr:hover {
  background: var(--light-bg);
}

.emp-code {
  background: #e3f2fd;
  color: #1976d2;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
}

.total-col {
  background: rgba(67, 233, 123, 0.1) !important;
  font-weight: 700;
}

.bonus {
  color: #28a745;
  font-weight: 600;
}

.deduction {
  color: #dc3545;
  font-weight: 600;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
  white-space: nowrap;
}

.status-paid {
  background: #d4edda;
  color: #155724;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.action-buttons {
  display: flex;
  gap: 6px;
}

.btn-sm {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: var(--light-bg);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.btn-sm:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

/* Attendance Styles */
.attendance-container {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.attendance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
  gap: 16px;
}

.attendance-header h3 {
  margin: 0;
  font-size: 1.3em;
  color: var(--text-primary);
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.attendance-grid {
  display: grid;
  gap: 16px;
}

.attendance-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 100px;
  gap: 20px;
  align-items: center;
  transition: all 0.3s ease;
}

.attendance-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateX(4px);
}

.attendance-card.present {
  border-left: 4px solid #28a745;
}

.attendance-card.late {
  border-left: 4px solid #ffc107;
}

.attendance-card.absent {
  border-left: 4px solid #dc3545;
}

.att-employee {
  display: flex;
  align-items: center;
  gap: 12px;
}

.emp-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.emp-details h4 {
  margin: 0 0 4px 0;
  font-size: 1.1em;
  color: var(--text-primary);
}

.emp-details .emp-code {
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 600;
}

.att-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.att-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time-label {
  font-size: 0.85em;
  color: var(--text-secondary);
}

.time-value {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95em;
}

.late-time {
  color: #ffc107;
}

.att-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.status-present {
  background: #d4edda;
  color: #155724;
}

.status-late {
  background: #fff3cd;
  color: #856404;
}

.status-absent {
  background: #f8d7da;
  color: #721c24;
}

.late-duration {
  font-size: 0.8em;
  color: #ffc107;
  font-weight: 600;
}

.att-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* Leave Management Styles */
.leave-container {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.leave-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

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

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

.leave-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
}

.leave-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.leave-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.leave-header {
  padding: 16px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leave-employee {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leave-employee h4 {
  margin: 0 0 4px 0;
  font-size: 1.1em;
}

.leave-type-badge {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 600;
}

.leave-body {
  padding: 20px;
}

.leave-dates {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.date-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--light-bg);
  border-radius: 8px;
}

.date-icon {
  font-size: 18px;
}

.date-item > div {
  display: flex;
  flex-direction: column;
}

.date-label {
  font-size: 0.8em;
  color: var(--text-secondary);
}

.date-value {
  font-weight: 600;
  color: var(--text-primary);
}

.days-count {
  color: var(--primary-color);
}

.leave-reason {
  background: var(--light-bg);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.leave-reason strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.leave-reason p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.5;
}

.leave-actions {
  display: flex;
  gap: 10px;
}

.btn-approve,
.btn-reject {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-approve {
  background: #28a745;
  color: white;
}

.btn-approve:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-reject {
  background: #dc3545;
  color: white;
}

.btn-reject:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Performance Review Styles */
.performance-container {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.perf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  gap: 24px;
}

.performance-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.performance-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.perf-header {
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.perf-employee {
  display: flex;
  align-items: center;
  gap: 12px;
}

.perf-employee .emp-avatar {
  width: 50px;
  height: 50px;
  background: white !important;
  color: #667eea;
}

.perf-employee h4 {
  margin: 0 0 4px 0;
  color: white;
  font-size: 1.2em;
}

.perf-position {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85em;
}

.rating-badge {
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
}

.rating-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  margin-bottom: 4px;
}

.rating-badge.excellent .rating-number {
  color: #28a745;
}

.rating-badge.good .rating-number {
  color: #4facfe;
}

.rating-badge.average .rating-number {
  color: #ffc107;
}

.rating-stars {
  display: block;
  font-size: 0.9em;
}

.perf-body {
  padding: 20px;
}

.perf-period {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 10px;
  background: var(--light-bg);
  border-radius: 8px;
  font-weight: 600;
}

.period-icon {
  font-size: 18px;
}

.perf-metrics {
  margin-bottom: 20px;
}

.metric-item {
  margin-bottom: 16px;
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--text-primary);
}

.metric-bar {
  height: 24px;
  background: var(--light-bg);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 4px;
}

.metric-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.3s ease;
}

.metric-value {
  font-size: 0.85em;
  color: var(--text-secondary);
  font-weight: 600;
}

.perf-comments {
  background: var(--light-bg);
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.perf-comments strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.perf-comments p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9em;
}

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

.reviewer {
  font-size: 0.85em;
  color: var(--text-secondary);
}

.perf-actions {
  display: flex;
  gap: 6px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.1em;
  margin: 0;
}

/* Responsive for Attendance/Leave/Performance */
@media (max-width: 1200px) {
  .attendance-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .att-actions {
    justify-content: flex-start;
  }

  .leave-grid,
  .perf-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .attendance-header,
  .filter-buttons,
  .leave-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-btn,
  .tab-btn {
    width: 100%;
  }
}

form {
  display: flex;
  flex-direction: column;
  max-width: 700px;
  gap: 20px;
}

label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95em;
  margin-bottom: 8px;
  display: block;
}

input,
select {
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1em;
  font-family: "Poppins", sans-serif;
  transition: all 0.3s ease;
  background: white;
}

button {
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 1em;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus,
select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

button {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  box-shadow: var(--shadow-md);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button:active {
  transform: scale(0.98);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 30px;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

th,
td {
  padding: 18px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85em;
  letter-spacing: 0.5px;
}

tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

tbody tr {
  transition: all 0.3s ease;
}

tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.05);
  transform: scale(1.01);
  box-shadow: var(--shadow-md);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  max-width: 450px;
  min-width: 350px;
  animation: slideUp 0.3s ease;
  border: 1px solid var(--border-color);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@media (max-width: 768px) {
  .menu-btn,
  .mobile-menu-btn {
    display: flex !important;
  }
  #sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  #sidebar.active {
    transform: translateX(0);
  }
  .content-card,
  #content {
    margin-left: 0;
    padding: 20px;
  }
  table {
    overflow-x: auto;
    display: block;
  }
  .card {
    padding: 20px;
    margin: 10px;
  }
}
/* Modern Login Form Design */
#login-form {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #6581cc, #53088c);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gradientShift 15s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.login-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 30px 60px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 500px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideUp 0.5s ease;
}

.login-container h2 {
  margin-bottom: 30px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2em;
  font-weight: 700;
}

.login-container .logo {
  font-size: 2em;
  margin-bottom: 0px;
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

#auth-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
}

.input-group {
  position: relative;
  width: 100%;
}

.input-group input {
  width: 100%;
  padding: 16px 16px 16px 50px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1em;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  transition: all 0.3s ease;
  background: white;
}

.input-group input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  outline: none;
}

.input-group::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3em;
  z-index: 1;
}

#username-group::before {
  content: "👤"; /* Icon user */
}

#password-group::before {
  content: "🔒"; /* Icon lock */
}

#confirm-password-group::before {
  content: "🔒";
}

#submit-btn {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.1em;
  font-weight: 600;
  margin-top: 10px;
  box-shadow: var(--shadow-md);
}

#submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

#submit-btn:active {
  transform: scale(0.98);
}

.toggle-link {
  margin-top: 15px;
  color: var(--primary-color);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.toggle-link:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.error-message {
  color: var(--danger-color);
  font-size: 0.9em;
  margin-top: 10px;
  display: none;
  background: rgba(239, 68, 68, 0.1);
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid var(--danger-color);
}

.success-message {
  color: var(--success-color);
  font-size: 0.9em;
  margin-top: 10px;
  background: rgba(16, 185, 129, 0.1);
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid var(--success-color);
}

/* Page Title Styling */
h1,
h2,
h3 {
  color: var(--text-primary);
  font-weight: 700;
}

h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.8em;
  margin-bottom: 15px;
}

/* Action Buttons */
td button {
  padding: 8px 16px;
  margin: 0 4px;
  font-size: 0.9em;
}

/* Loading Spinner */
.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Badges */
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.badge-info {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
}

@media (max-width: 480px) {
  .login-container {
    padding: 30px 20px;
    margin: 20px;
    border-radius: 20px;
  }
  .input-group input {
    font-size: 0.95em;
    padding: 14px 14px 14px 45px;
  }
  h1 {
    font-size: 1.8em;
  }
}

/* Employee Management Module - Tabbed Interface */
.employee-management {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
}

.employee-management h2 {
  margin-bottom: 30px;
  font-size: 2em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
  flex-wrap: wrap;
}

.tab-button {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 14px 24px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  position: relative;
  bottom: -2px;
  border-radius: 8px 8px 0 0;
}

.tab-button:hover {
  background: rgba(99, 102, 241, 0.05);
  color: var(--primary-color);
}

.tab-button.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.05);
}

.tab-content {
  display: none;
  animation: fadeInTab 0.3s ease;
}

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

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

.employee-form {
  max-width: 700px;
  background: var(--light-bg);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin: 0 auto;
}

.employee-form h3 {
  margin-bottom: 25px;
  color: var(--text-primary);
  font-size: 1.5em;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.search-box input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1em;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--text-secondary);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--text-primary);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

#search-results-container {
  margin-top: 30px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

#search-results {
  width: 100%;
  margin-top: 0;
}

.info-box {
  background: var(--light-bg);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

@media (max-width: 768px) {
  .tab-buttons {
    flex-direction: column;
  }

  .tab-button {
    width: 100%;
    text-align: left;
  }

  .search-box {
    flex-direction: column;
  }

  .search-box input,
  .search-box button {
    width: 100%;
  }

  .two-column-layout {
    flex-direction: column;
  }

  .left-panel,
  .right-panel {
    width: 100% !important;
  }
}

/* Two-column layout for edit and delete tabs */
.two-column-layout {
  display: block;
  margin-top: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.left-panel {
  width: 100%;
}

.right-panel {
  width: 100%;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.left-panel h4,
.right-panel h4 {
  margin-bottom: 15px;
  color: var(--text-primary);
  font-size: 1.2em;
  text-align: center;
}

/* Reference table styling */
.reference-table {
  width: 100%;
  font-size: 0.9em;
  margin-top: 10px;
  max-height: 500px;
  overflow-y: auto;
  display: block;
  margin: 30px;
}

.reference-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.reference-table th {
  font-size: 0.8em;
  padding: 12px 10px;
}

.reference-table td {
  padding: 10px;
}

.reference-table tbody {
  display: table;
  width: 100%;
}

.reference-table thead {
  display: table;
  width: 100%;
}

/* Quick action buttons in reference tables */
.btn-quick-edit,
.btn-quick-delete {
  padding: 6px 12px;
  font-size: 0.85em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn-quick-edit {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
}

.btn-quick-edit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-quick-delete:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Form instruction and warning boxes */
.form-instruction {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(139, 92, 246, 0.1)
  );
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
  margin-bottom: 20px;
}

.form-instruction p {
  margin: 0;
  color: var(--text-primary);
  font-size: 1em;
  line-height: 1.6;
}

.warning-box {
  background: rgba(239, 68, 68, 0.1);
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid var(--danger-color);
  margin-top: 15px;
}

.warning-box p {
  margin: 0;
  color: var(--danger-color);
  font-size: 0.95em;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-actions button {
  flex: 1;
}

#edit-employee-id {
  color: var(--primary-color);
  font-weight: 700;
}

/* Dashboard Styles */
.dashboard-container {
  padding: 20px;
}

.dashboard-header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  padding: 30px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
}

.dashboard-header h2 {
  margin: 0 0 20px 0;
  font-size: 2em;
  color: white;
}

.user-greeting h3 {
  margin: 0 0 10px 0;
  font-size: 1.8em;
  color: white;
  font-weight: 600;
}

.user-greeting .username {
  color: #ffd700;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.current-date {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1em;
  margin: 0;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-color);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-card.stat-primary {
  border-left-color: var(--primary-color);
}

.stat-card.stat-success {
  border-left-color: var(--success-color);
}

.stat-card.stat-warning {
  border-left-color: var(--warning-color);
}

.stat-card.stat-info {
  border-left-color: #3b82f6;
}

.stat-icon {
  font-size: 3em;
  line-height: 1;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2em;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* Dashboard Content */
.dashboard-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.dashboard-section {
  background: white;
  padding: 25px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.dashboard-section h4 {
  margin: 0 0 20px 0;
  color: var(--text-primary);
  font-size: 1.3em;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

/* Department Chart */
.department-chart {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.dept-bar-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.dept-label {
  min-width: 120px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95em;
}

.dept-bar-wrapper {
  flex: 1;
  background: var(--light-bg);
  border-radius: 8px;
  overflow: hidden;
  height: 35px;
}

.dept-bar {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  border-radius: 8px;
  transition: width 0.5s ease;
  min-width: 50px;
}

.dept-count {
  color: white;
  font-weight: 700;
  font-size: 0.9em;
}

/* Newest Employee Card */
.newest-employee-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--light-bg);
  border-radius: 12px;
  border-left: 4px solid var(--success-color);
}

.employee-avatar {
  font-size: 3em;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  border-radius: 50%;
}

.employee-info {
  flex: 1;
}

.employee-name {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.employee-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 0.95em;
}

/* System Summary */
.system-summary {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--light-bg);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.summary-item:hover {
  background: rgba(99, 102, 241, 0.05);
  transform: translateX(5px);
}

.summary-icon {
  font-size: 1.5em;
}

/* Responsive Dashboard */
@media (max-width: 1024px) {
  .dashboard-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header h2 {
    font-size: 1.5em;
  }

  .user-greeting h3 {
    font-size: 1.3em;
  }

  .stat-value {
    font-size: 1.5em;
  }

  .dept-label {
    min-width: 80px;
    font-size: 0.85em;
  }
}
