/* Right side panel modal */
#modalUser.right-side-panel {
  padding: 0 !important;
  overflow: visible !important;
}
#modalUser.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;
}
#modalUser.right-side-panel.show .modal-dialog {
  transform: translateX(0);
}
#modalUser.right-side-panel .modal-content {
  height: 100%;
  border-radius: 0.5rem;
  padding: 10px;
  display: flex;
  flex-direction: column;
}
#modalUser.right-side-panel .modal-dialog form {
  height: 100%;
}
#modalUser.right-side-panel .modal-body {
  flex: 1;
  overflow-y: auto;
}
#modalUser.right-side-panel .modal-footer {
  margin-top: auto;
}

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

/* Preview User Dialog */
#modalPreviewUser.right-side-panel {
  padding: 0 !important;
}
#modalPreviewUser.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;
}
#modalPreviewUser.right-side-panel.show .modal-dialog {
  transform: translateX(0);
}
#modalPreviewUser.right-side-panel .modal-content {
  height: 100%;
  border-radius: 0.5rem;
  padding: 10px;
  display: flex;
  flex-direction: column;
}
#modalPreviewUser.right-side-panel .modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
#modalPreviewUser.right-side-panel .modal-footer {
  margin-top: auto;
}
#modalPreviewUser.right-side-panel ~ .modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1060;
}
#modalPreviewUser .tab-content .tab-pane {
  padding: 0px;
  border: none;
  border-radius: none;
  color: var(--default-text-color);
}

/* Toggle password visibility */
.input-group input[name="password"],
.input-group input[name="password_confirm"] {
  border-right: none;
}
.input-group .btn-outline-secondary {
  cursor: pointer;
  color: white;
  border-color: var(--input-border);
  border-left: none;
}
.input-group .btn-outline-secondary:hover {
  background: rgb(220, 230, 245);
  color: black;
}

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

/* Password strength indicator */
#passwordStrength .progress {
  border-radius: 2px;
}
#passwordStrength .progress-bar {
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 2px;
}

/* DataTables top 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;
  position: relative;
}
.top-right .dataTables_filter input {
  padding-right: 2.5rem;
}
.top-right .dataTables_filter .users-search-clear {
  position: absolute;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  padding: 0.15rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1) !important;
  line-height: 1;
  color: #6c757d;
}
.top-right .dataTables_filter .users-search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}
.top-right .dataTables_filter .users-search-clear:hover {
  background-color: #e9ecef;
  color: #dc3545;
}
.top-right .dataTables_filter .users-search-clear:focus {
  box-shadow: none;
}
.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;
}

/* Username column with avatar */
.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-cell .avatar {
  flex-shrink: 0;
}
.user-cell .user-info {
  line-height: 1.3;
}
.user-cell .user-info .fw-bold {
  font-weight: 600;
}
.user-cell .user-info small {
  font-size: 0.75rem;
}
