/* ======================================
   🌐 BASE STYLING
====================================== */
body {
  background-color: #f8f9fa;
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
}

/* ======================================
   🏥 HEADER
====================================== */
.main-header {
  height: 60px;
  background-color: #000;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 15px;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.main-header h5 {
  margin: 0;
  flex-grow: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

/* ✅ Toggle Button */
#toggleSidebar {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
  z-index: 1200;
}

/* ======================================
   📦 SIDEBAR
====================================== */
.sidebar {
  width: 250px;
  height: calc(100vh - 60px);
  position: fixed;
  top: 60px;
  left: 0;
  background-color: #212529;
  color: #fff;
  overflow-y: auto;
  transition: all 0.3s ease-in-out;
  z-index: 1050;
  padding-bottom: 60px;
}

/* Sidebar links */
.sidebar .nav-link {
  padding: 12px 15px;
  color: #ddd;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: background 0.3s;
  font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background-color: #0d6efd;
  color: #fff;
}

/* ======================================
   🔄 COLLAPSED SIDEBAR (DESKTOP)
====================================== */
.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed .link-text {
  display: none;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
}

.sidebar.collapsed .bi {
  margin-right: 0 !important;
  font-size: 1.3rem;
}

/* ======================================
   🧾 MAIN CONTENT
====================================== */
.content {
  margin-top: 60px;
  margin-left: 250px;
  padding: 20px;
  transition: margin-left 0.3s ease;
}

.content.expanded {
  margin-left: 70px;
}

/* ======================================
   💳 CARDS AND BUTTONS
====================================== */
.card {
  border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn {
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
  transform: scale(1.03);
}

/* ======================================
   📱 MOBILE RESPONSIVE STYLING
====================================== */
@media (max-width: 991px) {
  /* Sidebar hidden by default */
  .sidebar {
    left: -250px;
    width: 250px;
    height: calc(100vh - 60px);
    position: fixed;
  }

  /* Sidebar when active (slide-in) */
  .sidebar.active {
    left: 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  }

  /* Content fills full width */
  .content {
    margin-left: 0;
    padding: 15px;
  }

  /* Toggle Button always visible */
  #toggleSidebar {
    position: relative;
    z-index: 1200;
  }

  /* Optional: dim background when sidebar open */
  body.sidebar-open::after {
    content: "";
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
  }
}

/* ======================================
   📞 SMALL DEVICES (Phones)
====================================== */
@media (max-width: 576px) {
  .main-header h5 {
    font-size: 15px;
  }

  .sidebar .nav-link {
    font-size: 14px;
    padding: 10px;
    justify-content: center;
  }

  .btn {
    font-size: 13px;
    padding: 5px 10px;
  }

  table th,
  table td {
    font-size: 12px;
  }
}
