:root {
  --primary: #0d6efd;
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 60px;
}

body {
  margin: 0;
  background: #f8f9fa;
  font-family: "Segoe UI", Arial, sans-serif;
}

.navbar-custom {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  background: var(--primary);
  color: #fff;
  padding: 0 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
}

.navbar-custom .navbar-brand {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
}

.navbar-custom .hamburger {
  background: none;
  border: none;
  font-size: 2rem;
  color: #fff;
  margin-right: 1rem;
  display: block;
}

.layout {
  display: flex;
  min-height: 100vh;
  margin-top: 56px;
}

.sidebar {
  background: #222;
  color: #fff;
  width: var(--sidebar-width);
  transition: width 0.2s;
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  display: flex;
  flex-direction: column;
  z-index: 1040;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
  max-width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: 1rem 1rem 0.5rem 1rem;
}

.sidebar .sidebar-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  margin-left: 0.5rem;
}

.sidebar.collapsed .sidebar-label {
  display: none;
}

.sidebar .icon {
  font-size: 1.3rem;
  width: 2rem;
  text-align: center;
  margin-right: 0.5rem;
}

.sidebar-user {
  padding: 0 1rem 1rem 1rem;
}

.sidebar .logout-form {
  margin-top: 0.5rem;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1 1 auto;
}

.sidebar li {
  display: flex;
  align-items: center;
  padding: 0.4rem 1rem;
  cursor: pointer;
  position: relative;
}

.sidebar li.active {
  background: var(--primary);
}

.sidebar li:hover, .sidebar li:focus-within {
  background: #343a40;
}

.sidebar .nav-link {
  color: #fff;
  text-decoration: none !important;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  width: 100%;
}

.sidebar .nav-link:visited,
.sidebar .nav-link:active,
.sidebar .nav-link:hover {
  color: #fff;
  text-decoration: none !important;
}

.sidebar .icon {
  text-decoration: none !important;
}

/* Sidebar dropdown menu styling */
.sidebar .dropdown-menu {
  background: #222;
  border: none;
  min-width: 180px;
  margin-left: 1.7rem;
  margin-top: 0.2rem;
  padding: 0.25rem 0;
}

.sidebar .dropdown-item {
  color: #fff;
  background-color: transparent !important;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  text-decoration: none;
}

.sidebar .dropdown-item:hover,
.sidebar .dropdown-item:focus {
  background: #343a40 !important; 
  color: #fff !important;           /* white text */
}

@media (max-width: 767.98px) {
  .layout {
    flex-direction: column;
    margin-top: 56px;
  }
  .sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 56px;
    height: calc(100vh - 56px);
    z-index: 1050;
  }
  .sidebar.mobile-active {
    display: flex;
  }
  .content {
    width: 100vw;
    padding-left: 0 !important;
  }
}

@media (min-width: 768px) {
  .navbar-custom .hamburger {
    display: none;
  }
}

.content {
  flex: 1 1 auto;
  padding: 2rem;
  background: #f8f9fa;
  min-width: 0;
  margin-left: 0;
  margin-top: 0;
}

.btn-primary {
  background: var(--primary);
  border: none;
}

.btn-outline-secondary {
  color: #222;
  border-color: #222;
}

/* Right sidebar (Quick Panel) */
.control-sidebar {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100%;
  background: #fff;
  transition: right 0.3s;
  box-shadow: -2px 0 8px rgba(0,0,0,0.09);
  z-index: 1100;
  overflow-y: auto;
}

.control-sidebar.show {
  right: 0;
}

.chart-fixed-height {
  max-height: 320px;
  min-height: 220px;
  height: 100%;
}


/* Pie/Doughnut: Square */
.chart-square {
  height: 260px !important;
  width: 260px !important;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

/* Line/Bar: Wide */
.chart-wide {
  height: 260px !important;
  width: 100% !important;
  max-width: 600px;
  display: block;
  margin: 0 auto;
}

/* AdminLTE-style Stat Card (Small Box) */
.small-box {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #f4f6f9;
  color: #fff;
  height: 100%;
  transition: transform 0.3s ease-in-out;
}

.small-box:hover {
  transform: scale(1.02);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

.small-box .inner {
  padding: 1rem 1rem 0.5rem 1rem;
  text-align: left;
  flex-grow: 1;
}

.small-box h3 {
  font-size: 2.2rem;
  font-weight: bold;
  margin: 0 0 0.25rem 0;
}

.small-box p {
  font-size: 1.1rem;
  margin: 0;
}

.small-box .icon {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 3rem;
  opacity: 0.2;
  transition: opacity 0.3s ease;
}

.small-box:hover .icon {
  opacity: 0.4;
}

.small-box-footer {
  background: rgba(0, 0, 0, 0.1);
  padding: 0.75rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  display: block;
  border-top: 1px solid rgba(255,255,255,0.1);
  width: 100%;
  border-radius: 0 0 0.5rem 0.5rem;
  color: inherit;
}

.small-box-footer:hover {
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
}

.small-box-footer a {
  color: inherit !important;
  text-decoration: none;
}


