/* =====================================================
   DentalClinic Dashboard - Main CSS
   ===================================================== */

@media (min-width: 768px) {
  html {
    scrollbar-gutter: stable;
  }

  body {
    padding-right: 0 !important;
  }
}

body.modal-open {
  overflow: auto !important;
  padding-right: 0 !important;
}

/* ─── CSS Variables → see vars.css ─── */

/* ─── Custom Scrollbar (Global) ─── */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
  transition: background 0.3s;
}

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

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ─── Loading Spinner ─── */
#loading-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5000;
  background: var(--color-bg-processing);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#loading-wrapper.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tooth-loader {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Logo */
.loader-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  animation: logoPulse 2s ease-in-out infinite;
  position: relative;
  z-index: 3;
}

@keyframes logoPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

/* Orbiting Rings */
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid transparent;
  top: 50%;
  left: 50%;
}

.ring-1 {
  width: 56px;
  height: 56px;
  border-top-color: var(--color-primary);
  border-right-color: var(--color-primary-light);
  animation: ringCW 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.ring-2 {
  width: 72px;
  height: 72px;
  border-bottom-color: var(--color-secondary);
  border-left-color: rgba(140, 198, 63, 0.08);
  animation: ringCCW 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Dots on rings */
.ring-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.ring-1 .ring-dot {
  background: var(--color-primary);
  box-shadow: 0 0 4px var(--color-primary-shadow);
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
}

.ring-2 .ring-dot {
  background: var(--color-secondary);
  box-shadow: 0 0 4px var(--color-secondary-shadow);
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes ringCW {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes ringCCW {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

/* Toast styles → see components.css */

/* ─── Box Shadow System ─── */
.box-shadow,
.avatar-box,
.header-actions .header-icon,
.toggle-sidebar,
.pin-sidebar,
.icon-box,
.modal-content,
.btn {
  box-shadow: var(--shadow-inset);
}

.card-shadow,
.app-footer,
.card {
  box-shadow: var(--shadow-card);
}

/* ─── Base ─── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-ar);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg-body);
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: var(--color-primary);
  transition: all .3s ease;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: none;
}

/* ─── Bootstrap Overrides ─── */
.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-export {
  background: rgba(140, 198, 63, 0.08);
  color: #5A8A1E;
  border: 1px solid rgba(140, 198, 63, 0.3);
}

.btn-export:hover,
.btn-export:focus {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
  box-shadow: 0 2px 8px var(--color-secondary-shadow);
}

/* ─── Page Wrapper ─── */
.page-wrapper {
  margin: 0;
}

.page-wrapper.pinned .main-container {
  padding-right: 74px;
}

/* ─── App Header (Blue bar at top) ─── */
.app-header {
  padding: 0 1.25rem;
  min-height: 50px;
  background: var(--color-bg-header);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}

.header-center-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.5px;
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.app-brand {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.app-brand .logo {
  max-width: 190px;
  max-height: 40px;
}

.app-brand .brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.app-brand .brand-text-sm {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

/* Toggle / Pin Sidebar Buttons */
.toggle-sidebar,
.pin-sidebar {
  background: var(--color-bg-card);
  border: 3px solid var(--color-bg-card);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-sidebar i,
.pin-sidebar i {
  color: var(--color-primary);
  font-size: 1rem;
}

/* Header toggle: mobile only */
.app-header .toggle-sidebar {
  display: none;
}

/* Hero header pin: desktop only */
.app-hero-header .pin-sidebar {
  display: flex;
}

/* Sidebar pin button — circular arrow on sidebar inner edge */
.sidebar-wrapper > .pin-sidebar {
  position: absolute;
  top: 0.6rem;
  inset-inline-end: -15px;
  z-index: 102;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-primary, #0096D6);
  border: 2px solid var(--color-bg-card);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 150, 214, 0.35);
  transition: background 0.2s, box-shadow 0.2s;
}

.sidebar-wrapper > .pin-sidebar i,
.sidebar-wrapper > .pin-sidebar i::before {
  color: #fff !important;
}

.sidebar-wrapper > .pin-sidebar:hover {
  background: var(--color-primary-hover, #007BB3) !important;
  box-shadow: 0 3px 12px rgba(0, 150, 214, 0.5);
}

.sidebar-wrapper > .pin-sidebar:hover i::before {
  color: #fff !important;
}

/* Arrow flips when sidebar is pinned */
.page-wrapper.pinned .sidebar-wrapper > .pin-sidebar i {
  transform: rotate(180deg);
  transition: transform 0.3s;
}

/* Reset rotation when hovered (pin icon is showing) */
.page-wrapper.pinned.sidebar-hovered .sidebar-wrapper > .pin-sidebar i {
  transform: rotate(0deg);
}

.sidebar-wrapper > .pin-sidebar i {
  transition: transform 0.3s;
}

/* RTL: flip arrow direction */
[dir="rtl"] .sidebar-wrapper > .pin-sidebar i {
  transform: scaleX(-1);
}

[dir="rtl"] .page-wrapper.pinned .sidebar-wrapper > .pin-sidebar i {
  transform: scaleX(-1) rotate(180deg);
}

[dir="rtl"] .page-wrapper.pinned.sidebar-hovered .sidebar-wrapper > .pin-sidebar i {
  transform: scaleX(-1) rotate(0deg);
}

@media (max-width: 1199.98px) {
  .app-header .toggle-sidebar {
    display: flex;
  }

  .app-hero-header .pin-sidebar {
    display: none;
  }

  .sidebar-wrapper > .pin-sidebar {
    display: none;
  }

  .app-brand .brand-text {
    display: none;
  }

  .app-hero-header {
    justify-content: center;
  }

  .app-hero-header .page-title {
    font-size: 1rem;
    margin: 0 !important;
  }
}

/* ─── Header Actions ─── */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.header-actions .dropdown-toggle::after {
  display: none;
}

.header-actions .dropdown-toggle .count-label {
  position: absolute;
  top: -4px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 30px;
  background: #EF4444;
}

.header-actions .dropdown-toggle .count-label.info {
  background: #3B82F6;
}

.header-actions .dropdown-toggle .count-label.success {
  background: #8CC63F;
}

.header-actions .dropdown-toggle .count-label.warning {
  background: #F59E0B;
}

.header-actions .header-icon {
  width: 30px;
  height: 30px;
  color: #fff;
  font-weight: 700;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
}

.header-actions .header-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Search Container */
.search-container {
  position: relative;
}

.search-container .form-control {
  min-width: 230px;
  transition: all ease .5s;
  min-height: 30px;
  padding-right: 36px;
  border: 0;
  border-radius: 0.375rem;
  font-size: 0.85rem;
}

.search-container .form-control:focus {
  min-width: 240px;
  box-shadow: 0 0 0 .25rem rgba(0, 0, 0, .1);
}

.search-container i {
  position: absolute;
  right: 10px;
  top: 7px;
  line-height: 1;
  color: #0096D6;
  font-size: 1.25rem;
}

/* Avatar Box */
.avatar-box {
  width: 38px;
  height: 38px;
  color: #fff;
  background: #0096D6;
  border: 3px solid #0096D6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 8px;
  position: relative;
  font-size: 0.85rem;
}

.avatar-box .status {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 13px;
  height: 13px;
  border-radius: 10px;
  border: 3px solid #fff;
}

.avatar-box .status.busy {
  background: #EF4444;
}

.avatar-box .status.online {
  background: #8CC63F;
}

.avatar-box .status.away {
  background: #F59E0B;
}

/* Header User Avatar */
.header-avatar-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  overflow: visible;
}

.header-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.header-avatar-wrap .status {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #0096D6;
}

.header-avatar-wrap .status.online {
  background: #8CC63F;
}

.header-avatar-wrap .status.busy {
  background: #EF4444;
}

.header-avatar-wrap .status.away {
  background: #F59E0B;
}

/* Header Country Flag */
.header-country-flag {
  height: 20px;
  width: 20px;
  border-radius: 2px;
}

.country-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.country-container img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

/* ─── Sidebar ─── */
.sidebar-wrapper {
  background: var(--color-bg-sidebar);
  width: 250px;
  position: fixed;
  top: 50px;
  right: 0;
  bottom: 0;
  z-index: 101;
  transition: right .4s cubic-bezier(0.4, 0, 0.2, 1), width .4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -2px 0 12px rgba(0, 0, 0, .08);
  border-inline-start: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 12px 12px;
  margin: 6px 8px;
  border-radius: 12px;
  background: var(--color-sidebar-profile-bg);
  border: 1px solid var(--color-border);
  margin-bottom: 0.5rem;
  transition: background 0.3s;
}

.sidebar-profile:hover {
  background: var(--color-sidebar-profile-hover);
  text-decoration: none;
}

.sidebar-profile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-inline-end: 10px;
  border: 2px solid rgba(0, 150, 214, 0.15);
}

.sidebar-profile .profile-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile .profile-name h6 {
  margin: 0;
  font-weight: 500;
  color: var(--color-sidebar-profile-name);
  font-size: 0.9rem;
}

.sidebar-profile .profile-name small {
  color: var(--color-sidebar-profile-role);
  font-size: 0.75rem;
}

/* Sidebar Menu */
.sidebar-menu {
  list-style-type: none;
  margin: 0;
  padding: 0 8px;
}

.sidebar-menu>li {
  position: relative;
  margin: 0 0 2px 0;
}

.sidebar-menu>li>a {
  padding: 7px 10px;
  display: flex;
  align-items: center;
  border-radius: 3px;
  border-right: none;
  color: var(--color-sidebar-text);
  white-space: nowrap;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .25s ease;
}

.sidebar-menu>li>a>i {
  font-size: 1.05rem;
  flex-shrink: 0;
  background: var(--color-sidebar-icon-bg);
  color: var(--color-primary);
  width: 30px;
  height: 30px;
  margin-inline-end: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all .25s ease;
}

/* ─── Hover State ─── */
.sidebar-menu>li:hover>a {
  color: var(--color-sidebar-text-hover);
  background: var(--color-sidebar-active-bg);
}

.sidebar-menu>li:hover>a i {
  background: var(--color-sidebar-icon-hover-bg);
  color: var(--color-primary);
}

/* ─── Active / Open Treeview ─── */
.sidebar-menu>li.active>a {
  color: var(--color-sidebar-text-hover);
  background: var(--color-sidebar-active-bg);
}

.sidebar-menu>li.active>a i {
  background: var(--color-sidebar-icon-hover-bg);
  color: var(--color-primary);
}

/* ─── Current Page (strongest) ─── */
.sidebar-menu>li.current-page>a {
  background: var(--color-sidebar-current-bg);
  color: var(--color-primary);
  font-weight: 500;
  border-inline-start: 3px solid var(--color-primary);
  padding-inline-start: 7px;
}

.sidebar-menu>li.current-page>a i {
  background: var(--color-sidebar-icon-hover-bg);
  color: var(--color-primary);
}

.sidebar-menu>li.current-page:hover>a {
  background: var(--color-sidebar-icon-hover-bg);
  color: var(--color-primary-hover);
}

.sidebar-menu>li.current-page:hover>a i {
  background: rgba(var(--color-primary-rgb), 0.2);
  color: var(--color-primary-hover);
}

/* Menu Category Header */
.sidebar-menu>li .menu-title {
  padding: 8px 12px;
  color: var(--color-sidebar-heading);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-sidebar-divider), transparent);
  margin: 4px 16px;
}

.sidebar-menu>li:first-child.sidebar-divider {
  display: none;
}

/* ─── Sidebar Bottom Actions (Mobile) ─── */
.sidebar-bottom-actions {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  margin-top: auto;
  border-top: 1px solid var(--color-border);
}

.sidebar-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-sidebar-icon-bg);
  color: var(--color-sidebar-text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.sidebar-action-btn i {
  font-size: 1.1rem;
  color: var(--color-primary);
}

.sidebar-action-btn:hover,
.sidebar-action-btn:active {
  background: var(--color-sidebar-active-bg);
  color: var(--color-sidebar-text-hover);
  border-color: var(--color-primary);
}

.sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e6f4fb;
}

.sidebar-avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1rem;
}

/* Treeview (Submenu) */
.sidebar-menu>li.treeview>a {
  position: relative;
  z-index: 10;
}

.sidebar-menu>li.treeview>a:after {
  font-family: "remixicon" !important;
  font-weight: 500;
  font-size: 1rem;
  content: "\ea4e";
  display: inline-block;
  position: absolute;
  left: 15px;
  top: 14px;
  color: #000;
  transition: all .5s;
}

.sidebar-menu>li.treeview.active>a:after {
  transform: rotate(90deg);
}

.sidebar-menu .treeview-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0 5px 0 0;
}

.sidebar-menu li.active>.treeview-menu {
  display: block;
}

.sidebar-menu .treeview-menu>li {
  margin: 0;
}

.sidebar-menu .treeview-menu>li>a {
  padding: 10px 67px 10px 15px;
  display: block;
  color: #000;
  white-space: nowrap;
  text-decoration: none;
  transition: all .2s ease;
}

.sidebar-menu .treeview-menu>li>a:hover {
  color: #0096D6;
}

.sidebar-menu .treeview-menu>li>a.active-sub {
  position: relative;
  color: #0096D6;
}

/* Sidebar Contact */
.sidebar-contact {
  padding: 10px 15px 10px 50px;
  background: #8CC63F;
  color: #fff;
  margin: 18px 20px 8px 20px;
  border-radius: 4px;
  position: relative;
  font-size: 0.85rem;
}

.sidebar-contact i {
  font-size: 1.75rem;
  position: absolute;
  bottom: 10px;
  right: 10px;
}

/* ─── Main Container ─── */
.main-container {
  padding: 0 250px 0 0;
  transition: padding .3s ease;
}

/* ─── Hero Header (Breadcrumb bar) ─── */
.app-hero-header {
  background: var(--color-bg-hero);
  padding: .5rem 1.5rem;
  position: sticky;
  top: 50px;
  z-index: 99;
  box-shadow: var(--shadow-sm);
  gap: 0.5rem;
}

.app-hero-header .page-title {
  color: var(--color-text);
  font-size: 1.1rem;
}

/* Breadcrumb */
.breadcrumb {
  margin: 0;
}

.breadcrumb .breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb .breadcrumb-item i {
  font-size: 1.5rem;
  margin-left: .75rem;
  color: #0096D6;
}

.breadcrumb .breadcrumb-item+.breadcrumb-item::before {
  font-family: "remixicon" !important;
  content: "\ea6c";
  font-size: 1.5rem;
  line-height: 1;
  vertical-align: middle;
}

.breadcrumb-active {
  color: #0096D6;
  font-weight: 500;
}

/* ─── App Body ─── */
.app-body {
  padding: .5rem 1.5rem 1rem 1.5rem;
  min-height: calc(100vh - 155px);
  width: 100%;
  box-sizing: border-box;
}

/* ─── App Footer ─── */
.app-footer {
  font-size: .725rem;
  margin: 0 1.5rem;
  padding: .4rem 1rem;
  height: 36px;
  color: var(--color-primary);
  border-radius: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-link {
  color: var(--color-primary);
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

/* ─── Sidebar WhatsApp Card ─── */
.sidebar-wa-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 12px 12px;
  padding: 10px 14px;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: 10px;
  color: #128C7E;
  text-decoration: none;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.sidebar-wa-card:hover {
  background: rgba(37, 211, 102, 0.15);
  color: #128C7E;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.15);
}

.sidebar-wa-icon {
  font-size: 1.3rem;
  color: #25D366;
  flex-shrink: 0;
}

.sidebar-wa-label {
  font-size: 0.8rem;
  font-weight: 600;
}

[data-theme="dark"] .sidebar-wa-card {
  background: rgba(37, 211, 102, 0.08);
  border-color: rgba(37, 211, 102, 0.15);
  color: #4ade80;
}

[data-theme="dark"] .sidebar-wa-card:hover {
  background: rgba(37, 211, 102, 0.15);
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.1);
}

[data-theme="dark"] .sidebar-wa-icon {
  color: #4ade80;
}


/* ─── Cards ─── */
.card {
  border: 0;
  background: var(--color-bg-card);
}

.card-header {
  border: 0;
  background: transparent;
}

.card-footer {
  border: 0;
}

/* ─── Gradient Stat Cards ─── */
.card-primary-gradient {
  background: linear-gradient(135deg, #0096D6 0%, #0077B3 100%);
  color: #fff;
  border: 0;
}

.card-success-gradient {
  background: linear-gradient(135deg, #8CC63F 0%, #6BA82E 100%);
  color: #fff;
  border: 0;
}

.card-info-gradient {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: #fff;
  border: 0;
}

.card-warning-gradient {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #fff;
  border: 0;
}

.card-gradient-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* ─── Dropdown ─── */
.dropdown-menu {
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  background: var(--color-bg-dropdown);
}

.dropdown-menu:after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 10px;
  height: 10px;
  background: var(--color-bg-dropdown);
  top: -5px;
  inset-inline-end: 10px;
  transform: rotate(45deg);
}

.dropdown-menu.dropdown-menu-end:after {
  inset-inline-end: 10px;
}

.dropdown-300 {
  min-width: 300px;
  max-width: 320px;
  width: 300px;
}

.dropdown-mini {
  width: 50px;
  min-width: 50px;
}

/* ─── Scroll Containers ─── */
.scroll200 {
  height: 200px;
  overflow: hidden;
}

.scroll240 {
  height: 240px;
  overflow: hidden;
}

.scroll300 {
  height: 300px;
  overflow: hidden;
}

.scroll350 {
  height: 350px;
  overflow: hidden;
}

/* ─── Tables ─── */
.table-outer {
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.table-bg {
  background: var(--color-surface-alt);
  border-radius: 3px;
  padding: 10px;
}

.table thead th {
  font-weight: 500;
}

.table thead td {
  font-weight: 500;
}

.table tr:last-child td {
  border: 0;
}

/* ─── Image Sizes ─── */
.img-shadow {
  box-shadow: 0 5px 5px rgba(0, 0, 0, .2);
  border: 1px solid #fff;
}

.img-1x {
  width: 1rem;
  height: 1rem;
}

.img-1xx {
  width: 1.5rem;
  height: 1.5rem;
}

.img-2x {
  width: 2rem;
  height: 2rem;
}

.img-2xx {
  width: 2.5rem;
  height: 2.5rem;
}

.img-3x {
  width: 3rem;
  height: 3rem;
}

.img-3xx {
  width: 3.5rem;
  height: 3.5rem;
}

.img-4x {
  width: 4rem;
  height: 4rem;
}

.img-4xx {
  width: 4.5rem;
  height: 4.5rem;
}

.img-5x {
  width: 5rem;
  height: 5rem;
}

.img-5xx {
  width: 5.5rem;
  height: 5.5rem;
}

.img-6x {
  width: 6rem;
  height: 6rem;
}

.img-7x {
  width: 7rem;
  height: 7rem;
}

/* ─── Icon Box ─── */
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.icon-box.sm {
  width: 2rem;
  height: 2rem;
}

.icon-box.md {
  width: 3rem;
  height: 3rem;
}

.icon-box.lg {
  width: 4rem;
  height: 4rem;
}

.icon-box.xl {
  width: 5rem;
  height: 5rem;
}

/* ─── Custom Colors ─── */
.bg-peach {
  background: #fea95f;
}

.bg-lime {
  background: #79d874;
}

.bg-arctic {
  background: #1ec5f9;
}

.bg-pine-green {
  background: #02b86f;
}

/* ─── Chart Heights ─── */
.chart-height-md {
  height: 150px;
}

.chart-height {
  height: 240px;
}

.chart-height-lg {
  height: 300px;
}

.chart-height-xl {
  height: 360px;
}

.chart-height-xxl {
  height: 480px;
}

/* ─── Activity ─── */
.activity-log {
  padding-right: 1.75rem;
  padding-bottom: 2rem;
  position: relative;
  list-style: none;
}

.activity-log:before {
  content: "";
  position: absolute;
  top: 1px;
  right: 0;
  background: #fff;
  border: 4px solid #0096D6;
  width: 17px;
  height: 17px;
  border-radius: 50px;
  z-index: 1;
}

.activity-log:after {
  content: "";
  position: absolute;
  right: 7px;
  top: 10px;
  background: #CBD5E1;
  height: 100%;
  width: 3px;
}

.activity-log:last-child {
  padding-bottom: 0;
}

.activity-list {
  border-bottom: 1px dotted #E2E8F0;
}

.activity-list .activity-time {
  border-left: 1px solid #E2E8F0;
}

.activity-list .activity-time .badge {
  border-radius: 0 4px 4px 0;
  min-width: 70px;
  text-align: right;
  margin: 5px 5px 15px 0;
}

.activity-list2 {
  margin: 0;
  list-style-type: none;
}

/* Activity Feed */
.activity-feed {
  padding: 10px 5px 0 0;
  word-wrap: break-word;
}

.activity-feed .feed-item {
  position: relative;
  padding: 0 25px 40px 0;
  border-right: 2px solid #0096D6;
}

.activity-feed .feed-item:after {
  content: "";
  display: flex;
  position: absolute;
  top: 0;
  right: -6px;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #151516;
}

/* ─── Stacked Images ─── */
.stacked-images {
  display: flex;
}

.stacked-images.center {
  justify-content: center;
}

.stacked-images img {
  border-radius: 50px;
  width: 32px;
  height: 32px;
  margin-left: -10px;
}

.stacked-images .plus {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50px;
  color: #fff;
  width: 32px;
  height: 32px;
}

/* ─── Sidebar Scrollbar ─── */
.sidebarMenuScroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-block-end: 1rem;
}

.sidebarMenuScroll::-webkit-scrollbar {
  width: 3px;
}

.sidebarMenuScroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

/* ─── Custom Tabs ─── */
.custom-tabs-container .nav-tabs {
  margin: 0 -16px;
  border-bottom: 1px solid #CBD5E1;
}

.custom-tabs-container .nav-tabs .nav-link {
  padding: .5rem 1rem;
}

.custom-tabs-container .nav-tabs .nav-link.active {
  border-color: transparent transparent #0096D6;
  color: #0096D6;
  background: transparent;
  border-bottom-width: 3px;
}

.custom-tabs-container .nav-tabs .nav-link i {
  font-size: 1.3rem;
  margin-left: 7px;
  vertical-align: middle;
}

.custom-tabs-container .nav-tabs .nav-link:hover {
  border-color: transparent transparent #CBD5E1;
  border-bottom-width: 3px;
}

.custom-tabs-container .tab-content {
  padding: 1.5rem 0 0 0;
}

/* ─── Form Overrides ─── */
.form-control:focus {
  box-shadow: 0 0 0 .25rem var(--color-primary-light);
}

/* ─── Pinned Sidebar ─── */
@media (min-width: 1200px) {
  /* Smooth transitions for collapsible text elements */
  .sidebar-profile .profile-name,
  .sidebar-menu .menu-text,
  .sidebar-wa-label,
  .sidebar-menu .badge {
    transition: opacity .3s ease, max-width .3s ease;
    overflow: hidden;
    white-space: nowrap;
  }

  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper {
    width: 74px;
  }

  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-profile .profile-name,
  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-menu .menu-text,
  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-wa-label,
  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-menu .badge {
    opacity: 0;
    max-width: 0;
    margin: 0;
    padding: 0;
  }

  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-menu .treeview.active .treeview-menu,
  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-menu li.treeview:after,
  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-contact {
    display: none !important;
  }

  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-profile {
    justify-content: center;
    padding: 10px 6px;
    margin: 6px 6px 8px;
  }

  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-profile img {
    margin-inline-end: 0;
    width: 36px;
    height: 36px;
  }

  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper .sidebar-wa-card {
    justify-content: center;
    padding: 10px;
    margin: 8px 6px 10px;
  }
}

/* ─── Responsive Sidebar ─── */
@media screen and (max-width: 1199.98px) {
  .page-wrapper .sidebar-wrapper {
    right: -270px;
  }

  .page-wrapper.toggled .sidebar-wrapper {
    right: 0;
    box-shadow: 0 2px 10px rgba(0, 150, 214, .15);
    border-radius: 20px 0 0 0;
  }

  .page-wrapper .main-container {
    padding: 0 10px;
  }

  .page-wrapper.pinned .main-container {
    padding: 0 10px;
  }
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  z-index: 100;
  display: none;
}

.page-wrapper.toggled .sidebar-overlay {
  display: block;
}

@media (min-width: 1200px) {
  .page-wrapper.toggled .sidebar-overlay {
    display: none;
  }
}

/* ─── Auto Align Graph ─── */
.auto-align-graph .apexcharts-canvas {
  margin: auto;
}

/* ─── ApexCharts RTL Fix ─── */
.apexcharts-canvas {
  direction: ltr;
}

.apexcharts-legend {
  direction: rtl;
}

/* ─── DataTables Custom ─── */

/* Table base */
table.dataTable {
  border: 1px solid var(--color-border);
  margin-bottom: 5px !important;
}

table.dataTable td {
  color: var(--color-text-body);
  vertical-align: middle;
  font-size: 0.875rem;
}

table.dataTable thead th {
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  position: relative;
  padding-inline-end: 24px !important;
}

/* Sort indicators for DT v2 — using ::before (↑) and ::after (↓) on th */
table.dataTable>thead th.dt-orderable-asc,
table.dataTable>thead th.dt-orderable-desc {
  cursor: pointer;
  position: relative;
  padding-inline-end: 28px !important;
}

table.dataTable>thead th.dt-orderable-asc::before,
table.dataTable>thead th.dt-orderable-desc::before,
table.dataTable>thead th.dt-orderable-asc::after,
table.dataTable>thead th.dt-orderable-desc::after {
  position: absolute;
  bottom: .5em;
  display: block;
  opacity: .3;
  font-size: 0.8rem;
  font-weight: 300;
}

/* ↑ arrow */
table.dataTable>thead th.dt-orderable-asc::before,
table.dataTable>thead th.dt-orderable-desc::before {
  inset-inline-end: 1em;
  content: "\2191";
}

/* ↓ arrow */
table.dataTable>thead th.dt-orderable-asc::after,
table.dataTable>thead th.dt-orderable-desc::after {
  inset-inline-end: 0.5em;
  content: "\2193";
}

/* Active ascending: ↑ highlighted */
table.dataTable>thead th.dt-ordering-asc::before {
  opacity: 1;
  color: var(--color-primary);
}

/* Active descending: ↓ highlighted */
table.dataTable>thead th.dt-ordering-desc::after {
  opacity: 1;
  color: var(--color-primary);
}

/* Active sort column bg */
table.dataTable>thead th.dt-ordering-asc,
table.dataTable>thead th.dt-ordering-desc {
  background: var(--color-primary-light) !important;
}

/* Hide DT v2 built-in sort icon (empty span) */
table.dataTable thead th span.dt-column-order {
  display: none !important;
}

/* Hover row */
table.dataTable tbody tr:hover {
  background-color: var(--color-bg-table-hover) !important;
}

/* Excel export button */
#btnExportExcel:hover {
  background: #1a5c38 !important;
}

/* Patients Toolbar Layout */
.patients-toolbar {
  justify-content: space-between;
  flex-wrap: nowrap !important;
}

.patients-toolbar .toolbar-start {
  flex: 1 1 0;
}

.patients-toolbar .toolbar-search {
  flex: 0 1 360px;
  padding: 0 0.75rem;
  min-width: 0;
}

.patients-toolbar .toolbar-search input {
  text-align: center;
}

.patients-toolbar .toolbar-end {
  flex: 1 1 0;
  justify-content: flex-end;
}

/* Mobile: single row toolbar */
@media (max-width: 767.98px) {
  .app-body {
    padding: 0.35rem;
  }

  .app-hero-header {
    padding: 0.35rem 0.75rem;
  }

  .app-hero-header .page-title {
    font-size: 0.95rem;
  }

  .app-body .row>* {
    padding-right: 0;
    padding-left: 0;
  }

  .patients-toolbar {
    flex-wrap: nowrap !important;
    gap: 0.4rem !important;
  }

  /* Hide Add button on mobile (FAB exists) */
  .patients-toolbar .toolbar-start {
    display: none;
  }

  /* Unwrap toolbar-end so children become direct flex items */
  .patients-toolbar .toolbar-end {
    display: contents !important;
  }

  .patients-toolbar .btn-export {
    order: 2;
    flex-shrink: 0;
  }

  .patients-toolbar .toolbar-search {
    order: 1;
    flex: 1;
    min-width: 0;
    padding: 0;
  }

  .patients-toolbar .toolbar-search .position-relative {
    max-width: 100%;
  }

  .patients-toolbar #customPageLength {
    order: 0;
    flex-shrink: 0;
  }
}

/* DT layout controls (v2) */
.dt-layout-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  padding: 0.5rem 0;
  gap: 0.5rem;
}

.dt-layout-row .dt-layout-cell {
  flex: 0 0 auto;
}

.dt-layout-row .dt-layout-cell:last-child {
  margin-inline-start: auto;
}

/* Search & Length */
.dataTables_wrapper .dataTables_length select,
.dt-length select {
  padding: .25rem 2rem .25rem .5rem;
  border: 1px solid #CBD5E1;
  border-radius: .375rem;
  font-size: .85rem;
}

.dataTables_wrapper .dataTables_filter input,
.dt-search input {
  border: 1px solid #CBD5E1;
  border-radius: .375rem;
  padding: .375rem .75rem;
  font-size: .85rem;
  min-width: 200px;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dt-search input:focus {
  border-color: #0096D6;
  outline: none;
  box-shadow: 0 0 0 .2rem rgba(0, 150, 214, .15);
}

/* Info */
.dataTables_wrapper .dataTables_info,
.dt-info {
  font-size: .82rem;
  color: #475569;
  padding-top: 0.75rem;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate,
.dt-paging {
  padding-top: 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button,
.dt-paging nav button {
  padding: .3rem .55rem;
  margin: 0 1px;
  border-radius: .375rem;
  border: 1px solid #CBD5E1;
  color: #0F172A !important;
  font-size: .82rem;
  cursor: pointer;
  background: #fff;
  transition: all .2s ease;
  line-height: 1;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dt-paging nav button:hover {
  background: #e6f4fb !important;
  border-color: #0096D6 !important;
  color: #0096D6 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dt-paging nav button.current {
  background: #0096D6 !important;
  border-color: #0096D6 !important;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dt-paging nav button.disabled {
  opacity: .4;
  cursor: default;
  pointer-events: none;
}

/* ─── Animations ─── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

/* ─── Utility ─── */
.no-shadow {
  box-shadow: none;
}

.shadow-light {
  box-shadow: 0 0 20px #fff;
}

/* ─── FullCalendar Custom ─── */
.schedule-calendar .fc-theme-standard .fc-scrollgrid {
  border: 0;
}

.schedule-calendar .fc .fc-toolbar.fc-header-toolbar {
  margin-bottom: 0.5rem;
}

.schedule-calendar .fc .fc-button {
  border: 1px solid transparent;
  padding: 0.4em 0.65em;
  font-size: 14px;
  font-family: var(--font-family-ar);
}

.schedule-calendar .fc .fc-non-business {
  background: transparent;
}

.schedule-calendar .fc .fc-bg-event {
  background: #e2f1fe !important;
  opacity: 1;
}

.schedule-calendar .fc .fc-button-primary {
  background-color: transparent;
  border-color: transparent;
  color: #0096D6;
}

.schedule-calendar .fc .fc-button-primary:not(:disabled).fc-button-active,
.schedule-calendar .fc .fc-button-primary:not(:disabled):active {
  background-color: #0096D6;
  border-color: #0096D6;
  color: #fff;
}

.schedule-calendar .fc .fc-toolbar-title {
  font-size: 1em;
  margin: 0;
  font-family: var(--font-family-ar);
  font-weight: 500;
}

.schedule-calendar .fc .fc-col-header-cell-cushion {
  padding: 8px 4px;
  color: #242424;
  font-weight: 500;
  font-size: 0.85rem;
}

.schedule-calendar .fc .fc-daygrid-day-number {
  padding: 6px 8px;
  font-size: 0.85rem;
  color: #0F172A;
}

.schedule-calendar .fc .fc-event {
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.8rem;
  border: none;
}

.schedule-calendar .fc .fc-daygrid-day.fc-day-today {
  background: #e3eefd;
}

.schedule-calendar .fc .fc-button:focus {
  box-shadow: none;
}

.schedule-calendar .fc td,
.schedule-calendar .fc th {
  border-color: #eef0f5;
}

/* Full Calendar event colors */
.fc-event-primary {
  background-color: #0096D6 !important;
}

.fc-event-success {
  background-color: #8CC63F !important;
}

.fc-event-warning {
  background-color: #F59E0B !important;
  color: #000 !important;
}

.fc-event-danger {
  background-color: #EF4444 !important;
}

.fc-event-info {
  background-color: #3B82F6 !important;
}

/* ─── Patient Action Buttons ─── */
.btn-icon-sm {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: .85rem;
}

/* ─── Status Badge ─── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 6px;
}

/* ─── Custom Card Styles for Dashboard ─── */
.card-primary-gradient {
  background: linear-gradient(135deg, #0096D6 0%, #38BDF8 100%);
  color: #fff;
  border: 0;
}

.card-success-gradient {
  background: linear-gradient(135deg, #8CC63F 0%, #5fd462 100%);
  color: #fff;
  border: 0;
}

.card-info-gradient {
  background: linear-gradient(135deg, #3B82F6 0%, #4fc3f7 100%);
  color: #fff;
  border: 0;
}

.card-warning-gradient {
  background: linear-gradient(135deg, #F59E0B 0%, #f5d77a 100%);
  color: #000;
  border: 0;
}

.card-gradient-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* ─── Backgrounds ─── */
.bg-1 {
  background: url(../images/bg.jpg);
  background-size: cover;
}

.bg-2 {
  background: url(../images/banner.svg);
  background-size: cover;
  background-position: left;
}

.bg-3 {
  background: url(../images/banner2.svg);
  background-size: cover;
  background-position: left;
}

.bg-4 {
  background: url(../images/banner3.svg);
  background-size: cover;
  background-position: left;
}

/* ─── Status Dot (inside badges) ─── */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-inline-end: 5px;
  vertical-align: middle;
}

/* ─── Patient Action Buttons ─── */
.btn-icon-sm {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* ─── Language Toggle Button ─── */
.lang-toggle-btn {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .25s ease;
  padding: 0;
  line-height: 1;
  box-shadow: var(--shadow-inset);
}

.lang-toggle-btn:hover {
  background: rgba(255, 255, 255, .15);
}

.lang-toggle-btn .lang-text {
  display: block;
}

/* Hide header theme/lang on mobile — moved to sidebar */
@media (max-width: 991.98px) {
  .header-actions .header-icon,
  .header-actions .lang-toggle-btn,
  .header-actions form:has(.lang-toggle-btn) {
    display: none !important;
  }
}

/* =====================================================
   LTR Mode Overrides (English)
   When dir="ltr" is set on <html>
   ===================================================== */
[dir="ltr"] .sidebar-wrapper {
  right: auto;
  left: 0;
}

[dir="ltr"] .main-container {
  padding-right: 0;
  padding-left: 250px;
}

[dir="ltr"] .page-wrapper.pinned .main-container {
  padding-right: 0;
  padding-left: 74px;
}

[dir="ltr"] .sidebar-menu>li>a {
  padding: 7px 25px 7px 15px;
  border-right: none;
  border-left: 3px solid transparent;
}

[dir="ltr"] .sidebar-menu>li>a>i {
  margin-left: 0;
  margin-right: 15px;
}

[dir="ltr"] .sidebar-menu>li:hover>a {
  border-right-color: transparent;
  border-left-color: #0096D6;
}

[dir="ltr"] .sidebar-menu>li .menu-title {
  padding: 8px 25px 8px 18px;
}

[dir="ltr"] .sidebar-menu>li.treeview>a:after {
  left: auto;
  right: 15px;
}

[dir="ltr"] .sidebar-menu .treeview-menu {
  padding: 0 0 0 5px;
}

[dir="ltr"] .sidebar-menu .treeview-menu>li>a {
  padding: 10px 15px 10px 67px;
}

[dir="ltr"] .sidebar-contact {
  padding: 10px 50px 10px 15px;
}

[dir="ltr"] .sidebar-contact i {
  right: auto;
  left: 10px;
}

[dir="ltr"] .sidebar-profile img {
  margin-left: 0;
  margin-right: 12px;
}

[dir="ltr"] .search-container .form-control {
  padding-right: 0.75rem;
  padding-left: 36px;
}

[dir="ltr"] .search-container i {
  right: auto;
  left: 10px;
}

[dir="ltr"] .breadcrumb .breadcrumb-item i {
  margin-left: 0;
  margin-right: .75rem;
}

[dir="ltr"] .activity-feed .feed-item {
  padding: 0 0 40px 25px;
  border-right: none;
  border-left: 2px solid #0096D6;
}

[dir="ltr"] .activity-feed .feed-item:after {
  right: auto;
  left: -6px;
}

[dir="ltr"] .activity-log {
  padding-right: 0;
  padding-left: 1.75rem;
}

[dir="ltr"] .activity-log:before {
  right: auto;
  left: 0;
}

[dir="ltr"] .activity-log:after {
  right: auto;
  left: 7px;
}

[dir="ltr"] .apexcharts-legend {
  direction: ltr;
}

/* Responsive LTR */
@media screen and (max-width: 1199.98px) {
  [dir="ltr"] .page-wrapper .sidebar-wrapper {
    right: auto;
    left: -270px;
  }

  [dir="ltr"] .page-wrapper.toggled .sidebar-wrapper {
    left: 0;
    right: auto;
    border-radius: 0 20px 0 0;
  }

  [dir="ltr"] .page-wrapper .main-container {
    padding: 0 10px;
  }

  [dir="ltr"] .page-wrapper.pinned .main-container {
    padding: 0 10px;
  }
}

/* =====================================================
   Dark Mode — Supplementary Overrides
   These handle elements that can't be fully driven by
   CSS variables alone (e.g., Bootstrap inline styles)
   ===================================================== */
[data-theme="dark"] .modal-content {
  background: var(--color-bg-modal);
  border-color: var(--color-border);
}

[data-theme="dark"] .modal-header {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .modal-footer {
  border-top-color: var(--color-border);
}

[data-theme="dark"] .modal-header-primary {
  background: linear-gradient(135deg, #0E7490 0%, #155E75 100%);
}

[data-theme="dark"] .btn-primary {
  background: #0E7490;
  border-color: #0E7490;
  color: #fff;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus {
  background: #0891B2;
  border-color: #0891B2;
}

[data-theme="dark"] .dropdown-item {
  color: var(--color-text);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

[data-theme="dark"] .dropdown-divider {
  border-color: var(--color-border);
}

[data-theme="dark"] .sidebar-avatar {
  border-color: rgba(56, 189, 248, 0.15);
}

[data-theme="dark"] .header-avatar {
  background: var(--color-bg-card);
}

[data-theme="dark"] .header-avatar-wrap .status {
  border-color: var(--color-bg-header);
}

/* Dark mode table overrides */
[data-theme="dark"] table.dataTable {
  border-color: var(--color-border);
}

[data-theme="dark"] .table-outer {
  border-color: var(--color-border);
}

/* Dark mode form controls */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: var(--color-bg-input);
  color: var(--color-text);
  border-color: var(--color-border);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background-color: var(--color-bg-input-focus);
  color: var(--color-text);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 .25rem var(--color-primary-light);
}

[data-theme="dark"] .form-control::placeholder {
  color: var(--color-placeholder);
}

/* Dark scrollbar in sidebar */
[data-theme="dark"] .sidebarMenuScroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

/* Dark mode loading wrapper */
[data-theme="dark"] #loading-wrapper {
  background: rgba(15, 23, 42, 0.5);
}

/* Dark mode treeview submenu */
[data-theme="dark"] .sidebar-menu .treeview-menu>li>a {
  color: var(--color-sidebar-text);
}

[data-theme="dark"] .sidebar-menu .treeview-menu>li>a:hover {
  color: var(--color-primary);
}

[data-theme="dark"] .sidebar-menu .treeview-menu>li>a.active-sub {
  color: var(--color-primary);
}

/* Dark mode custom tabs */
[data-theme="dark"] .custom-tabs-container .nav-tabs {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .custom-tabs-container .nav-tabs .nav-link.active {
  border-color: transparent transparent var(--color-primary);
  color: var(--color-primary);
}

/* Dark mode activity feed */
[data-theme="dark"] .activity-log:before {
  background: var(--color-bg-card);
  border-color: var(--color-primary);
}

[data-theme="dark"] .activity-log:after {
  background: var(--color-border);
}

/* Theme transition — smooth color change */
html[data-theme],
html:not([data-theme]) {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body,
.sidebar-wrapper,
.app-header,
.app-hero-header,
.card,
.modal-content,
.dropdown-menu {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Dark Mode: sidebar pin/back button --- */
[data-theme="dark"] .sidebar-wrapper > .pin-sidebar {
  background: #0E7490;
  box-shadow: 0 2px 8px rgba(14, 116, 144, 0.4);
}

[data-theme="dark"] .sidebar-wrapper > .pin-sidebar:hover {
  background: #155E75;
}

/* ─── Dark Mode: Confirmation / Delete / Block Modals ─── */

/* Warning header (bg-warning) — amber on dark */
[data-theme="dark"] .modal-header.bg-warning {
  background: linear-gradient(135deg, #92400E, #B45309) !important;
  color: #FEF3C7 !important;
}

[data-theme="dark"] .modal-header.bg-warning .modal-title {
  color: #FEF3C7;
}

[data-theme="dark"] .modal-header.bg-warning .btn-close {
  filter: brightness(0) invert(1);
}

/* Danger header (bg-danger) — dark red */
[data-theme="dark"] .modal-header.bg-danger {
  background: linear-gradient(135deg, #7F1D1D, #991B1B) !important;
}

/* Modal body text */
[data-theme="dark"] .modal-confirm .modal-body p {
  color: var(--color-text);
}

[data-theme="dark"] .modal-confirm .modal-body .text-muted {
  color: var(--color-text-muted) !important;
}

/* btn-warning — dark amber */
[data-theme="dark"] .btn-warning {
  background: #B45309;
  border-color: #B45309;
  color: #fff;
  box-shadow: var(--shadow-inset);
}

[data-theme="dark"] .btn-warning:hover,
[data-theme="dark"] .btn-warning:focus {
  background: #D97706;
  border-color: #D97706;
  color: #fff;
}

/* btn-danger */
[data-theme="dark"] .btn-danger {
  background: #991B1B;
  border-color: #991B1B;
  color: #fff;
  box-shadow: var(--shadow-inset);
}

[data-theme="dark"] .btn-danger:hover,
[data-theme="dark"] .btn-danger:focus {
  background: #B91C1C;
  border-color: #B91C1C;
  color: #fff;
}

/* btn-secondary — neutral dark */
[data-theme="dark"] .btn-secondary {
  background: var(--color-surface-hover);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .btn-secondary:focus {
  background: #475569;
  border-color: #475569;
  color: #fff;
}

/* btn-outline-danger */
[data-theme="dark"] .btn-outline-danger {
  color: #F87171;
  border-color: #F87171;
}

[data-theme="dark"] .btn-outline-danger:hover {
  background: #991B1B;
  border-color: #991B1B;
  color: #fff;
}

/* btn-light */
[data-theme="dark"] .btn-light {
  background: var(--color-surface-hover);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .btn-light:hover {
  background: #475569;
  color: #fff;
}

/* ─── Dark Mode: Toast Notifications ─── */
[data-theme="dark"] .toast-success,
[data-theme="dark"] #toast-container > .toast-success {
  background: linear-gradient(135deg, #065F46, #047857) !important;
  border-inline-start: 3px solid #34D399 !important;
}

[data-theme="dark"] .toast-error,
[data-theme="dark"] #toast-container > .toast-error {
  background: linear-gradient(135deg, #7F1D1D, #991B1B) !important;
  border-inline-start: 3px solid #F87171 !important;
}

[data-theme="dark"] .toast-warning,
[data-theme="dark"] #toast-container > .toast-warning {
  background: linear-gradient(135deg, #78350F, #92400E) !important;
  border-inline-start: 3px solid #FBBF24 !important;
}

[data-theme="dark"] .toast-info,
[data-theme="dark"] #toast-container > .toast-info {
  background: linear-gradient(135deg, #0C4A6E, #075985) !important;
  border-inline-start: 3px solid #38BDF8 !important;
}

/* ─── Dark Mode: Search Highlight (mark) ─── */
[data-theme="dark"] mark {
  background-color: rgba(56, 189, 248, 0.25);
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}

/* Search results items in modal */
[data-theme="dark"] .search-autocomplete-item {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .search-autocomplete-item .fw-medium {
  color: var(--color-text);
}

[data-theme="dark"] .search-autocomplete-item small.text-muted {
  color: var(--color-text-muted) !important;
}

/* ─── Dark Mode: Bootstrap Badges ─── */
[data-theme="dark"] .badge.bg-success {
  background-color: rgba(34, 197, 94, 0.2) !important;
  color: #4ADE80 !important;
}

[data-theme="dark"] .badge.bg-info {
  background-color: rgba(14, 165, 233, 0.2) !important;
  color: #38BDF8 !important;
}

[data-theme="dark"] .badge.bg-danger {
  background-color: rgba(239, 68, 68, 0.2) !important;
  color: #F87171 !important;
}

[data-theme="dark"] .badge.bg-warning {
  background-color: rgba(245, 158, 11, 0.2) !important;
  color: #FBBF24 !important;
}

[data-theme="dark"] .badge.bg-primary-subtle {
  background-color: rgba(14, 116, 144, 0.15) !important;
  color: #38BDF8 !important;
}

/* DataTable search highlight */
[data-theme="dark"] table.dataTable mark,
[data-theme="dark"] .dataTables_wrapper mark {
  background-color: rgba(56, 189, 248, 0.25);
  color: #fff;
}