/* ============================================================
   Dream Fantasy shell — top navigation bar (Phase 1)
   Replaces Adda's left sidebar with Dream's top app bar.
   Loaded LAST so it overrides redesign.css / illunise.css.
   Uses the (now red) --brand / --gradient-brand tokens.
   ============================================================ */
#app { display: block !important; }

/* ── Top app bar ─────────────────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 20px;
  height: 66px; padding: 0 24px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-bottom: 1px solid var(--line, rgba(17,20,45,0.10));
}
.appbar-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.appbar .logo-icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--gradient-brand, #FF1744); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; box-shadow: 0 4px 14px rgba(255,23,68,0.35);
}
.appbar .logo-text h2 { font-size: 15px; font-weight: 800; color: var(--ink, #1B1B2E); line-height: 1; margin: 0; }
.appbar .logo-text span { font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-faint, #8A8AA2); }

.appbar-nav {
  display: flex; align-items: center; gap: 3px;
  flex: 1; min-width: 0; justify-content: flex-start;
  overflow-x: auto; scrollbar-width: none;
}
.appbar-nav::-webkit-scrollbar { display: none; }
.appbar-nav .nav-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 10px; margin: 0; border: none; background: transparent;
  border-radius: 10px; color: var(--ink-soft, #5C5C76);
  font-family: inherit; font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: all .2s;
}
.appbar-nav .nav-item .nav-icon { width: auto; height: auto; font-size: 15px; color: inherit !important; }
/* Icon-only by default; the active item expands to show its label */
.appbar-nav .nav-item .nav-label { display: none; }
.appbar-nav .nav-item.active .nav-label { display: inline; }
.appbar-nav .nav-item.active { padding: 9px 14px; }
.appbar-nav .nav-item:hover { background: rgba(17,20,45,0.05); color: var(--ink, #1B1B2E); }
.appbar-nav .nav-item.active {
  background: var(--gradient-brand, #FF1744); color: #fff;
  box-shadow: 0 5px 16px rgba(255,23,68,0.30);
}
.appbar-nav .nav-item.active .nav-icon { color: #fff; }

.appbar-right { display: flex; align-items: center; gap: 9px; flex-shrink: 0; margin-left: auto; }
.appbar-right .topbar-date { display: none; }
.appbar-right #exportBtn .btn-label { display: none; }
.appbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px 5px 6px; background: rgba(17,20,45,0.04);
  border: 1px solid var(--line, rgba(17,20,45,0.10)); border-radius: 12px;
}
.appbar-user .user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gradient-brand, #FF1744); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.appbar-user .user-meta { line-height: 1.15; }
.appbar-user .user-name { font-size: 12px; font-weight: 700; color: var(--ink, #1B1B2E); }
.appbar-user .user-status { font-size: 10px; color: var(--success, #00A24A); display: flex; align-items: center; gap: 4px; }
.appbar-iconbtn {
  width: 32px; height: 32px; border-radius: 9px; background: transparent;
  border: 1px solid var(--line, rgba(17,20,45,0.10)); color: var(--ink-soft, #5C5C76);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; gap: 6px; transition: all .2s;
}
.appbar-iconbtn:hover { background: rgba(17,20,45,0.06); color: var(--ink, #1B1B2E); }
.appbar .theme-toggle { padding: 0 10px; height: 32px; }

/* Page-injected filters (#topbarExtra) → context bar under the nav */
.context-bar { width: 100%; max-width: 1520px; margin: 0 auto; padding: 16px 28px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.context-bar:empty { display: none; }

/* Full-width, centered content (no sidebar offset) */
.main-content { margin-left: 0 !important; display: block !important; min-height: calc(100vh - 66px); }
.page-content { max-width: 1520px; margin: 0 auto; width: 100%; padding: 28px 28px 48px !important; }

/* Sidebar → hidden on desktop; becomes the mobile drawer */
.sidebar { display: none !important; }
.hamburger-btn { display: none; }

@media (max-width: 1180px) {
  .appbar { gap: 12px; padding: 0 14px; }
  .appbar-nav { display: none; }
  .appbar-user .user-meta { display: none; }
  .hamburger-btn { display: flex; }
  .sidebar {
    display: flex !important; position: fixed; top: 0; left: 0;
    height: 100vh; width: 264px; transform: translateX(-100%);
    transition: transform .28s; z-index: 110; flex-direction: column;
  }
  .sidebar.mobile-open { transform: none; }
  .page-content { padding: 20px 16px 40px !important; }
  .context-bar { padding: 14px 16px 0; }
}

/* ============================================================
   Dream Dashboard — hero + bento (Phase 2)
   ============================================================ */
.dash-hero { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; }
.grid-2-1  { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }

.hero-assets {
  display: flex; flex-direction: column; gap: 18px;
  background: radial-gradient(130% 130% at 100% 0%, rgba(255,23,68,0.10) 0%, transparent 48%), var(--card, #fff);
}
.hero-assets-head { display: flex; align-items: center; justify-content: space-between; }
.hero-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-faint, #8A8AA2); display: flex; align-items: center; gap: 8px; }
.hero-eyebrow i { color: var(--brand, #FF1744); }
.hero-figure {
  font-size: 44px; font-weight: 800; letter-spacing: -1.4px; line-height: 1; margin: 0;
  background: linear-gradient(180deg, #17172B 0%, #45455E 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-chip { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 14px; background: rgba(17,20,45,0.03); border: 1px solid var(--line, rgba(17,20,45,0.09)); }
.hero-chip-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.hero-chip-label { font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--ink-faint, #8A8AA2); }
.hero-chip-val { font-size: 17px; font-weight: 800; color: var(--ink, #1B1B2E); }
.hero-netpos { margin-top: auto; padding: 16px; border-radius: 16px; background: rgba(17,20,45,0.02); border: 1px solid var(--line, rgba(17,20,45,0.09)); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-netpos-eq { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-np-label { font-size: 10.5px; color: var(--ink-faint, #8A8AA2); margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.hero-np-val { font-size: 17px; font-weight: 800; color: var(--ink, #1B1B2E); }
.hero-np-op { font-size: 20px; color: var(--ink-faint, #8A8AA2); font-weight: 300; }

.hero-side {
  display: flex; flex-direction: column; justify-content: center; gap: 9px;
  background: radial-gradient(130% 130% at 0% 100%, rgba(255,23,68,0.09) 0%, transparent 52%), var(--card, #fff);
}
.hero-side-icon { width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 21px; background: rgba(255,23,68,0.12); color: var(--brand, #FF1744); }
.hero-side-fig { font-size: 32px; font-weight: 800; letter-spacing: -1px; line-height: 1; margin: 4px 0 2px; }
.hero-side-sub { font-size: 12px; color: var(--ink-soft, #5C5C76); }

.dash-block-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-faint, #8A8AA2); margin-bottom: 12px; padding-left: 2px; }

@media (max-width: 1000px) {
  .dash-hero, .grid-2-1 { grid-template-columns: 1fr; }
  .hero-figure { font-size: 36px; }
  .hero-breakdown { grid-template-columns: 1fr; }
  .hero-netpos { flex-direction: column; align-items: stretch; }
  .hero-netpos .btn { width: 100%; justify-content: center; }
}
