/* Custom Typography Overrides */

/* Make all text darker/black by default */
body {
  color: #212529 !important;
  background-color: #f8f9fc;
  min-height: 100dvh !important;
}

/* Auto height — forcing 100% + 100vh makes the visual viewport sit below the top on mobile */
html, body {
  height: auto !important;
  min-height: 100dvh !important;
  overflow-x: hidden;
}

#root {
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: #212529 !important;
  font-weight: 600;
}

/* Footer h3 exception - Pink color */
footer h3 {
  color: #E91E63 !important;
}

/* Section headers with better spacing */
.h3 {
  letter-spacing: -0.5px;
}

/* Paragraphs and general text */
p, span, div, td, th, li {
  color: #212529;
}

/* Override SB Admin gray text classes */
.text-gray-800 {
  color: #212529 !important;
}

.text-gray-900 {
  color: #000000 !important;
}

/* Card improvements */
.card {
  border: none;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.card-body {
  color: #212529;
}

/* Stats card specific */
.stats-card {
  border-radius: 0.5rem;
  overflow: hidden;
}

.stats-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.12) !important;
}

/* Card header improvements */
.card-header {
  background-color: #fff;
  border-bottom: 1px solid #e3e6f0;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Table improvements */
.table {
  color: #212529;
}

.table td, .table th {
  color: #212529;
  vertical-align: middle;
  padding: 1rem 0.75rem;
}

.table thead th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  border-bottom: 2px solid #e3e6f0;
}

.table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.table thead th.sortable:hover {
  background-color: #f8f9fc;
  color: #4e73df;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background-color: #f8f9fc;
  transform: scale(1.01);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Form labels and inputs */
label, .form-label {
  color: #212529 !important;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-control {
  color: #212529 !important;
  border: 1px solid #d1d3e2;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.15);
}

/* Keep muted text slightly gray but readable */
.text-muted {
  color: #6c757d !important;
}

/* Small text */
small, .small {
  color: #6c757d !important;
}

/* Sidebar improvements */
.sidebar {
  box-shadow: 0 0 2rem rgba(0, 0, 0, 0.1);
}

.sidebar * {
  color: #fff !important;
}

.sidebar .nav-link {
  padding: 1rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, 0.8) !important;
}

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

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

.sidebar .nav-link span,
.sidebar .nav-link i,
.sidebar .sidebar-brand,
.sidebar a {
  color: #fff !important;
}

.sidebar .sidebar-divider {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Topbar improvements */
.topbar {
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
}

.topbar .nav-link {
  color: #212529 !important;
  transition: all 0.2s ease;
}

.topbar .nav-link:hover {
  color: #4e73df !important;
}

/* Dropdown improvements */
.dropdown-menu {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
}

.dropdown-item {
  color: #212529 !important;
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: #f8f9fc;
  color: #4e73df !important;
}

/* Button improvements */
.btn {
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 0.35rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

/* Badge improvements */
.badge {
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 0.25rem;
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 3rem;
  color: #d1d3e2;
  margin-bottom: 1rem;
}

.empty-state h5 {
  color: #5a5c69;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #858796;
  margin-bottom: 1.5rem;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #d1d3e2;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b7b9cc;
}


/* Sidebar Text - Force White */
.sidebar .nav-link,
.sidebar .nav-link span,
.sidebar .nav-link i {
  color: #fff !important;
}

.sidebar .nav-item.active .nav-link {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Logout Button - Red Filled Style */
.sidebar .logout-link {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
  border: 1px solid rgba(220, 53, 69, 0.5);
  transition: all 0.3s;
  margin: 0 1rem;
  border-radius: 0.35rem;
  padding: 0.75rem 1rem !important;
  display: block;
  max-width: calc(100% - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .logout-link:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
  border-color: #bd2130;
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.sidebar .logout-link i,
.sidebar .logout-link span {
  color: #fff !important;
}

/* Sidebar Brand */
.sidebar-brand {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Dropdown Logout Item */
.dropdown-item .text-danger {
  color: #dc3545 !important;
  font-weight: 600;
}

.dropdown-item:hover {
  background-color: #dc3545 !important;
}

.dropdown-item:hover .text-danger,
.dropdown-item:hover i {
  color: #fff !important;
}


/* Search Results Dropdown */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  margin-top: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

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

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

.search-result-item:hover {
  background-color: #f8f9fc;
  padding-left: 1.25rem;
}

.search-result-item i {
  width: 20px;
}

.navbar-search {
  position: relative;
}

.navbar-search .form-control {
  border-radius: 2rem;
  padding-left: 1rem;
}

.navbar-search .input-group-append .btn {
  border-radius: 0 2rem 2rem 0;
}


/* Mobile Sidebar Search */
.sidebar-search {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  margin: 0 0.5rem;
}

.sidebar-search .form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.sidebar-search .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-mobile-item {
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.search-mobile-item:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

/* Hide mobile search (unused in width=1200 shell) */
.sidebar-search {
  display: none !important;
}

/* Ensure sidebar is visible and positioned correctly on desktop */
.sidebar {
  position: relative !important;
  left: 0 !important;
  margin-left: 0 !important;
  width: 14rem !important;
}

/* Ensure content wrapper has proper margin */
#content-wrapper {
  margin-left: 0;
  width: 100%;
}

/* Desktop Sidebar Collapse */
body.sidebar-toggled .sidebar {
  width: 6.5rem !important;
  overflow: visible;
  min-width: 6.5rem;
}

body.sidebar-toggled .sidebar .nav-link span {
  display: none;
}

body.sidebar-toggled .sidebar .logout-link {
  margin: 0 0.5rem;
  padding: 0.75rem 0 !important;
  text-align: center;
  max-width: calc(100% - 1rem);
}

body.sidebar-toggled .sidebar .logout-link span {
  display: none;
}

body.sidebar-toggled .sidebar .logout-link i {
  margin: 0;
}

body.sidebar-toggled .sidebar .sidebar-search {
  display: none !important;
}

/* Adjust content when sidebar is collapsed */
body.sidebar-toggled #content-wrapper {
  margin-left: 0;
  width: calc(100% - 6.5rem);
}

/* Show tooltips on hover for collapsed items */
body.sidebar-toggled .sidebar .nav-link {
  text-align: center;
  padding: 0.75rem 0;
  border-left: none;
}

body.sidebar-toggled .sidebar .nav-link i {
  margin-right: 0;
}

body.sidebar-toggled .sidebar .nav-link.active {
  border-left: none;
  border-bottom: 3px solid #fff;
}


/* Sidebar toggle animation */
.sidebar {
  transition: left 0.3s ease-in-out;
}

/* Ensure page wrapper uses flexbox properly */
#wrapper {
  display: flex;
  width: 100%;
  min-height: 100dvh;
}

#wrapper #content-wrapper {
  overflow-x: hidden;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#wrapper #content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Desktop: content column participates in height fill (mobile already had this) */
#wrapper #content > .container-fluid {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
}


/* Ensure sidebar content doesn't overflow */
.sidebar {
  overflow-x: hidden !important;
}

.sidebar .nav-item {
  overflow: hidden;
}

.sidebar .nav-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modal */
.modal-responsive {
  max-width: 95vw;
  width: auto;
}

.modal-dialog {
  max-width: 600px;
}

.modal-body {
  padding: 1.5rem;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  border-bottom: 1px solid #e3e6f0;
  background: #f8f9fc;
}

.modal-title {
  font-weight: 600;
  color: #212529;
}

.modal-footer {
  border-top: 1px solid #e3e6f0;
  background: #f8f9fc;
}

/* Form Select Styling - Bootstrap 5 Compatible */
.form-select {
  background: #ffffff;
  border: 1px solid #d1d3e2;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: #212529;
  transition: all 0.2s ease;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-size: 0.875rem;
  line-height: 1.5;
}

.form-select:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
  outline: 0;
}

.form-select:hover {
  border-color: #4e73df;
}

.form-select:disabled {
  background-color: #f8f9fc;
  border-color: #e3e6f0;
  color: #6c757d;
  cursor: not-allowed;
}

/* Filter Panel */
.filter-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  right: -400px;
  width: 400px;
  background: #ffffff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filter-panel-open {
  right: 0;
}

body.filter-panel-visible {
  overflow: hidden !important;
}

.filter-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
}

.filter-panel-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e3e6f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fc;
  flex: 0 0 auto;
}

.filter-panel-header h5 {
  color: #4e73df;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.filter-panel-header .btn-link {
  color: #6c757d;
  text-decoration: none;
}

.filter-panel-header .btn-link:hover {
  color: #4e73df;
}

.filter-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.filter-panel-footer {
  flex: 0 0 auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e3e6f0;
  background: #f8f9fc;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

/* Filter Group Styling */
.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group label {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.5rem;
  display: block;
}

.filter-group .form-control,
.filter-group .form-select {
  border: 1px solid #d1d3e2;
  border-radius: 0.375rem;
  padding: 0.75rem;
  transition: all 0.2s ease;
}

.filter-group .form-control:focus,
.filter-group .form-select:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Filter toggle — viewport-centered; yellow + red */
.filter-toggle-btn,
.filter-toggle-btn.btn,
.filter-toggle-btn.btn-secondary,
.filter-toggle-btn.btn-primary {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 1030;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6c23e !important;
  border: 2px solid #e74a3b !important;
  color: #e74a3b !important;
  box-shadow: 0 4px 12px rgba(231, 74, 59, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.filter-toggle-btn i {
  color: #e74a3b !important;
}

.filter-toggle-btn:hover,
.filter-toggle-btn.btn:hover {
  transform: translateY(-50%) scale(1.1);
  background: #f4b619 !important;
  border-color: #e74a3b !important;
  color: #c0392b !important;
  box-shadow: 0 6px 16px rgba(231, 74, 59, 0.45);
}

.filter-toggle-btn:hover i {
  color: #c0392b !important;
}

.filter-toggle-btn.active,
.filter-toggle-btn.btn-primary.active,
.filter-toggle-btn.btn-primary {
  background: #e74a3b !important;
  border-color: #f6c23e !important;
  color: #f6c23e !important;
}

.filter-toggle-btn.active i,
.filter-toggle-btn.btn-primary i {
  color: #f6c23e !important;
}

/* Animation for filter count badge */
.filter-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Filter Panel Scrollbar */
.filter-panel-body::-webkit-scrollbar {
  width: 6px;
}

.filter-panel-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.filter-panel-body::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.filter-panel-body::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Column Visibility Grid */
.column-visibility-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.column-visibility-grid .form-check {
  margin-bottom: 0;
}

.column-visibility-grid .form-check-input {
  margin-top: 0.125rem;
}

.column-visibility-grid .form-check-label {
  font-size: 0.875rem;
  color: #495057;
  cursor: pointer;
  margin-left: 0.25rem;
}

.column-visibility-grid .form-check-input:checked + .form-check-label {
  color: #4e73df;
  font-weight: 500;
}


/* Compact row action menu (Users table, etc.) */
.action-menu-trigger {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5a5c69;
  background: #fff;
  border-color: #d1d3e2 !important;
  box-shadow: none !important;
  transform: none !important;
}

.action-menu-trigger:hover,
.action-menu-trigger:focus {
  color: #4e73df;
  background: #f8f9fc;
  border-color: #bac8f3 !important;
  transform: none !important;
  box-shadow: none !important;
}

.action-menu-dropdown .action-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.55rem 1rem;
  color: #212529 !important;
}

.action-menu-dropdown .action-menu-item:hover:not(:disabled) {
  background-color: #f8f9fc;
  color: #4e73df !important;
}

.action-menu-dropdown .action-menu-item.text-danger {
  color: #e74a3b !important;
}

.action-menu-dropdown .action-menu-item.text-danger:hover:not(:disabled) {
  background-color: #fdf2f2;
  color: #e74a3b !important;
}

.action-menu-dropdown .action-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Landing Page Footer Headers - Pink Color Override */
footer h3,
footer .h3 {
  color: #E91E63 !important;
}

/* Override global h3 rule specifically for footer */
footer h3[style*="color"] {
  color: #E91E63 !important;
}
