html {
  font-size: 11px;
}

body {
    margin: 0;
    padding-top: 56px; /* Match the navbar height */
    font-family: Verdana, Arial, sans-serif;
}

/* Avoid unexpected scroll bar */
* {
  box-sizing: border-box;
}

/* When sidebar is collapsed */
.sidebar.collapsed + .form-body {
    margin-left: 60px;
    padding-left: 1rem;
}

/* This assumes sidebar is always present */
.form-body {
  margin-left: var(--sidebar-expanded-width);
  margin-right: var(--right-panel-collapsed-width);
  padding: 0.5rem;
  height: calc(100vh - 100px); /* exclude navbar height */
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: #f0f2f5;
  justify-content: center;
  align-items: center;
}

.dialog-container {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  flex: 1;
  height: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.formdialog-body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 100px); /* Account for fixed navbar height */
  padding: 1rem;
  background-color: #f5f6fa;
}

.formdialog-container {
  width: 100%;
  max-width: 800px;
  background-color: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
}

.ui-dialog-buttonset button {
  margin: 0 0.5rem;
}

.ui-dialog-buttonset button:focus {
  outline: none;
}

/* Ensure dialogs are always on top of the slide menu */
.ui-dialog {
  z-index: 3000;
}

.ui-widget-overlay {
  z-index: 2999; /* keep overlay just below dialog */
  background: rgba(0, 0, 0, 0.4); /* semi-transparent black */
}

.custom-dialog-overlay {
  background: rgba(0, 0, 0, 0.4); /* semi-transparent black */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.search-wrapper {
    position: relative;
    display: inline-block;
}

.search-wrapper input {
    padding-right: 28px; /* leave space for search button */
    width: 100%;
}

.search-btn {
    color: #777;
    transition: color 0.2s ease, transform 0.2s ease;
}

.search-btn:hover {
    color: greenyellow;
    transform: scale(1.15);
}


/* entity search style */
/* --- Dialog container --- */
.entity-search-dialog {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: auto; /* prevent dialog container from scrolling */
    box-sizing: border-box;
    background-color: #fff;
}

/* --- Search header: fixed at the top --- */
.search-header {
    flex: 0 0 auto;
    padding: 10px;
    background-color: #fafafa;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 5;
}

.search-header input {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

/* --- Scrollable result area only --- */
.search-result {
    flex: 1 1 auto;
    overflow-y: auto; /* <-- scrollbar here */
    overflow-x: hidden;
    padding: 0;
    margin: 0;
    height: 100%;
    min-height: 0; /* critical for flex scroll behavior */
}

/* --- Result list styles --- */
.search-result ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result li {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s ease;
}

.search-result li:hover {
    background-color: #f2f7ff;
}

.search-result li.selected {
    background-color: #007bff;
    color: white;
}

/* --- Scrollbar styling (optional aesthetic) --- */
.search-result::-webkit-scrollbar {
    width: 8px;
}

.search-result::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}

.search-result::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.35);
}

.date-range-nav-btn {
  border: none;
  background: #f3f3f3;
  color: #444;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.date-range-nav-btn:hover {
  background: #e1e1e1;
  transform: scale(1.1);
}

.date-range-display {
  font-weight: 600;
  padding: 0 0.5rem;
  min-width: 160px;
  text-align: center;
}