body {
  background: var(--color-bg);
  margin: 0;
  font-family: system-ui, sans-serif;
}

.shg-header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 56px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  z-index: 1000;
}

.shg-layout {
  display: flex;
  padding-top: 56px;
}

.shg-sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--color-border);
  min-height: calc(100vh - 56px);
}

.shg-content {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
}

.shg-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .shg-sidebar { display: none; }
  .shg-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 56px;
    background: #fff;
    border-top: 1px solid var(--color-border);
    justify-content: space-around;
    align-items: center;
  }
  .shg-content {
    padding-bottom: 72px;
  }
}



/* ===============================
   SHG APP TOP HEADER – STRONG
   =============================== */

.shg-header {
  justify-content: space-between; /* ADD */
}

/* LEFT SIDE */
.shg-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* LOGO */
.shg-logo-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shg-logo-wrap span {
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

/* SHG NAME */
.shg-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* RIGHT SIDE – MEMBER NAME */
.shg-header-right {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
  white-space: nowrap;
}


/* ===============================
   FORCE SHG HEADER STYLES
   =============================== */

.shg-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

/* LEFT */
.shg-header .shg-header-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

/* LOGO */
.shg-header .shg-logo-wrap {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.shg-header .shg-logo-wrap span {
  color: var(--color-primary) !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}

/* SHG NAME */
.shg-header .shg-name {
  font-size: 16px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 220px !important;
}

/* RIGHT */
.shg-header .shg-header-right {
  font-size: 13px !important;
  font-weight: 500 !important;
  opacity: 0.9 !important;
}

/* ===============================
   MODAL OVERLAY
================================ */
#shg-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.6);
}

/* ===============================
   BACKDROP
================================ */
.shg-preview-backdrop {
  position: absolute;
  inset: 0;
}

/* ===============================
   PREVIEW BOX (ANCHOR CONTAINER)
================================ */
.shg-preview-box {
  position: relative;   /* 🔑 MOST IMPORTANT FIX */

  margin: auto;          /* ✅ forces perfect centering */
  left: 0;
  right: 0;

  background: #fff;
  border-radius: 18px;

  width: auto;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);

  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);

  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===============================
   CLOSE BUTTON (LOCKED TO BOX)
================================ */
.shg-preview-close {
  position: absolute;   /* relative to .shg-preview-box */
  top: 12px;
  right: 12px;

  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #ffffff;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);

  font-size: 22px;
  font-weight: 600;
  line-height: 1;

  color: #222;
  cursor: pointer;

  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  z-index: 10;
}

.shg-preview-close:active {
  transform: scale(0.95);
}

/* ===============================
   PREVIEW CONTENT
================================ */
#shg-preview-content {
  max-width: 100%;
  max-height: 100%;
}

/* IMAGE PREVIEW */
#shg-preview-content img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
}

/* PDF PREVIEW */
#shg-preview-content iframe {
  width: 90vw;
  height: 85vh;
  border: none;
}



