button {
  cursor:pointer;
}

#toast {
    position: fixed;
    top: -20px;
    z-index: 220;
    background: #333;
    color: #fff;
    width: 80%;
    padding: 10px 15px;
    margin: auto 10%;
    display: none;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 1em;
    transition: top 0.5s ease;
    opacity: 0.9;
}

#toast.error {
  background: #dc3333;
}

#toast.visible {
    top: 60px;
}

#waiting_mask {
    display: none;
    position: fixed;
    top: 0px;
    left: 0px;
    text-align: center;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    background-image: url(ajax-loader.gif);
    background-position: 50% 50%;
    background-repeat: no-repeat;
    z-index: 200;
}


.error-message {
  display: flex;
  flex-basis: 100%;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
  margin-left: 2rem;
  color: #F65563;
  font-size: 0.875rem;
  line-height: 1.25rem;
}


/* CUSTOM POPUP */
body.popup-open {
  overflow: hidden;
}

.app-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.app-popup {
  width: min(100%, 32rem);
  max-height: min(90vh, 46rem);
  display: flex;
  flex-direction: column;
  border: 1px solid rgb(50 55 67 / 0.75);
  border-radius: 1.5rem;
  background: #0b0b0d;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.app-popup-header {
  height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgb(50 55 67 / 0.55);
  background: rgb(0 0 0 / 0.85);
}

.app-popup-title {
  min-width: 0;
  color: #f3f4f6;
  font-size: 1.25rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-popup-close {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: #bdc1ca;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.app-popup-close:hover {
  background: rgb(255 255 255 / 0.08);
  color: #f3f4f6;
}

.app-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  color: #f3f4f6;
}

/* SIDE CONTENT */

.content-shell {
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

/* Slide-in panel */
.side-content {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: #0b0b0d;
  border-left: 1px solid rgb(50 55 67 / 0.75);
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.45);
  z-index: 80;
  transform: translateX(100%);
  transition: transform 220ms ease;
  display: flex;
  flex-direction: column;
}

/* Visible state */
.side-content.side-content-visible {
  transform: translateX(0);
}

.side-content-header {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgb(50 55 67 / 0.5);
  background: rgb(0 0 0 / 0.8);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
}

#side-content-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 1.25rem;
  font-weight: 700;
  color: #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-content-close {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: #bdc1ca;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.side-content-close:hover {
  background: rgb(255 255 255 / 0.08);
  color: #f3f4f6;
}

.side-content-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  color: #f3f4f6;
}

.side-content-body.fixed_height {
  overflow-y: hidden;
}

/* Overlay */
.side-content-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.side-content-overlay.side-content-overlay-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Desktop: keep panel below/next to sidebar visually if desired */
@media (min-width: 1024px) {
  .side-content {
    width: 420px;
  }

  .side-content-overlay {
    display: none;
  }
}