/* Right side panel modal */
#modalModule.right-side-panel {
  padding: 0 !important;
  position: relative;
}
#modalModule.right-side-panel .modal-dialog {
  position: fixed;
  top: 10px;
  right: 10px;
  margin: 0;
  width: 600px;
  max-width: calc(100vw - 20px);
  height: calc(100vh - 20px);
  transform: translateX(120%);
  transition: transform 0.3s ease-in-out;
  z-index: 1070;
}
#modalModule.right-side-panel.show .modal-dialog {
  transform: translateX(0);
}
#modalModule.right-side-panel .modal-content {
  height: 100%;
  border-radius: 0.5rem;
  padding: 10px;
  display: flex;
  flex-direction: column;
}
#modalModule.right-side-panel .modal-dialog form {
  height: 100%;
}
#modalModule.right-side-panel .modal-body {
  flex: 1;
  overflow-y: auto;
}
#modalModule.right-side-panel .modal-footer {
  margin-top: auto;
}

/* Backdrop untuk right-side panel: jangan tutupi header */
#modalModule.right-side-panel ~ .modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1060;
}

/* DataTables layout */
.top-left {
  float: left;
  padding-top: 0;
}
.top-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}
.top-right .dataTables_filter {
  float: none !important;
  margin: 0 !important;
}
.top-right .dt-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  float: none !important;
}
.bottom-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
}
.bottom-container .dataTables_info,
.bottom-container .dataTables_paginate {
  float: none !important;
  padding-top: 0;
}

/* Icon Picker */
#iconPickerDropdown {
  position: absolute;
  z-index: 1080;
  width: 100%;
  max-width: calc(100vw - 40px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  display: none;
  left: 0;
  top: 100%;
  background: #fff;
}
@media (prefers-color-scheme: dark) {
  #iconPickerDropdown {
    background: #1a1a2e;
  }
}

/* Multi-select groups */
#f_groups {
  min-height: 120px;
}
#f_groups option {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: 0.35rem;
}
.icon-picker-item {
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-picker-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Choices.js z-index untuk right-side panel modal */
#modalModule .choices {
  position: relative;
  z-index: 1080;
}
#modalModule .choices__list--dropdown {
  z-index: 1080 !important;
}

/* Preview Module Dialog - split layout with independent right panel scroll */
#modalPreviewModule.right-side-panel {
  padding: 0 !important;
}
#modalPreviewModule.right-side-panel .modal-dialog {
  position: fixed;
  top: 10px;
  right: 10px;
  margin: 0;
  width: 900px;
  max-width: calc(100vw - 20px);
  height: calc(100vh - 20px);
  transform: translateX(120%);
  transition: transform 0.3s ease-in-out;
  z-index: 1070;
}
#modalPreviewModule.right-side-panel.show .modal-dialog {
  transform: translateX(0);
}
#modalPreviewModule.right-side-panel .modal-content {
  height: 100%;
  border-radius: 0.5rem;
  padding: 10px;
  display: flex;
  flex-direction: column;
}
#modalPreviewModule.right-side-panel .modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#modalPreviewModule.right-side-panel .modal-footer {
  margin-top: auto;
}
#modalPreviewModule.right-side-panel ~ .modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1060;
}

.preview-row-layout {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  height: 100%;
}

.preview-col-left {
  flex: 0 0 auto;
  max-height: 100%;
  overflow: hidden;
}

.preview-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  padding: 0 !important;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--default-text-color);
}

.preview-panel-wrapper {
  flex-shrink: 0;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  overflow-y: auto;
  max-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--body-color-rgb), 0.35) transparent;
}
.preview-panel-wrapper::-webkit-scrollbar {
  width: 8px;
}
.preview-panel-wrapper::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}
.preview-panel-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(var(--body-color-rgb), 0.35);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.preview-panel-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: rgba(var(--body-color-rgb), 0.55);
  border: 0;
}
#previewGroupsTable,
#previewUsersTable {
  width: 100% !important;
}
