/* ===================================================================
   PORTAL.CSS  v5
=================================================================== */

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;background:#f0f2f7;color:#111}

/* ===================================================================
   LAYOUT
=================================================================== */
.portal{display:flex;height:100vh;overflow:hidden}
.content{flex:1;display:flex;flex-direction:column;min-width:0}
.page{padding:18px;overflow:auto}

/* ===================================================================
   SIDEBAR — navy, icon-only, no card backgrounds
=================================================================== */
.sidebar{
  width:60px;
  background:#1f2232;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:14px 0 10px;
  position:sticky;top:0;
  height:100dvh;
  overflow:hidden;
  flex-shrink:0;
  z-index:100;
}

.side-items{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  flex:1;
  width:100%;
  padding:0;
}

.side-bottom{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  width:100%;
  padding-bottom:4px;
}

.side-btn{
  width:44px;height:44px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:rgba(255,255,255,.5);
  cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  text-decoration:none;
  transition:background .12s ease, color .12s ease;
  flex-shrink:0;
  padding:0;
  position:relative;
}
.side-btn:hover{
  background:rgba(255,255,255,.1);
  color:#fff;
}
.side-btn.active{
  background:rgba(255,255,255,.15);
  color:#fff;
}
.side-btn.active::before{
  content:'';
  position:absolute;
  left:0; top:50%;
  transform:translateY(-50%);
  width:3px;height:22px;
  background:#5b8def;
  border-radius:0 3px 3px 0;
}

.side-user{
  width:36px;height:36px;
  border-radius:50%;
  background:#009CFF;
  color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-weight:500;font-size:14px;
  text-decoration:none;
  flex-shrink:0;
  margin-top:6px;
  transition:opacity .12s;
  letter-spacing:-0.5px;
}
.side-user:hover{opacity:.85}

.side-btn-wrap{
  position:relative;
  display:flex;align-items:center;justify-content:center;
  width:100%;
}
.side-btn-wrap .side-btn{ width:44px; }
.side-badge{
  position:absolute;right:6px;top:4px;
  min-width:16px;height:16px;padding:0 4px;
  border-radius:999px;
  display:flex;align-items:center;justify-content:center;
  font-size:10px;font-weight:700;line-height:1;
  background:#ff3b30;color:#fff;
  border:2px solid #1f2232;
  pointer-events:none;
}

/* ===================================================================
   SUBNAV
=================================================================== */
.subnav{
  width:0;overflow:hidden;
  transition:width .18s ease;
  background:#1a1d2f;
  border-right:1px solid rgba(255,255,255,.06);
  flex-shrink:0;
}
.subnav.open{width:200px}
.sub-panel{display:none;padding:22px 10px 16px}
.sub-panel.active{display:block}

.sub-title{
  font-weight:600;
  font-size:11px;
  letter-spacing:.8px;
  text-transform:uppercase;
  color:rgba(255,255,255,.3);
  margin-bottom:12px;
  padding:0 12px;
}

.sub-link{
  display:flex;
  align-items:center;
  padding:11px 12px;
  border-radius:7px;
  text-decoration:none;
  color:rgba(255,255,255,.6);
  font-size:13.5px;
  font-weight:400;
  margin-bottom:3px;
  background:transparent;
  transition:background .1s ease, color .1s ease;
  position:relative;
}
.sub-link:hover{
  background:rgba(255,255,255,.07);
  color:rgba(255,255,255,.95);
}
.sub-link.active{
  background:rgba(91,141,239,.15);
  color:#8cb4f5;
  font-weight:500;
}
.sub-link.active::before{
  content:'';
  position:absolute;
  left:0;top:50%;
  transform:translateY(-50%);
  width:3px;height:16px;
  background:#5b8def;
  border-radius:0 3px 3px 0;
}

.sub-muted{color:rgba(255,255,255,.25);font-size:12px;padding:0 10px}

/* ===================================================================
   TOPBAR — navy bar matching sidebar
=================================================================== */
.topbar{
  height:60px;
  display:flex;
  align-items:center;
  gap:0;
  padding:0 12px;
  background:linear-gradient(180deg, #242638 0%, #1f2232 100%);
  border-bottom:1px solid #13151f;
  box-shadow:0 2px 12px rgba(0,0,0,.35);
  flex-shrink:0;
}

/* Left: page name + star */
.topbar-title{
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 18px 0 4px;
  border-right:1px solid rgba(255,255,255,.18);
  flex-shrink:0;
  height:100%;
}
.topbar-page-name{
  font-size:13.5px;
  font-weight:700;
  color:#fff;
  white-space:nowrap;
  letter-spacing:0.1px;
}

/* Fav star */
.fav-star{
  flex-shrink:0;
  border:none;
  background:transparent;
  font-size:14px;
  line-height:1;
  cursor:pointer;
  color:rgba(255,255,255,.2);
  transition:color .15s;
  padding:2px 2px;
}
.fav-star:hover{ color:#f5c542; }
.fav-star.is-fav{ color:#f5c542; }

/* Centre: fav chips */
.topbar-chips{
  flex:1;
  display:flex;
  align-items:stretch;
  gap:2px;
  padding:0 10px;
  overflow-x:auto;
  scrollbar-width:none;
  -ms-overflow-style:none;
  height:100%;
}
.topbar-chips::-webkit-scrollbar{ display:none; }

/* Right: user pill */
.topbar-right{
  flex-shrink:0;
  margin-left:auto;
  padding-left:8px;
}

/* ── Fav chips ── */
.fav-chip{
  display:inline-flex;
  align-items:center;
  padding:0 13px;
  border-radius:0;
  font-size:13px;
  font-weight:500;
  color:rgba(255,255,255,.55);
  text-decoration:none;
  white-space:nowrap;
  transition:color .15s, background .15s, box-shadow .15s;
  cursor:pointer;
  user-select:none;
  flex-shrink:0;
  letter-spacing:0.1px;
  position:relative;
  font-weight:400;
  /* bottom-border underline slot */
  box-shadow:inset 0 -2px 0 transparent;
}
.fav-chip:hover{
  color:rgba(255,255,255,.9);
  background:rgba(255,255,255,.05);
  box-shadow:inset 0 -2px 0 rgba(255,255,255,.2);
}
.fav-chip.fav-active{
  color:#fff;
  font-weight:500;
  background:rgba(91,141,239,.1);
  box-shadow:inset 0 -2px 0 #5b8def;
}

/* Drag states */
.fav-chip.dragging{ opacity:.35; }
.fav-chip.drag-over{ background:rgba(91,141,239,.12); box-shadow:inset 0 -2px 0 rgba(91,141,239,.5); }

/* ── Fav badges ── */
.fav-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:17px;
  padding:0 5px;
  margin-left:7px;
  border-radius:8px;
  font-size:10.5px;
  font-weight:700;
  line-height:1;
  background:rgba(255,255,255,.1);
  color:rgba(255,255,255,.45);
}
.fav-active .fav-badge{
  background:rgba(91,141,239,.35);
  color:#c0d8ff;
}
.fav-badge.fav-badge-alert{
  background:rgba(224,96,96,.28);
  color:#f08080;
}

/* User pill */
.pill{
  background:rgba(255,255,255,.08);
  color:rgba(255,255,255,.55);
  padding:5px 12px;
  border-radius:999px;
  font-size:12.5px;
  font-weight:500;
  white-space:nowrap;
  letter-spacing:0.1px;
}

/* ===================================================================
   CARDS
=================================================================== */
.card{background:#fff;border:1px solid #e5e7ef;border-radius:16px;padding:18px}

/* ===================================================================
   LOGIN — split screen
=================================================================== */
.login-split{
  display:flex;
  height:100vh;
  margin:0;
  background:#f0f2f7;
}

/* Left navy panel */
.ls-panel{
  width:40%;
  min-width:280px;
  background:#1f2232;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:36px 40px;
  flex-shrink:0;
}
.ls-brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.ls-logo{
  width:32px;height:32px;
  background:#3b82f6;
  border-radius:7px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
.ls-brand-name{
  color:#fff;
  font-size:15px;
  font-weight:600;
  letter-spacing:-.2px;
}
.ls-hero{
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:40px 0;
}
.ls-tagline{
  color:rgba(255,255,255,.92);
  font-size:45px;
  font-weight:600;
  line-height:1.2;
  letter-spacing:-.4px;
  margin-bottom:16px;
}
.ls-sub{
  color:rgba(255,255,255,.38);
  font-size:17px;
  line-height:1.5;
}
.ls-icons{
  display:flex;
  gap:18px;
  color:rgba(255,255,255,.18);
}

/* Right form panel */
.ls-form-wrap{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f8f9fb;
}
.ls-form{
  width:100%;
  max-width:320px;
  padding:0 20px;
}
.ls-form-title{
  font-size:22px;
  font-weight:600;
  color:#1f2232;
  margin-bottom:4px;
  letter-spacing:-.3px;
}
.ls-form-sub{
  font-size:13px;
  color:#9ca3af;
  margin-bottom:28px;
}
.ls-label{
  display:block;
  font-size:12px;
  color:#6b7280;
  margin-bottom:6px;
  font-weight:500;
}
.ls-input{
  display:block;
  width:100%;
  padding:10px 13px;
  border:1px solid #d1d5db;
  border-radius:8px;
  background:#fff;
  font-size:14px;
  color:#111;
  outline:none;
  margin-bottom:16px;
  transition:border-color .15s;
  font-family:inherit;
}
.ls-input:focus{border-color:#5b8def;}
.ls-input::placeholder{color:#c0c4cc;}
.ls-btn{
  display:block;
  width:100%;
  padding:11px;
  border:0;
  border-radius:8px;
  background:#1f2232;
  color:#fff;
  font-size:14px;
  font-weight:500;
  cursor:pointer;
  font-family:inherit;
  letter-spacing:.1px;
  transition:background .15s;
  margin-top:4px;
}
.ls-btn:hover{background:#2d3150;}
.alert{background:#fff3f3;border:1px solid #ffd1d1;color:#a10000;border-radius:8px;padding:10px 13px;margin-bottom:16px;font-size:13px;}

@media(max-width:640px){
  .login-split{flex-direction:column;}
  .ls-panel{width:100%;min-width:0;padding:24px;flex:0 0 auto;}
  .ls-tagline{font-size:20px;}
  .ls-hero{padding:20px 0;}
  .ls-icons{display:none;}
}

/* ===================================================================
   COLLAPSIBLE SIDEBAR
=================================================================== */
.portal.is-collapsed .sidebar{width:0;padding:0;overflow:hidden}
.portal.is-collapsed .subnav{width:0 !important;border-right:0}
.portal.is-collapsed .content{width:100%}

.reopen-sidebar{
  position:fixed;left:12px;bottom:12px;z-index:9999;
  width:44px;height:44px;border:0;border-radius:12px;
  background:#1f2232;color:rgba(255,255,255,.7);cursor:pointer;
  box-shadow:0 4px 18px rgba(0,0,0,.28);
  display:none;
  align-items:center;justify-content:center;
}
.portal.is-collapsed .reopen-sidebar{display:flex}

/* ===================================================================
   MOBILE
=================================================================== */
@media (max-width:768px){
  .sidebar{padding-bottom:10px}
  .side-bottom{padding-bottom:10px}
}

/* ===================================================================
   LOAD MONITOR
=================================================================== */
.portal.p-loadmon .page{overflow:hidden !important;padding:0 !important}
.portal.p-loadmon .content{overflow:hidden !important}