:root {
  --accent: #00a0e0;
  --accent2: #e43c2f;
  --bg: #fff;
  --sidebar-width: 250px;
}

body {
  background: var(--bg);
  color: #111;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* Card styling */
.card {
  text-decoration: none;
  color: inherit;
  border-radius: 0.6rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.hover-shadow:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  position: fixed !important;
  left: 12px;
  top: 12px;
  z-index: 1080;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 0;
  background: rgba(0, 0, 0, 0.6) !important;
  color: #fff !important;
  transition: background 0.15s ease;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.8) !important;
}

/* Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1055;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}

body.sidebar-expanded .sidebar-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Sidebar */
#sidebar.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1060;
  background: #212529 !important;
  color: #fff;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
  overflow: hidden;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

#sidebar .sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

#sidebar .sidebar-brand {
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  display: block;
}

#sidebar .sidebar-brand:hover {
  color: #fff !important;
  opacity: 0.8;
}

#sidebar .sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 0;
}

#sidebar .sidebar-nav .nav {
  padding: 0 0.5rem;
  list-style: none;
  margin: 0;
}

#sidebar .sidebar-nav .nav-item {
  margin-bottom: 0.25rem;
}

#sidebar .sidebar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s;
  text-decoration: none;
  background: transparent;
  border: 0;
}

#sidebar .sidebar-nav .nav-link:hover {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

#sidebar .sidebar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  font-weight: 500;
}

#sidebar .sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

#sidebar .sidebar-section-label {
  list-style: none;
  color: rgba(255, 255, 255, 0.5) !important;
  letter-spacing: .04em;
  font-weight: 600;
}

#sidebar .sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
  flex-shrink: 0;
}

#sidebar .sidebar-footer .dropdown {
  width: 100%;
}

#sidebar .sidebar-user-toggle {
  width: 100%;
  text-align: left;
  color: #fff !important;
  padding: 0.75rem 1rem;
  border: 0;
  background: transparent !important;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.375rem;
  transition: background 0.2s;
  text-decoration: none;
}

#sidebar .sidebar-user-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

#sidebar .sidebar-user-toggle::after {
  margin-left: auto;
}

#sidebar .dropdown-menu {
  position: absolute !important;
  bottom: 100% !important;
  left: 0 !important;
  right: 0 !important;
  margin-bottom: 0.5rem;
  z-index: 1070;
  min-width: 100%;
}

#sidebar .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: #fff;
}

#sidebar .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.25s ease;
  position: relative;
  z-index: 1;
}

.main-content .container-fluid {
  padding: 1.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #sidebar.sidebar {
    transform: translateX(-100%);
    z-index: 1070;
  }

  body.sidebar-expanded #sidebar.sidebar {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }
}

/* Desktop Collapsed State */
body.sidebar-collapsed #sidebar.sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width)));
}

body.sidebar-collapsed .main-content {
  margin-left: 0;
}

/* Table Styling */
.table thead {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
}

/* Button Styling */
.btn-primary {
  background: var(--accent);
  border: 0;
}

.btn-primary:hover {
  background: #0088c0;
}

/* Header Hero */
.header-hero {
  padding: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(90deg, #f7fbfd, #fff);
  margin-bottom: 1rem;
}

/* Modal z-index fixes */
.modal {
  z-index: 1080 !important;
}

.modal.show {
  display: block !important;
}

.modal-backdrop {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.modal-dialog {
  z-index: 1081 !important;
  position: relative;
  margin: 1.75rem auto;
}

.modal-content {
  position: relative;
  z-index: 1082;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
