@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/tabler-icons.min.css');
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css');

/* Theme Brand Color Variables Overrides */
:root {
  --bs-primary: #01b2de;
  --bs-primary-rgb: 230, 98, 57;
  --bs-link-color: #01b2de;
  --bs-link-hover-color: #0d6efd;
  --bs-font-family-base: 'Poppins', sans-serif;
  --bs-body-font-family: 'Poppins', sans-serif;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #fafafa;
}

/* Global anchor tag reset — remove default underline and browser blue */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: #01b2de;
  text-decoration: none;
}

/* Custom Primary Color Overrides */
.btn-primary {
  background-color: #01b2de !important;
  border-color: #01b2de !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

.btn-outline-primary {
  color: #01b2de !important;
  border-color: #01b2de !important;
}

.btn-outline-primary:hover {
  background-color: #01b2de !important;
  color: #fff !important;
}

.text-primary {
  color: #01b2de !important;
}

.bg-primary {
  background-color: #01b2de !important;
  color: #fff !important;
}

.bg-primary-subtle {
  background-color: rgba(230, 98, 57, 0.1) !important;
}

.text-primary-subtle {
  color: #01b2de !important;
}

.border-primary {
  border-color: #01b2de !important;
}

.border-primary-subtle {
  border-color: rgba(230, 98, 57, 0.25) !important;
}

.link-primary {
  color: #01b2de !important;
}

.link-primary:hover {
  color: #0d6efd !important;
}

/* Custom Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(1px);
  display: none;
  z-index: 1030;
}

.overlay.show {
  display: block;
}

/* Custom Sidebar with Scrollbar support */
.sidebar {
  width: 240px;
  background: #ffffff;
  transition: width .3s, left .3s;
  border-right: 1px solid #e5e5e5;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  padding-top: 60px;
  z-index: 1030;
  overflow-y: auto;
  overflow-x: hidden;
  
  /* Firefox Scrollbar support for Sidebar */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.3s, width .3s, left .3s;
}

.sidebar:hover {
  scrollbar-color: rgba(1, 178, 222, 0.3) transparent;
}

/* Webkit custom scrollbars for Sidebar (Sleek overlay style) */
.sidebar::-webkit-scrollbar {
  width: 5px;
}

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

.sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 10px;
  transition: background 0.3s ease-in-out;
}

.sidebar:hover::-webkit-scrollbar-thumb {
  background: rgba(1, 178, 222, 0.25);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(1, 178, 222, 0.75) !important;
}

/* Global Premium Custom Scrollbars (Webkit) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 2px solid #f8fafc;
  transition: background 0.2s ease-in-out;
}

::-webkit-scrollbar-thumb:hover {
  background: #01b2de;
}

/* Global Firefox Scrollbar styling */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}


.sidebar .nav-link {
  color: #262626;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 400;
  gap: 12px;
  white-space: nowrap;
  margin: 1px 12px;
  border-radius: 8px;
}

.sidebar .nav-link:hover {
  color: #01b2de;
  background-color: #019fd12e;
}

.sidebar .nav-link.active {
  color: #01b2de;
  background-color: #019fd12e;
}

.sidebar .nav-link .ti {
  font-size: 18px;
}

.sidebar .nav-text {
  transition: opacity .2s;
}

.sidebar .logo-area {
  position: absolute;
  top: 0;
  left: 0;
  height: 60px;
  width: 100%;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 17px;
  color: #262626;
  border-bottom: 1px solid #e5e5e5;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
  width: 60px;
}

.sidebar.collapsed .nav-link {
  margin: 0px;
  background-color: transparent;
  padding: 8px 18px;
}

.sidebar.collapsed .nav-text {
  display: none;
}

.sidebar.collapsed .logo-text {
  display: none;
}

/* Custom Topbar and Content Wrapper layout */
.topbar {
  height: 60px;
  margin-left: 240px;
  transition: margin-left .3s;
}

.topbar.full {
  margin-left: 60px;
}

.content {
  margin-left: 240px;
  transition: margin-left .3s;
  padding-top: 80px;
  padding-bottom: 40px;
}

.content.full {
  margin-left: 60px;
}

@media (max-width: 992px) {
  .sidebar {
    left: -240px;
  }

  .sidebar.mobile-show {
    left: 0;
  }

  .topbar {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .content {
    margin-left: 0 !important;
  }
}

/* Custom Avatar classes */
.avatar {
  position: relative;
  display: inline-block;
  width: 3rem;
  height: 3rem;
}

.avatar-xs {
  width: 1.5rem;
  height: 1.5rem;
}

.avatar-sm {
  width: 2rem;
  height: 2rem;
}

.avatar-md {
  width: 2.5rem;
  height: 2.5rem;
}

.avatar-lg {
  width: 3.5rem;
  height: 3.5rem;
}

.avatar-xl {
  width: 5rem;
  height: 5rem;
}

.avatar-xxl {
  width: 7.5rem;
  height: 7.5rem;
}

.avatar img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
}

.avatar-indicators {
  position: relative;
}

.avatar-indicators:before {
  content: '';
  position: absolute;
  bottom: 0px;
  right: 5%;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: table;
}

.avatar-xxl.avatar-indicators:before {
  bottom: 5px;
  right: 17%;
  width: 16%;
  height: 16%;
}

.avatar-offline:before {
  background-color: #a3a3a3;
}

.avatar-online:before {
  background-color: #00C951;
}

.avatar-away:before {
  background-color: #F0B100;
}

.avatar-busy:before {
  background-color: #FB2C36;
}

.avatar-info:before {
  background-color: #00B8DB;
}

.avatar-initials {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
  text-transform: uppercase;
}

.avatar-primary .avatar-initials {
  color: #ffffff;
  background-color: #01b2de;
}

.avatar-secondary .avatar-initials {
  color: #ffffff;
  background-color: #525252;
}

.avatar-success .avatar-initials {
  color: #ffffff;
  background-color: #00C951;
}

.avatar-warning .avatar-initials {
  color: #ffffff;
  background-color: #F0B100;
}

.avatar-info .avatar-initials {
  color: #ffffff;
  background-color: #00B8DB;
}

.avatar-danger .avatar-initials {
  color: #ffffff;
  background-color: #FB2C36;
}

.avatar-light .avatar-initials {
  color: #ffffff;
  background-color: #f5f5f5;
}

.avatar-dark .avatar-initials {
  color: #ffffff;
  background-color: #171717;
}

.avatar-group .avatar+.avatar {
  margin-left: -1.2rem;
}

.avatar-group .avatar:hover {
  z-index: 2;
}

.avatar-group img,
.avatar-group .avatar .avatar-initials {
  border: 2px solid #ffffff;
}

/* Icon Shapes sizing utilities */
.icon-shape {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
}

.icon-xxs {
  width: 1rem;
  height: 1rem;
  line-height: 1rem;
}

.icon-xs {
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1.5rem;
}

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

.icon-md {
  width: 2.5rem;
  height: 2.5rem;
  line-height: 2.5rem;
}

.icon-lg {
  width: 3rem;
  height: 3rem;
  line-height: 3rem;
}

.icon-xl {
  width: 3.5rem;
  height: 3.5rem;
  line-height: 3.5rem;
}

.icon-xxl {
  width: 4rem;
  height: 4rem;
  line-height: 4rem;
}

.icon-xxxl {
  width: 7rem;
  height: 7rem;
  line-height: 7rem;
}

/* Icon Buttons utilities */
.btn-icon {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  font-size: 0.92969rem;
  font-weight: 400;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
}

.btn-icon.btn-xs {
  font-size: 0.75rem;
  width: 1.75rem;
  height: 1.75rem;
}

.btn-icon.btn-sm {
  font-size: 0.875rem;
  width: 2.1875rem;
  height: 2.1875rem;
}

.btn-icon.btn-lg {
  font-size: 1rem;
  width: 3.36875rem;
  height: 3.36875rem;
}

/* Timeline vertical */
.border-dashed {
  --ds-border-style: dashed;
}

.timeline-vertical {
  position: relative;
}

.timeline-vertical .timeline-item .timeline-bar {
  position: absolute;
  height: 100px;
  left: 5px;
  top: 24px;
}

.timeline-vertical-height .timeline-item .timeline-bar {
  height: calc(100% - 1rem) !important;
}

.vr {
  display: inline-block;
  align-self: stretch;
  width: 1px;
  min-height: 1em;
  background-color: #e5e5e5 !important;
  opacity: 0.75;
}

/* Stack-Responsive Tables on Mobile Screens */
@media (max-width: 768px) {

  /* Prevent horizontal scrolling of the container on mobile */
  .table-responsive-stack {
    overflow-x: visible !important;
  }

  /* Override Bootstrap text-nowrap and force proper wrapping */
  .table-responsive-stack,
  .table-responsive-stack table,
  .table-responsive-stack tbody,
  .table-responsive-stack tr,
  .table-responsive-stack td {
    white-space: normal !important;
  }

  .table-responsive-stack table,
  .table-responsive-stack thead,
  .table-responsive-stack tbody,
  .table-responsive-stack tfoot {
    display: block !important;
  }

  .table-responsive-stack thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
    display: block !important;
  }

  /* Style individual table rows as cards in body */
  .table-responsive-stack tbody tr {
    display: block !important;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  }

  /* Stack table cells in the body as row-based key-value pairs */
  .table-responsive-stack tbody td {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    border: none !important;
    border-bottom: 1px solid #f5f5f5 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    min-height: 48px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    gap: 15px !important;
  }

  .table-responsive-stack tbody td:last-child {
    border-bottom: 0 !important;
  }

  /* Add headers on the left side of stacked cells */
  .table-responsive-stack tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #525252;
    text-align: left;
    display: inline-block;
    flex-shrink: 0 !important;
    max-width: 45% !important;
    margin-right: auto !important;
  }

  /* Make sure links and span text inside cells display well and wrap nicely in mobile flex layout */
  .table-responsive-stack tbody td>a,
  .table-responsive-stack tbody td>span {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
    max-width: 55% !important;
    word-break: break-all !important;
  }

  /* Clean responsive pagination & footer stacking */
  .table-responsive-stack tfoot tr {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px;
    padding: 16px 8px !important;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
  }

  .table-responsive-stack tfoot td {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 0 !important;
    border: none !important;
  }

  .table-responsive-stack tfoot nav {
    display: flex !important;
    justify-content: center !important;
    width: 100%;
  }

  .table-responsive-stack tfoot .pagination {
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 4px;
  }
}

/* Compact Premium Styling for Desktop Views */
@media (min-width: 992px) {
  /* Tighten spacing of main content layout */
  .content {
    padding-top: 75px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  /* Make table elements more compact and high-density */
  .table {
    font-size: 13.5px !important;
  }

  .table th {
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    color: #525252 !important;
  }

  .table td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  /* Compact avatars inside the table */
  .table .avatar {
    width: 36px !important;
    height: 36px !important;
  }

  /* Sizing down badges and actions */
  .table .badge {
    font-size: 11px !important;
    padding: 4px 8px !important;
  }

  .table .btn-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 14px !important;
  }

  /* Sleeker search filter and card layout */
  .form-control {
    font-size: 13.5px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  .btn {
    font-size: 13.5px !important;
    padding: 7px 16px !important;
  }

  /* Page titles compact size */
  h1.fs-3 {
    font-size: 1.25rem !important; /* 20px instead of 28px */
  }

  p.text-secondary {
    font-size: 13px !important;
  }
}

/* Hover Utility Classes */
.hover-text-primary {
  transition: color 0.2s ease-in-out;
}
.hover-text-primary:hover {
  color: #01b2de !important;
}

/* Optimization of CRM KPI cards at mobile view (< 576px) */
@media (max-width: 576px) {
  /* Tighten padding and boundaries of statistics/KPI cards */
  .card.p-3, 
  .card.p-md-4, 
  .card-body.p-3, 
  .card-body.p-md-4,
  .card-body.p-4 {
    padding: 10px !important;
  }

  /* Tighten flex gap in metric structures */
  .d-flex.align-items-center.gap-2,
  .d-flex.align-items-center.gap-md-3,
  .d-flex.align-items-center.gap-md-2\.5,
  .d-flex.gap-2,
  .d-flex.gap-md-3 {
    gap: 6px !important;
  }

  /* Compact sizing of icon shape elements */
  .card .icon-shape[style*="width: 48px"],
  .card .icon-shape.icon-md,
  .card div[style*="width: 48px"],
  .card div[style*="width: 38px"] {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
  }

  /* Adjust icon font-sizes for smaller containers */
  .card .icon-shape[style*="width: 48px"] i,
  .card .icon-shape.icon-md i,
  .card div[style*="width: 48px"] i,
  .card div[style*="width: 38px"] i {
    font-size: 13px !important;
  }

  /* Adjust KPI label/title elements (H2 and H6) to prevent overflow or wrapping */
  .card h2, 
  .card h6 {
    font-size: 9.5px !important;
    letter-spacing: 0.2px !important;
    line-height: 1.2 !important;
    margin-bottom: 2px !important;
    font-weight: 600 !important;
  }

  /* Adjust KPI metrics values (H3) to render wide currencies perfectly */
  .card h3 {
    font-size: 13.5px !important;
    line-height: 1.1 !important;
    margin-top: 2px !important;
    margin-bottom: 2px !important;
    font-weight: 700 !important;
  }

  /* Adjust KPI subtexts/descriptions to fit perfectly */
  .card p, 
  .card .extra-small {
    font-size: 9px !important;
    line-height: 1 !important;
    margin-top: 2px !important;
    margin-bottom: 0 !important;
  }
}