*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%}
body.portal-app{
  font-family:'Hind Siliguri','Inter',sans-serif;color:#111827;
  display:flex;flex-direction:column;min-height:100dvh;max-height:100dvh;
  overflow:hidden;background:#f8fafc;
}
a{color:inherit;text-decoration:none}
.portal-topnav{
  flex-shrink:0;min-height:56px;padding:env(safe-area-inset-top) 14px 0;
  background:#fff;border-bottom:1px solid #e5e7eb;
  display:flex;align-items:center;gap:10px;position:relative;z-index:50;
}
.portal-menu-btn,.portal-icon-btn{
  flex-shrink:0;width:40px;height:40px;border:none;border-radius:8px;
  background:transparent;color:#111827;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.portal-menu-btn:hover,.portal-icon-btn:hover{background:#f3f4f6}
.portal-center{flex:1;min-width:0;text-align:center;line-height:1.2;min-height:56px;display:flex;flex-direction:column;justify-content:center}
.portal-center-site{
  display:inline-block;font-size:14px;font-weight:700;color:#e11d2e;letter-spacing:-.02em;
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.portal-center-site:hover{text-decoration:underline}
.portal-center-sub{display:block;margin-top:2px;font-size:11px;font-weight:500;color:#6b7280}
.portal-right{flex-shrink:0;display:flex;align-items:center;position:relative;z-index:51}
.portal-user-menu{
  display:none;position:absolute;top:calc(100% + 6px);right:0;z-index:60;
  background:#fff;border:1px solid #e5e7eb;border-radius:12px;
  box-shadow:0 8px 24px rgba(15,23,42,.1);min-width:220px;padding:6px 0;
}
.portal-user-menu.open{display:block}
.portal-user-menu a,.portal-user-menu button.portal-menu-item{
  display:flex;align-items:center;gap:10px;width:100%;padding:11px 16px;
  font-size:13px;font-weight:500;color:#374151;border:none;background:transparent;
  cursor:pointer;font-family:inherit;text-align:left;
}
.portal-user-menu a:hover,.portal-user-menu button.portal-menu-item:hover{background:#f8fafc;color:#111827}
.portal-user-menu svg{flex-shrink:0;color:#6b7280}
.portal-user-menu .sep{height:1px;background:#eef0f2;margin:6px 0}
.portal-user-menu button.portal-logout,
.portal-user-menu button.portal-logout svg{color:#e11d2e}
.portal-user-menu button.portal-logout:hover,
.portal-user-menu button.portal-logout:hover svg{background:#fef2f2;color:#c41828}

.portal-layout{flex:1;min-height:0;display:flex;position:relative;overflow:hidden;background:#f8fafc}
.portal-overlay{display:none;position:absolute;inset:0;z-index:20;background:rgba(15,23,42,.28);border:0}
.portal-overlay.open{display:block}
.portal-sidebar{
  width:240px;flex-shrink:0;background:#fff;border-right:1px solid #e5e7eb;
  padding:10px 8px;overflow:auto;z-index:10;
}
.portal-sidebar .sb-sec{
  font-size:11px;font-weight:600;color:#94a3b8;padding:12px 12px 6px;
  letter-spacing:.03em;text-transform:uppercase;
}
.portal-sidebar .sb-link{
  display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;margin:1px 0;
  border-radius:8px;color:#475569;font-size:13px;font-weight:500;
}
.portal-sidebar .sb-link:hover{background:#f1f5f9;color:#0f172a}
.portal-sidebar .sb-link.active{background:#fef2f2;color:#e11d2e;font-weight:600}
.portal-main{flex:1;min-width:0;overflow:auto;padding:20px 22px 40px;-webkit-overflow-scrolling:touch}
.portal-card{
  background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:28px 22px;
  max-width:560px;
}
.portal-card h1{font-size:18px;font-weight:700;margin-bottom:8px}
.portal-card p{font-size:14px;color:#6b7280;line-height:1.6}

@media(max-width:900px){
  .portal-overlay{position:fixed;top:calc(56px + env(safe-area-inset-top));left:0;right:0;bottom:0;z-index:40}
  .portal-sidebar{
    position:fixed;top:calc(56px + env(safe-area-inset-top));left:0;bottom:0;z-index:45;width:min(260px,82vw);
    transform:translateX(-100%);transition:transform .2s ease;
  }
  .portal-sidebar.open{transform:translateX(0);box-shadow:4px 0 16px rgba(15,23,42,.08)}
  .portal-main{padding:16px 14px 36px}
}
