/* Porto360 v4.76.22 — first-paint theme contract (cascade-layer free) */
:where(:root) {
  color-scheme: dark;
  --p360-page-bg: #161717;
  --p360-shell-bg: #202020;
  --p360-surface-card: #202020;
  --p360-surface-soft: #242424;
  --p360-surface-record: #242424;
  --p360-surface-hover: #292a2a;
  --p360-surface-input: #181919;
  --p360-border: rgba(255,255,255,.075);
  --p360-border-strong: rgba(255,255,255,.12);
  --p360-text: #f3f5f5;
  --p360-text-soft: #a2aaad;
  --p360-text-muted: #7e888d;
  --p360-accent: #55d9b7;
}
:where(html[data-theme='dark']) {
  color-scheme: dark;
  --p360-page-bg: #161717;
  --p360-shell-bg: #202020;
  --p360-surface-card: #202020;
  --p360-surface-soft: #242424;
  --p360-surface-record: #242424;
  --p360-surface-hover: #292a2a;
  --p360-surface-input: #181919;
  --p360-border: rgba(255,255,255,.075);
  --p360-border-strong: rgba(255,255,255,.12);
  --p360-text: #f3f5f5;
  --p360-text-soft: #a2aaad;
  --p360-text-muted: #7e888d;
}
:where(html[data-theme='light']) {
  color-scheme: light;
  --p360-page-bg: #F5F8FC;
  --p360-shell-bg: #ffffff;
  --p360-surface-card: #ffffff;
  --p360-surface-soft: #f7f8f8;
  --p360-surface-record: #ffffff;
  --p360-surface-hover: #f0f4f3;
  --p360-surface-input: #f8faf9;
  --p360-border: rgba(28,44,39,.10);
  --p360-border-strong: rgba(28,44,39,.16);
  --p360-text: #17201d;
  --p360-text-soft: #56635e;
  --p360-text-muted: #76827d;
}
:where(html,body,#root) { min-height: 100%; background: var(--p360-page-bg); }
:where(body) { margin: 0; color: var(--p360-text); }

/* v4.76.39 shell prepaint — viewport-first tablet contract */
@media (min-width:768px) and (max-width:1023px) {
  html #root .sidebar{background:var(--p360-shell-bg,#202020)!important;width:72px!important;min-width:72px!important;max-width:72px!important;padding-inline:8px!important;overflow:hidden!important;border-right:0!important}
  html #root .sidebar :is(.sidebar-group,.nav-item span,.sidebar-action button span){display:none!important}
  html #root .main-area{width:calc(100% - 72px)!important;margin-left:72px!important;padding-top:68px!important;background:var(--p360-shell-bg,#202020)!important}
  html #root .main-area>.topbar{position:fixed!important;inset:0 0 auto 72px!important;width:calc(100% - 72px)!important;height:68px!important;min-height:68px!important;border:0!important;border-radius:0!important;background:var(--p360-shell-bg,#202020)!important;background-image:none!important;box-shadow:none!important}
  html #root .main-area>main.content{min-height:calc(100dvh - 68px)!important;padding:30px 20px 32px!important;border-top-left-radius:28px!important;background:var(--p360-page-bg,#161717)!important}
}

/* v4.76.40 — first-paint shell parity */
html.p360-topbar-scrolled[data-theme="dark"] #root .main-area>.topbar.p360-native-topbar{background:rgba(27,28,28,.82)!important;border-bottom:1px solid rgba(255,255,255,.075)!important;box-shadow:0 12px 32px rgba(0,0,0,.22)!important;-webkit-backdrop-filter:blur(18px) saturate(145%)!important;backdrop-filter:blur(18px) saturate(145%)!important}
@media (min-width:768px) and (max-width:1023px){html #root .main-area>.topbar.p360-native-topbar::after{content:"";position:absolute;left:0;bottom:-28px;width:28px;height:28px;border-top-left-radius:28px;background:var(--p360-shell-bg,#202020);pointer-events:none}}

/* v4.76.40.37 — first-paint semantic desktop starts at 1024px. */
@media (min-width:1024px){
  html #root .sidebar{width:252px!important;min-width:252px!important;max-width:252px!important;background:var(--p360-shell-bg,#202020)!important}
  html #root .main-area{width:calc(100% - 252px)!important;margin-left:252px!important;padding-top:68px!important}
  html #root .main-area>.topbar{position:fixed!important;inset:0 0 auto 252px!important;width:calc(100% - 252px)!important;height:68px!important;min-height:68px!important;border:0!important;background:var(--p360-shell-bg,#202020)!important;background-image:none!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
  html.p360-sidebar-collapsed #root .sidebar{width:72px!important;min-width:72px!important;max-width:72px!important}
  html.p360-sidebar-collapsed #root .main-area{width:calc(100% - 72px)!important;margin-left:72px!important}
  html.p360-sidebar-collapsed #root .main-area>.topbar{inset-inline-start:72px!important;width:calc(100% - 72px)!important}
  html[data-theme="light"] #root .main-area>.topbar.p360-native-topbar{background:#fff!important;background-color:#fff!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
  html[data-theme="light"]:not(.p360-topbar-scrolled) #root .main-area>.topbar.p360-native-topbar::after{background:#fff!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;box-shadow:none!important}
}

/* v4.76.40.38 — desktop top is a true opaque shell surface. */
@media (min-width:1024px){
  html[data-shell-mode="desktop"][data-topbar-state="top"][data-theme="light"] #root .main-area>.topbar.p360-native-topbar{
    isolation:isolate!important;opacity:1!important;background:#fff!important;background-color:#fff!important;background-image:none!important;box-shadow:none!important;filter:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important
  }
  html[data-shell-mode="desktop"][data-topbar-state="top"][data-theme="light"] #root .main-area>.topbar.p360-native-topbar::before{
    content:""!important;display:block!important;position:absolute!important;inset:0!important;z-index:0!important;pointer-events:none!important;background:#fff!important;background-color:#fff!important;background-image:none!important;box-shadow:none!important;filter:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important
  }
  html[data-shell-mode="desktop"][data-topbar-state="top"][data-theme="light"] #root .main-area>.topbar.p360-native-topbar>*{position:relative!important;z-index:1!important}
}

/* v4.76.40.49 — mobile first-paint Porto360 navy topbar */
@media (max-width:767px){
  html #root .main-area>.topbar.p360-native-topbar{background:#05204B!important;background-color:#05204B!important;background-image:none!important;border:0!important;box-shadow:none!important;filter:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
}
