/* ═══════════════════════════════════════════════════════════
   HAIR GLAM SALON PORTAL — portal.css v2.2
   Scoped under #hgp-root to prevent Elementor conflicts
   v2.2: MOBILE FIX — position:fixed root eliminates 100vw
         squeeze bug; all overlays changed to position:absolute;
         bottom-nav kept in flex flow (no more fixed clipping).
═══════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Cormorant+Garamond:wght@500;600;700&display=swap');

/* ── Design Tokens ────────────────────────────────────── */
#hgp-root {
  --hgp-purple:       #6B2D8B;
  --hgp-purple-dk:    #4A1A6B;
  --hgp-purple-lt:    #9B59B6;
  --hgp-gold:         #C9A84C;
  --hgp-gold-lt:      #E8C97A;
  --hgp-pink:         #D4548A;
  --hgp-pink-lt:      #F0A0C0;
  --hgp-bg:           #F8F4FF;
  --hgp-bg-alt:       #EDE4F7;
  --hgp-surface:      rgba(255,255,255,0.92);
  --hgp-glass:        rgba(255,255,255,0.55);
  --hgp-border:       rgba(107,45,139,0.14);
  --hgp-shadow:       rgba(107,45,139,0.12);
  --hgp-text:         #2D0050;
  --hgp-text-mid:     #6B3A8A;
  --hgp-text-muted:   rgba(45,0,80,0.5);
  --hgp-green:        #16A34A;
  --hgp-red:          #DC2626;
  --hgp-amber:        #D97706;
  --hgp-sidebar-w:    248px;
  --hgp-topbar-h:     60px;
  --hgp-bottomnav-h:  68px;  /* mobile bottom nav */
  --hgp-radius:       14px;
  --hgp-font:         'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --hgp-font-serif:   'Cormorant Garamond', Georgia, serif;
  --hgp-safe-bottom:  env(safe-area-inset-bottom, 0px);
  --hgp-safe-top:     env(safe-area-inset-top, 0px);
}

/* ── Reset ────────────────────────────────────────────── */
#hgp-root *, #hgp-root *::before, #hgp-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ══════════════════════════════════════════════════════
   FOUC PREVENTION
   Hide root until JS adds .hgp-ready (set in portal.js init)
   Prevents the layout-break flash on first load
══════════════════════════════════════════════════════ */
#hgp-root:not(.hgp-ready) {
  visibility: hidden;
  /* Belt-and-suspenders: also suppress opacity so sub-pixel rendering can't leak */
  opacity: 0;
  pointer-events: none;
}
#hgp-root.hgp-ready {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  /* Smooth reveal after preloader fades */
  transition: opacity 0.25s ease;
}

/* ══════════════════════════════════════════════════════
   ELEMENTOR FULL-WIDTH ESCAPE
   With position:fixed on #hgp-root, the portal naturally
   escapes Elementor's container. We still zero the
   wrapper padding/margin so no white gap appears above it.
══════════════════════════════════════════════════════ */
.elementor-widget-container:has(#hgp-root),
.elementor-widget-html:has(#hgp-root),
.elementor-section:has(#hgp-root) .elementor-container,
.e-con:has(#hgp-root),
.e-con-inner:has(#hgp-root) {
  padding: 0 !important;
  overflow: visible !important;
}
.elementor-section:has(#hgp-root),
.e-con:has(#hgp-root),
.elementor-element:has(#hgp-root) {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* ── v2.2 ROOT FIX ────────────────────────────────────────
   position:fixed + inset:0 REPLACES the old
   width:100vw / left:50% / margin-left:-50vw trick.

   WHY: 100vw includes the OS scrollbar width (~17px on
   Windows) and breaks inside Elementor containers that have
   their own max-width. It caused the "squeezed" layout.
   position:fixed;inset:0 is always exactly the viewport —
   no arithmetic, no scrollbar offset, no Elementor leakage.

   SIDE EFFECT: all child position:fixed elements are now
   changed to position:absolute (they live inside a fixed
   root that already fills the viewport, so absolute is
   equivalent and immune to any ancestor transform).
──────────────────────────────────────────────────────── */
#hgp-root {
  font-family: var(--hgp-font);
  color: var(--hgp-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* WP admin bar offsets — offset top only (fixed root) */
body.admin-bar #hgp-root { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar #hgp-root { top: 46px; }
}

/* Prevent page scroll behind the portal */
body:has(#hgp-root) { overflow: hidden; }

/* ══════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════ */
#hgp-root #hgp-app {
  position: absolute;
  inset: 0;
  display: flex;
  background: var(--hgp-bg);
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR (desktop)
══════════════════════════════════════════════════════ */
#hgp-root #hgp-sidebar {
  width: var(--hgp-sidebar-w);
  height: 100%;
  min-height: 0;
  background: linear-gradient(180deg, #1E0038 0%, #3A0A5E 45%, #2D0050 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  flex-shrink: 0;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 32px rgba(0,0,0,0.3);
  overflow: hidden; /* clip decorative elements */
  /* Ensure flex children (nav + bottom) never get cropped vertically */
  min-height: 0;
}

/* Decorative shimmer stripe on sidebar */
#hgp-root #hgp-sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--hgp-gold), transparent);
}

#hgp-root .hgp-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
#hgp-root .hgp-sidebar-crown {
  font-size: 1.7rem;
  animation: crownBob 3s ease-in-out infinite;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(201,168,76,0.5));
}
@keyframes crownBob { 0%,100%{transform:translateY(0) rotate(-3deg);} 50%{transform:translateY(-4px) rotate(3deg);} }

#hgp-root .hgp-sidebar-brand-text strong {
  display: block;
  color: #fff;
  font-size: 1.05rem;
  font-family: var(--hgp-font-serif);
  font-weight: 700;
  letter-spacing: 0.02em;
}
#hgp-root .hgp-sidebar-brand-text small {
  color: rgba(201,168,76,0.7);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

#hgp-root .hgp-sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-height: 0; /* critical: allows flex child to shrink so bottom stays visible */
}
#hgp-root .hgp-sidebar-nav::-webkit-scrollbar { display: none; }

#hgp-root .hgp-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, transform 0.15s;
  margin-bottom: 2px;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#hgp-root .hgp-nav-item:hover {
  background: rgba(255,255,255,0.09);
  color: #fff;
  transform: translateX(2px);
}
#hgp-root .hgp-nav-item.active {
  background: linear-gradient(90deg, rgba(201,168,76,0.22), rgba(201,168,76,0.06));
  color: var(--hgp-gold-lt);
  border-left: 3px solid var(--hgp-gold);
  padding-left: 11px;
}
#hgp-root .hgp-nav-icon {
  font-size: 1.05rem;
  width: 24px;
  text-align: center;
  font-style: normal;
  flex-shrink: 0;
}
#hgp-root .hgp-nav-badge {
  margin-left: auto;
  background: var(--hgp-pink);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

#hgp-root .hgp-sidebar-bottom {
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  margin-top: auto; /* pushes it to the very bottom of the flex column */
}
#hgp-root .hgp-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
}
#hgp-root .hgp-sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--hgp-gold);
  object-fit: cover;
  flex-shrink: 0;
}
#hgp-root .hgp-sidebar-user strong { display: block; color: #fff; font-size: 0.83rem; }
#hgp-root .hgp-sidebar-user small { color: rgba(255,255,255,0.45); font-size: 0.68rem; }
#hgp-root .hgp-btn-logout {
  width: 100%;
  padding: 10px;
  background: rgba(220,38,38,0.1);
  color: rgba(255,180,180,0.8);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: 9px;
  font-family: var(--hgp-font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
#hgp-root .hgp-btn-logout:hover {
  background: rgba(220,38,38,0.25);
  color: #fff;
  border-color: rgba(220,38,38,0.4);
}

/* ══════════════════════════════════════════════════════
   SIDEBAR OVERLAY (mobile — tap outside to close)
══════════════════════════════════════════════════════ */
#hgp-root #hgp-sidebar-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 199;
  background: rgba(15,0,30,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: hgpFadeIn 0.22s ease;
}
#hgp-root #hgp-sidebar-overlay.visible { display: block; }

/* ══════════════════════════════════════════════════════
   MAIN AREA
══════════════════════════════════════════════════════ */
#hgp-root #hgp-main {
  flex: 1;
  min-height: 0;   /* flex-child shrink fix — allows children to control their own heights */
  display: flex;
  flex-direction: column;
  overflow: hidden; /* overflow:clip has poor WebKit/Safari support; hidden is safe */
  min-width: 0;
  position: relative; /* anchor for FAB (position:absolute) */
}

/* ══════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════ */
#hgp-root #hgp-topbar {
  height: var(--hgp-topbar-h);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--hgp-border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px 0 16px;
  position: relative;
  z-index: 90;
  box-shadow: 0 1px 16px rgba(107,45,139,0.08);
  flex-shrink: 0;
}

#hgp-root #hgp-menu-toggle {
  display: none;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--hgp-purple);
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
#hgp-root #hgp-menu-toggle:hover { background: var(--hgp-bg-alt); }

#hgp-root .hgp-bc-section {
  font-weight: 700;
  font-size: 1rem;
  color: var(--hgp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hgp-root .hgp-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#hgp-root .hgp-topbar-alerts {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(217,119,6,0.1);
  color: var(--hgp-amber);
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

/* Hide name on small screens — keep avatar */
#hgp-root .hgp-topbar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hgp-text-mid);
}
#hgp-root .hgp-topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
#hgp-root .hgp-topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--hgp-border);
  object-fit: cover;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   CONTENT AREA
   height:0 + flex:1 + overflow-y:auto = reliable iOS scroll
   min-height:0 alone can fail on older Safari/Chrome mobile
══════════════════════════════════════════════════════ */
#hgp-root #hgp-content {
  flex: 1;
  height: 0;       /* Force flex child to not intrinsically size — the robust iOS fix */
  min-height: 0;
  padding: 24px 28px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain; /* prevent scroll propagating to body on Android/iOS */
  scroll-behavior: smooth;
}

/* Loading / Spinner */
#hgp-root .hgp-loading-state {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
}
#hgp-root .hgp-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--hgp-border);
  border-top-color: var(--hgp-purple);
  border-radius: 50%;
  animation: hgpSpin 0.7s linear infinite;
}
@keyframes hgpSpin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION BAR
   Primary navigation for mobile — replaces sidebar nav
══════════════════════════════════════════════════════ */
#hgp-root #hgp-bottom-nav {
  display: none; /* hidden on desktop */
}

/* ══════════════════════════════════════════════════════
   SHARED COMPONENTS
══════════════════════════════════════════════════════ */

/* Section header */
#hgp-root .hgp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 10px;
}
#hgp-root .hgp-section-head h2 {
  font-family: var(--hgp-font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--hgp-text);
}
#hgp-root .hgp-section-head h2 small {
  font-size: 0.8rem;
  color: var(--hgp-text-muted);
  font-family: var(--hgp-font);
  font-weight: 400;
  margin-left: 8px;
}
#hgp-root .hgp-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Cards */
#hgp-root .hgp-card {
  background: var(--hgp-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hgp-border);
  border-radius: var(--hgp-radius);
  padding: 20px 22px;
  box-shadow: 0 4px 20px var(--hgp-shadow);
}

/* Stat cards */
#hgp-root .hgp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
#hgp-root .hgp-stat-card {
  background: var(--hgp-surface);
  border: 1px solid var(--hgp-border);
  border-radius: var(--hgp-radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--hgp-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
#hgp-root .hgp-stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(107,45,139,0.16); }
#hgp-root .hgp-stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
#hgp-root .hgp-stat-card.purple::after { background: linear-gradient(90deg, var(--hgp-purple), var(--hgp-purple-lt)); }
#hgp-root .hgp-stat-card.gold::after   { background: linear-gradient(90deg, var(--hgp-gold),   var(--hgp-gold-lt));   }
#hgp-root .hgp-stat-card.pink::after   { background: linear-gradient(90deg, var(--hgp-pink),   var(--hgp-pink-lt));   }
#hgp-root .hgp-stat-card.green::after  { background: linear-gradient(90deg, var(--hgp-green),  #4ADE80);               }
#hgp-root .hgp-stat-card.red::after    { background: linear-gradient(90deg, var(--hgp-red),    #F87171);               }
#hgp-root .hgp-stat-card.blue::after   { background: linear-gradient(90deg, #3B82F6, #93C5FD);                         }
#hgp-root .hgp-stat-card.teal::after   { background: linear-gradient(90deg, #0D9488, #5EEAD4);                         }
#hgp-root .hgp-stat-card.purple::after { background: linear-gradient(90deg, var(--hgp-purple), var(--hgp-purple-light)); }
#hgp-root .hgp-stat-icon { font-size: 1.5rem; margin-bottom: 10px; display: block; }
#hgp-root .hgp-stat-num {
  font-family: var(--hgp-font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--hgp-text);
  line-height: 1;
}
#hgp-root .hgp-stat-label {
  font-size: 0.72rem;
  color: var(--hgp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 5px;
}

/* Clickable / filterable stat cards */
#hgp-root .hgp-stat-filter {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
#hgp-root .hgp-stat-filter:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}
#hgp-root .hgp-stat-filter:hover .hgp-stat-label::after {
  content: ' ↗';
  opacity: .6;
  font-size: .65rem;
}
#hgp-root .hgp-stat-active {
  outline: 3px solid currentColor;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.35), 0 8px 24px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}
#hgp-root .hgp-stat-active .hgp-stat-label {
  font-weight: 700;
  color: var(--hgp-text);
}

/* Buttons */
#hgp-root .hgp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 17px;
  border-radius: 9px;
  font-family: var(--hgp-font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
#hgp-root .hgp-btn-primary {
  background: linear-gradient(135deg, var(--hgp-purple-dk), var(--hgp-purple));
  color: white;
  box-shadow: 0 4px 14px rgba(107,45,139,0.3);
}
#hgp-root .hgp-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(107,45,139,0.45); }
#hgp-root .hgp-btn-primary:active { transform: translateY(0); }
#hgp-root .hgp-btn-gold { background: linear-gradient(135deg, var(--hgp-gold), var(--hgp-gold-lt)); color: #2D0050; }
#hgp-root .hgp-btn-gold:hover { opacity: 0.9; transform: translateY(-1px); }
#hgp-root .hgp-btn-danger { background: var(--hgp-red); color: white; }
#hgp-root .hgp-btn-danger:hover { background: #b91c1c; }
#hgp-root .hgp-btn-ghost { background: var(--hgp-bg-alt); color: var(--hgp-text-mid); border: 1px solid var(--hgp-border); }
#hgp-root .hgp-btn-ghost:hover { background: var(--hgp-bg); }
#hgp-root .hgp-btn-sm { padding: 5px 12px; font-size: 0.78rem; border-radius: 7px; }
#hgp-root .hgp-btn-icon { padding: 7px; border-radius: 8px; }

/* Inputs / selects */
#hgp-root .hgp-field { margin-bottom: 15px; }
#hgp-root .hgp-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--hgp-text-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
#hgp-root .hgp-input,
#hgp-root .hgp-select,
#hgp-root .hgp-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--hgp-border);
  border-radius: 9px;
  font-size: 0.9rem;
  font-family: var(--hgp-font);
  color: var(--hgp-text);
  background: var(--hgp-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
#hgp-root .hgp-input:focus,
#hgp-root .hgp-select:focus,
#hgp-root .hgp-textarea:focus {
  border-color: var(--hgp-purple);
  box-shadow: 0 0 0 3px rgba(107,45,139,0.1);
}
#hgp-root .hgp-textarea { resize: vertical; min-height: 80px; }
#hgp-root .hgp-form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
#hgp-root .hgp-form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }

/* Search bar */
#hgp-root .hgp-search-wrap { position: relative; }
#hgp-root .hgp-search-wrap .hgp-input { padding-left: 36px; }
#hgp-root .hgp-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--hgp-text-muted); font-size: 0.85rem; pointer-events: none; }

/* Table */
#hgp-root .hgp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#hgp-root .hgp-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
#hgp-root .hgp-table th {
  background: linear-gradient(90deg, rgba(107,45,139,0.07), rgba(107,45,139,0.03));
  color: var(--hgp-text-mid);
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--hgp-border);
  white-space: nowrap;
}
#hgp-root .hgp-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(107,45,139,0.05);
  color: var(--hgp-text);
  vertical-align: middle;
}
#hgp-root .hgp-table tr:last-child td { border-bottom: none; }
#hgp-root .hgp-table tr:hover td { background: rgba(107,45,139,0.025); }
#hgp-root .hgp-table .hgp-actions { display: flex; gap: 6px; align-items: center; }

/* Badges / pills */
#hgp-root .hgp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.71rem; font-weight: 700; letter-spacing: 0.04em;
}
#hgp-root .hgp-badge-pending   { background: rgba(217,119,6,0.12);  color: var(--hgp-amber);  }
#hgp-root .hgp-badge-confirmed { background: rgba(107,45,139,0.12); color: var(--hgp-purple); }
#hgp-root .hgp-badge-completed { background: rgba(22,163,74,0.12);  color: var(--hgp-green);  }
#hgp-root .hgp-badge-cancelled { background: rgba(220,38,38,0.1);   color: var(--hgp-red);    }
#hgp-root .hgp-badge-paid      { background: rgba(22,163,74,0.12);  color: var(--hgp-green);  }
#hgp-root .hgp-badge-website   { background: rgba(212,84,138,0.12); color: var(--hgp-pink);   }
#hgp-root .hgp-badge-low       { background: rgba(220,38,38,0.1);   color: var(--hgp-red);    }
#hgp-root .hgp-badge-ok        { background: rgba(22,163,74,0.1);   color: var(--hgp-green);  }
#hgp-root .hgp-badge-active    { background: rgba(22,163,74,0.1);   color: var(--hgp-green);  }
#hgp-root .hgp-badge-inactive  { background: rgba(100,100,100,0.1); color: #666;              }

/* Empty state */
#hgp-root .hgp-empty { text-align: center; padding: 60px 20px; color: var(--hgp-text-muted); }
#hgp-root .hgp-empty span { font-size: 2.5rem; display: block; margin-bottom: 12px; }

/* Tabs */
#hgp-root .hgp-tabs { display: flex; gap: 3px; border-bottom: 2px solid var(--hgp-border); margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
#hgp-root .hgp-tabs::-webkit-scrollbar { display: none; }
#hgp-root .hgp-tab {
  padding: 9px 16px; border: none; background: none;
  font-family: var(--hgp-font); font-size: 0.84rem; font-weight: 600;
  color: var(--hgp-text-muted); cursor: pointer; border-radius: 8px 8px 0 0;
  transition: all 0.18s; position: relative; white-space: nowrap; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
#hgp-root .hgp-tab.active { color: var(--hgp-purple); }
#hgp-root .hgp-tab.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--hgp-purple); border-radius: 2px; }
#hgp-root .hgp-tab:hover:not(.active) { color: var(--hgp-text); background: var(--hgp-bg-alt); }

/* ══════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════ */
#hgp-root .hgp-modal-overlay {
  position: absolute; /* was fixed; root is fixed so absolute covers same area */
  inset: 0;
  z-index: 9000;
  background: rgba(30,0,56,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: hgpFadeIn 0.2s ease;
}
@keyframes hgpFadeIn { from{opacity:0;} to{opacity:1;} }

#hgp-root .hgp-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
  animation: hgpSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes hgpSlideUp { from{transform:translateY(28px) scale(0.97);opacity:0;} to{transform:translateY(0) scale(1);opacity:1;} }

#hgp-root .hgp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 15px;
  border-bottom: 1px solid var(--hgp-border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
#hgp-root .hgp-modal-header h3 { font-size: 1.08rem; font-weight: 700; color: var(--hgp-text); }
#hgp-root .hgp-modal-close {
  background: var(--hgp-bg-alt);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--hgp-text-muted);
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
#hgp-root .hgp-modal-close:hover { background: rgba(220,38,38,0.1); color: var(--hgp-red); }
#hgp-root .hgp-modal-body { padding: 20px 24px 24px; }
#hgp-root .hgp-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hgp-border);
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════ */
#hgp-root #hgp-toast-container {
  position: absolute; /* was fixed; root is now fixed so absolute = same result */
  bottom: 24px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
#hgp-root .hgp-toast {
  background: white;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: hgpSlideInRight 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 300px;
  border-left: 4px solid;
  pointer-events: all;
}
@keyframes hgpSlideInRight { from{transform:translateX(50px);opacity:0;} to{transform:translateX(0);opacity:1;} }
#hgp-root .hgp-toast.success { border-color: var(--hgp-green); color: var(--hgp-green); }
#hgp-root .hgp-toast.error   { border-color: var(--hgp-red);   color: var(--hgp-red);   }
#hgp-root .hgp-toast.info    { border-color: var(--hgp-purple); color: var(--hgp-purple);}

/* ══════════════════════════════════════════════════════
   CONFIRM DIALOG
══════════════════════════════════════════════════════ */
#hgp-root #hgp-confirm-overlay {
  position: absolute; /* was fixed */
  inset: 0; z-index: 9100;
  background: rgba(30,0,56,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#hgp-root .hgp-confirm-box {
  background: #fff;
  border-radius: 18px;
  padding: 28px 28px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  animation: hgpSlideUp 0.22s ease;
}
#hgp-root .hgp-confirm-box p { margin-bottom: 22px; font-size: 0.95rem; color: var(--hgp-text); line-height: 1.6; }
#hgp-root .hgp-confirm-btns { display: flex; gap: 12px; justify-content: center; }

/* ══════════════════════════════════════════════════════
   DASHBOARD SPECIFICS
══════════════════════════════════════════════════════ */
#hgp-root .hgp-dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
#hgp-root .hgp-chart-bar-wrap { display: flex; flex-direction: column; gap: 8px; }
#hgp-root .hgp-chart-bar-row { display: flex; align-items: center; gap: 10px; }
#hgp-root .hgp-chart-bar-label { font-size: 0.78rem; color: var(--hgp-text-muted); width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hgp-root .hgp-chart-bar-track { flex: 1; background: var(--hgp-bg-alt); border-radius: 4px; height: 8px; overflow: hidden; }
#hgp-root .hgp-chart-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--hgp-purple), var(--hgp-purple-lt)); transition: width 0.8s ease; }
#hgp-root .hgp-chart-bar-val { font-size: 0.78rem; font-weight: 700; color: var(--hgp-text-mid); width: 60px; text-align: right; }
#hgp-root .hgp-sparkline { display: flex; align-items: flex-end; gap: 4px; height: 48px; margin-top: 8px; }
#hgp-root .hgp-sparkline-bar { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(to top, var(--hgp-purple), var(--hgp-purple-lt)); min-width: 8px; transition: height 0.6s ease; opacity: 0.8; }
#hgp-root .hgp-card-title {
  font-size: 0.82rem; font-weight: 700; color: var(--hgp-text-mid);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
#hgp-root .hgp-card-title::before { content: ''; display: block; width: 3px; height: 14px; background: var(--hgp-gold); border-radius: 2px; }

/* ══════════════════════════════════════════════════════
   REPORTS
══════════════════════════════════════════════════════ */
#hgp-root .hgp-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
#hgp-root .hgp-revenue-bar-wrap { margin-top: 8px; }
#hgp-root .hgp-revenue-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#hgp-root .hgp-revenue-bar-date { font-size: 0.72rem; color: var(--hgp-text-muted); width: 70px; }
#hgp-root .hgp-revenue-bar-track { flex: 1; background: var(--hgp-bg-alt); border-radius: 4px; height: 10px; overflow: hidden; }
#hgp-root .hgp-revenue-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--hgp-gold),var(--hgp-gold-lt)); }
#hgp-root .hgp-revenue-bar-val { font-size: 0.78rem; font-weight: 700; color: var(--hgp-gold); width: 80px; text-align: right; }

/* Inventory */
#hgp-root .hgp-low-stock-banner {
  background: rgba(220,38,38,0.07); border: 1px solid rgba(220,38,38,0.18);
  border-radius: 10px; padding: 11px 16px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; font-size: 0.85rem; color: var(--hgp-red);
}

/* Nav divider */
#hgp-root .hgp-nav-divider {
  padding: 14px 14px 5px;
  display: flex; align-items: center; gap: 8px;
}
#hgp-root .hgp-nav-divider span {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.2em; color: rgba(201,168,76,0.4);
}
#hgp-root .hgp-nav-divider::before,
#hgp-root .hgp-nav-divider::after { content: ''; flex: 1; height: 1px; background: rgba(201,168,76,0.12); }

/* Topbar alerts */
#hgp-root .hgp-approval-alert {
  background: rgba(217,119,6,0.14); color: var(--hgp-amber);
  border: 1px solid rgba(217,119,6,0.28);
  animation: hgpApprovalPulse 2.5s ease-in-out infinite;
}
@keyframes hgpApprovalPulse { 0%,100%{opacity:1;} 50%{opacity:0.65;} }

/* Pending change banner */
#hgp-root .hgp-pending-info {
  background: rgba(217,119,6,.07); border: 1px solid rgba(217,119,6,.28);
  border-left: 4px solid var(--hgp-amber); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; color: #92400E;
}
#hgp-root .hgp-badge-pending-approval { background: rgba(217,119,6,.1); color: #92400E; border: 1px solid rgba(217,119,6,.28); }

/* Approvals */
#hgp-root .hgp-approval-card {
  background: var(--hgp-surface); border: 1px solid var(--hgp-border);
  border-radius: 14px; padding: 18px 20px; margin-bottom: 12px;
  transition: all .22s; position: relative; overflow: hidden;
}
#hgp-root .hgp-approval-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(to bottom, var(--hgp-gold), var(--hgp-amber));
}
#hgp-root .hgp-approval-card:hover { box-shadow: 0 8px 28px rgba(107,45,139,.1); }
#hgp-root .hgp-approval-meta { font-size: .78rem; color: var(--hgp-text-muted); margin-bottom: 10px; }
#hgp-root .hgp-change-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
#hgp-root .hgp-diff-col { background: var(--hgp-bg); border-radius: 8px; padding: 12px 14px; }
#hgp-root .hgp-diff-label { font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
#hgp-root .hgp-diff-row { font-size: .82rem; color: var(--hgp-text); margin-bottom: 4px; }

/* Activity log */
#hgp-root .hgp-log-module { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .71rem; font-weight: 700; text-transform: capitalize; letter-spacing: .04em; background: rgba(107,45,139,.08); color: var(--hgp-purple-lt); }
#hgp-root .hgp-log-admin    { color: var(--hgp-gold); font-weight: 700; font-size: .8rem; }
#hgp-root .hgp-log-reception { color: var(--hgp-purple-lt); font-size: .8rem; }
#hgp-root .hgp-log-time     { font-size: .77rem; color: var(--hgp-text-muted); white-space: nowrap; }
#hgp-root .hgp-log-filters  { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Notification pulse */
#hgp-root .hgp-nav-item .hgp-nav-badge.new-dot { background: var(--hgp-pink); animation: hgpPulse 2s ease-in-out infinite; }
@keyframes hgpPulse { 0%,100%{opacity:1;} 50%{opacity:.6;} }

/* Profile */
#hgp-root .hgp-profile-card { display: flex; align-items: center; gap: 20px; padding: 18px 0 22px; border-bottom: 1px solid var(--hgp-border); margin-bottom: 22px; }
#hgp-root .hgp-profile-avatar { width: 70px; height: 70px; border-radius: 50%; border: 3px solid var(--hgp-gold); object-fit: cover; flex-shrink: 0; }
#hgp-root .hgp-profile-name { font-size: 1.2rem; font-weight: 700; color: var(--hgp-text); }
#hgp-root .hgp-profile-email { font-size: .84rem; color: var(--hgp-text-muted); margin: 2px 0 6px; }
#hgp-root .hgp-pw-strength { height: 4px; border-radius: 2px; margin-top: 6px; transition: all .3s; }
#hgp-root .hgp-pw-strength.weak   { background: var(--hgp-red);   width: 33%; }
#hgp-root .hgp-pw-strength.medium { background: var(--hgp-amber); width: 66%; }
#hgp-root .hgp-pw-strength.strong { background: var(--hgp-green); width: 100%; }

/* WP access */
#hgp-root .hgp-wp-access-box { background: rgba(107,45,139,.04); border: 1px solid var(--hgp-border); border-radius: 10px; padding: 16px; margin-top: 4px; }
#hgp-root .hgp-wp-linked { display: flex; align-items: center; gap: 10px; background: rgba(22,163,74,.07); border: 1px solid rgba(22,163,74,.2); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
#hgp-root .hgp-wp-linked strong { font-size: .85rem; color: var(--hgp-text); }
#hgp-root .hgp-wp-linked small  { font-size: .72rem; color: var(--hgp-text-muted); display: block; }

/* Booking */
#hgp-root .hgp-booking-source-web  { background: rgba(212,84,138,.12); color: var(--hgp-pink); }
#hgp-root .hgp-booking-source-form { background: rgba(107,45,139,.12); color: var(--hgp-purple); }
#hgp-root .hgp-badge-new      { background: rgba(212,84,138,.15); color: #B52080; }
#hgp-root .hgp-badge-read     { background: rgba(107,45,139,.1);  color: var(--hgp-purple); }
#hgp-root .hgp-badge-replied  { background: rgba(22,163,74,.12);  color: var(--hgp-green); }
#hgp-root .hgp-badge-converted{ background: rgba(22,163,74,.12);  color: var(--hgp-green); }
#hgp-root .hgp-badge-declined { background: rgba(220,38,38,.1);   color: var(--hgp-red); }

/* ══════════════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════════════ */
#hgp-root #hgp-login-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E0038 0%, #5A0A8A 45%, #B01860 100%);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  padding-top: max(20px, var(--hgp-safe-top));
  padding-bottom: max(20px, var(--hgp-safe-bottom));
}

#hgp-root .hgp-login-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#hgp-root .hgp-login-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.3; }
#hgp-root .orb1 { width:480px;height:480px;top:-15%;left:-10%;background:radial-gradient(circle,#C9A84C,transparent); }
#hgp-root .orb2 { width:360px;height:360px;bottom:-12%;right:-8%;background:radial-gradient(circle,#D4548A,transparent); }
#hgp-root .orb3 { width:280px;height:280px;top:35%;right:15%;background:radial-gradient(circle,#9B59B6,transparent);animation:hgpOrb 8s ease-in-out infinite; }
@keyframes hgpOrb { 0%,100%{transform:translate(0,0);} 50%{transform:translate(18px,-14px);} }

#hgp-root .hgp-login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 410px;
  background: rgba(255,255,255,0.93);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 26px;
  padding: 42px 38px 34px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1);
}
#hgp-root .hgp-login-logo { text-align: center; margin-bottom: 30px; }
#hgp-root .hgp-login-logo-img {
  height: 90px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
  border-radius: 10px;
  filter: drop-shadow(0 4px 16px rgba(201,168,76,0.5));
  animation: logoFloat 2.5s ease-in-out infinite;
}
#hgp-root .hgp-login-crown { font-size: 2.7rem; animation: crownBob 2.5s ease-in-out infinite; display: block; filter: drop-shadow(0 4px 12px rgba(201,168,76,0.6)); }
/* Fallback text brand name (shown when logo file is missing) */
#hgp-root .hgp-login-brand-name {
  font-family: var(--hgp-font-serif);
  font-size: 2rem; font-weight: 700;
  background: linear-gradient(135deg, var(--hgp-purple), var(--hgp-pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin: 8px 0 2px;
}
#hgp-root .hgp-login-brand-sub {
  font-size: 0.78rem; color: var(--hgp-gold); font-style: italic;
  font-family: var(--hgp-font-serif); letter-spacing: 0.08em; display: block; margin-bottom: 4px;
}
#hgp-root .hgp-login-tagline { font-size: 0.75rem; color: var(--hgp-text-muted); letter-spacing: 0.18em; text-transform: uppercase; }
#hgp-root .hgp-login-logo p { font-size: 0.75rem; color: var(--hgp-text-muted); letter-spacing: 0.18em; text-transform: uppercase; }

#hgp-root .hgp-form-group { margin-bottom: 16px; }
#hgp-root .hgp-form-group label { display: block; font-size: 0.72rem; font-weight: 700; color: var(--hgp-text-mid); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
#hgp-root .hgp-input-wrap { position: relative; display: flex; align-items: center; }
#hgp-root .hgp-icon { position: absolute; left: 13px; font-size: 0.88rem; font-style: normal; color: var(--hgp-text-muted); pointer-events: none; }
#hgp-root .hgp-input-wrap input {
  width: 100%; padding: 13px 14px 13px 40px;
  border: 1.5px solid var(--hgp-border);
  border-radius: 11px; font-size: 0.92rem;
  font-family: var(--hgp-font);
  background: var(--hgp-bg); color: var(--hgp-text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none; appearance: none;
}
#hgp-root .hgp-input-wrap input:focus { border-color: var(--hgp-purple); box-shadow: 0 0 0 3px rgba(107,45,139,0.1); }
#hgp-root .hgp-toggle-pw { position: absolute; right: 12px; background: none; border: none; cursor: pointer; font-size: 0.85rem; color: var(--hgp-text-muted); padding: 4px; -webkit-tap-highlight-color: transparent; }

#hgp-root .hgp-login-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
#hgp-root .hgp-form-check { display: flex; align-items: center; gap: 8px; }
#hgp-root .hgp-form-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--hgp-purple); }
#hgp-root .hgp-form-check label { font-size: 0.83rem; color: var(--hgp-text-muted); cursor: pointer; }

#hgp-root .hgp-forgot-link {
  background: none; border: none; color: var(--hgp-purple);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  font-family: var(--hgp-font); padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
  -webkit-tap-highlight-color: transparent;
}
#hgp-root .hgp-forgot-link:hover { color: var(--hgp-pink); }

#hgp-root .hgp-btn-login {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--hgp-purple-dk), var(--hgp-purple), var(--hgp-purple-lt));
  color: white; border: none; border-radius: 50px;
  font-family: var(--hgp-font); font-size: 1rem; font-weight: 700;
  cursor: pointer; letter-spacing: 0.04em;
  box-shadow: 0 8px 28px rgba(107,45,139,0.45);
  transition: all 0.28s;
  -webkit-tap-highlight-color: transparent;
}
#hgp-root .hgp-btn-login:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(107,45,139,0.6); }
#hgp-root .hgp-btn-login:active { transform: translateY(0); box-shadow: 0 6px 18px rgba(107,45,139,0.4); }
#hgp-root .hgp-btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

#hgp-root .hgp-login-error {
  margin-top: 14px;
  background: rgba(220,38,38,0.09);
  border: 1px solid rgba(220,38,38,0.28);
  color: var(--hgp-red);
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.85rem;
  line-height: 1.5;
}
#hgp-root .hgp-login-footer { text-align: center; margin-top: 22px; font-size: 0.73rem; color: var(--hgp-text-muted); }
#hgp-root .hgp-forgot-header { margin-bottom: 18px; }
#hgp-root .hgp-forgot-header h3 { font-family: var(--hgp-font-serif); font-size: 1.3rem; color: var(--hgp-text); margin: 8px 0 5px; }
#hgp-root .hgp-forgot-header p { font-size: 0.84rem; color: var(--hgp-text-muted); line-height: 1.6; }
#hgp-root .hgp-back-btn {
  background: none; border: none; color: var(--hgp-purple);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  font-family: var(--hgp-font); padding: 0; margin-bottom: 4px;
  display: inline-flex; align-items: center; gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
#hgp-root .hgp-back-btn:hover { color: var(--hgp-pink); }
#hgp-root .hgp-reset-msg { margin-top: 14px; padding: 11px 14px; border-radius: 9px; font-size: 0.85rem; font-weight: 600; }
#hgp-root .hgp-reset-msg.success { background: rgba(22,163,74,.1); border: 1px solid rgba(22,163,74,.3); color: var(--hgp-green); }
#hgp-root .hgp-reset-msg.error   { background: rgba(220,38,38,.1); border: 1px solid rgba(220,38,38,.3); color: var(--hgp-red); }
#hgp-root .hgp-reset-msg.info    { background: rgba(107,45,139,.1); border: 1px solid rgba(107,45,139,.3); color: var(--hgp-purple); }

/* ══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE-FIRST APP LAYOUT
   ≤900px: sidebar slides in from left, overlay appears
   ≤640px: bottom nav bar, stacked grids, full-width modals
══════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* Sidebar: off-canvas on mobile */
  #hgp-root #hgp-sidebar {
    position: absolute;
    top: 0; left: 0;
    width: 82vw;           /* narrower than viewport so content is still visible behind */
    max-width: 300px;
    /* height via top+bottom so the flex layout fills the full panel */
    height: 100%;
    transform: translateX(-110%);
    box-shadow: none;
    /* overflow:hidden on the sidebar itself — the nav handles its own scroll.
       This ensures .hgp-sidebar-bottom is ALWAYS visible at the bottom. */
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  #hgp-root #hgp-sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 40px rgba(0,0,0,0.5);
  }

  #hgp-root #hgp-menu-toggle {
    display: flex !important;
  }

  /* Hide topbar user name text on small screens */
  #hgp-root .hgp-topbar-user-name { display: none; }

  /* Stack dashboard grids */
  #hgp-root .hgp-dash-grid { grid-template-columns: 1fr; }
  #hgp-root .hgp-report-grid { grid-template-columns: 1fr; }

  /* Tablet: ensure content can scroll all the way to bottom */
  #hgp-root #hgp-content { padding-bottom: 32px; }

  /* Toast: nudge up to clear the in-flow bottom nav */
  #hgp-root #hgp-toast-container { right: 12px; bottom: calc(var(--hgp-bottomnav-h) + 12px); }
}

@media (max-width: 640px) {

  /* Content: now that bottom-nav is in flex flow (not fixed),
     we only need modest bottom padding for breathing room. */
  #hgp-root #hgp-content {
    padding: 14px 14px 24px;
  }

  /* Bottom nav — natural flex child (NOT position:fixed).
     REASON: position:fixed inside an Elementor container
     with CSS transform becomes position:absolute relative
     to that container — causing the nav to appear in the
     wrong position or be clipped. As the last flex child
     of #hgp-main it reliably anchors at the bottom. */
  #hgp-root #hgp-bottom-nav {
    display: flex;
    position: relative; /* stays in flex flow */
    height: calc(var(--hgp-bottomnav-h) + var(--hgp-safe-bottom));
    padding-bottom: var(--hgp-safe-bottom);
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-top: 1px solid rgba(107,45,139,0.1);
    box-shadow: 0 -8px 32px rgba(107,45,139,0.12);
    z-index: 300;
    align-items: stretch;
    justify-content: space-around;
    flex-shrink: 0; /* prevent the nav from being squeezed by content */
  }

  #hgp-root .hgp-bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 2px 8px;
    text-decoration: none;
    color: var(--hgp-text-muted);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--hgp-font);
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s, background 0.15s;
    position: relative;
    min-height: 56px; /* 44px min touch target + label */
  }
  #hgp-root .hgp-bnav-item:active {
    background: rgba(107,45,139,0.05);
  }
  #hgp-root .hgp-bnav-item.active {
    color: var(--hgp-purple);
  }
  /* Active pill indicator */
  #hgp-root .hgp-bnav-item.active .hgp-bnav-icon-wrap {
    background: rgba(107,45,139,0.1);
    border-radius: 14px;
  }
  #hgp-root .hgp-bnav-icon-wrap {
    width: 44px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    transition: background 0.18s;
    margin-bottom: 1px;
    position: relative;
  }
  #hgp-root .hgp-bnav-icon {
    font-size: 1.3rem;
    display: block;
    line-height: 1;
  }
  /* Badge dot on bottom nav */
  #hgp-root .hgp-bnav-dot {
    position: absolute;
    top: 2px; right: 2px;
    width: 8px; height: 8px;
    background: var(--hgp-pink);
    border-radius: 50%;
    border: 2px solid white;
  }

  /* Topbar shorter on mobile */
  #hgp-root #hgp-topbar { padding: 0 14px; }
  #hgp-root .hgp-topbar-alerts { padding: 5px 9px; font-size: 0.72rem; }

  /* Stat cards 2-col on mobile */
  #hgp-root .hgp-stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  #hgp-root .hgp-stat-card { padding: 14px 16px; }
  #hgp-root .hgp-stat-num { font-size: 1.6rem; }

  /* Chart bar: narrower label so value is never clipped on small screens */
  #hgp-root .hgp-chart-bar-label { width: 90px; }
  #hgp-root .hgp-chart-bar-val { flex-shrink: 0; width: auto; min-width: 48px; }

  /* Form rows stack on mobile */
  #hgp-root .hgp-form-row   { grid-template-columns: 1fr; }
  #hgp-root .hgp-form-row-3 { grid-template-columns: 1fr; }

  /* Modal sheet on mobile — side margins so it doesn't touch screen edges */
  #hgp-root .hgp-modal-overlay { padding: 0 14px; align-items: flex-end; }
  #hgp-root .hgp-modal {
    border-radius: 22px; /* All corners rounded since it floats with margins */
    max-height: 90vh;
    width: 100%;
    animation: hgpSheetUp 0.3s cubic-bezier(0.34, 1.1, 0.64, 1);
    margin-bottom: 0;
  }
  @keyframes hgpSheetUp { from{transform:translateY(100%);} to{transform:translateY(0);} }

  /* Confirm dialog full-width on mobile */
  #hgp-root #hgp-confirm-overlay { padding: 0; align-items: flex-end; }
  #hgp-root .hgp-confirm-box { border-radius: 22px 22px 0 0; max-width: 100%; padding: 28px 24px; }

  /* Smaller table text */
  #hgp-root .hgp-table { font-size: 0.78rem; }
  #hgp-root .hgp-table th, #hgp-root .hgp-table td { padding: 9px 10px; }

  /* Section head stacks */
  #hgp-root .hgp-section-head { flex-direction: column; align-items: flex-start; }

  /* Login card full-width */
  #hgp-root .hgp-login-card { padding: 34px 26px 28px; }
}

@media (max-width: 380px) {
  #hgp-root .hgp-stats-grid { grid-template-columns: 1fr; }
  #hgp-root .hgp-login-card { padding: 28px 20px 24px; border-radius: 22px; }
}

/* ══════════════════════════════════════════════════════
   PULL-TO-REFRESH (mobile custom implementation)
══════════════════════════════════════════════════════ */
#hgp-root #hgp-ptr-indicator {
  display: none;
  position: absolute;
  top: var(--hgp-topbar-h);
  left: 0; right: 0;
  height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(107,45,139,0.08), transparent);
  color: var(--hgp-purple);
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 50;
  pointer-events: none;
  transition: opacity 0.2s;
}
#hgp-root #hgp-ptr-indicator.visible { display: flex; }
#hgp-root #hgp-ptr-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(107,45,139,0.2);
  border-top-color: var(--hgp-purple);
  border-radius: 50%;
  animation: hgpSpin 0.7s linear infinite;
}
#hgp-root #hgp-ptr-arrow {
  font-size: 1.1rem;
  transition: transform 0.2s;
  display: inline-block;
}
#hgp-root #hgp-ptr-arrow.ready { transform: rotate(180deg); }

/* ── Sidebar close button (mobile only) ─────────────── */
#hgp-root .hgp-sidebar-close {
  display: none;
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
#hgp-root .hgp-sidebar-close:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ── Hamburger icon lines ────────────────────────────── */
#hgp-root #hgp-menu-toggle {
  flex-direction: column;
  gap: 5px;
  padding: 10px 9px;
}
#hgp-root .hgp-hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--hgp-purple);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ── Role badge in topbar ────────────────────────────── */
#hgp-root .hgp-role-badge {
  background: rgba(201,168,76,.18);
  color: #A07830;
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: .05em;
  white-space: nowrap;
}

/* ── Improved bnav-label text ────────────────────────── */
#hgp-root .hgp-bnav-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

/* ── Mobile sidebar — show close button ─────────────── */
@media (max-width: 900px) {
  #hgp-root .hgp-sidebar-close {
    display: flex;
  }
  #hgp-root .hgp-topbar-user-name { display: none; }
  #hgp-root .hgp-role-badge { display: none; }
}


/* ══════════════════════════════════════════════════════
   v1.8 — MOBILE BRAND STRIP (inside portal, flex child)
   Replaces the broken fixed-position approach.
   The WP admin bar is always hidden by the shortcode's
   inline CSS, so we inject the brand name INSIDE the
   portal HTML as the first child of #hgp-main.
   Desktop (>782px): display:none.
══════════════════════════════════════════════════════ */
#hgp-root #hgp-brand-strip {
  display: none; /* Desktop: completely hidden */
}

@media (max-width: 782px) {
  #hgp-root #hgp-brand-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    flex-shrink: 0;
    background: linear-gradient(90deg, #1E0038 0%, #3A0A5E 100%);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 92; /* above content, below sidebar overlay */
    box-shadow: 0 1px 8px rgba(0,0,0,0.25);
  }
}

/* ══════════════════════════════════════════════════════
   v1.8 — MOBILE & TABLET RESPONSIVENESS ENHANCEMENTS
══════════════════════════════════════════════════════ */

/* ── 1. Topbar: tighter on mobile so all items fit ──── */
@media (max-width: 640px) {
  #hgp-root #hgp-topbar {
    padding: 0 10px;
    gap: 8px;
  }
  #hgp-root .hgp-topbar-alerts {
    padding: 4px 7px;
    font-size: 0.7rem;
    gap: 3px;
  }
  #hgp-root .hgp-topbar-avatar {
    width: 30px; height: 30px;
  }
}

/* ── 2. Stat cards: consistent 2-col on mobile, no orphan ── */
@media (max-width: 640px) {
  #hgp-root .hgp-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  #hgp-root .hgp-stat-card {
    padding: 12px 14px;
    min-height: 0;
  }
  #hgp-root .hgp-stat-num  { font-size: 1.45rem; }
  #hgp-root .hgp-stat-label { font-size: 0.63rem; }
  #hgp-root .hgp-stat-icon { font-size: 1.2rem; margin-bottom: 4px; }
}
@media (max-width: 380px) {
  #hgp-root .hgp-stats-grid { grid-template-columns: 1fr; }
}

/* ── 3. Bar chart: flexible label width prevents right cutoff ── */
@media (max-width: 640px) {
  #hgp-root .hgp-chart-bar-label {
    width: 88px;
    font-size: 0.72rem;
  }
  #hgp-root .hgp-chart-bar-val {
    width: auto;
    min-width: 44px;
    flex-shrink: 0;
    font-size: 0.72rem;
  }
  #hgp-root .hgp-revenue-bar-date { width: 56px; font-size: 0.68rem; }
  #hgp-root .hgp-revenue-bar-val  { width: 68px; font-size: 0.72rem; }
}

/* ── 4. Tables: smaller text + sticky header on mobile ─── */
@media (max-width: 640px) {
  #hgp-root .hgp-table { font-size: 0.76rem; }
  #hgp-root .hgp-table th { font-size: 0.64rem; padding: 8px 8px; }
  #hgp-root .hgp-table td { padding: 9px 8px; }
  #hgp-root .hgp-table thead tr th:first-child,
  #hgp-root .hgp-table tbody tr td:first-child { padding-left: 12px; }
}

/* ── 5. Cards: less padding on very small screens ────── */
@media (max-width: 640px) {
  #hgp-root .hgp-card { padding: 16px 16px; }
  #hgp-root .hgp-section-head h2 { font-size: 1.25rem; }
}

/* ── 6. Form grid always single column on mobile ──────── */
@media (max-width: 640px) {
  #hgp-root .hgp-form-row,
  #hgp-root .hgp-form-row-3 { grid-template-columns: 1fr; }
}

/* ── 7. Modal: side margins so it floats, all corners rounded ─── */
@media (max-width: 640px) {
  #hgp-root .hgp-modal-overlay { padding: 0 14px; align-items: flex-end; }
  #hgp-root .hgp-modal {
    border-radius: 22px;
    max-height: 90vh;
    width: 100%;
    animation: hgpSheetUp 0.3s cubic-bezier(0.34, 1.1, 0.64, 1);
  }
  #hgp-root .hgp-confirm-box {
    border-radius: 22px;
    max-width: 100%;
    margin: 0 14px;
  }
}

/* ── 8. Content bottom padding: bottom-nav is now in flex flow,
        no special padding needed at this breakpoint ─ */
/* (handled by the main 640px block above) */

/* ── 9. Tablet: single-col dash + generous bottom padding ── */
@media (min-width: 641px) and (max-width: 900px) {
  #hgp-root #hgp-content { padding-bottom: 40px; }
  #hgp-root .hgp-dash-grid { grid-template-columns: 1fr; }
  #hgp-root .hgp-report-grid { grid-template-columns: 1fr; }
  #hgp-root .hgp-stats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ── 10. Sign-out button: larger touch target on mobile ── */
@media (max-width: 900px) {
  #hgp-root .hgp-btn-logout {
    padding: 12px 10px;
    font-size: 0.85rem;
  }
  #hgp-root .hgp-sidebar-bottom {
    padding: 14px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    position: relative; /* ensure it stays in flex flow */
  }
}

/* ── 11. Section head stacks cleanly on mobile ──────── */
@media (max-width: 640px) {
  #hgp-root .hgp-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  #hgp-root .hgp-section-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  #hgp-root .hgp-section-actions .hgp-btn {
    font-size: 0.78rem;
    padding: 8px 14px;
  }
}

/* ── 12. Tabs scroll horizontally on narrow screens ──── */
@media (max-width: 640px) {
  #hgp-root .hgp-tabs { gap: 2px; }
  #hgp-root .hgp-tab  { padding: 8px 12px; font-size: 0.75rem; }
}

/* ═══════════════════════════════════════════════════════════════
   HAIR GLAM PORTAL v2.0 — MOBILE-FIRST COMPREHENSIVE REFACTOR
   Breakpoints: 480px (small mobile) | 768px (tablet) | 1024px (desktop)
   All rules scoped under #hgp-root to prevent Elementor bleed.
═══════════════════════════════════════════════════════════════ */

/* ── Global touch-target floor ─────────────────────── */
@media (max-width: 768px) {
  #hgp-root button,
  #hgp-root .hgp-btn,
  #hgp-root select.hgp-input,
  #hgp-root .hgp-nav-item,
  #hgp-root .hgp-bnav-item {
    min-height: 44px;
  }
  #hgp-root input.hgp-input,
  #hgp-root textarea.hgp-textarea {
    min-height: 44px;
    font-size: 16px; /* prevents iOS auto-zoom */
  }
}

/* ── hgp-btn-block helper ──────────────────────────── */
#hgp-root .hgp-btn-block {
  width: 100%;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════
   TOPBAR SIGN-OUT BUTTON
   Shown on ALL screen sizes — icon only (larger icon).
   Desktop sidebar logout button is hidden to avoid duplication.
═══════════════════════════════════════════════════ */
#hgp-root .hgp-topbar-signout {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(220,38,38,0.08);
  color: var(--hgp-red, #dc2626);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: 9px;
  padding: 8px 10px;
  cursor: pointer;
  min-height: 38px;
  min-width: 38px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: var(--hgp-font);
  font-size: 1.2rem;  /* bigger icon */
}
#hgp-root .hgp-topbar-signout:hover {
  background: rgba(220,38,38,0.18);
  color: #b91c1c;
  border-color: rgba(220,38,38,0.4);
}
#hgp-root .hgp-topbar-signout:active {
  background: rgba(220,38,38,0.28);
  color: #fff;
}
/* Show label text alongside icon */
#hgp-root .hgp-signout-label {
  display: inline;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
#hgp-root .hgp-topbar-signout {
  gap: 6px;
  padding: 8px 13px;
  min-width: unset;
}

/* Hide sidebar bottom sign-out since topbar handles it */
#hgp-root .hgp-btn-logout { display: none; }

/* ═══════════════════════════════════════════════════
   TABLE — HORIZONTAL SCROLL ON MOBILE
   Same column layout as desktop, scrollable horizontally.
   No card/stacked transformation — columns are identical
   to desktop for easy tracking and comparison.
═══════════════════════════════════════════════════ */

/* Outer wrapper: clips the table and provides the scroll track */
#hgp-root .hgp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Subtle scrollbar so users know it's scrollable */
  scrollbar-width: thin;
  scrollbar-color: var(--hgp-purple-light, #c8b4e0) transparent;
  border-radius: 12px;
  /* Ensure it never overflows its container */
  max-width: 100%;
}
#hgp-root .hgp-table-wrap::-webkit-scrollbar {
  height: 5px;
}
#hgp-root .hgp-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}
#hgp-root .hgp-table-wrap::-webkit-scrollbar-thumb {
  background: var(--hgp-purple-light, #c8b4e0);
  border-radius: 4px;
}

/* Table itself: never shrink below its natural width */
#hgp-root .hgp-table {
  min-width: 640px;  /* prevents column squeeze on narrow screens */
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

/* Per-table minimum widths — keeps columns readable on each section */
#hgp-root .hgp-payments-table  { min-width: 900px; }
#hgp-root .hgp-clients-table   { min-width: 640px; }
#hgp-root .hgp-stylist-table   { min-width: 620px; }
#hgp-root .hgp-payroll-table   { min-width: 820px; }
#hgp-root .hgp-appt-table      { min-width: 720px; }
#hgp-root .hgp-staff-table     { min-width: 600px; }
#hgp-root .hgp-inventory-table { min-width: 700px; }

@media (max-width: 900px) {
  /* Tighten cell padding on narrower screens so more fits */
  #hgp-root .hgp-table th,
  #hgp-root .hgp-table td {
    padding: 9px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  /* Allow these specific columns to wrap (they contain longer text) */
  #hgp-root .hgp-table .hgp-svc-cell,
  #hgp-root .hgp-table td[data-label="Services"],
  #hgp-root .hgp-table td[data-label="Notes"],
  #hgp-root .hgp-table td[data-label="Description"] {
    white-space: normal;
    min-width: 120px;
    max-width: 180px;
    word-break: break-word;
  }
}

@media (max-width: 640px) {
  #hgp-root .hgp-table th,
  #hgp-root .hgp-table td {
    padding: 7px 8px;
    font-size: 0.76rem;
  }
  /* Buttons inside tables: compact but still tap-friendly */
  #hgp-root .hgp-table .hgp-btn-sm {
    padding: 6px 10px;
    font-size: 0.72rem;
    min-height: 32px;
    white-space: nowrap;
  }
  /* Badges: compact */
  #hgp-root .hgp-table .hgp-badge {
    font-size: 0.66rem;
    padding: 2px 7px;
  }
}

/* Scroll hint: faint right-edge gradient on the wrapper when table overflows */
@media (max-width: 900px) {
  #hgp-root .hgp-table-wrap {
    position: relative;
  }
}

/* Empty state: always full-width centered */
#hgp-root .hgp-table .hgp-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 30px 0;
  justify-content: center;
  white-space: normal;
}

/* ═══════════════════════════════════════════════════
   PROFILE PAGE — RESPONSIVE GRID
═══════════════════════════════════════════════════ */
#hgp-root .hgp-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 960px;
}
@media (max-width: 768px) {
  #hgp-root .hgp-profile-grid { grid-template-columns: 1fr; }
}

#hgp-root .hgp-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
#hgp-root .hgp-profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid var(--hgp-gold, #c9a84c);
  object-fit: cover;
  flex-shrink: 0;
}
#hgp-root .hgp-profile-info { flex: 1; min-width: 0; }
#hgp-root .hgp-profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hgp-text);
  margin-bottom: 3px;
}
#hgp-root .hgp-profile-email {
  font-size: 0.82rem;
  color: var(--hgp-text-muted);
  margin-bottom: 6px;
  word-break: break-all;
}
#hgp-root .hgp-profile-hint {
  font-size: 0.82rem;
  color: var(--hgp-text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}
#hgp-root .hgp-profile-signout-wrap {
  margin-top: 6px;
}
/* On desktop the sidebar already has sign-out; hide the inline one */
@media (min-width: 901px) {
  #hgp-root .hgp-profile-signout-wrap { display: none; }
}

/* ═══════════════════════════════════════════════════
   FLOATING ACTION BUTTON (FAB) — Mobile speed-dial
   Position: bottom-right, above the bottom-nav bar.
   Only shown on mobile (≤900px), context-aware via JS.
   position:absolute (not fixed) — parent #hgp-main is
   position:relative, so absolute positions correctly
   within the portal layout.
═══════════════════════════════════════════════════ */
#hgp-fab-container {
  position: absolute; /* was fixed — now absolute within #hgp-main */
  bottom: calc(var(--hgp-bottomnav-h, 68px) + var(--hgp-safe-bottom, 0px) + 16px);
  right: 18px;
  z-index: 800;
}

/* The main + button */
#hgp-root .hgp-fab-main,
#hgp-fab-container .hgp-fab-main {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hgp-purple, #6b2d8b) 0%, #3A0A5E 100%);
  color: #fff;
  border: none;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(107,45,139,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
}
#hgp-root .hgp-fab-main:active,
#hgp-fab-container .hgp-fab-main:active {
  transform: scale(0.93);
  box-shadow: 0 3px 12px rgba(107,45,139,0.3);
}
#hgp-fab-container .hgp-fab-main--open {
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--hgp-red, #dc2626), #7f1d1d);
}

/* Speed-dial menu */
#hgp-fab-container .hgp-fab-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.94);
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.34,1.4,0.64,1);
}
#hgp-fab-container .hgp-fab-menu.hgp-fab-menu--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Individual speed-dial items */
#hgp-fab-container .hgp-fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--hgp-border, #e8e0f0);
  border-radius: 28px;
  padding: 10px 16px 10px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--hgp-font);
  color: var(--hgp-text, #1a0a2e);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(107,45,139,0.16);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  transition: background 0.15s, transform 0.12s;
}
#hgp-fab-container .hgp-fab-item:active {
  background: var(--hgp-bg-alt, #f4eeff);
  transform: scale(0.96);
}
#hgp-fab-container .hgp-fab-item-icon { font-size: 1.15rem; }
#hgp-fab-container .hgp-fab-item-label { font-size: 0.82rem; }

/* ═══════════════════════════════════════════════════
   SECTION FILTERS — RESPONSIVE ON MOBILE
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #hgp-root .hgp-section-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  #hgp-root .hgp-section-actions .hgp-input {
    flex: 1;
    min-width: 120px;
    max-width: none !important;
    width: auto !important;
  }
  #hgp-root .hgp-section-actions .hgp-search-wrap {
    flex: 1;
    min-width: 160px;
  }
  #hgp-root .hgp-section-actions .hgp-search-wrap .hgp-input {
    width: 100% !important;
  }
  #hgp-root .hgp-section-actions .hgp-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════════════
   DASHBOARD — MOBILE SIMPLIFICATION
   On small mobile, hide "secondary" dashboard cards
   to keep the view focused on key metrics.
   User can scroll for all content on tablet+.
═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* Stat grid: single column on very small phones */
  #hgp-root .hgp-stats-grid { grid-template-columns: 1fr 1fr; }
  /* Revenue sparkline takes full row, deprioritised visually */
  #hgp-root .hgp-dash-secondary { order: 99; }
}

/* ═══════════════════════════════════════════════════
   FORMS — MOBILE-FRIENDLY TOUCH INPUTS
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #hgp-root .hgp-field label {
    font-size: 0.78rem;
    margin-bottom: 6px;
    display: block;
    font-weight: 700;
    color: var(--hgp-text-mid);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  #hgp-root .hgp-field { margin-bottom: 16px; }
  #hgp-root .hgp-modal-body { padding: 16px 18px 20px; }
  #hgp-root .hgp-modal-header { padding: 16px 18px 12px; }
  /* Full-width cancel/save in modals */
  #hgp-root .hgp-modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  #hgp-root .hgp-modal-footer .hgp-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════════════
   TYPOGRAPHY & SPACING — MOBILE TUNE
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #hgp-root .hgp-section-head h2 { font-size: 1.2rem; }
  #hgp-root .hgp-section-head h2 small { display: block; font-size: 0.72rem; margin: 2px 0 0; }
  #hgp-root .hgp-card-title { font-size: 0.75rem; letter-spacing: 0.12em; }
}
@media (max-width: 480px) {
  #hgp-root .hgp-section-head h2 { font-size: 1.05rem; }
}

/* ═══════════════════════════════════════════════════
   APPROVAL & ACTIVITY LOG CARDS — MOBILE FRIENDLY
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #hgp-root .hgp-approval-card { padding: 14px 16px; }
  #hgp-root .hgp-approval-meta { flex-wrap: wrap; font-size: 0.72rem; }
}

/* ═══════════════════════════════════════════════════
   INVENTORY DIFF CARDS — MOBILE
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #hgp-root .hgp-diff-grid { grid-template-columns: 1fr !important; }
}

/* ═══════════════════════════════════════════════════
   BOTTOM-NAV: z-index (in-flow flex child, not fixed)
═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  #hgp-root #hgp-bottom-nav { z-index: 300; }
}

/* ═══════════════════════════════════════════════════
   LOADING SKELETON (improves perceived performance)
═══════════════════════════════════════════════════ */
#hgp-root .hgp-skeleton {
  background: linear-gradient(90deg, var(--hgp-border) 25%, var(--hgp-bg-alt) 50%, var(--hgp-border) 75%);
  background-size: 200% 100%;
  animation: hgpSkeleton 1.4s ease infinite;
  border-radius: 6px;
  height: 14px;
  margin-bottom: 8px;
}
@keyframes hgpSkeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE BREAKPOINT SUMMARY (reference)
   480px  → small mobile (single-col stat cards)
   768px  → table→card transform, profile grid stacks
   900px  → sidebar becomes off-canvas, bottom nav shows
   1024px → full desktop layout
═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   v2.1 — PRELOADER, SIGN-OUT ICON, MARGINS, NOTIFICATIONS
═══════════════════════════════════════════════════════════════ */

/* ── PAGE PRELOADER ─────────────────────────────────────────── */
#hgp-preloader {
  position: absolute; /* was fixed — fixed is now the root itself */
  inset: 0;
  z-index: 99999;
  background: linear-gradient(160deg, #1E0038 0%, #3A0A5E 60%, #2D0050 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  /* No initial transition — must appear instantly on page load */
  transition: none;
}
/* Transition only kicks in when hiding */
#hgp-preloader.hgp-preloader-hiding {
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#hgp-preloader.hgp-preloader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.hgp-preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hgp-preloader-crown {
  font-size: 3rem;
  animation: crownBob 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 16px rgba(201,168,76,0.6));
}
.hgp-preloader-name {
  color: #fff;
  font-family: var(--hgp-font-serif, Georgia, serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hgp-preloader-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--hgp-gold, #c9a84c);
  border-radius: 50%;
  animation: hgpSpin 0.75s linear infinite;
  margin-top: 6px;
}

/* ── SIGN-OUT BUTTON — legacy block (overridden above) ──────── */
/* Rules moved to primary TOPBAR SIGN-OUT block earlier in file  */
#hgp-root .hgp-topbar-signout {
  /* intentionally blank — see primary block */
}
@media (max-width: 900px) {
  #hgp-root .hgp-topbar-signout {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(220,38,38,0.09);
    color: #dc2626;
    border: 1.5px solid rgba(220,38,38,0.25);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    min-height: 40px;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: var(--hgp-font);
  }
  /* No ::before icon — HTML button already contains the power symbol ⏻ + "Sign out" text */
  #hgp-root .hgp-topbar-signout::before { content: none !important; display: none !important; }
  #hgp-root .hgp-topbar-signout:active {
    background: rgba(220,38,38,0.22);
  }
}

/* ── MOBILE EDGE MARGINS (prevent content touching screen edges) ─ */
@media (max-width: 768px) {
  /* Content area: generous side padding */
  #hgp-root #hgp-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Cards: ensure they don't bleed to edges */
  #hgp-root .hgp-card {
    margin-left: 0;
    margin-right: 0;
  }

  /* Topbar: consistent horizontal padding */
  #hgp-root #hgp-topbar {
    padding-left: 14px;
    padding-right: 14px;
    gap: 10px;
  }

  /* Section head: breathing room */
  #hgp-root .hgp-section-head {
    padding-bottom: 8px;
    margin-bottom: 16px;
  }

  /* Table cards: side margins so rows have breathing room */
  #hgp-root .hgp-table tbody tr {
    margin-left: 0;
    margin-right: 0;
  }

  /* Stat grid: small gap between cards */
  #hgp-root .hgp-stats-grid { gap: 10px; }

  /* Dash grid: vertical gap */
  #hgp-root .hgp-dash-grid { gap: 14px; }

  /* Modal: generous side margins */
  #hgp-root .hgp-modal-overlay { padding: 0 18px; }

  /* Buttons in sections: slight inset from edges */
  #hgp-root .hgp-section-actions .hgp-btn { margin-left: 0; }

  /* Brand strip: comfortable text padding */
  #hgp-root #hgp-brand-strip { padding: 0 18px; }
}
@media (max-width: 480px) {
  #hgp-root #hgp-content {
    padding-left: 12px;
    padding-right: 12px;
  }
  #hgp-root .hgp-modal-overlay { padding: 0 12px; }
}

/* ── NOTIFICATION BELL BUTTON ───────────────────────────────── */
#hgp-root .hgp-notif-bell { display: none !important; } /* removed v2.5 */
.hgp-notif-bell-DISABLED {
#hgp-root .hgp-notif-bell-DISABLED:active { background: var(--hgp-border); }

/* Red badge on bell */
#hgp-root .hgp-notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: #dc2626;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  line-height: 1;
}

/* ── NOTIFICATION PANEL (dropdown) ─────────────────────────── */
#hgp-root .hgp-notif-panel { display: none !important; } /* removed v2.5 */
.hgp-notif-panel-DISABLED {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-height: 420px;
  background: #fff;
  border: 1px solid var(--hgp-border, #e8e0f0);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(107,45,139,0.18);
  z-index: 9500;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (max-width: 480px) {
  #hgp-root .hgp-notif-panel { display: none !important; } /* removed v2.5 */
.hgp-notif-panel-DISABLED {
    width: calc(100vw - 24px);
    right: -60px; /* shift left to stay on screen */
  }
}
#hgp-root .hgp-notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--hgp-border);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--hgp-text);
  flex-shrink: 0;
}
#hgp-root .hgp-notif-mark-read {
  background: none;
  border: none;
  color: var(--hgp-purple, #6b2d8b);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--hgp-font);
  padding: 0;
}
#hgp-root .hgp-notif-list {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
#hgp-root .hgp-notif-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--hgp-text-muted);
  font-size: 0.82rem;
}
#hgp-root .hgp-notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hgp-border, #e8e0f0);
  cursor: default;
  transition: background 0.12s;
}
#hgp-root .hgp-notif-item:last-child { border-bottom: none; }
#hgp-root .hgp-notif-item.unread {
  background: rgba(107,45,139,0.04);
}
#hgp-root .hgp-notif-item-title {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--hgp-text);
  margin-bottom: 4px;
  line-height: 1.3;
}
#hgp-root .hgp-notif-item-body {
  font-size: 0.75rem;
  color: var(--hgp-text-muted);
  line-height: 1.45;
  margin-bottom: 4px;
}
#hgp-root .hgp-notif-item-time {
  font-size: 0.65rem;
  color: var(--hgp-text-muted);
  opacity: 0.75;
}
/* Coloured left border per notification type */
#hgp-root .hgp-notif-item[data-type="approved"]  { border-left: 3px solid #16a34a; }
#hgp-root .hgp-notif-item[data-type="rejected"]  { border-left: 3px solid #dc2626; }
#hgp-root .hgp-notif-item[data-type="info"]      { border-left: 3px solid var(--hgp-purple); }

/* Keep topbar-right position:relative so the dropdown is positioned from it */
#hgp-root .hgp-topbar-right { position: relative; }

/* ═══════════════════════════════════════════════════════════
   PAYMENTS — MULTI-SERVICE ITEMS  (v2.3.0)
═══════════════════════════════════════════════════════════ */

/* Services section inside payment modal */
#hgp-root .hgp-services-section {
  background: var(--hgp-bg-alt);
  border: 1px solid var(--hgp-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
}
#hgp-root .hgp-services-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
#hgp-root .hgp-services-header label {
  font-size: 0.88rem;
  color: var(--hgp-text);
}
#hgp-root .hgp-service-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
#hgp-root .hgp-service-row-fields {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.5fr;
  gap: 8px;
  flex: 1;
}
#hgp-root .hgp-remove-svc {
  flex-shrink: 0;
  color: var(--hgp-text-muted);
  padding: 6px 10px;
  min-width: 36px;
}
#hgp-root .hgp-remove-svc:hover {
  color: #dc2626;
  border-color: #dc2626;
}
#hgp-root .hgp-services-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hgp-border);
  font-size: 0.92rem;
  color: var(--hgp-text-muted);
}
#hgp-root .hgp-services-total strong {
  font-size: 1.05rem;
  color: var(--hgp-purple);
}

/* Services cell in payments table */
#hgp-root .hgp-svc-cell { min-width: 180px; }
#hgp-root .hgp-svc-list { display: flex; flex-direction: column; gap: 3px; }
#hgp-root .hgp-svc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.82rem;
  padding: 2px 0;
  border-bottom: 1px dashed var(--hgp-border);
}
#hgp-root .hgp-svc-item:last-child { border-bottom: none; }
#hgp-root .hgp-svc-name { color: var(--hgp-text); flex: 1; }
#hgp-root .hgp-svc-amt  {
  color: var(--hgp-purple);
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════
   PAYMENTS TABLE — uses horizontal scroll (see .hgp-table-wrap above)
   Service rows in the payment form still stack on small screens.
═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Service row fields stack on mobile */
  #hgp-root .hgp-service-row-fields {
    grid-template-columns: 1fr;
  }
  #hgp-root .hgp-service-row {
    flex-wrap: wrap;
    background: var(--hgp-bg);
    border: 1px solid var(--hgp-border);
    border-radius: 8px;
    padding: 10px;
    align-items: flex-start;
  }
  #hgp-root .hgp-service-row-fields { flex: 100%; }
  #hgp-root .hgp-remove-svc { margin-left: auto; }
}
/* ═══════════════════════════════════════════════════════════
   PAYMENTS — FILTERS, CLIENT AUTOCOMPLETE, EXPORT  (v2.4.0)
═══════════════════════════════════════════════════════════ */

/* Section head with export + add buttons */
#hgp-root .hgp-payments-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Filter bar card */
#hgp-root .hgp-payments-filters {
  padding: 14px 18px;
  margin-bottom: 16px;
}
#hgp-root .hgp-filters-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#hgp-root .hgp-filter-search-wrap {
  flex: 1;
}
#hgp-root .hgp-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
#hgp-root .hgp-filter-search {
  width: 100%;
}

/* Client autocomplete datalist styling */
#hgp-root #hgp-p-client {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b2d8b' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  padding-left: 34px;
}

/* ── Mobile filters ─────────────────────────── */
@media (max-width: 640px) {
  #hgp-root .hgp-filters-row {
    grid-template-columns: 1fr;
  }
  #hgp-root .hgp-filters-row > .hgp-btn:last-child {
    grid-column: 1;
  }
  #hgp-root .hgp-payments-actions {
    width: 100%;
    justify-content: flex-end;
  }
  #hgp-root .hgp-section-head {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* ═══════════════════════════════════════════════════════════
   INVENTORY — CATEGORY MANAGER  (v2.5.0)
═══════════════════════════════════════════════════════════ */
#hgp-root .hgp-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--hgp-bg-alt);
  border: 1px solid var(--hgp-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
}
#hgp-root .hgp-cat-del {
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}
#hgp-root .hgp-cat-del:hover {
  opacity: 1;
  color: #dc2626;
  border-color: #dc2626;
}

/* ═══════════════════════════════════════════════════════════
   INVENTORY — CATEGORY MANAGER  (v2.5.0)
═══════════════════════════════════════════════════════════ */
#hgp-root .hgp-cat-manager {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#hgp-root .hgp-cat-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
#hgp-root .hgp-cat-add-row input { flex: 1; }
#hgp-root .hgp-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--hgp-bg-alt);
  border: 1px solid var(--hgp-border);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--hgp-text);
}
#hgp-root .hgp-btn-xs {
  font-size: 0.68rem !important;
  padding: 3px 8px !important;
  min-height: unset !important;
  height: auto !important;
  line-height: 1.4 !important;
}

/* ═══════════════════════════════════════════════════════════
   INVENTORY — MANAGE CATEGORIES MODAL  (v2.5.0)
═══════════════════════════════════════════════════════════ */
#hgp-root .hgp-cats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 4px;
}
#hgp-root .hgp-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--hgp-bg-alt);
  border: 1px solid var(--hgp-border);
  border-radius: 8px;
  gap: 10px;
}
#hgp-root .hgp-cat-name {
  font-size: 0.88rem;
  color: var(--hgp-text);
  font-weight: 500;
  flex: 1;
}
#hgp-root .hgp-cat-default {
  font-size: 0.7rem;
  color: var(--hgp-text-muted);
  background: rgba(107,45,139,0.08);
  border-radius: 20px;
  padding: 2px 9px;
  font-style: italic;
}
#hgp-root .hgp-cats-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
@media (max-width: 640px) {
  #hgp-root .hgp-cats-add { flex-direction: column; }
  #hgp-root .hgp-cats-add .hgp-input,
  #hgp-root .hgp-cats-add .hgp-btn { width: 100%; }
}

/* ── Notif bell removed — ensure no ghost space ─────── */
#hgp-root #hgp-notif-btn { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   PORTAL LOGO — sidebar, preloader, brand strip  (v2.9.0)
═══════════════════════════════════════════════════════════ */

/* Preloader logo — removed v2.9, crown emoji used instead */
#hgp-preloader .hgp-preloader-logo { display: none !important; }
@keyframes logoFloat { 0%,100%{transform:translateY(0) scale(1);} 50%{transform:translateY(-6px) scale(1.04);} }

/* Sidebar logo — removed v2.9, text-only brand */
#hgp-root .hgp-sidebar-logo { display: none !important; }

/* Mobile brand strip — HIDDEN on mobile, use text title only */
#hgp-root #hgp-brand-strip .hgp-brand-strip-logo {
  display: none;
}

/* Login page logo */
#hgp-root .hgp-login-logo-img {
  height: 90px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
  border-radius: 10px;
  filter: drop-shadow(0 4px 16px rgba(201,168,76,0.5));
  animation: logoFloat 2.5s ease-in-out infinite;
}

/* ── v2.9.1 Date Filter Bar ─────────────────────────────── */
#hgp-root .hgp-date-filter-bar {
  padding: 12px 16px;
}
#hgp-root .hgp-input-sm {
  padding: 6px 10px;
  font-size: .82rem;
  height: 34px;
}
#hgp-root .hgp-quick-filters .hgp-btn-sm {
  font-size: .78rem;
  padding: 5px 12px;
  border-radius: 20px;
  transition: background .15s, color .15s;
}
#hgp-root .hgp-count-banner {
  font-family: inherit;
}
@media (max-width: 640px) {
  #hgp-root .hgp-date-filter-bar .hgp-filters-row > div:last-child {
    margin-left: 0 !important;
    flex-wrap: wrap;
  }
  #hgp-root .hgp-input-sm { width: 100% !important; }
}

/* ── v2.9.3 Stylist Attendant styles ─────────────────────── */
#hgp-root .hgp-stylist-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: linear-gradient(135deg, rgba(107,45,139,0.12), rgba(155,89,182,0.10));
  border: 1px solid rgba(107,45,139,0.25);
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  color: #6b2d8b;
  white-space: nowrap;
}
#hgp-root .hgp-stat-card.purple {
  border-left-color: #7c3aed;
}
#hgp-root .hgp-stat-card.purple .hgp-stat-num,
#hgp-root .hgp-stat-card.purple .hgp-stat-icon { color: #7c3aed; }
#hgp-root .hgp-stat-card.green {
  border-left-color: #16a34a;
}
#hgp-root .hgp-stat-card.green .hgp-stat-num,
#hgp-root .hgp-stat-card.green .hgp-stat-icon { color: #16a34a; }
#hgp-root .hgp-stylist-table td { vertical-align: middle; }
#hgp-root .hgp-sa-date-edit { font-size: .78rem; padding: 4px 8px; height: 30px; }

/* ── v2.9.3 Payroll bonus badge ────────────────────────── */
#hgp-root .hgp-bonus-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(201,168,76,0.07));
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  color: #a07820;
  white-space: nowrap;
}
#hgp-root .hgp-bonus-badge small { font-weight: 400; font-size: .72rem; }

/* Payroll radio toggle labels */
#hgp-root .hgp-radio-label {
  padding: 7px 14px;
  border: 1px solid var(--hgp-border, #e5e7eb);
  border-radius: 8px;
  font-size: .85rem;
  transition: border-color .15s, background .15s;
}
#hgp-root .hgp-radio-label:has(input:checked) {
  border-color: var(--hgp-gold, #c9a84c);
  background: rgba(201,168,76,0.08);
  font-weight: 600;
}


/* ═══════════════════════════════════════════════════════
   COMPREHENSIVE MOBILE RESPONSIVENESS FIXES — v2.9.42
   Targets: 320px–640px devices across all portal sections
═══════════════════════════════════════════════════════ */

/* ── FIX 1: Stats grid — always 2 columns on phones ── */
@media (max-width: 480px) {
  #hgp-root .hgp-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
@media (max-width: 360px) {
  #hgp-root .hgp-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

/* ── FIX 2: Stat card number font — prevent overflow ── */
@media (max-width: 480px) {
  #hgp-root .hgp-stat-num {
    font-size: 1.35rem;
    word-break: break-all;
  }
  #hgp-root .hgp-stat-card {
    padding: 12px 10px;
  }
  #hgp-root .hgp-stat-icon {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }
  #hgp-root .hgp-stat-label {
    font-size: 0.62rem;
  }
}

/* ── FIX 3: Section head — smaller title on tiny screens ── */
@media (max-width: 380px) {
  #hgp-root .hgp-section-head h2 {
    font-size: 1.15rem;
  }
  #hgp-root .hgp-section-head h2 small {
    font-size: 0.7rem;
  }
}

/* ── FIX 4: Section actions — wrap and compact on phones ── */
@media (max-width: 480px) {
  #hgp-root .hgp-section-actions {
    width: 100%;
    justify-content: flex-end;
  }
  #hgp-root .hgp-section-actions .hgp-btn {
    padding: 8px 12px;
    font-size: 0.78rem;
  }
}
@media (max-width: 360px) {
  #hgp-root .hgp-section-actions .hgp-btn {
    padding: 7px 10px;
    font-size: 0.74rem;
    gap: 4px;
  }
}

/* ── FIX 5: Table scroll hint — right-edge fade gradient ── */
@media (max-width: 900px) {
  #hgp-root .hgp-table-wrap {
    position: relative;
  }
  /* pseudo-element fade on right edge signals scroll affordance */
  #hgp-root .hgp-table-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.85));
    pointer-events: none;
    border-radius: 0 12px 12px 0;
  }
}

/* ── FIX 6: Modal — dvh + safe keyboard clearance ── */
@media (max-width: 640px) {
  #hgp-root .hgp-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  #hgp-root .hgp-modal {
    width: 100%;
    max-width: 100%;
    /* dvh accounts for virtual keyboard; vh fallback for older browsers */
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    margin: 0;
  }
  #hgp-root .hgp-modal-body {
    max-height: calc(90vh - 120px);
    max-height: calc(90dvh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}
@media (max-width: 380px) {
  #hgp-root .hgp-modal {
    max-height: 95vh;
    max-height: 95dvh;
  }
  #hgp-root .hgp-modal-body {
    max-height: calc(93vh - 110px);
    max-height: calc(93dvh - 110px);
  }
}

/* ── FIX 7: Date filter bar — full-width inputs at 480px ── */
@media (max-width: 480px) {
  #hgp-root .hgp-date-filter-bar {
    padding: 10px 12px;
  }
  #hgp-root .hgp-date-filter-bar .hgp-filters-row {
    flex-direction: column;
    gap: 8px;
  }
  #hgp-root .hgp-date-filter-bar .hgp-filters-row > * {
    width: 100%;
  }
  #hgp-root .hgp-date-filter-bar input[type="date"],
  #hgp-root .hgp-date-filter-bar input[type="month"],
  #hgp-root .hgp-date-filter-bar input[type="number"],
  #hgp-root .hgp-date-filter-bar select {
    width: 100%;
    min-width: 0;
  }
  #hgp-root .hgp-quick-filters {
    flex-wrap: wrap;
    gap: 6px;
  }
  #hgp-root .hgp-quick-filters .hgp-btn-sm {
    font-size: 0.72rem;
    padding: 5px 10px;
  }
}

/* ── FIX 8: Form fields — safe tap targets ── */
@media (max-width: 640px) {
  #hgp-root .hgp-input,
  #hgp-root .hgp-select,
  #hgp-root .hgp-textarea {
    font-size: 16px !important; /* prevents iOS auto-zoom on focus */
    min-height: 42px;
  }
  #hgp-root .hgp-textarea {
    min-height: 80px;
  }
}

/* ── FIX 9: Payroll form — revenue display doesn't overflow ── */
@media (max-width: 480px) {
  #hgp-pr-revenue-display {
    font-size: 0.9rem !important;
    min-height: 40px;
    padding: 8px 10px;
  }
}

/* ── FIX 10: Button rows in modals — wrap on tiny screens ── */
@media (max-width: 380px) {
  #hgp-root .hgp-modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  #hgp-root .hgp-modal-footer .hgp-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── FIX 11: Table action buttons — horizontal scroll on tiny ── */
@media (max-width: 380px) {
  #hgp-root .hgp-table .hgp-actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
  }
  #hgp-root .hgp-table .hgp-btn-sm {
    padding: 5px 8px;
    font-size: 0.68rem;
    min-height: 30px;
    white-space: nowrap;
  }
}

/* ── FIX 12: Bottom nav more-panel — cap height, prevent viewport overflow ── */
#hgp-root .hgp-bnav-more-panel,
#hgp-root .hgp-more-panel {
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── FIX 13: Topbar — prevent overflow on 320px ── */
@media (max-width: 380px) {
  #hgp-root #hgp-topbar {
    padding: 0 10px;
    gap: 6px;
  }
  #hgp-root .hgp-topbar-actions {
    gap: 4px;
  }
}

/* ── FIX 14: Content padding — compact on smallest screens ── */
@media (max-width: 380px) {
  #hgp-root #hgp-content {
    padding: 10px 10px 20px;
  }
}

/* ── FIX 15: Prevent any element from breaking layout ── */
#hgp-root * {
  min-width: 0; /* allows flex children to shrink below their content width */
}

/* ═══════════════════════════════════════════════════════
   iOS SAFARI SELECT PICKER FIX
   On iOS, native <select> pickers can be blocked when the
   parent chain has overflow:hidden, CSS transforms, or
   -webkit-overflow-scrolling:touch above them.
   These rules ensure the select renders its native picker
   sheet correctly on all iOS versions.
═══════════════════════════════════════════════════════ */

/* Ensure select elements always fire the native iOS picker */
#hgp-root .hgp-select,
#hgp-root select.hgp-input {
  -webkit-appearance: menulist;  /* forces native rendering on iOS */
  appearance: auto;
  /* Override any inherited pointer-events: none that might block taps */
  pointer-events: auto;
  /* Ensure full tap target on mobile */
  touch-action: manipulation;
  position: relative;
  z-index: 1;
}

/* The modal body has overflow:auto which can clip the select on older iOS.
   The select itself needs a specific stacking context. */
@media (max-width: 900px) {
  #hgp-root .hgp-modal-body {
    /* Use scroll instead of auto — slightly better iOS compat */
    overflow-y: scroll;
    -webkit-overflow-scrolling: auto; /* NOT touch — touch can trap select events */
  }
  /* Prevent transform on modal from clipping select picker */
  #hgp-root .hgp-modal {
    /* Remove the slide-up animation on mobile that uses transform.
       On iOS, any CSS transform on an ancestor creates a new stacking
       context that can interfere with native select pickers. */
    animation: none !important;
    transform: none !important;
  }
  /* Wrapper div around selects: no overflow clipping */
  #hgp-root .hgp-field:has(.hgp-select),
  #hgp-root .hgp-field:has(select) {
    overflow: visible;
  }
}

/* Tap target: minimum 44×44px for any interactive select on touch devices */
@media (pointer: coarse) {
  #hgp-root .hgp-select {
    min-height: 44px;
    cursor: pointer;
  }
}
