/* ============================================================
   SignOn 2000 — Niv Dashboard · V2 OVERRIDES (LEAN)
   Loads AFTER style.css. Contains ONLY:
     1. Top header — glass refinement
     2. Bottom sticky Liquid Glass dock (force-override original top sticky)
   Everything else stays exactly as defined in style.css.
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   1. HEADER — subtle glass refinement
   ──────────────────────────────────────────────────────────── */
.header{
  background: rgba(255,255,255,0.78) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(45,123,243,0.10);
  border-radius: 18px !important;
  padding: 12px 18px !important;
  box-shadow: 0 4px 16px rgba(54,65,83,0.06);
}
.user-avatar{
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue-brand);
}
.notif-bell-btn{
  background: #F8FAFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  transition: background .2s, color .2s, transform .15s;
}
.notif-bell-btn:hover{ background: #ECF3FF; color: var(--blue-brand); }
.notif-bell-btn:active{ transform: scale(.95); }

/* ────────────────────────────────────────────────────────────
   2. TABS NAV — FORCE to bottom sticky Liquid Glass dock
   (overrides original `position: sticky; top: 67px`)
   ──────────────────────────────────────────────────────────── */
.tabs-nav{
  position: fixed !important;
  top: auto !important;
  bottom: max(20px, env(safe-area-inset-bottom, 0px)) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 100 !important;
  display: flex !important;
  justify-content: center !important;
  padding: 0 14px !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  pointer-events: none;
}

.tabs-glass-bar{
  pointer-events: auto;
  width: 100% !important;
  max-width: 760px !important;
  position: relative;

  /* Liquid Glass */
  background: rgba(255,255,255,0.45) !important;
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid rgba(255,255,255,0.55) !important;
  border-radius: 26px !important;
  padding: 8px !important;
  box-shadow:
    0 20px 50px rgba(15,24,52,0.18),
    0 6px 16px rgba(15,24,52,0.08),
    inset 0 1px 0 rgba(255,255,255,0.65),
    inset 0 -1px 0 rgba(15,24,52,0.04) !important;
}

.tabs-glass-track{
  position: relative;
  display: flex !important;
  gap: 4px !important;
  align-items: stretch;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Sliding "liquid glass" pill indicator — slides smoothly between tabs.
   Restored: no more color flicker because inactive icons are native #2D7BF3
   (no filter), so there is nothing muddy to interpolate during the slide. */
.tabs-glass-indicator{
  display: block !important;
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  height: 100% !important;
  background: linear-gradient(135deg, #2D7BF3 0%, #0059D1 100%) !important;
  border-radius: 20px !important;
  box-shadow:
    0 8px 22px rgba(45,123,243,0.32),
    inset 0 1px 0 rgba(255,255,255,0.35) !important;
  transition:
    left .42s cubic-bezier(.22, .61, .36, 1),
    width .42s cubic-bezier(.22, .61, .36, 1) !important;
  z-index: 0;
  pointer-events: none;
  will-change: left, width;
}

/* Tab buttons — icon + label stacked, dock-style */
.tab-btn{
  position: relative;
  z-index: 1;
  flex: 1 1 0 !important;
  min-width: 0;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 9px 6px 8px !important;
  border-radius: 20px !important;
  background: transparent !important;
  border: none !important;
  color: var(--text-light);
  font-family: 'Noto Sans Hebrew', sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  /* instant color switch — no interpolation (kills the muddy mid-transition flash) */
  transition: transform .15s ease;
}
.tab-btn span{
  display: block !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  opacity: .85;
  transition: opacity .35s ease;
}
.tab-btn img, .tab-btn svg{
  width: 22px !important;
  height: 22px !important;
  flex-shrink: 0;
  /* only animate the press/lift — NOT filter/color (that caused color jumps) */
  transition: transform .2s ease !important;
}

/* ── INACTIVE icons — brand blue (#2D7BF3) instead of grayscale ── */
/* SVG-as-img: colorize via CSS filter that maps black → #2D7BF3 */
.tab-btn:not(.active) img{
  /* icons are now #2D7BF3 directly in the SVG — no filter recolor (the old
     filter approximation skewed purple). Native color = exact brand blue. */
  filter: none !important;
  opacity: 1 !important;
}
/* Inline SVG (e.g. the survey star) — uses currentColor on stroke */
.tab-btn:not(.active) svg{
  color: var(--blue-brand) !important;
  stroke: var(--blue-brand) !important;
  fill: none !important;
  filter: none !important;
  opacity: 1 !important;
}
.tab-btn:not(.active){ color: var(--blue-brand) !important; }
.tab-btn:not(.active) span{ color: var(--blue-brand) !important; opacity: .85; }

/* Hover state on inactive — full opacity */
.tab-btn:hover:not(.active) img,
.tab-btn:hover:not(.active) svg{ opacity: 1 !important; }
.tab-btn:hover:not(.active) span{ opacity: 1 !important; }

/* ── ACTIVE — white icon + text; the sliding glass pill IS the background ── */
.tab-btn.active{ color: #fff !important; }
.tab-btn.active span{ opacity: 1; color: #fff !important; }
.tab-btn.active img{
  filter: brightness(0) invert(1) !important;
}
.tab-btn.active svg{
  color: #fff !important;
  stroke: #fff !important;
  filter: none !important;
}
.tab-btn.active img,
.tab-btn.active svg{ transform: translateY(-1px) scale(1.04); }
.tab-btn:active{ transform: scale(.96); }

/* ────────────────────────────────────────────────────────────
   3. Leave room at bottom for the fixed dock
   ──────────────────────────────────────────────────────────── */
.app-container,
body{
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ────────────────────────────────────────────────────────────
   MOBILE OVERRIDES (≤640px) — header taller, logo centered,
   bell on the far left, sticky dock narrower
   ──────────────────────────────────────────────────────────── */
@media (max-width: 640px){

  /* ===== HEADER ===== */
  .header{
    position: relative !important;
    padding: 14px 16px !important;
    min-height: 66px;
    border-radius: 18px !important;
  }
  .header-content{
    gap: 12px !important;
    position: relative;
    min-height: 42px;
  }
  .header-right{
    gap: 10px !important;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
  }
  .user-avatar{
    width: 42px !important;
    height: 42px !important;
  }
  .user-name{ font-size: 14px !important; }
  .user-role{ font-size: 10.5px !important; }
  .header-center{ display: none !important; }

  /* Header-left: contains both bell + logo. We want the bell on the far
     LEFT and the logo CENTERED in the WHOLE header. Logo goes absolute-
     centered against .header (which is the position:relative ancestor).
     DO NOT set position:relative on .header-left — that would make the
     logo center inside the tiny 38px header-left box. */
  .header-left{
    gap: 0 !important;
    position: static !important;     /* let logo bubble up to .header */
  }
  .logo{
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    height: 28px !important;
    width: auto !important;
    pointer-events: none;
    z-index: 1;
  }

  /* Bell icon — bigger, rounded square, clear left position.
     Give it its own positioning context so it sits above the centered logo.
     overflow: visible ensures the badge corner doesn't get clipped. */
  .notif-bell-btn{
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    background: #F8FAFF !important;
    border: 1px solid #E5E7EB !important;
    flex-shrink: 0;
    position: relative !important;
    overflow: visible !important;
    z-index: 2;
  }
  .notif-bell-btn svg{ width: 20px; height: 20px; }

  /* Notification badge — clean iOS-style red dot, sits on the
     OUTER top corner of the button (top-right physically),
     with a white ring to separate it from the bell. */
  .notif-badge{
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    left: auto !important;
    bottom: auto !important;
    inset-inline-end: auto !important;
    inset-inline-start: auto !important;
    min-width: 20px !important;
    height: 20px !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    background: #F9513F !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid #fff !important;
    box-shadow: 0 3px 8px rgba(249, 81, 63, 0.32);
    box-sizing: border-box;
    z-index: 3 !important;
    /* display controlled by .visible class — do NOT force display here */
  }
  .notif-badge.visible {
    display: inline-flex !important;
  }
  /* Ensure no ancestor clips the badge corner */
  .header,
  .header-content,
  .header-left{
    overflow: visible !important;
  }

  /* ===== BOTTOM STICKY DOCK — wider, more spacious ===== */
  .tabs-nav{ padding: 0 12px !important; }
  .tabs-glass-bar{
    max-width: 440px !important;
    padding: 7px !important;
    border-radius: 24px !important;
  }
  .tabs-glass-track{ gap: 2px !important; }
  .tab-btn{ padding: 7px 4px !important; border-radius: 18px !important; }
  .tab-btn img, .tab-btn svg{ width: 20px !important; height: 20px !important; }
  .tab-btn span{ font-size: 10px !important; }
  .tabs-glass-indicator{ border-radius: 18px !important; }

  .app-container, body{
    padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Extra-narrow phones */
@media (max-width: 380px){
  .header{ padding: 12px 12px !important; }
  .user-avatar{ width: 38px !important; height: 38px !important; }
  .user-name{ font-size: 13px !important; }
  .logo{ height: 24px !important; }
  .notif-bell-btn{ width: 38px !important; height: 38px !important; }
  .tabs-nav{ padding: 0 10px !important; }
  .tabs-glass-bar{ max-width: 360px !important; }
}
