:root {
  /* Split view active tile colors; match Tailwind primary palette */
  --split-view-active-bg: #FCEDEB;      /* primary-300 */
  --split-view-active-border: #E54F38;  /* primary-600 */
}

.btn-with-icon:hover img {
  filter: brightness(0) invert();
  transition: 0.3s;
}
.w-fill-available {
  width: -webkit-fill-available;
  width: -moz-available;
  width: stretch;
}

.progress {
  display: flex;
  justify-content: space-between;
}

.progress li {
  position: relative;
  width: 50%;
}

.progress li .sec::before {
  content: "";
  position: absolute;
  height: 3px;
  width: 100%;
  background-color: var(--progress-track-bg, #ffe5e1);
  inset-inline-start: 0;
  top: 15px;
  bottom: 0;
}

.progress li span {
  position: relative;
  z-index: 1;
}

.progress li:nth-child(2),
.progress li:nth-child(3) {
  display: flex;
  justify-content: center;
}

.progress li:last-child {
  display: flex;
  justify-content: flex-end;
  width: 30%;
  text-align: end;
}

.progress li:nth-child(1) {
  width: 30%;
}

.progress li:nth-child(1) p {
  text-align: start;
}

.peer:focus~.peer-focus\:ring-4 {
  box-shadow: unset !important;
}

.tog:after {
  background-color: white !important;
  border: unset !important;
}

.modelcontent {
  padding-top: 60px;
}

@layer utilities {
  @keyframes fade-in {
    0% {
      opacity: 0;
      transform: scale(0.95);
    }

    100% {
      opacity: 1;
      transform: scale(1);
    }
  }

  .animate-fade-in {
    animation: fade-in 0.3s ease-out forwards;
  }
}

.container {
  width: 70%;
  min-width: 50%;
  margin: auto;
  display: flex;
  flex-direction: column;
}

.kanban-heading {
  display: flex;
  flex-direction: row;
  justify-content: center;
  font-family: sans-serif;
}

.kanban-heading-text {
  font-size: 1.8rem;
  background-color: tomato;
  padding: 0.8rem 1.7rem;
  border-radius: 0.5rem;
  margin: 1rem;
}

.kanban-board {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  font-family: sans-serif;
}

/* .kanban-block {
  padding: 0.6rem;
  width: 30.5%;
  min-width: 14rem;
  min-height: 4.5rem;
  border-radius: 0.3rem;
} */

/* #todo {
  background-color: #fec6d1;
}

#inprogress {
  background-color: #ffaf00;
}

#done {
  background-color: #018b01;
} */
.task {
  background-color: white;
  margin: 0.2rem 0rem 0.3rem 0rem;
  border: 0.1rem solid black;
  border-radius: 0.2rem;
  padding: 0.5rem 0.2rem 0.5rem 2rem;
}

#task-button {
  margin: 0.2rem 0rem 0.1rem 0rem;
  background-color: white;
  border-radius: 0.2rem;
  width: 100%;
  border: 0.25rem solid black;
  padding: 0.5rem 2.7rem;
  border-radius: 0.3rem;
  font-size: 1rem;
}

/* accordion design */
.accordion-content {
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.accordion-content.open {
  max-height: 500px;
  /* Adjust as needed */
  /* padding-top: 1rem; */
  padding-bottom: 1rem;
}

/* scrollbar-customize */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #e1e1e1;
  border-radius: 12px;
}

::-webkit-scrollbar-thumb {
  background-color: #c0c0c0;
  border-radius: 12px;
  border: 1px solid #c0c0c0;
}

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

.kanban-block {
  border: 2px solid transparent;
}

.kanban-block.highlight {
  border: 2px dashed #4a90e2;
}

/* Wrapper so the filter panel takes zero layout space */
.filter-panel-slot {
  height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  display: block;
}

/* Floating filter panel — right side, below navbar, movable */
.filter-panel-floating {
  position: fixed;
  top: 10.5rem;  /* default: below main header + navbar */
  right: 1.25rem;
  left: auto;
  width: 34rem;
  max-width: calc(100vw - 2.5rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-0.5rem);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.filter-panel-floating.filter-panel-dragging,
.filter-panel-floating.filter-panel-resizing {
  transition: none;
}

/* Preset sizes for quick min/max controls */
.filter-panel-floating.filter-panel-max {
  left: auto;
  right: 1.25rem;
  width: 52rem;
  max-width: calc(100vw - 12rem);
}

.filter-panel-floating.filter-panel-min {
  left: auto;
  right: 1.25rem;
  width: 34rem;
}

/* Settings page: panel needs to sit lower because of extra header spacing */
.settings-page #filterpanel.filter-panel-floating {
  top: 13.25rem;
}

.filter-panel-inner {
  min-height: 0;
  max-height: calc(100vh - 12rem); /* keep panel inside viewport */
}

/* Make the main body area scroll when content exceeds available height */
.filter-panel-inner > .p-4 {
  max-height: calc(100vh - 12rem - 2.5rem); /* subtract header height */
  overflow-y: auto;
}

/* Resize handles — drag to change width/height */
.filter-panel-resize-w {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  z-index: 5;
}
.filter-panel-resize-w:hover {
  background: rgba(0, 0, 0, 0.06);
}
.filter-panel-resize-w-left {
  right: auto;
  left: 0;
}

.filter-panel-resize-h {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  cursor: ns-resize;
  z-index: 5;
}
.filter-panel-resize-h:hover {
  background: rgba(0, 0, 0, 0.06);
}

#filterpanel.hidden.filter-panel-floating {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-0.5rem);
}

#filterpanel.visible.filter-panel-floating {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.select2-container {
  display: unset !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: unset !important;
  padding-inline-start: 13px !important;
}

.select2-container--default .select2-selection--single {
  font-size: 0.85rem;
}

.select2-container .select2-selection--single {
  height: 38px !important;
}

.select2-container--default .select2-selection--single {
  display: flex !important;
  align-items: center !important;
  border: 1px solid #e1e1e1 !important;
  border-radius: 5px !important;
  /* margin-top: 5px !important; */
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 5px !important;
}

.select2-container--default .select2-results__option--highlighted {
  transition: 0.3s;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
.select2-container--default .select2-results__option--selected.select2-results__option--selectable {
  background-color: #e54f3817 !important;
  color: #e54f38 !important;
}

.select2-results__option {
  font-size: 0.85rem !important;
}

.select2-dropdown {
  border: 1px solid #e1e1e1 !important;
  border-top: unset !important;
  margin-top: -4px !important;
}

.select2-container--default .select2-results__option--selected {
  background-color: unset !important;
}

.select2-container--default .select2-selection--single:focus-visible {
  outline: unset !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #e6e6e6 !important;
  border-radius: 4px !important;
  font-size: 0.85rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  transition: 0.3s !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  font-size: 0.7rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: white !important;
  border-inline-end: 1px solid #ffffff7d !important;
  font-size: 0.8rem !important;
  height: 100%;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
  border: 1px solid #a1a1a1;
}

/* .select2-container--default .select2-selection--multiple {
  border: 1px solid #e1e1e1 !important;
  font-size: 0.85rem;
  height: 36px;
  font-size: 0.85rem  !important;
  display: flex !important;
  align-items: center !important;
  border-radius: 5px !important;
  margin-top: 5px !important;
} */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus {
  background-color: #b75d2a !important;
}

.select2-results__options {
  box-shadow: 0px 5px 5px #00000008;
}

/* .select2-container .select2-selection--multiple .select2-selection__rendered{
  padding-left: 13px !important;
  color: unset !important;
} */
.select2-container .select2-search__field::placeholder {
  font-size: 0.75rem;
  /* Equivalent to Tailwind's text-xs */
  /* line-height: 1rem; */
  color: #999;
  /* e.g., #ff0000 for red */
  opacity: 1;
  /* Ensure visibility */
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #999;
  /* e.g., #ff0000 for red */
  font-size: 0.75rem;
}

.select2-container--default .select2-selection--multiple {
  border: 1px solid #e1e1e1 !important;
  padding: 6px 5px !important;
  min-height: 38px !important;
  height: auto !important;
  max-height: 128px !important;
  overflow-y: auto !important;
  line-height: normal !important;
  display: flex !important;
  flex-wrap: wrap !important;
  /* "safe" keeps overflowing chips scrollable from the top instead of clipping the first ones */
  align-items: flex-start !important;
  align-items: safe center !important;
  align-content: flex-start !important;
  align-content: safe center !important;
  font-size: 0.85rem !important;
  position: relative !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  padding-inline-start: 13px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  align-content: center !important;
  width: auto !important;
  flex: 1 1 auto !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline {
  display: inline-flex !important;
  align-items: center !important;
  width: auto !important;
  flex: 0 0 auto !important;
  max-height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered:not(:empty) + .select2-search--inline {
  position: absolute !important;
  top: 50% !important;
  inset-inline-end: 5px;
  transform: translateY(-50%) !important;
  width: 6px !important;
  min-width: 6px !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple .select2-search--inline,
.select2-container--default .select2-selection--multiple .select2-search--inline:focus-within {
  max-height: 22px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered:empty + .select2-search--inline {
  flex: 1 1 auto !important;
  width: 100% !important;
  max-height: 22px !important;
  min-height: 22px !important;
  overflow: visible !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
  margin-top: 0 !important;
  height: 22px !important;
  line-height: 22px !important;
  padding: 0 !important;
  vertical-align: middle !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: var(--menu-arrow-fg, #e54f38) !important;
  color: white;
  border: none !important;
  margin: 2px !important;
  /* Add margin for spacing between choices */
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  display: flex;
  align-items: center;
  padding: 3px 5px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: white !important;
  border-inline-end: 1px solid #ffffff7d !important;
  font-size: 0.8rem !important;
  padding: 0 5px !important;
  position: static !important;
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
}

input[type="checkbox"] {
  color: #e54f38;
}

/* table button img{
  filter: brightness(0);
  opacity: .5;
} */

.file-label {
  padding: 10px;
  background: #e57938;
  display: inline-flex;
  align-items: center;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  gap: 6px;
  /* spacing between icon and text */
}

.file-label input[type="file"] {
  display: none;
}

.file-content {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
}

.swal-footer {
  display: flex;
  justify-content: center;
}

.swal-button {
  background-color: #e54f38;
  transition: 0.3s;
}

.swal-button:hover {
  background-color: #ac3b2a !important;
  color: white;
}

.swal-button:focus {
  box-shadow: unset;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.4rem;
  border-radius: 0.625rem;
  color: #374151;
  /* text-gray-700 */
  min-width: 3.5rem;
}

.nav-link-label {
  font-size: 0.6rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 3.2rem;
}

.sidebar-link {
  color: #7b7b7b;
}

.nav-link-icon,
.sidebar-link-icon {
  display: inline-block;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-image: var(--icon-url);
  mask-image: var(--icon-url);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.sidebar-link-icon {
  width: 19px;
  height: 19px;
}

.nav-link.active,
.nav-link.bg-primary-600 {
  color: white;
}

.nav-link.active .nav-link-label,
.nav-link.bg-primary-600 .nav-link-label {
  color: white !important;
}

.select2-container--default .select2-selection--single {
  position: relative;
}

.default-modal6::before {
  pointer-events: none !important;
}

.custom-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background-color: #a29f9f;
  /* Replace with your primary */
  border-radius: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.custom-scroll {
  scrollbar-width: thin;
  scrollbar-color: #c4c1c1 #dfdfdf;
}

.probar li div {
  clip-path: polygon(100% 50%, 90% 0%, 0% 0%, 10% 50%, 0% 100%, 90% 100%);
  -webkit-clip-path: polygon(100% 50%, 90% 0%, 0% 0%, 10% 50%, 0% 100%, 90% 100%);
}

.probar li:first-child div {
  clip-path: polygon(100% 50%, 90% 0%, 0% 0%, 0% 50%, 0% 100%, 90% 100%);
  -webkit-clip-path: polygon(100% 50%, 90% 0%, 0% 0%, 0% 50%, 0% 100%, 90% 100%);
  border-start-start-radius: 3px;
  border-end-start-radius: 3px;
}

/* CUSTOM DROPDOWN */
/* .dropdown-content {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.dropdown-wrapper {
  z-index: 50;
}

.dropdown-wrapper:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
} */

/* SIDEBAR  */

.sidebarModal {
  width: 350px;
  max-width: calc(100% - 1rem);
  height: calc(-2rem + 100vh);
  position: fixed;
  z-index: 999;
  border-radius: 1rem;
  top: 1rem;
  right: 1rem;
  padding: 1rem;
  transform: translateX(calc(100% + 1rem));
  transition: 0.3s;
}

.sidebarModal.active {
  transform: translateX(0px);
  box-shadow: rgba(0, 0, 0, 0.1) -15px 5px 20px;
}

@media (max-width: 575px) {
  .sidebarModal {
    width: 300px;
  }
}

.sidebarModal {
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

.sidebarModal.active {
  transform: translateX(0);
}

/* Records card/kanban view — three-dot menu */
.card-item-menu-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.card-item-menu {
  position: absolute !important;
  top: 2.1875rem !important;
  right: 0.9375rem !important;
  left: auto !important;
  transform: none !important;
  z-index: 10;
}

.card-item-menu .block {
  text-align: start;
}

.file-label {
  padding: 10px !important;
  background: #e57938 !important;
  display: inline-flex !important;
  align-items: center !important;
  color: #fff !important;
  cursor: pointer !important;
  border-radius: 4px !important;
  gap: 6px !important;
  /* spacing between icon and text */
}

.file-label input[type="file"] {
  display: none !important;
}

.file-content {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 0.9rem !important;
}

/*  for dashboard styles */

.chart-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
  overflow: hidden;
}

canvas {
  max-width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
  overflow: hidden;
}

.component-item {
  transition: all 0.2s ease;
  cursor: grab;
}

.component-item:hover {
  transform: translateX(2px);
}

.component-item:active {
  cursor: grabbing;
}

.fa-solid {
  width: 16px;
  text-align: center;
}

#reorderModal {
  background: rgba(0, 0, 0, 0.5);
}

/* KPI Fixed Position Styles */
.kpi-component-fixed {
  position: relative;
}

/* Ensure KPIs are always in their grid layout */
.kpi-section {
  position: sticky;
  top: 70px;
  /* Account for the fixed header */
  z-index: 10;
  background: #f9fafb;
  padding: 1rem 0;
  margin-bottom: 2rem;
}

/* KPI Card Styles */
.shadow-sm {
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.text-gray-500 {
  color: #6b7280;
}

.text-gray-900 {
  color: #111827;
}

.text-green-600 {
  color: #16a34a;
}

.text-red-600 {
  color: #dc2626;
}

/* Background color utilities for KPI icons */
.bg-\[#FFF3E0\] {
  background-color: #fff3e0;
}

.bg-\[#E8F5E8\] {
  background-color: #e8f5e8;
}

.bg-\[#FFE1F4\] {
  background-color: #ffe1f4;
}

.bg-\[#E3F2FD\] {
  background-color: #e3f2fd;
}

.bg-\[#F3E5F5\] {
  background-color: #f3e5f5;
}

.bg-\[#E0F2F1\] {
  background-color: #e0f2f1;
}

/* Icon colors */
.text-orange-500 {
  color: #f97316;
}

.text-green-500 {
  color: #22c55e;
}

.text-pink-500 {
  color: #ec4899;
}

.text-blue-500 {
  color: #3b82f6;
}

.text-purple-500 {
  color: #a855f7;
}

.text-teal-500 {
  color: #14b8a6;
}

/* Dropdown Styles */
/* .dropdown-wrapper {
  position: relative;
  display: inline-block;
} */
.dropdown-content {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: none;
  position: absolute;
  background-color: white;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid;
  inset-inline-end: 0;
  inset-inline-start: auto;
}

.dropdown-wrapper {
  z-index: 50;
  position: relative;
}

/* Active state - replaces hover */
.dropdown-wrapper.active .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  display: block;
}

.dropdown-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown-content a {
  color: #374151;
  text-decoration: none;
  display: block;
  text-align: start;
}

.dropdown-content a:hover {
  background-color: #f9fafb;
  color: #e54f38;
}

/* Recently viewed cards: hover only highlights the border */
.dropdown-content a.recently-viewed-item:hover {
  background-color: transparent;
  color: #374151;
}

/* Ensure FontAwesome icons work */
.fas {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Grid responsive adjustments */
@media (max-width: 1200px) {
  .col-span-3 {
    grid-column: span 4 / span 4;
  }
}

@media (max-width: 768px) {
  .col-span-3 {
    grid-column: span 12 / span 12;
  }

  .col-span-6 {
    grid-column: span 12 / span 12;
  }
}

/*  dashboard component form styles */

#preview-wrapper {
  position: relative;
  overflow: hidden;
  /* Clips the tooltip if it overflows */
}

#preview-container {
  position: relative;
  height: 100%;
  /* Ensure it takes full height of wrapper */
}

/* Optional: Style the tooltip to ensure it fits better */
.echarts-tooltip {
  position: absolute !important;
  /* Override ECharts default if possible */
  z-index: 1000;
  /* Ensure it stays above other content */
  max-width: 200px;
  /* Limit tooltip width to prevent excessive overflow */
  word-wrap: break-word;
  /* Break long text */
}

/* floating menu */
.floating-menu {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #e54f38;
  position: fixed;
  bottom: 15px;
  left: 15px;
  z-index: 9;
}

.floating-menu input {
  position: absolute;
  width: 45px;
  height: 45px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.floating-menu input:checked~.plus-icon {
  transform: rotate(135deg);
}

.floating-menu input:checked~.floating-nav li:nth-child(1) {
  transform: translatey(-48px);
}

.floating-menu input:checked~.floating-nav li:nth-child(2) {
  transform: translatey(-88px);
}

.floating-menu input:checked~.floating-nav li:nth-child(3) {
  transform: translatey(-128px);
}

.floating-menu input:checked~.floating-nav li:nth-child(4) {
  transform: translatey(-168px);
}

.floating-menu input:checked~.floating-nav li:nth-child(5) {
  transform: translatey(-208px);
}

.floating-menu input~.plus-icon {
  transform: rotate(0);
}

.floating-menu>.plus-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  font-size: 18px;
  line-height: 1;
  color: #ffffff;
  border-radius: 50%;
  transform: rotate(0);
  transition: all 0.5s ease;
  pointer-events: none;
  position: absolute;
  box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.2);
}

.floating-menu>.floating-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

.floating-menu>.floating-nav li {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  position: absolute;
  transition: all 0.5s ease;
}

.floating-nav li {
  position: relative;
}

/* Notification styles */
.badge {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  background-color: #ef4444;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  font-size: 12px;
}

.genealogy-tree ul {
  padding-top: 20px;
  position: relative;
  padding-left: 0px;
  display: flex;
  justify-content: center;
}

.genealogy-tree li {
  float: left;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 20px 5px 0 5px;
}

.genealogy-tree li::before,
.genealogy-tree li::after {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 2px solid #ccc;
  width: 50%;
  height: 18px;
}

.genealogy-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid #ccc;
}

.genealogy-tree li:only-child::after,
.genealogy-tree li:only-child::before {
  display: none;
}

.genealogy-tree li:only-child {
  padding-top: 0;
}

.genealogy-tree li:first-child::before,
.genealogy-tree li:last-child::after {
  border: 0 none;
}

.genealogy-tree li:last-child::before {
  border-right: 2px solid #ccc;
  border-radius: 0 5px 0 0;
  -webkit-border-radius: 0 5px 0 0;
  -moz-border-radius: 0 5px 0 0;
}

.genealogy-tree li:first-child::after {
  border-radius: 5px 0 0 0;
  -webkit-border-radius: 5px 0 0 0;
  -moz-border-radius: 5px 0 0 0;
}

.genealogy-tree ul ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid #ccc;
  width: 0;
  height: 20px;
}

.genealogy-tree li a {
  text-decoration: none;
  color: #666;
  font-size: 13px;
  display: inline-block;
  border-radius: 10px;
  transition: 0.3s;
}

/*
.genealogy-tree li a:hover,
.genealogy-tree li a:hover + ul li a {
  background: #ffefed;
  color: #333;
} */

/*--------------memeber-card-design----------*/

.member-view-box {
  padding: 10px 35px;
  text-align: center;
  border-radius: 10px;
  position: relative;
  border: 1px;
  border-style: solid;
  position: relative;
}

.member-view-box:after {
  content: "";
  position: absolute;
  width: 23px;
  height: 23px;
  background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJjdXJyZW50Q29sb3IiIGQ9Ik03LjQxIDguNThMMTIgMTMuMTdsNC41OS00LjU5TDE4IDEwbC02IDZsLTYtNnoiLz48L3N2Zz4=);
  object-fit: contain;
  left: 0;
  right: 0;
  margin: auto;
  z-index: 9;
  bottom: -8px;
  opacity: 0.5;
}

/* Show arrow only when the node has children; hide for leaf nodes */
.genealogy-tree li>a .member-view-box:after {
  display: none;
}

.genealogy-tree li.has-children>a .member-view-box:after {
  display: block;
}

.member-image {
  padding: 10px;
  width: 120px;
  position: relative;
}

.member-image img {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  background-color: #fff;
  z-index: 1;
}

.member-header {
  /* padding: 5px 0; */
  /* text-align: center; */
  /* background: #345; */
  color: #333;
  font-size: 16px;
  /* border-radius: 4px 4px 0 0; */
  font-weight: 600;
}

.member-footer {
  text-align: center;
}

.member-footer div.name {
  color: #666;
  font-size: 13px;
  margin-bottom: 15px;
  font-weight: 500;
}

.member-footer div.downline {
  color: #000;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-bottom: 10px;
}

.member-footer div.downline button {
  width: 28px;
  height: 28px;
  border: 1px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.member-footer div.downline button:hover {
  background-color: var(--split-view-active-border, #e54f38);
  border: 1px solid var(--split-view-active-border, #e54f38);
}

.member-footer div.downline button:hover svg {
  color: white;
}

.member-footer div.downline button svg {
  width: 16px;
  transition: 0.3s;
  color: #333;
}

/* First button */
.downline button:nth-child(1) {
  background-color: #e0f7fa;
}

/* Second button */
.downline button:nth-child(2) {
  background-color: #e8f5e9;
}

/* Third button */
.downline button:nth-child(3) {
  background-color: #f3e5f5;
}

/* Fourth button */
.downline button:nth-child(4) {
  background-color: #cef0de;
}

/* Fifth button */
.downline button:nth-child(5) {
  background-color: #cef0de;
}

.downline button:nth-child(5):hover,
.downline button:nth-child(1):hover,
.downline button:nth-child(2):hover,
.downline button:nth-child(3):hover,
.downline button:nth-child(4):hover {
  background-color: var(--split-view-active-border, #e54f38);
  border: 1px solid var(--split-view-active-border, #e54f38);
}

/* Role card action colours (per action, independent of position) */
.member-footer div.downline button.role-action-add-user { background-color: #e0f7fa; }
.member-footer div.downline button.role-action-add-role { background-color: #e8f5e9; }
.member-footer div.downline button.role-action-view-user { background-color: #f3e5f5; }
.member-footer div.downline button.role-action-edit-role { background-color: #fff3cd; }
.member-footer div.downline button.role-action-delete-role { background-color: #e5e7eb; }
.member-footer div.downline button[class*="role-action-"]:hover {
  background-color: var(--split-view-active-border, #e54f38);
  border: 1px solid var(--split-view-active-border, #e54f38);
}

/* Viewport */
.canvas-wrap {
  position: relative;
  height: calc(100vh - 240px);
  overflow-y: auto;
  overflow-x: auto;
  background: #f7f7f7;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Canvas plane that we pan/zoom via CSS variables */
.canvas {
  position: relative;
  /* width: 4000px; */
  /* big plane; can be larger */
  /* height: 3000px; */
  transform: translate(var(--tx), var(--ty)) scale(var(--scale));
  transform-origin: 0 0;
  transition: transform 0s;
  /* no easing for snappy feel */
  padding: 3rem;
}

/* Nodes behave like Figma frames */
.node {
  position: absolute;
  min-width: 140px;
  min-height: 72px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  cursor: move;
  /* will be draggable */
  user-select: none;
}

/* Hand tool (spacebar) cursors */
.canvas-wrap.hand {
  cursor: grab;
}

.canvas-wrap.hand.dragging {
  cursor: grabbing;
}

.error-container {
  text-align: center;
}

.error-title {
  font-size: 25px;
  font-weight: 700;
  color: #212529;
  margin-bottom: 12px;
}

.error-description {
  font-size: 16px;
    color: #6c757d;
    margin-bottom: 20px;
    max-width: 600px;
}
.permission-info {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 32px;
}

.permission-code {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 4px 8px;
  font-family: "Monaco", "Consolas", monospace;
  font-size: 13px;
  color: #495057;
}

/* Hide default radio */
input[type="radio"] {
  display: none !important;
}

/* Custom circle */
.radio-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 6px;
  font-size: 14px;
  color: #333;
}

.radio-group .custom-radio {
  width: 18px;
  height: 18px;
  border: 2px solid #d5d5d5;
  border-radius: 50%;
  position: relative;
  transition: all 0.2s ease-in-out;
}

/* Inner filled circle when checked (via sibling input or direct .checked class) */
.radio-group input[type="radio"]:checked+.custom-radio::after,
.radio-group .custom-radio.checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background: #e54f38;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.leftspace {
  padding-inline-start: 230px !important;
}

/* Detail view side nav (Activity, Related Lists) — separator follows text direction */
.detail-tab-side-nav {
  border-inline-end: 1px solid #dddddd;
}

.detail-tab-side-nav-list {
  padding-inline-end: 0.75rem;
}

/* Record detail prev/next control group (split view) */
.detail-record-nav {
  display: flex;
  gap: 0;
  overflow: hidden;
  margin-inline-start: 0.5rem;
  box-shadow: 0px 0px 20px 0px rgb(0 0 0 / 5%);
}

.detail-record-nav-btn--prev {
  border-inline-end: 1px solid white;
  border-start-start-radius: 5px;
  border-end-start-radius: 5px;
}

.detail-record-nav-btn--next {
  border-start-end-radius: 5px;
  border-end-end-radius: 5px;
}

.error-container {
  text-align: center;
}

.error-title {
  font-size: 25px;
  font-weight: 700;
  color: #212529;
  margin-bottom: 12px;
}

.error-description {
  font-size: 16px;
  color: #6c757d;
  margin-bottom: 8px;
}

.permission-info {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 32px;
}

.permission-code {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 4px 8px;
  font-family: "Monaco", "Consolas", monospace;
  font-size: 13px;
  color: #495057;
}

.file-preview {
  background: #e54f380f;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  margin-bottom: 10px;
  border: 2px dashed #e54f3840;
  position: relative;
  overflow: hidden;
}

/* .file-preview::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(102, 126, 234, 0.05) 0%,
    transparent 70%
  );
} */

.file-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1;
}

.file-icon svg {
  width: 25px;
  height: 25px;
  fill: #e53e3e;
}

.file-name {
  font-size: 13px;
  color: #2d3748;
  margin-bottom: 3px;
  word-break: break-all;
  position: relative;
  z-index: 1;
}

.open-link {
  color: #667eea;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

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

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.detail-card {
  background: white;
  padding: 10px 15px;
  border-radius: 10px;

  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.detail-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #a0aec0;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.detail-value {
  font-size: 13px;
  color: #2d3748;
  font-weight: 500;
}

.notes-section {
  background: white;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  /* margin-bottom: 30px; */
}

.notes-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  color: #2d3748;
  font-weight: 600;
  font-size: 13px;
}

/* .notes-textarea {
  width: 100%;

  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  color: #2d3748;
  resize: vertical;
  transition: all 0.3s ease;
  font-family: inherit;
}

.notes-textarea:focus {
  outline: none;
  border-color: #e54f38;
}
.notes-textarea::placeholder {
  font-size: 0.8rem;
} */
.actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.preview-placeholder {
  width: 170px;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #a0aec0;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  margin-bottom: 10px;
  border-radius: 10px;
}

.history-diff-chip {
  background-color: color-mix(in srgb, var(--menu-arrow-fg, #e54f38) 20%, white);
  color: var(--menu-arrow-fg, #e54f38);
  padding: 2px 4px;
  border-radius: 5px;
}

.history-diff-chip-added {
  background-color: #d2f5df9c;
  color: #1f9254;
}

.history-diff-chip-removed {
  background-color: color-mix(in srgb, var(--menu-arrow-fg, #e54f38) 20%, white);
  color: var(--menu-arrow-fg, #e54f38);
}

/* .contact-info {
  background: #e54f380f;
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 10px;
  display: flex;
  flex-flow: wrap;
  row-gap: 5px;
  column-gap: 40px;
} */

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 3px 0;
  color: #2d3748;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}

.status-lost {
  background: #fed7d7;
  color: #c53030;
}

.status-won {
  background: #c6f6d5;
  color: #276749;
}

.email-container {
  max-width: 600px;
  width: 100%;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); */
  border: 1px solid #e2e8f0;
}

.header {
  background: linear-gradient(135deg, #4285f4 0%, #2563eb 100%);
  padding: 20px;
  text-align: center;
}

.header h1 {
  color: white;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.content {
  padding: 20px;
  color: #2d3748;
  line-height: 1.8;
}

.greeting {
  font-size: 14px;
  margin-bottom: 10px;
}

.greeting strong {
  color: #1a202c;
  font-weight: 600;
}

.message {
  font-size: 13px;
  color: #4a5568;
  margin-bottom: 5px;
}

.signature {
  margin-top: 15px;
  font-size: 13px;
  color: #4a5568;
}

.signature-line {
  margin-bottom: 4px;
}

.footer {
  background: #f7fafc;
  padding: 10px;
  text-align: center;
  border-top: 1px solid #e2e8f0;
}

.footer-text {
  font-size: 13px;
  color: #718096;
}

@media (max-width: 640px) {
  .header {
    padding: 30px 20px;
  }

  .header h1 {
    font-size: 26px;
  }

  .content {
    padding: 30px 20px;
  }

  .greeting,
  .message,
  .signature {
    font-size: 15px;
  }

  .cta-button {
    padding: 14px 40px;
    font-size: 15px;
  }
}

.tablebtn button:first-child {
  border-start-start-radius: 5px;
  border-end-start-radius: 5px;
}

.tablebtn button:last-child {
  border-start-end-radius: 5px;
  border-end-end-radius: 5px;
}

.tablebtn button:only-child {
  border-radius: 5px;
}

/* Action button group dividers — logical borders for LTR and RTL */
.tablebtn .border-r,
.tablebtn .border-e {
  border-right-width: 0;
  border-inline-end-width: 1px;
  border-inline-end-color: #fff;
}

.tablebtn > button:last-child,
.tablebtn > .dropdown-wrapper:last-child button {
  border-inline-end-width: 0;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}


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

body {
  font-family: "Inter", sans-serif;
  background: #f8f9fa;
  color: #2d3436;
  line-height: 1.6;
}

img {
  max-width: 100%;
}

.header {
  text-align: center;
  margin-bottom: 20px;
  background: #fff;
  padding-top: 2px;
}

.header h1 {
  font-size: 2.3rem;
  color: #2d3436;
  font-weight: 700;
}

.header p {
  font-size: 1.1rem;
  color: #636e72;

}

.core-module {
  background: linear-gradient(135deg, #e54f38 0%, #c5311b 100%);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 40px;
  margin-top: 4px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  overflow: hidden;
  position: relative;
}

.core-module::before {
  content: "";
  position: absolute;
  background-image: url("../icons/bg.svg");
  z-index: 0;
  width: 800px;
  height: 160px;
  inset-inline-end: 0;
  background-position: center;
  background-size: cover;
  opacity: 0.4;
  bottom: 0;
}

.core-module-icon {
  width: 80px;
  height: 80px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.core-module-icon img {
  width: 50px;
}


.core-module-info h2 {
  font-size: 2rem;
  font-weight: 600;
}

.core-module-info p {
  font-size: 1rem;
  opacity: 0.9;
}

.core-version {
  background: rgba(255, 255, 255, 0.25);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 600;
  backdrop-filter: blur(1px);
  border: 1px solid #ffffff33;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.module-card {
  cursor: pointer;
  background: white;
  border-radius: 12px;
  padding: 30px;
  transition: all 0.3s ease;
  border: 1px solid #f2f2f2;
  position: relative;
  overflow: hidden;
}


.module-card:hover {
  transform: translateY(-5px);
  box-shadow: rgba(0, 0, 0, 0.25) 0px 25px 20px -20px;
}

.module-card:hover::before {
  transform: scaleY(1);
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

.module-icon {
  width: 50px;
  height: 50px;
  background: #fcedeb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.module-icon img {
  width: 25px;
}

.module-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2d3436;
}

.module-version {
  display: inline-block;
  background: rgb(229 79 56 / 10%);
  border: 1px solid rgb(229 79 56 / 20%);
  color: #e54f38;
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.module-description {
  color: #636e72;
  font-size: 0.95rem;
  margin-top: 15px;
  line-height: 1.6;
}

.stats-bar {
  background: white;
  border-radius: 12px;
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  border: 1px solid #f2f2f2;
}

.stat-item {
  display: flex;
  gap: 20px;
  align-items: center;
}

.stat-item .module-icon {
  width: 80px;
  height: 80px;
}

.stat-item .module-icon img {
  width: 40px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ee5a52;
}

.stat-label {
  color: #636e72;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }

  .core-module {
    padding: 30px;
    text-align: center;
    justify-content: center;
  }

  .core-module-info h2 {
    font-size: 1.5rem;
  }

  .core-version {
    font-size: 1.2rem;
    padding: 12px 24px;
  }

  .modules-grid {
    grid-template-columns: 1fr;
  }
}

input::placeholder {
  font-size: .8rem;
}

.tabloading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.progress li.active .sec::before {
  background-color: #E54F38;
}


.list-cell-border-l {
  box-shadow: inset 0 -1px 0 0 var(--list-border-color, #e9e9e9), inset -1px 0 0 0 var(--list-border-color, #e9e9e9);
}
.list-cell-border-r {
  box-shadow: inset 0 -1px 0 0 var(--list-border-color, #e9e9e9), inset 1px 0 0 0 var(--list-border-color, #e9e9e9);
}
.list-cell-border-l-strong {
  box-shadow: inset 0 -1px 0 0 var(--list-border-color-strong, #efefef), inset -1px 0 0 0 var(--list-border-color-strong, #efefef);
}
.list-cell-border-r-strong {
  box-shadow: inset 0 -1px 0 0 var(--list-border-color-strong, #efefef), inset 1px 0 0 0 var(--list-border-color-strong, #efefef);
}

/* Search fields with start/end icons (RTL-safe) */
.horilla-search-input {
  padding-inline-start: 2.25rem;
  padding-inline-end: 2rem;
}

.horilla-search-input--toolbar {
  padding-inline-start: 0.5rem;
  padding-inline-end: 2.5rem;
}

.horilla-search-icon-start {
  position: absolute;
  inset-inline-start: 10px;
  top: 9px;
}

.horilla-search-icon-end {
  position: absolute;
  inset-inline-end: 10px;
  top: 9px;
}

.horilla-search-btn-end {
  position: absolute;
  inset-inline-end: 0.75rem;
  top: 0;
  bottom: 0;
  margin-top: auto;
  margin-bottom: auto;
  cursor: pointer;
}

.form-readonly-lock {
  position: absolute;
  inset-inline-end: 0.75rem;
  top: 0;
  bottom: 0;
  margin-top: auto;
  margin-bottom: auto;
  height: fit-content;
  pointer-events: none;
}

.file-input-clear-btn {
  position: absolute;
  top: 0.5rem;
  inset-inline-end: 0.5rem;
  z-index: 10;
}

.filter-count-badge {
  inset-inline-end: -0.5rem;
}

@media (min-width: 1024px) {
  .filter-count-badge {
    inset-inline-end: -0.25rem;
  }
}

/* Summernote's full screen mode is position: fixed, but the modal box is
   scaled by a transform, which makes it the containing block instead of the
   viewport and clips the editor inside the modal. Drop the transform while
   an editor inside it is full screen. */
.modal-box:has(.note-editor.fullscreen) {
  transform: none !important;
  transition: none !important;
}

/* The editing area is transparent and relies on the modal behind it, so a
   full screen editor needs its own background. */
.note-editor.note-frame.fullscreen {
  background-color: #fff;
}

/* Summernote sizes the full screen editing area from the window height in
   JS, which leaves a gap at the bottom and lags behind the toggle. Let the
   editor fill the viewport with flex instead. */
.note-editor.note-frame.fullscreen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.note-editor.note-frame.fullscreen .note-editing-area {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.note-editor.note-frame.fullscreen .note-editing-area .note-editable,
.note-editor.note-frame.fullscreen .note-editing-area .note-codable {
  flex: 1 1 auto;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto;
}

/* Restore list markers inside the Summernote editor: Tailwind Preflight
   resets all ul/ol to list-style: none globally, which hides numbering
   and bullets even though the toolbar's ordered/unordered list buttons
   work correctly. */
.note-editor .note-editing-area .note-editable ol,
.email-preview-content ol,
.notes-section ol {
  list-style: decimal;
  padding-inline-start: 1.5rem;
}

.note-editor .note-editing-area .note-editable ul,
.email-preview-content ul,
.notes-section ul {
  list-style: disc;
  padding-inline-start: 1.5rem;
}

.note-editor .note-editing-area .note-editable ol ol,
.note-editor .note-editing-area .note-editable ul ol,
.email-preview-content ol ol,
.email-preview-content ul ol,
.notes-section ol ol,
.notes-section ul ol {
  list-style: lower-alpha;
}

.note-editor .note-editing-area .note-editable ul ul,
.note-editor .note-editing-area .note-editable ol ul,
.email-preview-content ul ul,
.email-preview-content ol ul,
.notes-section ul ul,
.notes-section ol ul {
  list-style: circle;
}

/*
 * Detail tabs: a wide table must scroll inside its tab and never stretch the
 * tab (or push controls such as "Add Task" off screen), however many columns
 * it has now or gets later. Flex children default to min-width: auto, which
 * lets their content widen them, so reset it for the tab wrappers.
 */
.tab-content,
.tab-content > *,
[id$="-tab-contents"],
[id$="-tab-contents"] > *,
[id^="table-container-"] {
  min-width: 0;
}

/* Global HTMX loading indicator */
.htmx-indicator {
  display: none;
  pointer-events: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: flex !important;
}

/* Inline spinners (buttons, delete modals) */
.htmx-indicator.htmx-indicator-inline {
  display: none;
}
.htmx-request .htmx-indicator.htmx-indicator-inline,
.htmx-request.htmx-indicator.htmx-indicator-inline {
  display: inline-block !important;
}

/* Pagination (load more) spinner: shown only when it is the active indicator */
.pagination-indicator {
  display: none;
}
.htmx-request .pagination-indicator {
  display: none;
}
.htmx-request.pagination-indicator {
  display: inline;
}

/* Time inputs that paint the app's own clock icon as a background image: make
   Chrome's native picker button invisible, stretch it over that icon (clicking
   the icon opens the picker) and drop its stray focus outline. Inputs without
   the custom icon keep the browser's default one. */
input[type="time"][style*="clock_icon"] {
  position: relative;
}

input[type="time"][style*="clock_icon"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 40px;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  outline: none;
}

/* Filter rows: Field / Operator / Value always share one row. Space is shared by the width the row
   really has (not the screen), so a shrunk or resized filter panel gives the value column the most room
   and tightens the AND/OR box and the gaps instead of breaking the row. */
.filter-row {
  container-type: inline-size;
}

.filter-row-fields-wrap {
  container-type: inline-size;
}

.filter-row-fields-wrap > .filter-row-fields {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr);
}

.filter-row-fields > .col {
  min-width: 0;
}

@container (max-width: 439px) {
  /* The AND / OR box takes less of a short row */
  .filter-row > .w-20 {
    width: 4.5rem;
  }
}

@container (max-width: 339px) {
  .filter-row-fields-wrap > .filter-row-fields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 0.5rem;
  }

  /* Less padding inside the select boxes, so short names like "Equals" are not cut */
  .filter-row-fields .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-inline-start: 8px !important;
    padding-inline-end: 16px !important;
  }

  .filter-row-fields .select2-container--default .select2-selection--single .select2-selection__arrow {
    width: 16px;
  }
}

.filter-row .no-value-note {
  white-space: nowrap;
  overflow: hidden;
}

@container (max-width: 479px) {
  /* A "between" pair (two dates or times) goes one under the other inside the value cell.
     The "No value needed" note is not a pair: it keeps its icon and text on one line. */
  .filter-row-fields > .col:nth-child(3) .h-full.flex.gap-2:not(.no-value-note) {
    flex-wrap: wrap;
    height: auto;
  }

  /* On a narrow row (the AND box and the remove button take space) the note keeps one line */
  .filter-row .no-value-note {
    padding-inline: 0.5rem;
    gap: 0.375rem;
  }

  .filter-row-fields > .col:nth-child(3) .h-full.flex.gap-2 > .w-3\/6 {
    width: 100%;
    height: auto;
  }
}

@container (max-width: 199px) {
  .filter-row-fields-wrap > .filter-row-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Chips use the whole box: select2 keeps an empty strip on the left of the chip list */
#filterpanel .filter-row .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  padding-inline-start: 4px !important;
}

/* Filter multi-selects keep their chips on one line: global.js shows the chips that fit and adds a
   "+N" chip for the rest. The chips never shrink, so their real width can be measured. */
.filterMultiSelect + .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  flex-wrap: nowrap !important;
  overflow: hidden;
}

.filterMultiSelect + .select2-container--default .select2-selection--multiple .select2-selection__choice {
  flex: none !important;
}

.filterMultiSelect + .select2-container--default .select2-selection--multiple .select2-selection__choice.filter-summary-hidden {
  display: none !important;
}

.filterMultiSelect + .select2-container--default .select2-selection--multiple .select2-selection__choice.filter-more-chip {
  padding: 3px 8px !important;
  font-size: 0.7rem;
  cursor: default;
}

/* Value fields stay inside their cell and long values are cut with an ellipsis */
#filterpanel .filter-row .radio-group {
  flex-wrap: wrap;
  row-gap: 0.25rem;
}

#filterpanel .filter-row .select2-container {
  max-width: 100%;
}

/* The chip list must not grow to the width of its content, or the field clips the chips and scrolls */
#filterpanel .filter-row .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  min-width: 0;
  max-width: 100%;
}

#filterpanel .filter-row .select2-container--default .select2-selection--multiple .select2-selection__choice {
  max-width: calc(100% - 4px);
  min-width: 0;
  overflow: hidden;
}

#filterpanel .filter-row .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#filterpanel .filter-row .select2-container--default .select2-selection--single .select2-selection__rendered {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Filter panel: alignment only (positions and equal heights, no colours, borders or fonts) */
#filterpanel .filter-row {
  align-items: flex-start;
}

/* The remove button sits on the line of the first control, and True / False on the line of the
   other controls, even when the row is taller */
#filterpanel .filter-row-fields .col > .flex {
  align-items: flex-start;
}

#filterpanel .filter-row-fields button.w-3 {
  height: 38px;
  display: flex;
  align-items: center;
}

#filterpanel .filter-row .radio-group {
  margin-top: 0;
  min-height: 38px;
  align-items: center;
}

/* Add More Filter and the action buttons share one height and one line */
#filterpanel #filter-form > .justify-between button {
  height: 30px;
  display: inline-flex;
  align-items: center;
}

/* Filter multi-selects: the hidden inline search never adds a line under the chips */
.filterMultiSelect + .select2-container--default .select2-selection--multiple .select2-selection__rendered:not(:empty) + .select2-search--inline {
  max-height: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Segmented Yes/No (or custom labels) for BooleanField, see partials/boolean_segmented.html */
.bool-seg {
  display: flex;
  box-sizing: border-box;
  height: 38px;
  gap: 3px;
  padding: 3px;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.3s;
}
.bool-seg:hover { border-color: #e54f38; }
.bool-seg > span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #a8a8a8;
  border-radius: 4px;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
input[type="checkbox"]:not(:checked) + .bool-seg > span:first-child { background: #f0f0f0; color: #515151; }
input[type="checkbox"]:checked + .bool-seg > span:last-child { background: #e54f38; color: #fff; }
input[type="checkbox"]:focus-visible + .bool-seg { border-color: #e54f38; box-shadow: 0 0 0 3px rgba(229, 79, 56, 0.25); }
input[type="checkbox"]:disabled + .bool-seg,
input[type="checkbox"][readonly] + .bool-seg { opacity: 0.6; cursor: not-allowed; }
