/* ═══════════════════════════════════════════════════
   MOKED DOMINOS — Design System v4
   Color tokens, typography, depth, glassmorphism
═══════════════════════════════════════════════════ */

:root {
  /* ── Color Tokens ── */
  --c-brand-dk:    #1a5c8a;
  --c-brand:       #2c7cb8;
  --c-brand-md:    #4a9fd4;
  --c-brand-lt:    #85b8d8;
  --c-brand-ghost: #cce4f5;
  --c-brand-tint:  #eef6fc;

  --c-red:         #e31837;
  --c-green:       #16a34a;
  --c-green-lt:    #dcfce7;
  --c-amber:       #d97706;
  --c-amber-lt:    #fef3c7;
  --c-purple:      #7c3aed;
  --c-teal:        #0e9488;

  --c-text:        #1a2a3a;
  --c-text-2:      #3d5166;
  --c-muted:       #607080;
  --c-subtle:      #94a3b8;
  --c-border:      #c8dcea;
  --c-border-lt:   #ddeefa;
  --c-surface:     #ffffff;
  --c-bg:          #b4cfe3;
  --c-bg-2:        #d0e8f5;

  /* ── Typography Scale ── */
  --t-display:  2rem;
  --t-h1:       1.5rem;
  --t-h2:       1.25rem;
  --t-h3:       1.0625rem;
  --t-h4:       0.9375rem;
  --t-body:     0.875rem;
  --t-small:    0.8125rem;
  --t-xs:       0.75rem;
  --t-2xs:      0.6875rem;
  --t-label:    0.625rem;

  --w-black:    900;
  --w-bold:     800;
  --w-semibold: 700;
  --w-medium:   600;
  --w-regular:  400;

  /* ── Depth / Shadow ── */
  --shadow-1: 0 2px 8px rgba(0,30,80,.06);
  --shadow-2: 0 4px 16px rgba(0,30,80,.09), 0 2px 6px rgba(0,30,80,.06);
  --shadow-3: 0 10px 28px rgba(0,30,80,.12), 0 4px 12px rgba(0,30,80,.08);
  --shadow-overlay: 0 20px 60px rgba(0,20,60,.22), 0 8px 24px rgba(0,20,60,.14);

  /* ── Radius ── */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-2xl:  28px;
  --r-full: 999px;

  /* ── Spacing ── */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;  --sp-10: 40px;

  /* ── Transitions ── */
  --ease-out:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-enter:  cubic-bezier(0, 0, 0.2, 1);
  --t-fast:  120ms;
  --t-base:  200ms;
  --t-slow:  320ms;

  /* ── Navbar height ── */
  --nb-h: 52px;
  --bottom-nav-h: 62px;
}

/* ── DARK MODE TOKENS ── */
html.dark {
  --c-text:    #e0eefa;
  --c-text-2:  #a8c4dc;
  --c-muted:   #607080;
  --c-subtle:  #4a6070;
  --c-border:  #2a4f6e;
  --c-border-lt:#1e3a50;
  --c-surface: #162840;
  --c-bg:      #0d1f2e;
  --c-bg-2:    #112233;
  --c-brand-tint: #1a3350;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Assistant', Arial, sans-serif;
  font-size: var(--t-body);
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  padding-bottom: var(--bottom-nav-h);
  transition: background var(--t-base) var(--ease-out),
              color var(--t-base) var(--ease-out);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-brand-lt); border-radius: var(--r-full); }

/* ── FOCUS ── */
:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ════════════════════════════════════
   NAVBAR — v4
════════════════════════════════════ */
#mainNavbar {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  height: var(--nb-h);
  background: linear-gradient(135deg, var(--c-brand-dk) 0%, var(--c-brand-md) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255,255,255,.1), 0 4px 16px rgba(0,20,60,.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 8px;
}

/* right: user + hamburger */
.nb-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.nb-user {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-md);
  padding: 5px 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}
.nb-user:hover  { background: rgba(255,255,255,.2); }
.nb-user:active { transform: scale(.96); background: rgba(255,255,255,.24); }

.nb-avatar {
  width: 26px; height: 26px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--c-red), var(--c-brand));
  color: #fff;
  font-size: var(--t-2xs);
  font-weight: var(--w-black);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.nb-name { color: #fff; font-size: var(--t-xs); font-weight: var(--w-bold); }

.nb-hamburger {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-md);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4.5px;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
  flex-shrink: 0;
}
.nb-hamburger:hover  { background: rgba(255,255,255,.2); }
.nb-hamburger:active { transform: scale(.92); }
.nb-hamburger span {
  display: block;
  width: 15px; height: 1.5px;
  background: #fff;
  border-radius: var(--r-full);
  transition: transform var(--t-base) var(--ease-out),
              opacity var(--t-base);
}
.nb-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nb-hamburger.open span:nth-child(2) { opacity: 0; }
.nb-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* center: logo — clickable to home */
.nb-center {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  pointer-events: all;
  text-decoration: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-md);
  transition: background var(--t-fast);
}
.nb-center:active { background: rgba(255,255,255,.12); }
.nb-logo { height: 28px; width: 28px; object-fit: contain; filter: brightness(0) invert(1); opacity: .88; }
.nb-brand { color: #fff; font-size: var(--t-small); font-weight: var(--w-black); letter-spacing: .1px; white-space: nowrap; }

/* left: clock only */
.nb-left { display: flex; align-items: center; flex-shrink: 0; }
#nbClock {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.2;
}
#nbClock .nbc-time {
  color: #fff;
  font-size: 15px;
  font-weight: var(--w-black);
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
#nbClock .nbc-date {
  color: rgba(255,255,255,.65);
  font-size: var(--t-label);
  font-weight: var(--w-semibold);
}

/* back bar */
.nb-back-bar {
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(192,216,236,.4);
  padding: 5px 16px;
}
.nb-back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--c-brand-dk);
  font-size: var(--t-xs); font-weight: var(--w-semibold);
  text-decoration: none;
  padding: 2px 0;
  transition: color var(--t-fast);
}
.nb-back-link:hover { color: var(--c-brand); }
html.dark .nb-back-bar { background: rgba(0,0,0,.25); border-color: rgba(0,0,0,.2); }
html.dark .nb-back-link { color: var(--c-brand-lt); }

/* ════════════════════════════════════
   DRAWER — full redesign
════════════════════════════════════ */
.nb-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base) var(--ease-out);
}
.nb-drawer-overlay.open { opacity: 1; pointer-events: all; }

.nb-drawer {
  position: fixed;
  top: 0; right: -320px;
  width: 300px; height: 100dvh;
  background: var(--c-surface);
  z-index: 301;
  box-shadow: var(--shadow-overlay);
  transition: right var(--t-slow) var(--ease-out);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.nb-drawer.open { right: 0; }

.dr-head {
  background: linear-gradient(135deg, var(--c-brand-dk) 0%, var(--c-brand-md) 100%);
  padding: 20px 18px 14px;
  flex-shrink: 0;
}
.dr-head-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dr-close {
  width: 30px; height: 30px;
  background: rgba(255,255,255,.15);
  border: none; border-radius: var(--r-full);
  color: #fff; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), transform var(--t-fast);
}
.dr-close:hover  { background: rgba(255,255,255,.25); }
.dr-close:active { transform: scale(.9); }
.dr-user-info { display: flex; align-items: center; gap: 12px; }
.dr-avatar {
  width: 48px; height: 48px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.35);
  color: #fff; font-size: 20px; font-weight: var(--w-black);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dr-name  { color: #fff; font-size: var(--t-h4); font-weight: var(--w-bold); }
.dr-role  { color: rgba(255,255,255,.72); font-size: var(--t-xs); font-weight: var(--w-semibold); margin-top: 2px; }

/* dark mode toggle in drawer */
.dr-dark-toggle {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-top: 14px;
  cursor: pointer;
}
.dr-dark-label { color: rgba(255,255,255,.9); font-size: var(--t-xs); font-weight: var(--w-semibold); }
.dr-dark-sw {
  width: 38px; height: 22px;
  background: rgba(255,255,255,.25);
  border-radius: var(--r-full);
  position: relative;
  transition: background var(--t-base);
}
.dr-dark-sw::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: var(--r-full);
  transition: transform var(--t-base) var(--ease-spring);
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
html.dark .dr-dark-sw { background: rgba(255,255,255,.5); }
html.dark .dr-dark-sw::after { transform: translateX(-16px); }

.dr-body { flex: 1; overflow-y: auto; padding: 8px 0 24px; }
.dr-section {
  padding: 9px 18px 2px;
  font-size: var(--t-label);
  font-weight: var(--w-bold);
  color: var(--c-subtle);
  text-transform: uppercase;
  letter-spacing: .7px;
}
.dr-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 18px;
  font-size: 12.5px; font-weight: 600;
  color: var(--c-text);
  text-decoration: none;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  position: relative;
  border: none; background: none; width: 100%;
  text-align: right; font-family: 'Assistant', Arial, sans-serif;
  line-height: 1.3;
}
.dr-item:hover  { background: var(--c-brand-tint); color: var(--c-brand-dk); }
.dr-item:active { background: #ddeefa; }
.dr-item.active {
  background: var(--c-brand-tint);
  color: var(--c-brand-dk);
  font-weight: 700;
}
.dr-item.active::before {
  content: '';
  position: absolute;
  right: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--c-brand);
  border-radius: var(--r-full) 0 0 var(--r-full);
}
.dr-icon { color: var(--c-muted); flex-shrink: 0; }
.dr-item:hover .dr-icon, .dr-item.active .dr-icon { color: var(--c-brand); }
.dr-item.danger { color: #c0392b; }
.dr-item.danger .dr-icon { color: #c0392b; }
.dr-divider { height: 1px; background: var(--c-border-lt); margin: 6px 0; }

/* ════════════════════════════════════
   BOTTOM NAVIGATION BAR
════════════════════════════════════ */
#bottomNav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 -4px 20px rgba(0,30,80,.1);
  display: flex;
  align-items: stretch;
  z-index: 190;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
html.dark #bottomNav {
  background: rgba(22,40,64,.95);
  border-color: rgba(255,255,255,.06);
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; cursor: pointer;
  text-decoration: none;
  color: var(--c-subtle);
  font-size: 10.5px; font-weight: 700;
  transition: color .14s ease, transform .14s ease;
  padding: 7px 0 5px;
  -webkit-tap-highlight-color: transparent;
  border: none; background: none;
  font-family: 'Assistant', Arial, sans-serif;
  position: relative;
}
.bn-item:active { transform: scale(.92); }
.bn-item.active { color: var(--c-brand); }
.bn-item.active .bn-icon { color: var(--c-brand); }
.bn-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2.5px;
  background: var(--c-brand);
  border-radius: 0 0 var(--r-full) var(--r-full);
}
.bn-icon { color: var(--c-subtle); transition: color var(--t-fast), transform var(--t-fast); }
.bn-item.active .bn-icon { transform: scale(1.1); }
.bn-badge {
  position: absolute;
  top: 4px; right: calc(50% - 18px);
  width: 16px; height: 16px;
  background: var(--c-red);
  color: #fff;
  font-size: 9px; font-weight: var(--w-black);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ════════════════════════════════════
   PAGE TRANSITIONS
════════════════════════════════════ */
.page-transition-overlay {
  position: fixed; inset: 0;
  background: var(--c-brand-dk);
  z-index: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .15s var(--ease-out);
}
.page-transition-overlay.active { opacity: .15; pointer-events: none; }

/* page enter */
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pageSlideBack {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pageFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter        { animation: pageSlideIn   .22s var(--ease-out) forwards; }
.page-enter-back   { animation: pageSlideBack .22s var(--ease-out) forwards; }
.page-fade         { animation: pageFade      .2s  var(--ease-out) forwards; }

/* staggered cards */
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.stagger-child {
  opacity: 0;
  animation: cardReveal .3s var(--ease-spring) forwards;
}
.stagger-child:nth-child(1) { animation-delay: .04s; }
.stagger-child:nth-child(2) { animation-delay: .08s; }
.stagger-child:nth-child(3) { animation-delay: .12s; }
.stagger-child:nth-child(4) { animation-delay: .16s; }
.stagger-child:nth-child(5) { animation-delay: .20s; }
.stagger-child:nth-child(6) { animation-delay: .24s; }
.stagger-child:nth-child(7) { animation-delay: .28s; }

/* ════════════════════════════════════
   FLOATING LABELS
════════════════════════════════════ */
.field-wrap {
  position: relative;
  margin-bottom: 4px;
}
.field-wrap input,
.field-wrap select,
.field-wrap textarea {
  width: 100%;
  padding: 18px 12px 6px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: 'Assistant', Arial, sans-serif;
  font-size: var(--t-body); font-weight: var(--w-semibold);
  color: var(--c-text);
  background: var(--c-surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}
.field-wrap input:focus,
.field-wrap select:focus {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px rgba(44,124,184,.12);
}
.field-label {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: var(--t-body); font-weight: var(--w-semibold);
  color: var(--c-muted);
  pointer-events: none;
  transition: all .18s var(--ease-out);
  background: transparent;
}
.field-wrap input:focus ~ .field-label,
.field-wrap input:not(:placeholder-shown) ~ .field-label,
.field-wrap select:focus ~ .field-label,
.field-wrap textarea:focus ~ .field-label {
  top: 8px;
  transform: translateY(0);
  font-size: var(--t-label);
  font-weight: var(--w-bold);
  color: var(--c-brand);
}

/* ════════════════════════════════════
   CARDS v4
════════════════════════════════════ */
.card-v4 {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-top: 3px solid var(--card-color, var(--c-brand));
  text-decoration: none;
  display: flex; flex-direction: column; gap: var(--sp-2);
  position: relative; overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              border-color var(--t-fast);
}
.card-v4:hover  { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.card-v4:active { transform: translateY(-1px) scale(.98); box-shadow: var(--shadow-1); }
.card-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--c-brand); color: #fff;
  font-size: 9px; font-weight: var(--w-black);
  padding: 2px 7px; border-radius: var(--r-full);
  letter-spacing: .3px;
}
.card-badge.new    { background: var(--c-green); }
.card-badge.update { background: var(--c-amber); }
.card-label-v4 {
  font-size: var(--t-label); font-weight: var(--w-bold);
  color: var(--c-muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.card-title-v4 { font-size: var(--t-small); font-weight: var(--w-bold); color: var(--c-brand-dk); line-height: 1.3; }
.card-desc-v4  { font-size: var(--t-2xs); font-weight: var(--w-medium); color: var(--c-muted); line-height: 1.4; }
.card-arrow-v4 { font-size: 12px; color: var(--c-brand-lt); margin-top: auto; align-self: flex-start; }

/* ════════════════════════════════════
   SKELETON v4
════════════════════════════════════ */
.sk {
  background: linear-gradient(90deg,
    var(--c-brand-ghost) 25%,
    var(--c-brand-tint) 50%,
    var(--c-brand-ghost) 75%);
  background-size: 300% 100%;
  animation: sk-shimmer 1.6s infinite var(--ease-out);
  border-radius: var(--r-sm);
}
html.dark .sk {
  background: linear-gradient(90deg, #1e3a55 25%, #243a50 50%, #1e3a55 75%);
  background-size: 300% 100%;
}
@keyframes sk-shimmer {
  0%   { background-position: 300% 0; }
  100% { background-position: -300% 0; }
}
.sk-line  { height: 14px; width: 100%; margin-bottom: 8px; }
.sk-line.w-60 { width: 60%; }
.sk-line.w-40 { width: 40%; }
.sk-line.h-20 { height: 20px; }
.sk-line.h-32 { height: 32px; }

/* ════════════════════════════════════
   EMPTY STATE v4
════════════════════════════════════ */
.empty-v4 {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--sp-10) var(--sp-6);
  text-align: center; gap: var(--sp-3);
}
.empty-v4-icon {
  width: 64px; height: 64px;
  background: var(--c-brand-tint);
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-brand-lt);
}
.empty-v4-title { font-size: var(--t-h4); font-weight: var(--w-bold); color: var(--c-text-2); }
.empty-v4-desc  { font-size: var(--t-small); color: var(--c-muted); max-width: 260px; line-height: 1.5; }

/* ════════════════════════════════════
   SUCCESS / ERROR STATES
════════════════════════════════════ */
@keyframes successPop {
  0%   { transform: scale(0) rotate(-10deg); opacity: 0; }
  60%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.success-checkmark {
  width: 56px; height: 56px;
  background: var(--c-green);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px;
  animation: successPop .4s var(--ease-spring) forwards;
  margin: 0 auto;
}

/* ════════════════════════════════════
   TOAST v4
════════════════════════════════════ */
#toastRoot {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 12px);
  left: 50%; transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  pointer-events: none;
}
.toast-v4 {
  background: #1a2a3a;
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px) scale(.94);
  transition: opacity .2s, transform .22s var(--ease-spring);
  display: flex; align-items: center; gap: 8px;
  letter-spacing: .1px;
}
.toast-v4.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-v4.success { background: var(--c-green); }
.toast-v4.error   { background: #c0392b; }
.toast-v4.warn    { background: var(--c-amber); }

/* ════════════════════════════════════
   PROGRESS INDICATOR
════════════════════════════════════ */
.page-progress {
  position: sticky; top: var(--nb-h);
  z-index: 100;
  height: 3px;
  background: var(--c-border-lt);
}
.page-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--c-brand), var(--c-brand-md));
  border-radius: var(--r-full);
  transition: width .3s var(--ease-out);
  min-width: 4px;
}

/* ════════════════════════════════════
   STICKY SECTION HEADERS
════════════════════════════════════ */
.sticky-sec {
  position: sticky;
  top: var(--nb-h);
  z-index: 50;
  background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-brand-md) 100%);
  padding: 7px 14px;
  color: #fff;
  font-size: var(--t-xs); font-weight: var(--w-bold);
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,30,80,.15);
}

/* ════════════════════════════════════
   GLASSMORPHISM CARDS
════════════════════════════════════ */
.glass {
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.5);
}
html.dark .glass {
  background: rgba(22,40,64,.7);
  border-color: rgba(255,255,255,.08);
}

/* ════════════════════════════════════
   OFFLINE BANNER v4
════════════════════════════════════ */
#offlineBanner {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 12px);
  left: 50%; transform: translateX(-50%) translateY(0);
  background: #1a2a3a;
  color: #fff;
  font-size: var(--t-xs); font-weight: var(--w-semibold);
  padding: 10px 20px;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-3);
  z-index: 5000;
  display: flex; align-items: center; gap: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}
#offlineBanner.show { opacity: 1; pointer-events: all; }

/* ════════════════════════════════════
   DARK MODE overrides (non-report)
════════════════════════════════════ */
html.dark .tabs-shell,
html.dark .tab-panel,
html.dark .panel {
  background: var(--c-surface) !important;
  border-color: var(--c-border) !important;
}
html.dark .tab-button {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
}
html.dark .tab-button.active {
  background: var(--c-brand) !important;
  border-color: var(--c-brand) !important;
}
html.dark .action-card,
html.dark .card-v4 {
  background: var(--c-surface) !important;
  border-color: var(--c-border) !important;
}
html.dark .hero-card {
  background: linear-gradient(135deg, #0d2a3d 0%, #1a5c8a 100%) !important;
}
html.dark .status-panel { background: rgba(22,40,64,.8) !important; border-color: var(--c-border) !important; }
html.dark .login-card { background: var(--c-surface) !important; }
html.dark input, html.dark select { background: var(--c-bg-2) !important; color: var(--c-text) !important; border-color: var(--c-border) !important; }

/* ════════════════════════════════════
   MOBILE responsive
════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --nb-h: 48px; }
  .nb-brand { display: none; }
  .nb-name  { display: none; }
  #nbClock .nbc-date { display: none; }
  #nbClock .nbc-time { font-size: 13px; }
}

/* hide bottom nav on desktop */
@media (min-width: 768px) {
  #bottomNav { display: none; }
  body { padding-bottom: 0; }
  #toastRoot { bottom: 16px; }
  #offlineBanner { bottom: 16px; }
}

/* ── METRIC PROGRESS (reusable) ── */
.metric-bar-wrap { height: 8px; background: var(--c-border-lt); border-radius: var(--r-full); overflow: hidden; }
.metric-bar { height: 100%; border-radius: var(--r-full); background: var(--c-brand); width: 0%; transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Tab group emoji */
.tab-emoji{font-size:18px;flex-shrink:0;line-height:1;}

/* ═══════════════════════════════════════════════
   שלב 6 — UX STRUCTURE additions
═══════════════════════════════════════════════ */

/* ── SUB-BAR (back + page title + home) ── */
.nb-sub-bar {
  width: 100%;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(192,216,236,.5);
  padding: 5px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  position: sticky;
  top: var(--nb-h);
  z-index: 190;
}
.nb-sub-bar-home {
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
}
.nb-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--c-brand-dk, #1a5c8a);
  font-size: 12.5px;
  font-weight: 700;
  font-family: 'Assistant', Arial, sans-serif;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 7px;
  transition: background .12s, color .12s, transform .1s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.nb-back-btn:hover  { background: rgba(44,124,184,.1); color: var(--c-brand, #2c7cb8); }
.nb-back-btn:active { transform: scale(.95); }
.nb-page-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text-2, #3d5166);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nb-page-title-home {
  color: transparent;
  pointer-events: none;
}
.nb-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  color: var(--c-brand-dk, #1a5c8a);
  text-decoration: none;
  flex-shrink: 0;
  transition: background .12s, transform .1s;
}
.nb-home-btn:hover  { background: rgba(44,124,184,.1); }
.nb-home-btn:active { transform: scale(.92); }

html.dark .nb-sub-bar {
  background: rgba(22,40,64,.88);
  border-color: rgba(0,0,0,.22);
}
html.dark .nb-back-btn,
html.dark .nb-home-btn { color: var(--c-brand-lt, #85b8d8); }
html.dark .nb-page-title { color: var(--c-text-2, #a8c4dc); }

/* body padding accounts for sub-bar */
body {
  padding-bottom: max(var(--bottom-nav-h, 60px), env(safe-area-inset-bottom, 0px));
}

/* ── BOTTOM NAV label ── */
.bn-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* ── MICRO-INTERACTIONS ── */

/* Cards */
.hb-card, .pa-metric, .pa-imp, .pa-insight, .pa-tool,
.hb-qbtn, .card-v4, .tool-card, .pa-tool {
  will-change: transform;
}
.hb-card:hover, .pa-metric:hover, .pa-insight:hover {
  transform: translateY(-3px) !important;
}
.hb-card:active, .pa-metric:active, .hb-qbtn:active, .pa-tool:active {
  transform: scale(.97) !important;
  transition-duration: .08s !important;
}

/* Buttons ripple effect */
button:not(.nb-back-btn):not(.dr-close):not(.nb-hamburger):not(.bn-item) {
  position: relative;
  overflow: hidden;
}
button:not(.nb-back-btn):not(.dr-close):not(.nb-hamburger):not(.bn-item)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.2);
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
button:not(.nb-back-btn):not(.dr-close):not(.nb-hamburger):not(.bn-item):active::after {
  opacity: 1;
}

/* ── VISUAL HIERARCHY IMPROVEMENTS ── */

/* Section headers — stronger */
.hb-section-head {
  padding-bottom: 10px !important;
  border-bottom-width: 2px !important;
}
.hb-section-title {
  font-size: 16px !important;
  font-weight: 800 !important;
}

/* Spacing between sections */
.hb-section + .hb-section,
.pa-section + .pa-section { margin-top: 4px; }

/* Card groups — consistent shadow */
.hb-grid .hb-card:hover,
.hb-grid-4 .hb-card:hover { box-shadow: 0 8px 24px rgba(44,124,184,.14) !important; }

/* ── PROGRESS BAR ANIMATION ENHANCEMENT ── */
.pa-bar {
  position: relative;
  overflow: hidden;
}
.pa-bar::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: -60%;
  width: 40%;
  background: rgba(255,255,255,.35);
  transform: skewX(-20deg);
  animation: barShine 2.5s ease infinite 1.4s;
}
@keyframes barShine {
  0%   { left: -60%; }
  100% { left: 120%; }
}

/* ── LOADING SKELETON for dynamic grids ── */
.sk-metric {
  height: 180px;
  border-radius: 12px;
}
.sk-imp {
  height: 100px;
  border-radius: 10px;
}

/* ── EMPTY STATE for grids ── */
.grid-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 20px;
  color: var(--c-subtle, #94a3b8);
  font-size: 13.5px;
  font-weight: 700;
}
.grid-empty svg { opacity: .35; }

/* ── CONSISTENT FOCUS RING ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2.5px solid var(--c-brand, #2c7cb8);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── NO HORIZONTAL SCROLL ── */
html, body { overflow-x: hidden; max-width: 100vw; }

/* ── DESKTOP LAYOUT improvements ── */
@media (min-width: 768px) {
  .nb-sub-bar { padding: 5px 24px; }
  .hb-hero { padding: 24px 24px 22px; }
  .hb-quick { margin-top: 24px; }
  .hb-main  { margin-top: 24px; }
}

/* ── MOBILE fine-tuning ── */
@media (max-width: 640px) {
  .nb-sub-bar { padding: 4px 12px; min-height: 32px; }
  .nb-back-btn { font-size: 12px; }
  .nb-page-title { font-size: 12px; }
}

/* ══════════════════════════════════════════
   שלב 12 — Navigation Excellence
══════════════════════════════════════════ */

/* ── DRAWER SEARCH ── */
.dr-search-wrap {
  position: relative;
  padding: 12px 16px 8px;
  flex-shrink: 0;
}
.dr-search {
  width: 100%; border: 1.5px solid rgba(255,255,255,.2);
  border-radius: var(--r-md); background: rgba(255,255,255,.12);
  color: #fff; font-family: 'Assistant', Arial, sans-serif;
  font-size: 13px; font-weight: 600;
  padding: 9px 36px 9px 12px;
  outline: none; transition: border-color .14s, background .14s;
}
.dr-search::placeholder { color: rgba(255,255,255,.45); }
.dr-search:focus {
  border-color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.18);
}
.dr-search-icon {
  position: absolute;
  left: 28px; top: 50%; transform: translateY(-50%);
  pointer-events: none;
  color: rgba(255,255,255,.45);
  margin-top: 4px;
}

/* ── DRAWER SHORTCUTS ── */
.dr-shortcuts {
  padding: 6px 16px 12px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 4px;
}
.dr-shortcuts-label {
  font-size: 9.5px; font-weight: 700;
  color: rgba(255,255,255,.45); text-transform: uppercase;
  letter-spacing: .7px; margin-bottom: 6px; display: block;
}
.dr-shortcuts-row {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.dr-shortcut {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.9); border-radius: 7px;
  padding: 5px 10px; font-size: 11.5px; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: background .12s; white-space: nowrap;
  font-family: 'Assistant', Arial, sans-serif;
}
.dr-shortcut:hover  { background: rgba(255,255,255,.22); }
.dr-shortcut:active { transform: scale(.96); }

/* ── DRAWER EMPTY SEARCH STATE ── */
.dr-empty-search {
  flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 16px; color: rgba(255,255,255,.45);
  font-size: 13px; font-weight: 600; text-align: center;
}

/* ── BREADCRUMB (desktop only) ── */
.nb-breadcrumb {
  display: none; /* only on desktop */
  align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  color: var(--c-muted);
  margin-right: auto;
  overflow: hidden; white-space: nowrap;
}
.nb-bc-item { color: var(--c-muted); }
.nb-bc-current { color: var(--c-brand-dk); font-weight: 700; }
.nb-bc-sep { color: var(--c-subtle); font-size: 10px; }

@media (min-width: 768px) {
  .nb-breadcrumb { display: flex; }
  .nb-page-title  { display: none; } /* breadcrumb replaces title on desktop */
}

/* ── BOTTOM NAV — safe area ── */
#bottomNav {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 4px);
}
.bn-item { min-height: 44px; } /* iOS tap target */

/* ── DRAWER BODY scroll ── */
#drBody {
  flex: 1; overflow-y: auto; padding: 4px 0 16px;
}

/* reset existing dr-body (now dr-body is inside drawer but id is drBody) */
.nb-drawer {
  display: flex; flex-direction: column;
}
.nb-drawer .dr-head { flex-shrink: 0; }
.nb-drawer .dr-search-wrap { flex-shrink: 0; }
.nb-drawer .dr-shortcuts { flex-shrink: 0; }

/* ── DRAWER ITEM active indicator stronger ── */
.dr-item.active {
  background: var(--c-brand-tint) !important;
  color: var(--c-brand-dk) !important;
  font-weight: 800 !important;
}
.dr-item.active::before {
  content: '';
  position: absolute; right: 0; top: 4px; bottom: 4px;
  width: 3.5px; background: var(--c-brand);
  border-radius: var(--r-full) 0 0 var(--r-full);
}

html.dark .dr-search { border-color: rgba(255,255,255,.15); }
html.dark .dr-shortcut { border-color: rgba(255,255,255,.12); }

/* ══ שלב 14 — Mobile fixes ══ */

/* 1. bn-item tap target ← 44px מינימום לאייפון */
.bn-item {
  min-height: 44px;
  padding: 7px 0 5px;
}

/* 2. body padding-bottom כולל safe-area (חוסם תוכן מאחורי bottom nav באייפון) */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  }
}

/* 3. drawer max-width לסינון מסכים צרים מאוד */
.nb-drawer {
  max-width: calc(100vw - 40px);
}

/* 4. drawer search height על מובייל — נוחות הקלדה */
@media (max-width: 640px) {
  .dr-search { font-size: 14px; padding: 10px 36px 10px 12px; }
  .dr-shortcut { font-size: 12px; padding: 6px 10px; }
}

/* 5. admin pb-wrap padding על מובייל */
@media (max-width: 640px) {
  .pb-wrap { padding: 14px 12px; }
  .pb-mc-input { font-size: 16px; } /* מונע zoom אוטומטי ב-iOS */
  .pb-cat-head { font-size: 12.5px; }
  .pb-preview { padding: 12px 14px; }
  .pb-pv-pill { font-size: 12px; padding: 5px 10px; }
  .pb-board-title { font-size: 16px; }
}

/* 6. home hero stat pill ← אין עודף רוחב */
@media (max-width: 640px) {
  .hb-meta { flex-wrap: wrap; gap: 8px; }
  .hb-meta-item { flex: 1; min-width: 80px; }
  .hb-hero-cta { font-size: 12px; padding: 8px 14px; }
}

/* 7. profile hero stat pills — מניעת overflow */
@media (max-width: 430px) {
  .pa-stat-pill { padding: 9px 14px; }
  .pa-stat-val  { font-size: 20px; }
  .pa-name      { font-size: 22px; }
  .pa-score-val { font-size: 26px; }
}

/* 8. link cards on very small screens */
@media (max-width: 390px) {
  .hb-compact-grid { grid-template-columns: 1fr; }
  .hb-link-card { padding: 10px 12px; }
}

/* 9. bottom nav dark mode */
html.dark #bottomNav {
  background: rgba(13,31,46,.95);
  border-top-color: rgba(255,255,255,.06);
}

/* 10. drawer items tap target */
.dr-item { min-height: 42px; }
.dr-shortcut { min-height: 32px; }

/* ══ Professional visual refinement — global navigation only ══ */
#mainNavbar {
  background: linear-gradient(135deg, #164d75 0%, #2d7fae 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 3px 14px rgba(0,20,60,.16);
}
.nb-user,
.nb-hamburger {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
}
.nb-user:hover,
.nb-hamburger:hover { background: rgba(255,255,255,.16); }
.nb-avatar { box-shadow: 0 2px 7px rgba(0,0,0,.16); }
.nb-logo { opacity:.92; }
.nb-sub-bar {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid #d3e3ee;
  box-shadow: 0 2px 8px rgba(0,30,80,.045);
}
.nb-back-btn,
.nb-home-btn {
  border: 1px solid #d3e3ee;
  background: #fff;
  color: #174f78;
}
.nb-back-btn:hover,
.nb-home-btn:hover { background: #f4f9fd; }
.drawer {
  border-left: 1px solid rgba(0,30,80,.08);
  box-shadow: 0 14px 44px rgba(0,20,60,.20);
}
.dr-section-title { color: #607080; }
.dr-item { border-radius: 10px; }
.dr-item.active { border-right-width: 3px; background: #eef6fc; color: #174f78; }
.dr-item:hover { background: #f5f9fc; }
.bn-item { color:#607080; }
.bn-item.active { color:#174f78; }
@media (hover:hover){
  .hb-qbtn:hover,.hb-card:hover,.hb-link-card:hover,.pa-metric:hover,.pa-insight:hover,.pa-action-card:hover,.msg-card:hover,.pb-metric-card:hover { transition-duration: 140ms; }
}


/* ═══════════════════════════════════════════════
   FINAL UX FIX — locked chrome + calmer system look
══════════════════════════════════════════════════ */
body.has-app-nav {
  padding-top: calc(var(--nb-h) + 36px);
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
}
#mainNavbar {
  position: fixed !important;
  top: 0; right: 0; left: 0;
}
.nb-sub-bar {
  position: fixed !important;
  top: var(--nb-h); right: 0; left: 0;
  z-index: 195;
}
#bottomNav {
  position: fixed !important;
  right: 0; left: 0; bottom: 0;
}
.nb-sub-bar-home {
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid #d3e3ee;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nb-center img { width: 20px; height: 20px; border-radius: 4px; }
.dr-item, .bn-item, .nb-back-btn, .nb-home-btn, .nb-user, .nb-hamburger {
  transition: background .12s ease, border-color .12s ease, transform .1s ease, color .12s ease;
}
@media (max-width: 640px) {
  body.has-app-nav { padding-top: calc(var(--nb-h) + 32px); }
}
@media (min-width: 769px) {
  body { padding-bottom: 24px; }
}


/* ═══════════════════════════════════════════════
   FINAL PROFESSIONAL UI PASS — global chrome refinements
══════════════════════════════════════════════════ */
#mainNavbar {
  background: linear-gradient(135deg, #164d75 0%, #2d7fae 100%) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 3px 14px rgba(0,20,60,.14) !important;
}
.nb-sub-bar {
  background: rgba(255,255,255,.94) !important;
  border-bottom: 1px solid #d6e4ee !important;
  box-shadow: 0 2px 8px rgba(0,30,80,.04) !important;
}
.nb-center img { width: 19px !important; height: 19px !important; }
.nb-brand { letter-spacing: .05px; }
.nb-user,
.nb-hamburger,
.nb-back-btn,
.nb-home-btn {
  border-width: 1px !important;
}
.nb-back-btn,
.nb-home-btn {
  background: #fff !important;
  color: #174f78 !important;
  border-color: #d6e4ee !important;
}
.nb-back-btn:hover,
.nb-home-btn:hover { background:#f5f9fc !important; }
.nb-drawer { box-shadow: 0 14px 44px rgba(0,20,60,.18) !important; }
.dr-item { border-radius: 10px; }
.dr-item.active { background:#eef6fc !important; color:#174f78 !important; border-right-width:3px !important; }
.dr-item:hover { background:#f5f9fc !important; }
.dr-section { color:#607080 !important; letter-spacing:.35px; }
#bottomNav { box-shadow: 0 -2px 10px rgba(0,30,80,.06) !important; }
.bn-item.active { color:#174f78 !important; }
body.has-app-nav {
  padding-top: calc(var(--nb-h) + 36px) !important;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 10px) !important;
}
#mainNavbar { position: fixed !important; top:0; right:0; left:0; }
.nb-sub-bar { position: fixed !important; top: var(--nb-h); right:0; left:0; z-index:195; }
#bottomNav { position: fixed !important; right:0; left:0; bottom:0; }
@media (min-width: 769px) { body { padding-bottom: 24px !important; } }
@media (max-width: 640px) { body.has-app-nav { padding-top: calc(var(--nb-h) + 32px) !important; } }
