html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Custom RBS Styles */
:root {
  --primary-color: #2563eb;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --light-bg: #f8fafc;
  --dark-text: #1e293b;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--light-bg);
  color: var(--dark-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.navbar-brand, .navbar .nav-link {
  color: white !important;
  font-weight: 500;
}

.navbar-brand:hover, .navbar .nav-link:hover {
  color: rgba(255,255,255,0.8) !important;
}

/* Tab navigation styles */
.nav-tabs {
  border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
  color: var(--dark-text) !important;
  border: 1px solid transparent;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s;
}

.nav-tabs .nav-link:hover {
  border-color: #e9ecef #e9ecef #dee2e6;
  color: var(--primary-color) !important;
  background-color: #f8f9fa;
}

.nav-tabs .nav-link.active {
  color: var(--primary-color) !important;
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
  border-bottom-color: transparent;
  font-weight: 600;
}

.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.table {
  border-radius: 8px;
  overflow: hidden;
}

.table thead {
  background-color: var(--primary-color);
  color: white;
}

/* Form buttons spacing to prevent footer overlap */
.container .mt-4.mb-5,
.container .mt-3.mb-5 {
  margin-bottom: 3rem !important;
  padding-bottom: 2rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }

  .table-responsive {
    font-size: 0.85rem;
  }

  .btn {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
  }

  .card-body {
    padding: 1rem;
  }

  .container .mt-4.mb-5,
  .container .mt-3.mb-5 {
    margin-bottom: 2rem !important;
    padding-bottom: 1.5rem;
  }
}

.footer {
  background-color: #1e293b;
  color: white;
  padding: 2rem 0;
  margin-top: auto;
}

.footer a {
  color: rgba(255,255,255,0.8);
}

/* Enhanced Navigation Styles */
.navbar-nav .dropdown-menu {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: none;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

.navbar-nav .dropdown-item {
  padding: 0.75rem 1.25rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.navbar-nav .dropdown-item:hover {
  background-color: #f8f9fa;
  transform: translateX(4px);
}

.navbar-nav .dropdown-item i {
  width: 20px;
  text-align: center;
  margin-right: 0.75rem;
}

/* Mega Menu Styles */
.mega-menu {
  position: static !important;
}

.mega-menu > .dropdown-menu {
  width: 100%;
  max-width: 900px;
  left: 50% !important;
  transform: translateX(-50%);
  padding: 1.5rem;
  margin-top: 0;
}

.mega-menu-column {
  padding: 0.5rem 1rem;
}

.mega-menu-column h6 {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mega-menu-column .dropdown-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

/* Menu Search */
.menu-search-container {
  position: relative;
  margin-bottom: 1rem;
}

.menu-search {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.9rem;
}

.menu-search:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.menu-search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
}

/* Menu Categories */
.menu-category {
  font-weight: 600;
  color: #495057;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.menu-category:first-child {
  margin-top: 0;
}

/* Keyboard Shortcut Badge */
.kbd-shortcut {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  font-size: 0.7rem;
  line-height: 1;
  color: #6c757d;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  font-family: monospace;
  margin-left: auto;
}

/* Active Menu Item */
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Menu Item Groups */
.menu-group {
  border-left: 3px solid var(--primary-color);
  padding-left: 0.5rem;
  margin: 0.5rem 0;
}

/* Quick Actions */
.quick-action-item {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 6px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.quick-action-item:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 991px) {
  .mega-menu > .dropdown-menu {
    width: 100%;
    max-width: 100%;
    left: 0 !important;
    transform: none;
  }
  
  .navbar-nav .dropdown-menu {
    margin-top: 0;
  }
}

/* Global Menu Search Modal */
.global-menu-search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.global-menu-search-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.global-menu-search-container {
  position: relative;
  width: 90%;
  max-width: 600px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.global-menu-search-header {
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
}

.global-menu-search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  color: var(--dark-text);
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.search-result-item:hover {
  background-color: #f8f9fa;
  border-left-color: var(--primary-color);
  color: var(--primary-color);
}

.search-result-item:focus {
  outline: none;
  background-color: #f8f9fa;
  border-left-color: var(--primary-color);
}

.search-result-item i.fa-arrow-right {
  opacity: 0;
  transition: opacity 0.2s;
}

.search-result-item:hover i.fa-arrow-right {
  opacity: 1;
}