/* ======================================== RESET & GLOBAL ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #eef2f3, #d9e2ec);
  color: #333;
  overflow-x: hidden;
}

/* ======================================== SIDEBAR ======================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100%;
  background: #2c3e50;
  color: #ecf0f1;
  padding-top: 30px;
  transition: transform 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar h2 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 22px;
  color: #1abc9c;
  letter-spacing: 1px;
}

.sidebar ul {
  list-style: none;
}

.sidebar ul li {
  margin: 10px 0;
}

.sidebar ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: #ecf0f1;
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
}

.sidebar ul li a i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
  background: #1abc9c;
  color: #fff;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 900;
}

.sidebar-overlay.active {
  display: block;
}

/* Sidebar Responsive */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.active {
    transform: translateX(0);
  }
}

/* ======================================== HEADER ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 240px;
  width: calc(100% - 240px);
  height: 60px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  z-index: 800;
  transition: all 0.3s ease;
}

.header h1 {
  font-size: 20px;
  color: #2c3e50;
  font-weight: 600;
}

.menu-btn {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: #2c3e50;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1abc9c;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

.profile-btn:hover {
  background: #16a085;
}

.profile-btn img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
}

/* Header Responsive */
@media (max-width: 992px) {
  .header {
    left: 0;
    width: 100%;
  }
  .menu-btn {
    display: block;
  }
}

/* ======================================== MAIN CONTENT ======================================== */
.main-content {
  margin-left: 240px;
  padding: 80px 20px 20px 20px;
  transition: all 0.3s ease;
}

@media (max-width: 992px) {
  .main-content {
    margin-left: 0;
    padding-top: 80px;
  }
}

/* ======================================== DASHBOARD CARDS ======================================== */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background: #fff;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.card i {
  font-size: 28px;
  color: #1abc9c;
}

.card h3 {
  margin: 0;
  font-size: 22px;
  color: #2c3e50;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: #7f8c8d;
}

.card-employees i { color: #3498db; }
.card-present i { color: #27ae60; }
.card-absent i { color: #e74c3c; }
.card-leave i { color: #f39c12; }

/* ======================================== BUTTONS ======================================== */
.btn-check-attendance {
  display: inline-block;
  margin-bottom: 30px;
  padding: 10px 20px;
  background: #1abc9c;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.btn-check-attendance:hover {
  background: #16a085;
}

.attendance-btn {
  padding: 6px 12px;
  margin: 2px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
}

.present { background-color: #28a745; color: white; }
.absent { background-color: #dc3545; color: white; }
.leave { background-color: #ff9800; color: white; }

.attendance-btn:hover { opacity: 0.9; }
.status-marked { font-weight: bold; margin-left: 10px; }

/* ======================================== TABLES ======================================== */
.table-wrapper { overflow-x: auto; }

.card.attendance,
.card.chart-section {
  background: #fff;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  margin-bottom: 30px;
}

.card h2 {
  margin-bottom: 15px;
  font-size: 18px;
  color: #2c3e50;
  border-left: 4px solid #1abc9c;
  padding-left: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  border-radius: 10px;
  overflow: hidden;
}

thead {
  background: #1abc9c;
  color: #fff;
}

thead th {
  padding: 12px;
  text-align: left;
  font-size: 14px;
}

tbody tr {
  background: #f8f9fa;
  transition: background 0.3s ease;
}

tbody tr:nth-child(even) { background: #ecf0f1; }
tbody tr:hover { background: #d6f0f1; }

tbody td {
  padding: 12px;
  font-size: 16px;
  color: #2c3e50;
}

/* ======================================== PROFILE MODAL ======================================== */
.profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 2000;
}

.profile-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.profile-content {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  position: relative;
}

.close-profile {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: #e74c3c;
}

/* ======================================== CHART SECTION ======================================== */
.chart-section canvas {
  width: 100% !important;
  height: auto !important;
}

/* ======================================== RESPONSIVE ======================================== */
@media (max-width: 992px) {
  .main-content { padding-top: 80px; }
}

@media (max-width: 768px) {
  .dashboard-cards { grid-template-columns: 1fr; }
  table { min-width: 100%; }
  .card h3 { font-size: 18px; }
  .card p { font-size: 13px; }
}

@media (max-width: 480px) {
  .header h1 { font-size: 16px; }
  .profile-btn span { display: none; }
  .profile-btn { padding: 6px; }
  .main-content { padding: 70px 10px; }
  .btn-check-attendance { width: 100%; text-align: center; }
}
