body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f4f6f9;
}

/* Sidebar */
.sidebar {
  width: 220px;
  height: 100vh;
  background: #0f172a;
  color: white;
  position: fixed;
  padding: 20px;
}

.sidebar h2 {
  margin-bottom: 30px;
}

.sidebar a {
  display: block;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  color: #cbd5f5;
  text-decoration: none;
}

.sidebar a:hover {
  background: #1e293b;
  color: white;
}

/* Main */
.main {
  margin-left: 240px;
  padding: 30px;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  padding: 20px;
  border-radius: 14px;
  color: white;
  font-weight: bold;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transition: 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

/* 
.blue { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.red { background: linear-gradient(135deg, #ef4444, #dc2626); } */



.blue {
  background: linear-gradient(135deg, #4547ea, #c2bffb);
}

.green {
  background: linear-gradient(135deg, #30b661, #a3f1c0);
}

.orange {
  background: linear-gradient(135deg, #f7a10d, #ebc498);
}

.red {
  background: linear-gradient(135deg, #f02525, #ea9d9d);
}

/* Chart container */
.chart-box {
  background: white;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

/* Table */
.table-box {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f1f5f9;
}

th,
td {
  padding: 14px;
  text-align: left;
}

tr {
  border-bottom: 1px solid #eee;
}

/* Status badge */
.status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}

.new {
  background: #e0e7ff;
  color: #3730a3;
}

.converted {
  background: #dcfce7;
  color: #166534;
}

.progress {
  background: #fef3c7;
  color: #92400e;
}

.lost {
  background: #fee2e2;
  color: #991b1b;
}

/* Mobile */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
  }
}


.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.topbar h2 {
  margin: 0;
}

.sub {
  color: #64748b;
  font-size: 14px;
}

/* .profile {
  display: flex;
  align-items: center;
  gap: 10px;
} */

.avatar {
  width: 40px;
  height: 40px;
  background: #191a32;
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
}

.profile-wrapper {
  display: flex;
  justify-content: center;
  /* horizontal center */
  align-items: center;
  /* vertical center */
  min-height: 80vh;
  /* full screen feel */
}

.profile-card {
  width: 100%;
  max-width: 520px;
  background: white;
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Labels */
.profile-card label {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

/* Inputs */
.profile-card input {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  transition: all 0.2s ease;
}

/* Focus effect */
.profile-card input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Disabled email */
.profile-card input[disabled] {
  background: #f1f5f9;
  color: #64748b;
}

/* BUTTON (IMPORTANT) */
.profile-card button {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Button hover */
.profile-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

/* Message */
#msg {
  margin-top: 12px;
  font-size: 14px;
  text-align: center;
}


/* Dropdown menu */
.profile {
  position: relative;
  cursor: pointer;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 55px;
  width: 220px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: none;
  padding: 10px;
  z-index: 100;
}

.user-info {
  padding: 10px;
}

.menu-item {
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.menu-item:hover {
  background: #f1f5f9;
}

.logout {
  color: #ef4444;
}

.dropdown.show {
  opacity: 1;
  transform: translateY(0);
}

.topbar button {
  padding: 10px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 8px;
}


.filter-box input,
.filter-box select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

/* Status dropdown */
.status-select {
  padding: 6px;
  border-radius: 6px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: #6366f1;
  color: white;
  cursor: pointer;
}

.pagination button:disabled {
  background: #ccc;
  cursor: not-allowed;
}


.filter-box {
  display: flex;
  gap: 12px;
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.input-group input,
.select,
.date {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  outline: none;
}

.input-group input:focus,
.select:focus,
.date:focus {
  border-color: #6366f1;
}

.apply-btn {
  padding: 10px 18px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.apply-btn:hover {
  transform: translateY(-1px);
}



.new {
  background: #e0e7ff;
}

.in_progress {
  background: #fef3c7;
}

.converted {
  background: #dcfce7;
}

.lost {
  background: #fee2e2;
}

.edit-btn {
  margin-left: 8px;
  padding: 4px 8px;
  font-size: 12px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}


.status-cell {
  display: flex;
  justify-content: space-between;
  /* 🔥 key */
  align-items: center;
  min-width: 200px;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
  /* 🔥 prevents break */
}

/* Optional fixed width for badge */
.status-badge {
  min-width: 120px;
  text-align: center;
}

/* Button */
.edit-btn {
  padding: 5px 10px;
  font-size: 12px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}


.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: #fff;
  padding: 20px;
  width: 400px;
  margin: 100px auto;
  border-radius: 12px;
}

.modal input {
  width: 95%;
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.modal button {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  border: none;
  background: #6366f1;
  color: white;
  border-radius: 8px;
}

.cancel {
  background: #ef4444;
}



.toast {
  visibility: hidden;
  min-width: 250px;
  background: #111827;
  color: #fff;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease, top 0.3s ease;
}

.toast.show {
  visibility: visible;
  opacity: 1;
}


#pagination button {
  padding: 6px 12px;
  margin: 5px;
  cursor: pointer;
}

#pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ================= MOBILE SIDEBAR (HAMBURGER) ================= */

.menu-btn {
  display: none;
  font-size: 22px;
  background: #0f172a;
  color: white;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* MOBILE */
@media (max-width: 768px) {

  /* Show hamburger */
  .menu-btn {
    display: block;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
  }

  /* Sidebar hidden by default */
  .sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    width: 220px;
    height: 100%;
    transition: 0.3s ease;
    z-index: 1000;
  }

  /* When active */
  .sidebar.active {
    left: 0;
  }

  /* Overlay background */
  .overlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    top: 0;
    left: 0;
    z-index: 999;
  }

  .overlay.show {
    display: block;
  }

  /* Main reset */
  .main {
    margin-left: 0 !important;
    padding-top: 60px;
  }

}