/* HRMS Payroll System - Styles */

/* Variables */
:root {
  --primary-color: #4F46E5;
  --secondary-color: #10B981;
  --danger-color: #EF4444;
  --warning-color: #F59E0B;
  --info-color: #3B82F6;
  --dark-color: #1F2937;
  --light-color: #F9FAFB;
  --border-color: #E5E7EB;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --sidebar-width: 260px;
  --header-height: 70px;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--light-color);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: white;
  padding: 20px 0;
  transition: transform 0.3s ease;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .logo i {
  font-size: 28px;
  color: var(--primary-color);
}

.sidebar .logo h2 {
  font-size: 20px;
  font-weight: 700;
}

.sidebar .nav-menu {
  padding: 20px 0;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 15px;
}

.sidebar .nav-item i {
  width: 20px;
  font-size: 18px;
}

.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.sidebar .nav-item.active {
  background: linear-gradient(90deg, var(--primary-color) 0%, #6366F1 100%);
  color: white;
  border-left: 4px solid white;
  padding-left: 16px;
}

.sidebar .sidebar-footer {
  position: absolute;
  bottom: 20px;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* Header */
.header {
  height: var(--header-height);
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header .menu-toggle {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-primary);
  cursor: pointer;
  display: none;
}

.header .menu-toggle:hover {
  color: var(--primary-color);
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.header .header-right {
  display: flex;
  align-items: center;
  gap: 25px;
}

.header .search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--light-color);
  padding: 10px 20px;
  border-radius: 25px;
  border: 1px solid var(--border-color);
}

.header .search-box i {
  color: var(--text-secondary);
}

.header .search-box input {
  border: none;
  background: none;
  outline: none;
  width: 200px;
  font-size: 14px;
}

.header .notification-icon {
  position: relative;
  cursor: pointer;
}

.header .notification-icon i {
  font-size: 20px;
  color: var(--text-secondary);
}

.header .notification-icon .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger-color);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.header .user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.header .user-profile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
}

.header .user-profile span {
  font-weight: 500;
  color: var(--text-primary);
}

/* Page Content */
.page {
  display: none;
  padding: 30px;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stats 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: 12px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-card .stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
}

.stat-card .stat-details h3 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-card .stat-details p {
  color: var(--text-secondary);
  font-size: 14px;
}

.stat-card.blue .stat-icon {
  background: linear-gradient(135deg, var(--info-color) 0%, #2563EB 100%);
}

.stat-card.green .stat-icon {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #059669 100%);
}

.stat-card.orange .stat-icon {
  background: linear-gradient(135deg, var(--warning-color) 0%, #D97706 100%);
}

.stat-card.purple .stat-icon {
  background: linear-gradient(135deg, var(--primary-color) 0%, #6366F1 100%);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

/* Card */
.card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.card .card-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.card .card-header .view-all {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.card .card-header .view-all:hover {
  text-decoration: underline;
}

/* Activity List */
.activity-list .activity-item {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-list .activity-item:last-child {
  border-bottom: none;
}

.activity-list .activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.activity-list .activity-icon.blue {
  background: var(--info-color);
}

.activity-list .activity-icon.green {
  background: var(--secondary-color);
}

.activity-list .activity-icon.orange {
  background: var(--warning-color);
}

.activity-list .activity-details {
  flex: 1;
}

.activity-list .activity-details p {
  font-size: 14px;
  margin-bottom: 5px;
}

.activity-list .activity-details strong {
  color: var(--text-primary);
}

.activity-list .activity-details .time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Holiday List */
.holiday-list .holiday-item {
  display: flex;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

.holiday-list .holiday-item:last-child {
  border-bottom: none;
}

.holiday-list .holiday-date {
  background: linear-gradient(135deg, var(--primary-color) 0%, #6366F1 100%);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  min-width: 60px;
}

.holiday-list .holiday-date .day {
  display: block;
  font-size: 24px;
  font-weight: 700;
}

.holiday-list .holiday-date .month {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
}

.holiday-list .holiday-details h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
}

.holiday-list .holiday-details p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Buttons */
.page-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #6366F1 100%);
  color: white;
}

.btn.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.btn.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn.btn-secondary:hover {
  background: var(--light-color);
}

/* Table */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--light-color);
}

.data-table thead th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: var(--light-color);
}

.data-table tbody td {
  padding: 15px;
  font-size: 14px;
}

.data-table .user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-table .user-cell img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
}

.data-table .status-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.data-table .status-badge.active {
  background: #D1FAE5;
  color: #065F46;
}

.data-table .status-badge.inactive {
  background: #FEE2E2;
  color: #991B1B;
}

.data-table .action-buttons {
  display: flex;
  gap: 8px;
}

.data-table .action-buttons button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.data-table .action-buttons button.edit {
  background: #DBEAFE;
  color: #1E40AF;
}

.data-table .action-buttons button.edit:hover {
  background: #BFDBFE;
}

.data-table .action-buttons button.delete {
  background: #FEE2E2;
  color: #991B1B;
}

.data-table .action-buttons button.delete:hover {
  background: #FECACA;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .header .menu-toggle {
    display: block;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0 15px;
  }

  .header .search-box {
    display: none;
  }

  .header .user-profile span {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 15px;
  }
}

/* Role-based Badge Styles */
.user-role-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  margin: 15px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary-color) 0%, #6366F1 100%);
  color: white;
}

.user-role-badge.hr {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #059669 100%);
}

.user-role-badge.employee {
  background: linear-gradient(135deg, var(--info-color) 0%, #2563EB 100%);
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.quick-action-btn i {
  font-size: 32px;
}

.quick-action-btn.blue {
  color: var(--info-color);
}

.quick-action-btn.green {
  color: var(--secondary-color);
}

.quick-action-btn.orange {
  color: var(--warning-color);
}

.quick-action-btn.purple {
  color: var(--primary-color);
}

.quick-action-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: currentColor;
}

/* Trend Indicators */
.trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  margin-top: 5px;
}

.trend.positive {
  color: var(--secondary-color);
}

.trend.negative {
  color: var(--danger-color);
}

.trend.warning {
  color: var(--warning-color);
}

/* Chart Styles */
.chart-card {
  min-height: 350px;
}

.filter-select {
  padding: 8px 15px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  background: white;
}

.chart-placeholder {
  padding: 20px 0;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 250px;
  gap: 10px;
}

.bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary-color) 0%, #6366F1 100%);
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  transition: all 0.3s ease;
  position: relative;
}

.bar:hover {
  opacity: 0.8;
  transform: translateY(-5px);
}

.bar-label {
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

/* Alert Styles */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.alert-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid;
}

.alert-item.critical {
  background: #FEE2E2;
  border-color: var(--danger-color);
}

.alert-item.warning {
  background: #FEF3C7;
  border-color: var(--warning-color);
}

.alert-item.info {
  background: #DBEAFE;
  border-color: var(--info-color);
}

.alert-item .alert-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-item.critical .alert-icon {
  background: var(--danger-color);
  color: white;
}

.alert-item.warning .alert-icon {
  background: var(--warning-color);
  color: white;
}

.alert-item.info .alert-icon {
  background: var(--info-color);
  color: white;
}

.alert-item .alert-details h4 {
  font-size: 15px;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.alert-item .alert-details p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.alert-item .alert-details .time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Performance Badge */
.performance-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.performance-badge.excellent {
  background: #D1FAE5;
  color: #065F46;
}

.performance-badge.good {
  background: #DBEAFE;
  color: #1E40AF;
}

/* Action List */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.action-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: var(--light-color);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.action-item.urgent {
  border-color: var(--danger-color);
  background: #FEF2F2;
}

.action-item .action-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #6366F1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

.action-item .action-details {
  flex: 1;
}

.action-item .action-details h4 {
  font-size: 15px;
  margin-bottom: 5px;
}

.action-item .action-details p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.btn-action {
  padding: 8px 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: #4338CA;
}

/* Recruitment List */
.recruitment-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.recruitment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.recruitment-item:last-child {
  border-bottom: none;
}

.candidate-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.candidate-info img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
}

.candidate-info h4 {
  font-size: 14px;
  margin-bottom: 3px;
}

.candidate-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Leave Badge */
.leave-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.leave-badge.casual {
  background: #DBEAFE;
  color: #1E40AF;
}

.leave-badge.sick {
  background: #FEE2E2;
  color: #991B1B;
}

.leave-badge.earned {
  background: #D1FAE5;
  color: #065F46;
}

/* Approve/Reject Buttons */
.action-buttons .approve {
  background: #D1FAE5;
  color: #065F46;
}

.action-buttons .approve:hover {
  background: #A7F3D0;
}

.action-buttons .reject {
  background: #FEE2E2;
  color: #991B1B;
}

.action-buttons .reject:hover {
  background: #FECACA;
}

/* Filter Buttons */
.filter-buttons {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-sm.active {
  background: var(--primary-color);
  color: white;
}

/* Badge Count */
.badge-count {
  background: var(--danger-color);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Date Badge */
.date-badge {
  background: var(--light-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Schedule List */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.schedule-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: var(--light-color);
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.schedule-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
  min-width: 80px;
}

.schedule-details h4 {
  font-size: 15px;
  margin-bottom: 5px;
}

.schedule-details p {
  font-size: 13px;
  color: var(--text-secondary);
}

.schedule-details i {
  margin-right: 5px;
}

/* Month Selector */
.month-selector {
  display: flex;
  align-items: center;
  gap: 15px;
}

.month-selector button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.month-selector button:hover {
  background: var(--light-color);
  color: var(--primary-color);
}

.month-selector span {
  font-weight: 600;
  color: var(--text-primary);
}

/* Attendance Calendar */
.attendance-calendar {
  padding: 20px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 2px solid var(--border-color);
  background: white;
}

.calendar-day.present {
  background: #D1FAE5;
  border-color: var(--secondary-color);
  color: #065F46;
}

.calendar-day.absent {
  background: #FEE2E2;
  border-color: var(--danger-color);
  color: #991B1B;
}

.calendar-day.half-day {
  background: #FEF3C7;
  border-color: var(--warning-color);
  color: #92400E;
}

.calendar-day.weekend {
  background: var(--light-color);
  color: var(--text-secondary);
}

.calendar-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
}

.calendar-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-legend i {
  font-size: 10px;
}

/* Responsive Updates */
@media (max-width: 768px) {
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-grid {
    gap: 5px;
  }

  .calendar-day {
    font-size: 12px;
  }

  .bar-chart {
    height: 200px;
  }
}
