/* ====== RESET ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: #f5f7fa;
  color: #333;
  height: 100vh;
  overflow: hidden;
}

/* ====== MAIN CONTAINER ====== */
.container {
  display: flex;
  height: 100vh;
}

/* ====== SIDEBAR ====== */
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #3b1d8a, #a72c7d);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 25px 20px;
}

.sidebar .logo {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center;
  letter-spacing: 1px;
}

.sidebar ul {
  list-style: none;
}

.sidebar ul li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  margin: 5px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
  font-size: 15px;
}

.sidebar ul li:hover,
.sidebar ul li.active {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar ul li i {
  width: 20px;
  text-align: center;
}

.sidebar ul li a {
    color: inherit;
    text-decoration: none;
    display: block;
    padding: 12px 0;
}

.sidebar .contact-box {
  background: rgba(255, 255, 255, 0.15);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  font-size: 14px;
}

.sidebar .contact-box button {
  margin-top: 10px;
  background: #ff8c00;
  border: none;
  color: #fff;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.sidebar .contact-box button:hover {
  background: #ffa733;
}

/* ====== MAIN ====== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 25px;
  overflow-y: auto;
}

/* ====== TOP BAR ====== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.topbar .welcome {
  font-size: 20px;
  font-weight: 500;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .user i {
  font-size: 30px;
  color: #555;
}

/* ====== STAT CARDS ====== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.card {
  background: #fff;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: 0.3s;
}

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

.card h3 {
  font-size: 16px;
  color: #777;
  margin-bottom: 10px;
}

.card p {
  font-size: 28px;
  font-weight: 600;
  color: #333;
}

/* Card color variants */
.card.total p { color: #ff6b81; }
.card.online p { color: #2ecc71; }
.card.offline p { color: #e74c3c; }

/* ====== MAP BOX ====== */
.map-box {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  flex: 1;
  min-height: 400px;
}

.leaflet-container {
  height: 100%;
  width: 100%;
}

/* ====== SCROLLBAR ====== */
.main::-webkit-scrollbar {
  width: 8px;
}

.main::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* ===== POPUP ===== */
.popup {
  position: absolute;
  top: 20px;
  width: 320px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 999;
  display: none;
  flex-direction: column;
}

.popup.active {
  display: flex;
}

.popup.left { left: 20px; }
.popup.right { right: 20px; }

.popup-header {
  background: #4a3aff;
  color: #fff;
  padding: 12px 15px;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.popup-content {
  padding: 15px;
  overflow-y: auto;
  max-height: 450px;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  cursor: pointer;
  background: #f0f0f0;
}

.tab-btn.active {
  background: #4a3aff;
  color: #fff;
}

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

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.info-table td, .info-table th {
  border: 1px solid #ccc;
  padding: 4px 6px;
}

.info-table th {
  background: #e8f0ff;
  text-align: center;
}

/* ===== Control Buttons on Map ===== */
.map-controls {
  position: absolute;
  top: 20px;
  right: 370px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.map-controls button {
  background: #4a3aff;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: 0.2s;
}

.map-controls button:hover {
  background: #5c53ff;
}

.flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.add-btn {
  margin-top: 10px;
  background: #00c389;
  border: none;
  color: white;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.schedule-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.confirm-btn {
  background: #4a3aff;
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
}

.cancel-btn {
  background: transparent;
  border: none;
  color: #888;
  font-weight: 500;
}

