/* ================================================================
   D3F DESIGN SYSTEM — BOOTSTRAP 5.3 THEME LAYER  v2.0
   ─────────────────────────────────────────────────────────────────
   ✓ Pure token-driven — zero hardcoded surfaces
   ✓ Dark mode: full RGB parity for status badges
   ✓ RTL/LTR correct transforms (no invalid calc)
   ✓ color-scheme declared for native browser elements
   ✓ focus-visible expanded to all interactive elements
   ✓ Overlay/backdrop for mobile menu
   ✓ Google Fonts merged into one request
   ✓ nav-pills / pagination / accordion / list-group unified
   ✓ form-range thumb unified via CSS variable
   ✓ Sidebar internals, header buttons, mobile menu skin
   ✓ Toast, footer, dropdown-max-height, guest layout
   ✓ IBM Plex Sans (LTR) + IBM Plex Sans Arabic (RTL)
   ✓ Landing page sections: head, features, results, choose, social
   ✓ af-item, profile-avatar, service-description, messages/tickets
   ✓ Blog/post pages, API page, FAQ accordion
   ✓ Pagination, alerts, tooltips, hidden utility
   ✓ Table: link/service cell widths, RTL font-size
   ================================================================ */

/* ================================================================
   §01  FONTS — single merged request
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans+Arabic:wght@100;200;300;400;500;600;700&family=Outfit:wght@100..900&family=Readex+Pro:wght@200..700&display=swap');

@font-face {
  font-family: 'jooza';
  src: url('https://res.cloudinary.com/d3mfollow/raw/upload/v1663184069/fonts/flat-jooza-Regular_vvye7d.ttf') format('truetype');
  font-weight: normal;
  font-display: swap;
}

/* ================================================================
   §02  BRAND & STATUS — LIGHT MODE
   ================================================================ */
:root,
[data-bs-theme="light"] {
  color-scheme: light;

  /* ── Brand ── */
  --bs-primary:             #009ef7;
  --bs-primary-rgb:         0, 158, 247;
  --bs-secondary:           #FA5A7D;
  --bs-secondary-rgb:       250, 90, 125;
  --bs-purple:              #8950FC;
  --bs-purple-rgb:          137, 80, 252;

  /* ── Semantic ── */
  --bs-success:             #01B780;
  --bs-success-rgb:         1, 183, 128;
  --bs-warning:             #ffa500;
  --bs-warning-rgb:         255, 165, 0;

  /* ── Subtle & Emphasis ── */
  --bs-primary-bg-subtle:         #e6f5fe;
  --bs-primary-border-subtle:     #b3e1fd;
  --bs-primary-text-emphasis:     #003f63;
  --bs-secondary-bg-subtle:       #fef0f3;
  --bs-secondary-border-subtle:   #fcd5de;
  --bs-secondary-text-emphasis:   #642432;

  /* ── Focus ring (derived from brand) ── */
  --bs-focus-ring-color:    rgba(var(--bs-primary-rgb), 0.25);
  --d3f-focus-outline:      2px solid var(--bs-primary);

  /* ── Status — text ── */
  --status-completed-text:    #01B780;
  --status-canceled-text:     #ff0000;
  --status-partial-text:      #ff4500;
  --status-pending-text:      #ffa500;
  --status-inprogress-text:   #0000ff;
  --status-processing-text:   #00bfff;
  --status-active-text:       #800080;

  /* ── Status — RGB (for rgba() backgrounds) ── */
  --status-completed-rgb:     1, 183, 128;
  --status-canceled-rgb:      255, 0, 0;
  --status-partial-rgb:       255, 69, 0;
  --status-pending-rgb:       255, 165, 0;
  --status-inprogress-rgb:    0, 0, 255;
  --status-processing-rgb:    0, 191, 255;
  --status-active-rgb:        128, 0, 128;
}

/* ================================================================
   §03  BRAND & STATUS — DARK MODE (full RGB parity)
   ================================================================ */
[data-bs-theme="dark"] {
  color-scheme: dark;

  --bs-primary:             #33aef8;
  --bs-primary-rgb:         51, 174, 248;
  --bs-purple:              #9d6bfa;
  --bs-purple-rgb:          157, 107, 250;

  --bs-primary-bg-subtle:         rgba(51, 174, 248, 0.15);
  --bs-primary-border-subtle:     rgba(51, 174, 248, 0.25);
  --bs-primary-text-emphasis:     #80cdfa;
  --bs-secondary-bg-subtle:       rgba(250, 90, 125, 0.15);
  --bs-secondary-border-subtle:   rgba(250, 90, 125, 0.25);
  --bs-secondary-text-emphasis:   #fcaebf;

  --d3f-focus-outline:      2px solid var(--bs-primary);

  /* ── Status — text (dark-adjusted) ── */
  --status-completed-text:    #34d8a7;
  --status-canceled-text:     #ff6666;
  --status-partial-text:      #ff854d;
  --status-pending-text:      #ffc94d;
  --status-inprogress-text:   #8080ff;
  --status-processing-text:   #4dd2ff;
  --status-active-text:       #d866d8;

  /* ── Status — RGB (dark-adjusted, matching text above) ── */
  --status-completed-rgb:     52, 216, 167;
  --status-canceled-rgb:      255, 102, 102;
  --status-partial-rgb:       255, 133, 77;
  --status-pending-rgb:       255, 201, 77;
  --status-inprogress-rgb:    128, 128, 255;
  --status-processing-rgb:    77, 210, 255;
  --status-active-rgb:        216, 102, 216;
}

/* ================================================================
   §04  GLOBAL LAYOUT TOKENS & TYPOGRAPHY
   ================================================================ */
:root {
  --d3f-sidebar-width:     270px;
  --d3f-header-height:     70px;
  --d3f-transition:        0.2s ease-in-out;
  --d3f-transition-slow:   0.35s ease-in-out;

  /* Typography — IBM Plex Sans as primary, Outfit/Readex Pro as fallbacks */
  --bs-body-font-family:   'IBM Plex Sans', 'Outfit', 'Readex Pro', sans-serif;
  --bs-body-font-weight:   300;
  --bs-body-line-height:   1.7;

  /* Radius */
  --bs-border-radius:      8px;
  --bs-border-radius-sm:   4px;
  --bs-border-radius-lg:   10px;
  --bs-border-radius-pill: 50px;
}

html[dir="ltr"] {
  --bs-body-font-family:   'IBM Plex Sans', 'Outfit', 'Readex Pro', sans-serif;
  --d3f-dir-flip: 1;
}

html[dir="rtl"] {
  --bs-body-font-family:   'IBM Plex Sans Arabic', 'Readex Pro', 'Outfit', sans-serif;
  --d3f-dir-flip: -1;
}

html[dir="rtl"] .jooza { font-family: 'jooza'; }

/* ================================================================
   §05  BASE RESET & SCROLLBAR
   ================================================================ */
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100vh; overflow-x: hidden; }
body.menu-open { overflow: hidden; }

/* Section title underline */
.title { position: relative; }
.title::before {
  content: "";
  position: absolute;
  bottom: -12px;
  inset-inline-start: 0;
  width: 80px;
  height: 3px;
  border-radius: 1px;
  background-color: var(--bs-primary);
}
.section-features .title::before,
.section-services .title::before {
  inset-inline-start: 50%;
  transform: translateX(-50%);
}

/* Subtle custom scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 4px;
  transition: background-color var(--d3f-transition);
}
:hover::-webkit-scrollbar-thumb { background-color: var(--bs-border-color); }

/* ================================================================
   §06  BOOTSTRAP COMPONENT TOKEN OVERRIDES
   ================================================================ */

/* ── Dropdown ── */
.dropdown-menu {
  --bs-dropdown-link-active-bg:    var(--bs-primary);
  --bs-dropdown-link-active-color: #fff;
  background-color: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}

/* ── Dropdown toggle arrow via Font Awesome ── */
.dropdown-toggle::after {
  vertical-align: baseline;
  content: "\f078";
  font-size: 10px;
  font-family: "Font Awesome 5 Pro";
  font-weight: 500;
  border: 0;
}
html[dir="ltr"] .dropdown-toggle::after { margin-left: 8px; }
html[dir="rtl"] .dropdown-toggle::after { margin-right: 8px; }

/* ── Pagination ── */
.pagination {
  --bs-pagination-active-bg:            var(--bs-primary);
  --bs-pagination-active-border-color:  var(--bs-primary);
  --bs-pagination-focus-box-shadow:     0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.pagination > li { margin: 0 2px; }
.pagination > li a {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 30px;
  height: 30px;
  color: var(--bs-body-color);
  font-weight: 700;
}
.pagination > li.active a { color: var(--bs-primary); }

/* ── List Group ── */
.list-group {
  --bs-list-group-active-bg:            var(--bs-primary);
  --bs-list-group-active-border-color:  var(--bs-primary);
  --bs-list-group-active-color:         #fff;
}

/* ── Progress ── */
.progress,
.progress-stacked {
  --bs-progress-bar-bg: var(--bs-primary);
}

/* ── Accordion ── */
.accordion {
  --bs-accordion-active-color:         var(--bs-primary);
  --bs-accordion-active-bg:            rgba(var(--bs-primary-rgb), 0.08);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* ── FAQ Accordion ── */
#accordionFaqs .accordion-item {
  border: 0;
  overflow: hidden;
  background-color: var(--bs-tertiary-bg);
}
#accordionFaqs .accordion-item .accordion-button {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-body-color);
  border-radius: var(--bs-border-radius) !important;
  font-weight: 500;
}
#accordionFaqs .accordion-button:not(.collapsed) {
  color: var(--bs-primary);
  box-shadow: none;
}
[data-bs-theme="dark"] #accordionFaqs .accordion-button.collapsed::after {
  filter: brightness(0) invert(1);
}
#accordionFaqs .accordion-button::after {
  width: 1rem;
  height: 1rem;
  background-size: 1rem;
}
#accordionFaqs .accordion-item .accordion-button:focus { box-shadow: none; }
#accordionFaqs .accordion-item .accordion-body { font-size: 14px; }

/* ── Nav Pills ── */
.nav-pills {
  --bs-nav-pills-link-active-bg:    var(--bs-primary);
  --bs-nav-pills-link-active-color: #fff;
}
.nav-pills .nav-link {
  color: var(--bs-body-color);
  font-weight: 600;
  transition: all var(--d3f-transition);
}

/* ── Nav Tabs (section-services) ── */
.section-services .nav-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  min-height: 55px;
  border: 0;
}
.section-services .nav-tabs .nav-link {
  border: 0;
  border-bottom: var(--bs-border-width) solid var(--bs-border-color);
  color: var(--bs-secondary-color);
  font-weight: 600;
  font-size: 20px;
  position: relative;
}
.section-services .nav-tabs .nav-link.active {
  background-color: transparent;
  color: var(--bs-body-color);
  border-bottom-color: var(--bs-border-color);
}
.section-services .nav-tabs .nav-link.active::before {
  content: "";
  height: 3px;
  width: 120px;
  background-color: var(--bs-primary);
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
}

/* ── Cards & Modals ── */
.card,
.modal-content {
  background-color: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}
.card { box-shadow: var(--bs-box-shadow-sm); }
.card-header {
  border-bottom: var(--bs-border-width) solid var(--bs-border-color);
  padding: 16px 20px;
}

/* ── Alert ── */
.alert {
  border: 0;
  font-size: 14px;
  margin-bottom: 10px;
}

/* ── Tooltip ── */
.tooltip { font-size: 12px !important; }
html[dir="ltr"] .tooltip { font-family: 'IBM Plex Sans', 'Outfit', 'Readex Pro', sans-serif !important; }
html[dir="rtl"] .tooltip { font-family: 'IBM Plex Sans Arabic', 'Readex Pro', 'Outfit', sans-serif !important; }

/* ── Hidden utility ── */
.hidden { display: none !important; }

/* ================================================================
   §07  BUTTONS
   ================================================================ */
.btn {
  --bs-btn-font-weight: 500;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--d3f-transition);
}

/* Primary */
.btn-primary {
  --bs-btn-bg:                    var(--bs-primary);
  --bs-btn-border-color:          var(--bs-primary);
  --bs-btn-hover-bg:              #0095e8;
  --bs-btn-hover-border-color:    #0095e8;
  --bs-btn-active-bg:             #0095e8;
  --bs-btn-active-border-color:   #0095e8;
  --bs-btn-disabled-bg:           var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
  --bs-btn-focus-shadow-rgb:      var(--bs-primary-rgb);
}
.btn-outline-primary {
  --bs-btn-color:               var(--bs-primary);
  --bs-btn-border-color:        var(--bs-primary);
  --bs-btn-hover-bg:            var(--bs-primary);
  --bs-btn-hover-border-color:  var(--bs-primary);
  --bs-btn-active-bg:           var(--bs-primary);
  --bs-btn-active-border-color: var(--bs-primary);
  --bs-btn-focus-shadow-rgb:    var(--bs-primary-rgb);
}

/* Secondary */
.btn-secondary {
  --bs-btn-color:                 #fff;
  --bs-btn-bg:                    var(--bs-secondary);
  --bs-btn-border-color:          var(--bs-secondary);
  --bs-btn-hover-color:           #fff;
  --bs-btn-hover-bg:              #fc456a;
  --bs-btn-hover-border-color:    #fc456a;
  --bs-btn-active-color:          #fff;
  --bs-btn-active-bg:             #fc456a;
  --bs-btn-active-border-color:   #fc456a;
  --bs-btn-disabled-bg:           var(--bs-secondary);
  --bs-btn-disabled-border-color: var(--bs-secondary);
  --bs-btn-focus-shadow-rgb:      var(--bs-secondary-rgb);
}
.btn-outline-secondary {
  --bs-btn-color:               var(--bs-secondary);
  --bs-btn-border-color:        var(--bs-secondary);
  --bs-btn-hover-color:         #fff;
  --bs-btn-hover-bg:            var(--bs-secondary);
  --bs-btn-hover-border-color:  var(--bs-secondary);
  --bs-btn-active-color:        #fff;
  --bs-btn-active-bg:           var(--bs-secondary);
  --bs-btn-active-border-color: var(--bs-secondary);
  --bs-btn-focus-shadow-rgb:    var(--bs-secondary-rgb);
}

/* Purple */
.btn-purple {
  --bs-btn-color:                 #fff;
  --bs-btn-bg:                    var(--bs-purple);
  --bs-btn-border-color:          var(--bs-purple);
  --bs-btn-hover-color:           #fff;
  --bs-btn-hover-bg:              #7337EE;
  --bs-btn-hover-border-color:    #7337EE;
  --bs-btn-active-color:          #fff;
  --bs-btn-active-bg:             #7337EE;
  --bs-btn-active-border-color:   #7337EE;
  --bs-btn-focus-shadow-rgb:      var(--bs-purple-rgb);
}
.btn-outline-purple {
  --bs-btn-color:               var(--bs-purple);
  --bs-btn-border-color:        var(--bs-purple);
  --bs-btn-hover-color:         #fff;
  --bs-btn-hover-bg:            var(--bs-purple);
  --bs-btn-hover-border-color:  var(--bs-purple);
  --bs-btn-active-color:        #fff;
  --bs-btn-active-bg:           var(--bs-purple);
  --bs-btn-active-border-color: var(--bs-purple);
  --bs-btn-focus-shadow-rgb:    var(--bs-purple-rgb);
}

/* Purple utilities */
.text-purple      { color: var(--bs-purple) !important; }
.bg-purple        { background-color: var(--bs-purple) !important; color: #fff; }
.bg-purple-subtle {
  background-color: rgba(var(--bs-purple-rgb), 0.15) !important;
  color: var(--bs-purple) !important;
}

/* Loading state */
.btn.loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.btn.loading i { visibility: hidden; }
.btn.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: btn-spin 0.65s linear infinite;
}
.btn-outline-primary.loading::after,
.btn-outline-secondary.loading::after,
.btn-outline-purple.loading::after {
  border-color: currentColor;
  border-top-color: transparent;
}

@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ================================================================
   §08  FORMS
   ================================================================ */
.form-label,
.control-label  { font-weight: 600; font-size: 14px; }
.form-control,
.form-select    { font-size: 14px; }
.form-control:not(textarea),
.form-select    { height: 50px; }

/* Focus */
.form-control:focus,
.form-select:focus {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}
.form-check-input:focus,
.select2-container--focus .form-control,
.select2-container--open .form-control {
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
}

/* Disabled / Readonly */
.form-control:disabled,
.form-control[readonly] {
  background-color: var(--bs-body-bg);
}

/* Warning state */
.form-control.is-warning,
.form-select.is-warning {
  border-color: var(--bs-warning) !important;
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-warning-rgb), 0.25);
}
.warning-feedback {
  display: block;
  color: var(--bs-warning);
  font-size: 12px;
  margin-top: 4px;
}

/* form-select SVG arrows per theme */
[data-bs-theme="light"] .form-select {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIgNUw4IDExTDE0IDUiIHN0cm9rZT0iIzE4MUMzMiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg==");
}
[data-bs-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIgNUw4IDExTDE0IDUiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=");
}

/* Checkbox / Radio / Switch — use brand primary */
.form-check .form-check-input {
  border-color: var(--bs-border-color);
  background-color: transparent;
}
.form-check .form-check-input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border-radius: 3px;
}
.form-check .form-check-label { padding: 0 10px; }
.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 11' width='13' height='11' fill='none'%3e%3cpath d='M11.0426 1.02893C11.3258 0.695792 11.8254 0.655283 12.1585 0.938451C12.4917 1.22162 12.5322 1.72124 12.249 2.05437L5.51985 9.97104C5.23224 10.3094 4.72261 10.3451 4.3907 10.05L0.828197 6.88335C0.50141 6.59288 0.471975 6.09249 0.762452 5.7657C1.05293 5.43891 1.55332 5.40948 1.88011 5.69995L4.83765 8.32889L11.0426 1.02893Z' fill='%23ffffff'/%3e%3c/svg%3e");
  background-size: 10px;
}

/* Range slider thumb — all browsers */
.form-range::-webkit-slider-thumb { background-color: var(--bs-primary); }
.form-range::-moz-range-thumb     { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.form-range::-ms-thumb             { background-color: var(--bs-primary); }

/* btn-close dark mode */
[data-bs-theme="dark"] .modal-header .btn-close { filter: invert(1); }

/* Search field */
.search button {
  position: absolute;
  background-color: transparent;
  border: 0;
  color: var(--bs-body-color);
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
}
html[dir="ltr"] .search button { left: 10px; }
html[dir="rtl"] .search button { right: 10px; }
html[dir="ltr"] .search .form-control { padding-left: 50px; }
html[dir="rtl"] .search .form-control { padding-right: 50px; }

.page-orders .search .form-control,
.page-refunds .search .form-control,
.page-subscriptions .search .form-control,
.page-drip-feed .search .form-control,
.page-refill .search .form-control {
  background-color: var(--bs-tertiary-bg);
  border-color: var(--bs-tertiary-bg);
}

/* ================================================================
   §09  SELECT2 INTEGRATION
   ================================================================ */
.select2-container--default .select2-selection--single {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
  border-radius: var(--bs-border-radius) !important;
  height: 50px !important;
  display: flex !important;
  align-items: center;
  padding-inline-start: 0.75rem;
  padding-inline-end: 2.25rem;
}

/* Search dropdown variant — no extra end padding */
html[dir="ltr"] .select2-container--default:not(.search-dropdown) .select2-selection--single {
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
}
html[dir="rtl"] .select2-container--default:not(.search-dropdown) .select2-selection--single {
  padding: 0.375rem 0.75rem 0.375rem 2.25rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--bs-body-color);
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border: 0 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b::before {
  content: "\f078";
  font-family: "Font Awesome 5 Pro";
  font-size: 14px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-end: 5px;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b::before {
  transform: translateY(-50%) rotate(180deg);
}
.select2-container .select2-dropdown {
  border-radius: var(--bs-border-radius) !important;
  box-shadow: var(--bs-box-shadow);
  border-color: var(--bs-border-color);
  background-color: var(--bs-tertiary-bg);
  margin: 10px 0 !important;
}
.select2-results__option a { color: var(--bs-body-color) !important; font-size: 14px; }
.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--bs-secondary-bg) !important;
  color: var(--bs-body-color) !important;
}
.select2-selection__id.badge.badge-secondary { background-color: var(--bs-primary); }

/* ================================================================
   §10  LAYOUT — Sidebar, Header, Mobile Menu, Overlay
   ================================================================ */

/* ── Top navbar (landing) ── */
.navbar-top {
  position: sticky;
  top: 0;
  z-index: var(--bs-zindex-sticky);
  height: 100px;
  transition: height 0.3s;
}
body.header-sm .navbar-top {
  backdrop-filter: blur(20px);
  height: 80px;
  background-color: rgba(var(--bs-body-bg-rgb), 0.80);
}

/* ── Navbar brand & nav links ── */
.navbar-brand img { width: 160px; }
html[dir="ltr"] .navbar-nav { margin-left: 100px; }
html[dir="rtl"] .navbar-nav { margin-right: 100px; }
html[dir="ltr"] .navbar-nav .nav-item:not(:last-of-type) { margin-right: 40px; }
html[dir="rtl"] .navbar-nav .nav-item:not(:last-of-type) { margin-left: 40px; }
.navbar-nav .nav-item .nav-link {
  text-transform: capitalize;
  color: var(--bs-body-color);
  position: relative;
  padding-left: 0;
  padding-right: 0;
  font-weight: 600;
}
.navbar-nav .nav-item.active .nav-link { color: var(--bs-primary); }
.navbar-nav .nav-item.active .nav-link::before {
  content: "";
  position: absolute;
  bottom: 0;
  width: 14px;
  height: 3px;
  border-radius: 1px;
  background-color: var(--bs-primary);
}

/* Hamburger */
.navbar-toggler           { border: 0; padding: 0; }
.navbar-toggler:focus     { box-shadow: none; outline: none; }
.navbar-toggler > span {
  display: block;
  width: 28px;
  height: 1.5px;
  margin: 6px 0;
  background-color: var(--bs-body-color);
  border-radius: 2px;
  transition: transform 150ms linear, opacity 150ms linear;
}
.navbar-toggler > span:nth-child(2) { transform: scaleX(0.7); }
.navbar-toggler:hover > span:nth-child(2) { transform: scaleX(1); }

/* ── Dashboard sidebar ── */
.aside-wrap {
  background-color: var(--bs-tertiary-bg);
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  width: var(--d3f-sidebar-width);
  z-index: 1050;
  overflow: hidden;
  transition: transform var(--d3f-transition-slow);
  border-inline-end: var(--bs-border-width) solid var(--bs-border-color);
}

body.dashboard .wrap .content-wrap {
  padding-top: var(--d3f-header-height);
  margin-inline-start: var(--d3f-sidebar-width);
  width: calc(100% - var(--d3f-sidebar-width));
  position: relative;
  z-index: 1;
}

.header-wrap {
  background-color: var(--bs-tertiary-bg);
  position: fixed;
  top: 0;
  inset-inline-end: 0;
  width: calc(100% - var(--d3f-sidebar-width));
  height: var(--d3f-header-height);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1040;
  isolation: isolate;
  border-bottom: var(--bs-border-width) solid var(--bs-border-color);
}

/* ── Mobile menu ── */
.menu-mobile {
  background-color: var(--bs-body-bg);
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  width: var(--d3f-sidebar-width);
  z-index: 1050;
  transition: transform var(--d3f-transition-slow);
}

/* LTR: slide left  |  RTL: slide right */
.menu-mobile                      { transform: translateX(-100%); }
html[dir="rtl"] .menu-mobile      { transform: translateX(100%); }

body.menu-open .menu-mobile,
body.menu-open .aside-wrap        { transform: none !important; }

/* ── Overlay backdrop ── */
.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1045;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  transition: opacity var(--d3f-transition-slow);
  opacity: 0;
}
body.menu-open .menu-overlay {
  display: block;
  opacity: 1;
}

/* ================================================================
   §11  TABLES & STATUS BADGES
   ================================================================ */
.table { vertical-align: middle; }
html[dir="rtl"] .table { font-size: 12px; }
html[dir="ltr"] .table { font-size: 14px; }

.table th,
.table td  { border-bottom: 0; }
.table tbody tr:not(.category-name) td { background-color: var(--bs-secondary-bg); }
.table tbody tr:not(.category-name, :last-of-type) td {
  border-bottom: 4px solid var(--bs-body-bg);
}
.table tbody td:first-of-type {
  border-start-start-radius: var(--bs-border-radius-lg);
  border-end-start-radius:   var(--bs-border-radius-lg);
}
.table tbody td:last-of-type {
  border-start-end-radius: var(--bs-border-radius-lg);
  border-end-end-radius:   var(--bs-border-radius-lg);
}

/* Cell helpers */
.table td .link {
  width: 200px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
}
.table td span.service {
  width: 240px;
  display: block;
}

/* Status badge base */
.table td span.status {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--bs-border-radius);
  font-weight: 600;
  white-space: nowrap;
}

/* Category name row */
.category-name strong {
  background-color: var(--bs-primary);
  border-radius: var(--bs-border-radius-lg);
  display: block;
  width: 100%;
  padding: 16px;
  font-weight: 500;
}

/* Status variants */
.status.completed, .status.answered    { color: var(--status-completed-text);  background: rgba(var(--status-completed-rgb),  0.15); }
.status.canceled,  .status.error,
.status.closed                         { color: var(--status-canceled-text);   background: rgba(var(--status-canceled-rgb),   0.15); }
.status.partial,   .status.expired     { color: var(--status-partial-text);    background: rgba(var(--status-partial-rgb),    0.15); }
.status.pending,   .status.paused      { color: var(--status-pending-text);    background: rgba(var(--status-pending-rgb),    0.15); }
.status.inprogress                     { color: var(--status-inprogress-text); background: rgba(var(--status-inprogress-rgb), 0.15); }
.status.processing                     { color: var(--status-processing-text); background: rgba(var(--status-processing-rgb), 0.15); }
.status.active,    .status.rejected    { color: var(--status-active-text);     background: rgba(var(--status-active-rgb),     0.15); }

/* ================================================================
   §12  UTILITIES & COMPONENTS
   ================================================================ */
.block-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bs-tertiary-bg);
  font-size: 20px;
  flex-shrink: 0;
}

.card-platform-hover { transition: transform 0.3s, box-shadow 0.3s; }
.card-platform-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--bs-box-shadow-lg);
}

/* ── Add Funds item ── */
.af-item {
  background-color: var(--bs-tertiary-bg);
  padding: 10px;
  border-radius: var(--bs-border-radius);
}
.af-item .icon {
  background-color: var(--bs-primary);
  border-radius: var(--bs-border-radius);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
}

/* ── Profile Avatar ── */
.profile-avatar > span {
  width: 85px;
  height: 85px;
  background-color: var(--bs-secondary-bg);
  border-radius: var(--bs-border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

/* ── Service Description ── */
.service-description {
  border-radius: var(--bs-border-radius);
  background-color: var(--bs-secondary-bg);
}
.service-description > div > button {
  color: var(--bs-body-color);
}

/* ── API page ── */
.page-api pre {
  background-color: var(--bs-secondary-bg);
  padding: 20px 10px;
  border-radius: var(--bs-border-radius);
  color: var(--bs-body-color);
  display: block;
}

/* ================================================================
   §13  MESSAGES & TICKETS
   ================================================================ */
.messages > div:not(:last-of-type) { margin-bottom: 10px; }

.messages .ticket-message {
  background-color: var(--bs-secondary-bg);
  border-radius: var(--bs-border-radius-sm);
  font-size: 14px;
  padding: 10px;
}

.messages .ticket-avatar {
  width: 40px;
  height: 40px;
  background-color: rgba(var(--bs-primary-rgb), 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
}

/* Tail arrows — LTR */
html[dir="ltr"] .messages .ticket-message-right .ticket-message::after,
html[dir="rtl"] .messages .ticket-message-left .ticket-message::after {
  content: "";
  border: 8px solid transparent;
  border-right-color: var(--bs-secondary-bg);
  display: block;
  width: 0;
  height: 0;
  position: absolute;
  top: 10px;
  left: -16px;
}

html[dir="rtl"] .messages .ticket-message-right .ticket-message::after,
html[dir="ltr"] .messages .ticket-message-left .ticket-message::after {
  content: "";
  border: 8px solid transparent;
  border-left-color: var(--bs-secondary-bg);
  display: block;
  width: 0;
  height: 0;
  position: absolute;
  top: 10px;
  right: -16px;
}

/* ================================================================
   §14  BLOG / POSTS
   ================================================================ */
.post .post-image {
  border-radius: var(--bs-border-radius);
  overflow: hidden;
}
.post .post-title {
  height: 60px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-post-main .post-thumb img {
  display: block;
  max-width: 100%;
  border-radius: var(--bs-border-radius);
  overflow: hidden;
  margin: 0 auto;
}
.page-post-main .post-content * {
  font-family: inherit !important;
  line-height: inherit !important;
  color: var(--bs-body-color) !important;
}
.page-post-main .post-content a,
.page-post-main .post-content a * {
  text-decoration: none !important;
  color: var(--bs-primary) !important;
}

/* ================================================================
   §15  LANDING PAGE SECTIONS
   ================================================================ */

/* ── Section Head ── */
.section-head h1 { max-width: 550px; }
html[dir="ltr"] .section-head h1 { font-size: 60px; }
html[dir="rtl"] .section-head h1 { font-size: 40px; line-height: 1.5; }
.section-head .d-flex { gap: 10px 20px; }
.section-head img { width: 90%; display: block; margin: auto; }

/* ── Section Features ── */
.section-features .items {
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: space-around;
  gap: 80px 20px;
}
.section-features .item {
  max-width: 440px;
  width: 100%;
  display: flex;
}
.section-features .item .item-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 30px;
  color: #fff;
}
html[dir="ltr"] .section-features .item .item-icon { margin-right: 20px; }
html[dir="rtl"] .section-features .item .item-icon { margin-left: 20px; }

.section-features .item:nth-child(1) .item-icon { background-color: var(--bs-primary); }
.section-features .item:nth-child(2) .item-icon { background-color: var(--bs-secondary); }
.section-features .item:nth-child(3) .item-icon { background-color: #E67C84; }
.section-features .item:nth-child(4) .item-icon { background-color: #36A069; }
.section-features .item .item-icon svg { width: 35px; }

.section-features .item h4::before {
  content: "";
  width: 60px;
  height: 3px;
  position: absolute;
  bottom: -22px;
  border-radius: 1px;
}
html[dir="ltr"] .section-features .item h4::before { left: 0; }
html[dir="rtl"] .section-features .item h4::before { right: 0; }
.section-features .item:nth-child(1) h4::before { background-color: var(--bs-primary); }
.section-features .item:nth-child(2) h4::before { background-color: var(--bs-secondary); }
.section-features .item:nth-child(3) h4::before { background-color: #E67C84; }
.section-features .item:nth-child(4) h4::before { background-color: #36A069; }

/* ── Section Results ── */
.section-results .numbers {
  background-color: var(--bs-primary);
  padding: 20px 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
html[dir="ltr"] .section-results .numbers { border-radius: 10px 100px 10px 10px; }
html[dir="rtl"] .section-results .numbers { border-radius: 100px 10px 10px 10px; }
.section-results .numbers::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 60px;
  width: 1px;
  background-color: #fff;
  display: block;
}
.section-results .number { width: 100%; }
.section-results img { width: 100%; }

/* ── Section Choose ── */
.section-choose ul li {
  color: var(--bs-secondary-color);
  position: relative;
}
html[dir="ltr"] .section-choose ul li { padding-left: 20px; }
html[dir="rtl"] .section-choose ul li { padding-right: 20px; }
.section-choose ul li::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--bs-primary);
  display: block;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
html[dir="ltr"] .section-choose ul li::before { left: 0; }
html[dir="rtl"] .section-choose ul li::before { right: 0; }
.section-choose ul li:not(:last-of-type) { margin-bottom: 10px; }
.section-choose img { width: 90%; display: block; margin: auto; }

/* ── Social Absolute Icons ── */
.social-absolute > div {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background-color: rgba(64, 123, 255, 0.15);
  border-radius: 50%;
  font-size: 40px;
  z-index: -1;
}
.social-absolute > div.facebook  { color: #407BFF; top: -40px; left: 10%; }
.social-absolute > div.youtube   { color: #FC3A4D; top: -40px; right: 10%; }
.social-absolute > div.instagram { color: #DE53D0; bottom: 0; left: 15%; }
.social-absolute > div.twitter   { color: #1CA1F2; bottom: 0; right: 15%; }

/* ================================================================
   §16  FOCUS-VISIBLE — expanded to all interactive elements
   ================================================================ */
*:focus { outline: none; }

.btn:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[role="menuitem"]:focus-visible,
[role="option"]:focus-visible,
[role="checkbox"]:focus-visible,
[role="radio"]:focus-visible,
[role="switch"]:focus-visible,
[role="link"]:focus-visible,
summary:focus-visible,
details > summary:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.list-group-item:focus-visible,
.page-link:focus-visible,
.accordion-button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: var(--d3f-focus-outline);
  outline-offset: 3px;
  box-shadow: none !important;
}

/* ================================================================
   §17  ASIDE / SIDEBAR — INTERNAL ELEMENTS
   ================================================================ */

/* ── Logo ── */
.aside-wrap .aside-logo img { width: 200px; }

/* ── User balance block ── */
.aside-wrap .aside-user .balance {
  border-radius: var(--bs-border-radius-lg);
  text-align: center;
}
.aside-wrap .aside-user .balance > div {
  width: 100%;
  padding: 16px;
}
.aside-wrap .aside-user .balance > div:first-of-type {
  background-color: var(--bs-primary);
  border-radius: var(--bs-border-radius-sm) var(--bs-border-radius-sm) 0 0;
}
.aside-wrap .aside-user .balance > div:last-of-type {
  background-color: #0095e8;
  border-radius: 0 0 var(--bs-border-radius-sm) var(--bs-border-radius-sm);
}

/* ── Scrollable menu region ── */
.aside-wrap .aside-menu { flex: 1 1 auto; overflow-y: auto; }

/* ── Menu links ── */
.aside-wrap .aside-menu ul li {
  position: relative;
}

.aside-wrap .aside-menu ul li a {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  color: var(--bs-body-color);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  text-transform: capitalize;
  border-radius: var(--bs-border-radius);
  transition: color var(--d3f-transition), background-color var(--d3f-transition);
}

.aside-wrap .aside-menu ul li a:hover {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.06);
}

.aside-wrap .aside-menu ul li.active > a {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.10);
}

/* ── Icon inside menu link ── */
.aside-wrap .aside-menu ul li a i,
.aside-wrap .aside-menu ul li a .navbar-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
html[dir="ltr"] .aside-wrap .aside-menu ul li a i,
html[dir="ltr"] .aside-wrap .aside-menu ul li a .navbar-icon { margin-right: 12px; }
html[dir="rtl"] .aside-wrap .aside-menu ul li a i,
html[dir="rtl"] .aside-wrap .aside-menu ul li a .navbar-icon { margin-left: 12px; }

/* ── Show-more toggle chevron ── */
.aside-wrap .aside-menu #showMoreMenu + button i {
  transition: transform 500ms ease-in-out;
}
.aside-wrap .aside-menu #showMoreMenu + button[aria-expanded="true"] i {
  transform: rotate(-180deg);
}

/* ================================================================
   §18  HEADER WRAP — SIMPLE MODERN SAAS
   ================================================================ */
.header-page-title {
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--bs-body-color);
  white-space: nowrap;
}

.header-actions {
  gap: 8px;
  flex-shrink: 0;
}

.header-actions > li {
  display: flex;
  align-items: center;
}

.header-icon-button,
.header-user {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition:
    background-color var(--d3f-transition),
    color var(--d3f-transition),
    border-color var(--d3f-transition);
}

/* Bell */
.header-icon-button {
  width: 40px;
  height: 40px;
  justify-content: center;
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-secondary-color);
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  font-size: 15px;
  position: relative;
  flex-shrink: 0;
}

.header-icon-button:hover {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.05);
  border-color: rgba(var(--bs-primary-rgb), 0.22);
}

.header-ticket-badge {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #f1416c;
  color: #fff;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  border: 2px solid var(--bs-body-bg);
}

/* User trigger */
.header-user {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
}

.header-user:hover {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.05);
  border-color: rgba(var(--bs-primary-rgb), 0.22);
}

.header-user__avatar {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(var(--bs-primary-rgb), 0.10);
  color: var(--bs-primary);
  border-radius: inherit;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
  overflow: hidden;
}

.header-user__name,
.header-user__chevron {
  display: none !important;
}

/* User menu */
.header-user-menu {
  width: 280px;
  padding: 8px;
  border-radius: 14px;
}

.header-user-menu-header {
  padding: 10px 12px 12px;
  margin-bottom: 4px;
}

.header-user-menu-header__name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--bs-body-color);
}

.header-user-menu-header__email {
  display: block;
  font-size: 11px;
  color: var(--bs-secondary-color);
  margin-top: 2px;
}

.header-user-menu-header__balance {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  background-color: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--bs-primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.header-user-menu .dropdown-item {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}

.header-user-menu .dropdown-item i {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.header-user-menu-label {
  padding: 8px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.header-user-menu-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 8px 8px;
}

.header-mini-chip {
  min-width: 40px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  transition:
    background-color var(--d3f-transition),
    color var(--d3f-transition),
    border-color var(--d3f-transition);
}

button.header-mini-chip {
  cursor: pointer;
}

.header-mini-chip:hover {
  color: var(--bs-primary);
  border-color: rgba(var(--bs-primary-rgb), 0.22);
  background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.header-mini-chip.active {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.10);
  border-color: rgba(var(--bs-primary-rgb), 0.18);
}

/* Theme icon */
[data-bs-theme="dark"] .header-theme-button i::before {
  content: "\f185";
}

/* Responsive */
@media (max-width: 991.98px) {
  .header-page-title {
    font-size: 16px;
  }
}

@media (max-width: 767.98px) {
  .header-actions {
    gap: 6px;
  }

  .header-icon-button,
  .header-user {
    width: 38px;
    height: 38px;
  }

  .header-user {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
  }

  .header-user__avatar {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    font-size: 12px;
    line-height: 1;
  }

  .header-user-menu {
    width: 260px;
  }

  .header-page-title {
    font-size: 15px;
  }
}
/* Balance Dropdown Button (replaces old balance display) */
.header-balance-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  background-color: rgba(var(--bs-primary-rgb), 0.08);
  border: 1px solid rgba(var(--bs-primary-rgb), 0.15);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bs-primary);
  text-decoration: none;
  transition: all var(--d3f-transition);
  flex-shrink: 0;
  cursor: pointer;
}

.header-balance-dropdown:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.12);
  border-color: rgba(var(--bs-primary-rgb), 0.25);
  color: var(--bs-primary);
}

.header-balance-dropdown i:first-child {
  font-size: 14px;
}

.header-balance__value {
  font-weight: 800;
}

.header-balance__chevron {
  font-size: 10px;
  opacity: 0.7;
  margin-inline-start: 4px;
  transition: transform 0.2s ease;
}

.dropdown.show .header-balance__chevron {
  transform: rotate(180deg);
}

/* Currency Menu */
.header-currency-menu {
  min-width: 240px;
  padding: 8px;
  border-radius: 14px;
  margin-top: 8px;
}

.header-currency-menu-header {
  padding: 10px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--bs-border-color);
  font-size: 12px;
  font-weight: 700;
  color: var(--bs-secondary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-currency-menu-header i {
  font-size: 14px;
}

.header-currency-menu .dropdown-item {
  padding: 8px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  gap: 10px;
}

.header-currency-menu .currency-symbol {
  color: var(--bs-secondary-color);
  font-size: 11px;
  font-weight: 400;
}

.header-currency-menu .currency-check {
  color: var(--bs-primary);
  font-size: 12px;
  margin-inline-start: auto;
}

/* Active currency styling */
.header-currency-menu .dropdown-item.active {
  background-color: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--bs-primary);
}

.header-currency-menu .dropdown-item.active .currency-symbol {
  color: var(--bs-primary);
}

/* Responsive */
@media (max-width: 767.98px) {
  .header-balance-dropdown {
    padding: 0 10px;
    gap: 6px;
  }
  
  .header-balance-dropdown .fa-wallet {
    display: none;
  }
  
  .header-balance__value {
    font-size: 12px;
  }
  
  .header-balance__chevron {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .header-balance-dropdown {
    padding: 0 10px;
  }
  
  .header-balance-dropdown .fa-wallet,
  .header-balance__chevron {
    display: none;
  }
  
  .header-balance-dropdown {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
  }
}

/* ================================================================
   §19  MOBILE MENU — INTERNAL LINKS SKIN
   ================================================================ */
.menu-mobile ul li a {
  color: var(--bs-body-color);
  padding: 20px;
  display: block;
  text-transform: capitalize;
  font-weight: 500;
  text-decoration: none;
  border-bottom: var(--bs-border-width) solid var(--bs-border-color);
  transition: color var(--d3f-transition), background-color var(--d3f-transition);
}
.menu-mobile ul li a:hover    { color: var(--bs-primary); background-color: var(--bs-secondary-bg); }
.menu-mobile ul li.active > a { color: var(--bs-primary); }

/* ================================================================
   §20  TOAST — Custom notification strip
   ================================================================ */
.toast-wrap {
  position: fixed;
  bottom: 15px;
  max-width: 320px;
  width: 100%;
  background-color: var(--bs-primary);
  color: #fff;
  z-index: 200;
  padding: 12px 16px;
  border-radius: var(--bs-border-radius);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--bs-box-shadow);
  animation: toast-in var(--d3f-transition) ease-out;
}
html[dir="ltr"] .toast-wrap { right: 15px; }
html[dir="rtl"] .toast-wrap { left: 15px; }

.toast-wrap.toast-success  { background-color: var(--bs-success); }
.toast-wrap.toast-danger   { background-color: #dc3545; }
.toast-wrap.toast-warning  { background-color: var(--bs-warning); color: #000; }

.toast-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.toast-wrap [data-d3f-toast-close] {
  background: transparent;
  border: 0;
  color: inherit;
  opacity: 0.75;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity var(--d3f-transition);
}
.toast-wrap [data-d3f-toast-close]:hover { opacity: 1; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   §21  FOOTER — Guest layout (social & menu links)
   ================================================================ */
footer { border-top: var(--bs-border-width) solid var(--bs-border-color); }
.footer-logo img { width: 140px; }

html[dir="ltr"] footer .footer-menu li:not(:last-of-type) { margin-right: 40px; }
html[dir="rtl"] footer .footer-menu li:not(:last-of-type) { margin-left: 40px; }

footer .footer-menu li a {
  color: var(--bs-body-color);
  font-weight: 700;
  text-transform: capitalize;
  font-size: 14px;
  text-decoration: none;
  transition: color var(--d3f-transition);
}
footer .footer-menu li a:hover { color: var(--bs-primary); }

html[dir="ltr"] .footer-social li:not(:last-of-type) { margin-right: 10px; }
html[dir="rtl"] .footer-social li:not(:last-of-type) { margin-left: 10px; }

.footer-social li a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bs-primary);
  color: #fff;
  border-radius: 50%;
  text-decoration: none;
  transition: background-color var(--d3f-transition);
}
.footer-social li a:hover { background-color: #0095e8; }

/* ================================================================
   §22  UTILITIES
   ================================================================ */

/* Dropdown max-height helper */
.dropdown-max-height {
  max-height: 400px;
  overflow-y: auto;
}

/* Guest page wrapper */
body.guest .wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.guest .wrap > .item-wrap:first-of-type { flex: 1 1 auto; }

/* ================================================================
   §23  ACCESSIBILITY — motion & contrast
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .aside-wrap,
  .menu-mobile,
  .navbar-top,
  .card-platform-hover { transition: none !important; }

  .card-platform-hover:hover { transform: none !important; }

  .btn.loading::after {
    animation: btn-fade 1s ease-in-out infinite !important;
    border-color: rgba(255, 255, 255, 0.9);
    border-top-color: rgba(255, 255, 255, 0.9);
  }

  .toast-wrap { animation: none; }
}

@keyframes btn-fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

@media (prefers-contrast: more) {
  .form-control,
  .form-select,
  .card { outline: 1px solid var(--bs-body-color); }
  .table td span.status { font-weight: 700; }
}

/* ================================================================
   §24  RESPONSIVE
   ================================================================ */
@media (max-width: 991.98px) {
  .header-wrap {
    width: 100% !important;
    padding: 16px;
  }
  body.dashboard .wrap .content-wrap {
    width: 100%;
    margin-inline-start: 0;
  }
  .aside-wrap { transform: translateX(-100%); }
  html[dir="rtl"] .aside-wrap { transform: translateX(100%); }

  .navbar-top                      { height: 70px; }
  body.header-sm .navbar-top       { height: 60px; }
  .navbar-brand img                { width: 140px; }

  .aside-wrap .aside-logo img      { width: 160px; }
  .footer-logo img                 { width: 120px; }

  html[dir="ltr"] footer .footer-menu li:not(:last-of-type) { margin-right: 20px; }
  html[dir="rtl"] footer .footer-menu li:not(:last-of-type) { margin-left: 20px; }

  .section-features .items { row-gap: 40px; }

  html[dir="rtl"] .section-head h1 { font-size: 36px; }
  html[dir="ltr"] .section-head h1 { font-size: 46px; }
}

@media (max-width: 767.98px) {
  .section-features .items { grid-template-columns: 1fr; }
  html[dir="rtl"] .section-head h1 { font-size: 30px; }
  html[dir="ltr"] .section-head h1 { font-size: 40px; }
}

@media (max-width: 575.98px) {
  .section-results .numbers { padding: 20px; }

  .social-absolute > div { font-size: 20px; width: 60px; height: 60px; }
  .social-absolute > div.instagram,
  .social-absolute > div.twitter   { top: 64%; }
  .social-absolute > div.instagram { left: 5%; }
  .social-absolute > div.twitter   { right: 5%; }
}

@media (max-width: 479.98px) {
  .navbar-brand img { width: 130px; }
  html[dir="rtl"] .section-head h1 { font-size: 28px; }
  html[dir="ltr"] .section-head h1 { font-size: 36px; }

  .section-head .d-flex { flex-direction: column; }
  .section-head .d-flex a { width: 100%; }

  .social-absolute > div:nth-child(n+3) { width: 50px; height: 50px; }
  .social-absolute > div.instagram,
  .social-absolute > div.twitter        { top: 60%; }
}