/* Custom Theme - Gold Color Palette */
* {
  font-family: 'Tajawal', sans-serif;
}

:root {
  --gold-primary: #c9a227;
  --gold-dark: #a6850f;
  --gold-light: #f5e6b3;
  --gold-accent: #d4af37;
  --gold-gradient-start: #d4af37;
  --gold-gradient-end: #c9a227;
}

body {
  background-color: #f8f7f4;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: none;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 1rem 1.25rem;
}

.card-header h6 {
  font-weight: 700;
  color: #333;
  margin: 0;
}

.card-body {
  padding: 1.25rem;
}

/* Buttons */
.btn-primary {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: #fff;
}

.btn-primary:focus {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.3);
}

.btn-secondary {
  background: #f1f1f1;
  border: none;
  color: #666;
}

.btn-secondary:hover {
  background: #e5e5e5;
  color: #333;
}

.btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

/* Form Controls */
.form-label {
  font-weight: 600;
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

/* Tables */
.table thead th {
  font-weight: 600;
  color: #666;
  border-bottom: 1px solid #eee;
  padding: 1rem;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f5f5f5;
}

.table tbody tr:hover {
  background-color: #fffdf5;
}

/* Modals */
.modal-content {
  border: none;
  border-radius: 12px;
}

.modal-header {
  border-bottom: 1px solid #eee;
  padding: 1rem 1.25rem;
}

.modal-title {
  font-weight: 700;
  color: #333;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  border-top: 1px solid #eee;
  padding: 1rem 1.25rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #999;
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
  display: block;
}

/* Status Badges */
.status-badge {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.status-active {
  background-color: #d1fae5;
  color: #065f46;
}

.status-inactive {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Dropdowns */
td {
  position: relative;
}

td .dropdown-content {
  display: none;
  position: absolute;
  top: 20px;
  right: 0;
  min-width: 150px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  text-align: right;
}

td .dropdown-content a {
  display: block;
  padding: 10px 15px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

td .dropdown-content a:hover {
  background-color: #fffdf5;
  color: var(--gold-dark);
}

td .dropdown-content.show {
  display: block;
}

td .dropdown-toggle {
  cursor: pointer;
  font-size: 18px;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #888;
}

.drop-zone:hover {
  border-color: var(--gold-primary);
  background: #fffdf5;
}

.drop-zone.dragging {
  border-color: var(--gold-primary);
  background: var(--gold-light);
}

/* Footer */
.footer {
  padding: 1rem;
  text-align: center;
  color: #888;
  font-size: 0.85rem;
}

/* Gradient backgrounds for dashboard icons */
.bg-gradient-primary {
  background: linear-gradient(135deg, #d4af37 0%, #c9a227 100%);
}

.bg-gradient-info {
  background: linear-gradient(135deg, #4a9d9a 0%, #3d8584 100%);
}

.bg-gradient-warning {
  background: linear-gradient(135deg, #e8a838 0%, #d4942a 100%);
}

.bg-gradient-danger {
  background: linear-gradient(135deg, #c97a5d 0%, #b5664a 100%);
}

.bg-gradient-dark {
  background: linear-gradient(135deg, #3d3d3d 0%, #555555 100%);
}

/* ===== Professional Sidebar Styles ===== */
.sidenav {
  background: linear-gradient(180deg, #0f0f1a 0%, #1a1a2e 50%, #0f0f1a 100%) !important;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  width: 280px !important;
  min-height: 100vh;
}

/* Logo Section */
.sidenav-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.sidenav-header .navbar-brand {
  padding: 0;
  margin: 0;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.3);
}

.logo-icon i {
  font-size: 1.5rem;
  color: #fff;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.logo-text .brand-subtitle {
  font-size: 0.75rem;
  color: var(--gold-primary);
  font-weight: 500;
  letter-spacing: 1px;
}

/* Navigation Section */
.sidenav .navbar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
}

/* Section Title */
.nav-section {
  padding: 1.25rem 1rem 0.5rem;
  margin-top: 0.5rem;
}

.nav-section:first-child {
  margin-top: 0;
  padding-top: 0.5rem;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(201, 162, 39, 0.6);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Navigation Items */
.sidenav .nav-item {
  margin-bottom: 4px;
}

.sidenav .nav-link {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: rgba(255, 255, 255, 0.6) !important;
  margin: 0 0.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.sidenav .nav-link::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--gold-primary);
  border-radius: 3px 0 0 3px;
  transition: height 0.3s ease;
}

.sidenav .nav-link:hover {
  background: rgba(201, 162, 39, 0.08);
  border-color: rgba(201, 162, 39, 0.15);
  color: #fff !important;
  transform: translateX(-4px);
}

.sidenav .nav-link:hover::before {
  height: 60%;
}

/* Navigation Icon */
.nav-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-left: 12px;
}

.nav-icon i {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.sidenav .nav-link:hover .nav-icon {
  background: rgba(201, 162, 39, 0.15);
  border-color: rgba(201, 162, 39, 0.25);
  transform: scale(1.05);
}

.sidenav .nav-link:hover .nav-icon i {
  color: var(--gold-primary);
}

.sidenav .nav-link-text {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Active State */
.sidenav .nav-link.active {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.35);
  transform: translateX(-4px);
  border-color: transparent;
}

.sidenav .nav-link.active::before {
  height: 70%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.sidenav .nav-link.active .nav-icon {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.sidenav .nav-link.active .nav-icon i {
  color: #fff;
}

.sidenav .nav-link.active .nav-link-text {
  color: #fff !important;
  font-weight: 600;
}

/* Footer Section */
.sidenav-footer {
  padding: 1rem;
  border-top: 1px solid rgba(201, 162, 39, 0.1);
  background: rgba(0, 0, 0, 0.2);
  margin-top: auto;
}

.sidenav-footer .logout-link {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.6) !important;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.sidenav-footer .logout-link:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444 !important;
}

.sidenav-footer .logout-link:hover .nav-icon {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.25);
}

.sidenav-footer .logout-link:hover .nav-icon i {
  color: #ef4444;
}

.sidenav-footer .footer-brand {
  text-align: center;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidenav-footer .footer-brand small {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

/* Hide old elements */
.sidenav hr.horizontal {
  display: none;
}

/* Sidenav Close Button */
.sidenav #iconSidenav {
  color: rgba(255, 255, 255, 0.7) !important;
  transition: all 0.3s ease;
  z-index: 10;
}

.sidenav #iconSidenav:hover {
  color: #fff !important;
}

/* Mobile Toggler */
.sidenav-toggler-line {
  background-color: #333 !important;
}

/* Sidebar Scrollbar */
.sidenav::-webkit-scrollbar {
  width: 4px;
}

.sidenav::-webkit-scrollbar-track {
  background: transparent;
}

.sidenav::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.3);
  border-radius: 4px;
}

.sidenav::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* Main content adjustment */
.main-content {
  margin-right: 280px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

@media (max-width: 1199.98px) {
  .sidenav {
    transform: translateX(280px);
    transition: transform 0.3s ease;
  }

  .sidenav.show {
    transform: translateX(0);
  }

  .main-content {
    margin-right: 0 !important;
  }
}

/* Links */
a {
  color: var(--gold-primary);
}

a:hover {
  color: var(--gold-dark);
}

/* Form Check (Checkbox) */
.form-check-input:checked {
  background-color: var(--gold-primary);
  border-color: var(--gold-primary);
}

.form-check-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--gold-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* ===== Dashboard Charts Styles ===== */
.chart {
  position: relative;
  height: 300px;
}

.chart canvas {
  max-height: 100%;
}

/* Chart Card Headers */
.card-header .badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
}

/* Dashboard Stats Cards */
.card .numbers h5 {
  font-size: 1.5rem;
  color: #333;
}

.card .numbers p {
  color: #666;
}

.icon-shape.icon-md {
  width: 48px;
  height: 48px;
  min-width: 48px;
}

/* Summary Stats Row */
.card-body .icon-shape {
  transition: transform 0.3s ease;
}

.card-body .d-flex:hover .icon-shape {
  transform: scale(1.05);
}

/* Chart Loading State */
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #999;
}

.chart-loading i {
  font-size: 2rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive Chart Adjustments */
@media (max-width: 991px) {
  .chart {
    height: 250px;
  }
}

@media (max-width: 575px) {
  .chart {
    height: 200px;
  }

  .card-header .badge {
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
  }
}

/* ===== Top Navbar Styles ===== */
.top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 280px;
  height: 70px;
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 900;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* Adjust main content for fixed navbar */
.main-content {
  margin-top: 70px !important;
  padding-top: 1.5rem;
}

/* Global Search */
.navbar-search {
  display: flex;
  align-items: center;
  gap: 0;
  background: #f5f5f5;
  border-radius: 12px;
  padding: 0;
  flex: 1;
  max-width: 450px;
  position: relative;
  border: 2px solid transparent;
  transition: all 0.3s;
}

.navbar-search:focus-within {
  background: #fff;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.1);
}

.navbar-search i.search-icon {
  color: #999;
  font-size: 0.95rem;
  padding-right: 1rem;
}

.navbar-search input {
  border: none;
  background: transparent;
  padding: 0.85rem 1rem;
  flex: 1;
  font-size: 0.95rem;
  outline: none;
  color: #333;
}

.navbar-search input::placeholder {
  color: #999;
}

.global-search-btn {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  border: none;
  border-radius: 0 10px 10px 0;
  padding: 0.85rem 1.25rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
}

.global-search-btn:hover {
  opacity: 0.9;
}

.keyboard-shortcut {
  background: #e5e5e5;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  color: #666;
  margin-right: 10px;
  font-family: monospace;
  font-weight: 600;
}

/* Search Results Dropdown */
#globalSearchResults {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

#globalSearchResults.show {
  display: block;
}

.search-loading,
.search-error,
.search-empty {
  padding: 2rem;
  text-align: center;
  color: #999;
}

.search-loading i,
.search-error i,
.search-empty i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.search-error {
  color: #ef4444;
}

.search-category {
  padding: 0.5rem 1rem;
  background: #f8f7f4;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #fffdf5;
}

.search-result-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
}

.search-result-content {
  flex: 1;
}

.search-result-title {
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
}

.search-result-subtitle {
  font-size: 0.8rem;
  color: #888;
}

.search-result-extra {
  font-size: 0.75rem;
  color: var(--gold-dark);
  background: var(--gold-light);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Navbar Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Live Clock */
.live-clock {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #f8f7f4 0%, #f0efe8 100%);
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  color: #333;
}

.live-clock i {
  color: var(--gold-primary);
  font-size: 1rem;
}

.live-clock .clock-time {
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 75px;
  text-align: center;
}

.live-clock .clock-date {
  font-size: 0.8rem;
  color: #666;
  padding-right: 10px;
  border-right: 1px solid #ddd;
}

/* Notifications Bell */
.navbar-notifications {
  position: relative;
  width: 44px;
  height: 44px;
  background: #f5f5f5;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  color: #666;
}

.navbar-notifications:hover {
  background: var(--gold-light);
  color: var(--gold-dark);
}

.navbar-notifications .notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
}

/* User Dropdown */
.user-dropdown {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
  border-radius: 12px;
  transition: all 0.3s;
  position: relative;
}

.user-dropdown:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.user-dropdown-info {
  display: flex;
  flex-direction: column;
}

#adminName {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.admin-role {
  font-size: 0.75rem;
  color: var(--gold-primary);
}

.user-dropdown i.fa-chevron-down {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s;
  margin-right: 4px;
}

.user-dropdown:hover i.fa-chevron-down {
  transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  min-width: 200px;
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.user-dropdown-menu.show {
  display: block;
}

.user-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.85rem 1rem;
  color: #333;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.user-dropdown-menu a:hover {
  background: #f8f7f4;
}

.user-dropdown-menu a i {
  width: 18px;
  color: var(--gold-primary);
}

.user-dropdown-menu .divider {
  height: 1px;
  background: #eee;
  margin: 0.25rem 0;
}

.user-dropdown-menu a.logout-item {
  color: #ef4444;
}

.user-dropdown-menu a.logout-item i {
  color: #ef4444;
}

/* Responsive Navbar */
@media (max-width: 1199.98px) {
  .top-navbar {
    right: 0;
    padding: 0 1.5rem;
  }
}

@media (max-width: 991.98px) {
  .top-navbar {
    padding: 0 1rem;
  }

  .navbar-search {
    max-width: 280px;
  }

  .live-clock .clock-date {
    display: none;
  }

  .user-dropdown-info {
    display: none;
  }

  .user-dropdown {
    padding: 0.5rem;
  }
}

@media (max-width: 767.98px) {
  .top-navbar {
    height: 60px;
  }

  .main-content {
    margin-top: 60px !important;
  }

  .navbar-search {
    display: none;
  }

  .live-clock {
    padding: 0.5rem 0.75rem;
  }

  .keyboard-shortcut {
    display: none;
  }
}

@media (max-width: 480px) {
  .live-clock {
    display: none;
  }

  .navbar-actions {
    gap: 0.75rem;
  }
}

/* ===== Comprehensive Responsive Styles ===== */

/* Mobile First Base Styles */
@media (max-width: 575.98px) {
  /* Container padding */
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Cards */
  .card {
    border-radius: 10px;
    margin-bottom: 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .card-header {
    padding: 0.875rem 1rem;
  }

  /* Tables - horizontal scroll */
  .table-responsive {
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table thead th {
    font-size: 0.75rem;
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
  }

  .table tbody td {
    font-size: 0.8rem;
    padding: 0.75rem 0.5rem;
  }

  /* Buttons */
  .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
  }

  /* Page headers */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-actions .btn-header {
    width: 100%;
    justify-content: center;
  }

  /* Search bar */
  .search-bar {
    padding: 10px 14px;
  }

  .search-bar input {
    font-size: 0.85rem;
  }

  /* Modals */
  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-content {
    border-radius: 12px;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-footer {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    width: 100%;
  }

  /* Form controls */
  .form-control, .form-select {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* Dashboard stats */
  .col-sm-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Side panel */
  .side-panel {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Empty state */
  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-state i {
    font-size: 2.5rem;
  }

  .empty-state h3 {
    font-size: 1rem;
  }
}

/* Tablet Styles */
@media (min-width: 576px) and (max-width: 991.98px) {
  /* Container */
  .container-fluid {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Page headers */
  .page-header {
    flex-wrap: wrap;
  }

  /* Stats grid */
  .col-lg-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* Side panel */
  .side-panel {
    width: 450px !important;
  }

  /* Charts */
  .col-lg-8, .col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Desktop Large */
@media (min-width: 1400px) {
  .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Increase tap targets */
  .btn, button {
    min-height: 44px;
  }

  .nav-link {
    padding: 0.75rem 1rem;
  }

  .form-control, .form-select {
    min-height: 44px;
  }

  /* Remove hover effects on touch */
  .card:hover,
  .btn:hover,
  .table tbody tr:hover {
    transform: none;
  }
}

/* Print Styles */
@media print {
  .sidenav,
  .top-navbar,
  .header-actions,
  .search-bar,
  .btn,
  .modal {
    display: none !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
  }

  body {
    background: #fff;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid #333;
  }

  .btn-primary {
    border: 2px solid #000;
  }

  .form-control {
    border: 2px solid #333;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Mobile Sidebar Toggle ===== */
.mobile-menu-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 1100;
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
  border: none;
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
}

.mobile-menu-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.mobile-menu-toggle i {
  color: #c9a227;
  font-size: 1.25rem;
}

/* Sidenav toggler styling */
#iconNavbarSidenav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
}

#iconNavbarSidenav:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.sidenav-toggler-inner {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.sidenav-toggler-line {
  width: 22px;
  height: 2px;
  background: #c9a227 !important;
  border-radius: 2px;
  transition: all 0.3s;
}

#iconNavbarSidenav:hover .sidenav-toggler-line {
  background: #fff !important;
}

/* Mobile toggle container */
.d-xl-none.p-3 {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1050;
  padding: 0 !important;
}

@media (max-width: 1199.98px) {
  .d-xl-none.p-3 {
    display: block;
  }

  .main-content {
    padding-top: 70px;
  }
}

@media (min-width: 1200px) {
  .d-xl-none.p-3 {
    display: none !important;
  }
}

/* Sidebar overlay for mobile */
.sidenav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.sidenav-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Ensure sidebar shows properly on mobile */
@media (max-width: 1199.98px) {
  .sidenav {
    transform: translateX(280px);
    transition: transform 0.3s ease-in-out;
    z-index: 1040;
  }

  .sidenav.show,
  .g-sidenav-pinned .sidenav {
    transform: translateX(0);
  }

  .main-content {
    margin-right: 0 !important;
  }

  /* Adjust top navbar on mobile */
  .top-navbar {
    right: 0 !important;
    padding-right: 70px;
  }
}

/* ===== Additional Responsive Enhancements ===== */

/* Grid Cards on Mobile */
@media (max-width: 767.98px) {
  .row.g-3 > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
  }

  .row.g-3 {
    margin-left: -8px;
    margin-right: -8px;
  }

  /* Page title responsive */
  .page-title {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .page-title i {
    font-size: 1rem;
  }

  .count-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  /* Header actions */
  .header-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .btn-header {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  /* Search bar full width */
  .search-bar {
    margin-bottom: 1rem;
  }

  /* Customer grid cards */
  .customer-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .customer-card {
    padding: 1rem;
  }

  /* Reports grid */
  .reports-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .report-link-card {
    padding: 1.25rem;
  }

  /* Admin grid */
  .admins-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Tablet specific */
@media (min-width: 768px) and (max-width: 991.98px) {
  .customer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reports-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admins-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Fix footer position */
.footer {
  margin-top: auto;
}

/* Ensure proper spacing below content */
.container-fluid.py-4 {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
}

.container-fluid.py-4 > .footer {
  margin-top: auto;
}
