/*
 * Keep the public /demo shell visually aligned with the current Formora CRM app.
 * Loaded last so these rules mirror the final presentation/layout layers in CRM.
 */

:root{
  --sync-forest:#073c35;
  --sync-forest-dark:#052f2a;
  --sync-line:#e0e6e3;
  --sync-blue:#1768f2;
  --sync-orange:#ff6f55;
}

/* Demo notice remains visible, but should not change the product layout. */
.demo-banner{
  height:30px!important;
  min-height:30px!important;
  position:fixed!important;
  inset:0 0 auto 0!important;
  z-index:700!important;
  justify-content:space-between!important;
  padding:0 16px!important;
  gap:16px!important;
  font-size:10px!important;
  background:#052f2a!important;
}

.app-shell{
  display:block!important;
  min-height:100vh!important;
  padding-top:30px!important;
}

/* ---------- Current app: auto-collapsing sidebar ---------- */
.sidebar{
  position:fixed!important;
  inset:30px auto 0 0!important;
  top:30px!important;
  width:78px!important;
  height:calc(100vh - 30px)!important;
  z-index:260!important;
  display:flex!important;
  flex-direction:column!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  padding-bottom:72px!important;
  background:linear-gradient(180deg,#073b34 0%,#06362f 68%,#052f2a 100%)!important;
  border-right:1px solid rgba(255,255,255,.08)!important;
  transition:width .22s cubic-bezier(.2,.8,.2,1),box-shadow .22s ease!important;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.22) transparent;
}
.sidebar:hover{
  width:230px!important;
  box-shadow:16px 0 34px rgba(4,42,35,.14)!important;
}
.sidebar::-webkit-scrollbar{width:7px}
.sidebar::-webkit-scrollbar-track{background:transparent}
.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.22);border-radius:20px}

.logo{
  position:sticky!important;
  top:0!important;
  z-index:8!important;
  flex:0 0 86px!important;
  width:230px!important;
  height:86px!important;
  min-height:86px!important;
  padding:0 17px!important;
  gap:14px!important;
  justify-content:flex-start!important;
  background:#073b34!important;
  border-bottom:1px solid rgba(255,255,255,.09)!important;
}
.logo img{
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  flex:0 0 44px!important;
  object-fit:contain!important;
}
.logo strong{
  max-width:0!important;
  opacity:0!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  transform:translateX(-8px)!important;
  transition:opacity .14s ease,max-width .22s ease,transform .22s ease!important;
  font-size:20px!important;
}
.sidebar:hover .logo strong{
  max-width:150px!important;
  opacity:1!important;
  transform:translateX(0)!important;
}

#demoNav{
  flex:0 0 auto!important;
  width:230px!important;
  padding:10px 10px!important;
  gap:4px!important;
}
#demoNav button{
  position:relative!important;
  width:210px!important;
  min-height:50px!important;
  height:50px!important;
  grid-template-columns:48px minmax(0,1fr) auto!important;
  gap:0!important;
  padding:0 12px 0 0!important;
  border-radius:12px!important;
  overflow:hidden!important;
  font-size:15px!important;
  font-weight:600!important;
}
#demoNav button>i{
  width:48px!important;
  min-width:48px!important;
  display:grid!important;
  place-items:center!important;
  font-size:18px!important;
}
#demoNav button>span{
  opacity:0!important;
  transform:translateX(-7px)!important;
  white-space:nowrap!important;
  transition:opacity .13s ease,transform .2s ease!important;
}
.sidebar:hover #demoNav button>span{opacity:1!important;transform:translateX(0)!important}
#demoNav button>b{
  opacity:0!important;
  transform:scale(.75)!important;
  transition:opacity .13s ease,transform .18s ease!important;
}
.sidebar:hover #demoNav button>b{opacity:1!important;transform:scale(1)!important}
.sidebar:not(:hover) #demoNav button.active{
  width:58px!important;
  margin-left:0!important;
  border-radius:13px!important;
}

/* Saved Views injected by demo-ui-polish.js. */
.demo-saved-views{
  width:230px!important;
  margin-top:3px!important;
  opacity:0!important;
  pointer-events:none!important;
  transform:translateX(-8px)!important;
  transition:opacity .13s ease,transform .2s ease!important;
}
.sidebar:hover .demo-saved-views{
  opacity:1!important;
  pointer-events:auto!important;
  transform:translateX(0)!important;
}
.sidebar:not(:hover) .demo-saved-views{display:none!important}

/* Fixed profile footer, matching the desktop app's final lock. */
.sidebar>.sidebar-profile{
  position:fixed!important;
  left:0!important;
  right:auto!important;
  bottom:0!important;
  top:auto!important;
  z-index:280!important;
  height:72px!important;
  min-height:72px!important;
  width:78px!important;
  margin:0!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  overflow:hidden!important;
  background:#052f2a!important;
  border:0!important;
  border-top:1px solid rgba(255,255,255,.1)!important;
  box-shadow:0 -8px 18px rgba(3,31,26,.16)!important;
  cursor:pointer!important;
}
.sidebar>.sidebar-profile>.avatar{
  width:40px!important;
  height:40px!important;
  min-width:40px!important;
  min-height:40px!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-shadow:0 0 0 2px rgba(255,255,255,.09)!important;
}
.sidebar:not(:hover)>.sidebar-profile>div,
.sidebar:not(:hover)>.sidebar-profile>i{display:none!important}
.sidebar:hover>.sidebar-profile{
  width:230px!important;
  display:grid!important;
  grid-template-columns:48px minmax(0,1fr) 18px!important;
  align-items:center!important;
  justify-content:initial!important;
  gap:10px!important;
  padding:0 14px 0 15px!important;
}
.sidebar:hover>.sidebar-profile>div,
.sidebar:hover>.sidebar-profile>i{display:block!important}
.sidebar:hover>.sidebar-profile>.avatar{justify-self:center!important}

/* ---------- Main shell + topbar ---------- */
.main-shell{
  margin-left:78px!important;
  min-width:0!important;
  min-height:calc(100vh - 30px)!important;
}
.topbar{
  height:86px!important;
  position:sticky!important;
  top:30px!important;
  z-index:240!important;
  gap:12px!important;
  padding:0 30px!important;
  background:rgba(255,255,255,.98)!important;
  border-bottom:1px solid var(--sync-line)!important;
  backdrop-filter:blur(15px)!important;
}
.search-wrap{max-width:none!important;flex:1 1 auto!important}
.search{
  width:min(760px,68vw)!important;
  height:50px!important;
  border:1px solid #d5ded9!important;
  border-radius:13px!important;
  padding:0 13px!important;
}
.workspace-wrap{margin-left:auto!important;flex:0 0 auto!important}
.workspace{
  min-width:154px!important;
  max-width:220px!important;
  height:42px!important;
  border-radius:10px!important;
  box-shadow:0 3px 12px rgba(19,51,40,.06)!important;
}
.topbar .create{
  flex:0 0 50px!important;
  width:50px!important;
  height:50px!important;
}
.topbar .mail{
  flex:0 0 46px!important;
  width:46px!important;
  height:46px!important;
  border-radius:12px!important;
}
.workspace-menu{
  position:fixed!important;
  width:300px!important;
  z-index:460!important;
  padding:8px!important;
  border-radius:14px!important;
  box-shadow:0 22px 58px rgba(21,43,35,.20)!important;
}
.workspace-menu>button{min-height:56px!important}

.content{
  max-width:1540px!important;
  padding:30px 30px 50px!important;
  margin:0 auto!important;
}
.page-head{margin-bottom:24px!important}
.page-head h1{font-size:34px!important;line-height:1.1!important;margin:5px 0 7px!important;letter-spacing:-.035em!important}
.page-head p{font-size:14px!important}

/* ---------- Team page: mirror current CRM table + member detail ---------- */
.demo-team-page{max-width:1540px;margin:0 auto}
.demo-org-banner{
  display:grid;grid-template-columns:minmax(0,1.35fr) minmax(560px,1fr);gap:24px;align-items:center;
  padding:22px 24px;margin-bottom:16px;background:#fff;border:1px solid var(--sync-line);border-radius:16px;
}
.demo-org-brand{display:grid;grid-template-columns:54px 1fr;gap:14px;align-items:center}
.demo-org-brand img{width:50px;height:50px;object-fit:contain}
.demo-org-brand small,.demo-org-brand strong,.demo-org-brand p{display:block;margin:0}
.demo-org-brand small{font-size:9px;font-weight:900;letter-spacing:.13em;color:#73867d}
.demo-org-brand strong{font:700 18px Manrope,sans-serif;margin:3px 0 4px}
.demo-org-brand p{font-size:11px;line-height:1.45;color:#718078}
.demo-org-meta{display:grid;grid-template-columns:repeat(4,1fr);gap:0;margin:0}
.demo-org-meta>div{padding:0 14px;border-left:1px solid #e7ece9}
.demo-org-meta dt{font-size:9px;color:#7a8982;margin-bottom:4px}
.demo-org-meta dd{margin:0;font-size:11px;font-weight:800;color:#263831}
.demo-team-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:16px}
.demo-team-kpis article{padding:17px 18px;background:#fff;border:1px solid var(--sync-line);border-radius:14px}
.demo-team-kpis span,.demo-team-kpis strong,.demo-team-kpis small{display:block}
.demo-team-kpis span{font-size:10px;color:#6f7f77;font-weight:700}
.demo-team-kpis strong{font:700 22px Manrope,sans-serif;margin:5px 0 3px}
.demo-team-kpis small{font-size:9px;color:#1d8a64}
.demo-team-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px;align-items:start}
.demo-team-members,.demo-member-detail{background:#fff;border:1px solid var(--sync-line);border-radius:16px;overflow:hidden}
.demo-team-toolbar{height:58px;padding:0 17px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e9eeeb}
.demo-team-toolbar strong{font-size:14px}.demo-team-toolbar span{font-size:10px;color:#77857e;margin-left:6px}
.demo-team-toolbar button{border:0;background:transparent;color:#1768f2;font-size:11px;font-weight:800;cursor:pointer}
.demo-team-row{width:100%;min-height:64px;display:grid;grid-template-columns:1.6fr .8fr .48fr .52fr .48fr .82fr .62fr;gap:8px;align-items:center;padding:0 15px;border:0;border-bottom:1px solid #edf0ee;background:#fff;text-align:left}
button.demo-team-row{cursor:pointer}.demo-team-row:not(.demo-team-head):hover,.demo-team-row.active{background:#f7faf8}
.demo-team-head{min-height:44px;background:#f8faf9!important;color:#6f7f77;font-size:9px;font-weight:800}
.demo-team-person{display:flex;align-items:center;gap:9px;min-width:0}.demo-team-person span{min-width:0}.demo-team-person strong,.demo-team-person small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.demo-team-person strong{font-size:11px}.demo-team-person small{font-size:9px;color:#77857e;margin-top:2px}
.demo-team-row>b,.demo-team-row>strong,.demo-team-row>span{font-size:10px}.demo-status-dot{width:7px;height:7px;display:inline-block;border-radius:50%;margin-right:5px;background:#8e9b95}.demo-status-online{background:#159569}.demo-status-away{background:#ff9a55}
.demo-member-detail{padding:20px}.demo-member-detail>header{display:flex;align-items:center;gap:12px;padding-bottom:18px;border-bottom:1px solid #edf0ee}.demo-member-detail h2{font-size:18px;margin:0}.demo-member-detail p{font-size:11px;margin:2px 0}.demo-member-detail header small{font-size:9px;color:#809088}.demo-member-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:16px 0;border-bottom:1px solid #edf0ee}.demo-member-stats span,.demo-member-stats strong{display:block}.demo-member-stats span{font-size:8px;color:#7b8982}.demo-member-stats strong{font-size:12px;margin-top:3px}.demo-member-detail h3{font-size:12px;margin:16px 0 9px}.demo-member-activity{display:grid;gap:10px}.demo-member-activity>div{display:grid;grid-template-columns:8px 1fr;gap:9px}.demo-member-activity>div>i{width:7px;height:7px;border-radius:50%;background:#1768f2;margin-top:4px}.demo-member-activity strong,.demo-member-activity small{display:block}.demo-member-activity strong{font-size:10px}.demo-member-activity small{font-size:8px;color:#7a8982;margin-top:2px}

/* ---------- Current app: record drawers are centered modals ---------- */
.record-drawer:not([hidden])::before{content:"";position:fixed;inset:30px 0 0 0;background:rgba(8,30,24,.30);backdrop-filter:blur(5px);z-index:-1;pointer-events:none}
.record-drawer{
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  top:calc(50% + 15px)!important;
  bottom:auto!important;
  width:min(760px,calc(100vw - 150px))!important;
  height:min(82vh,760px)!important;
  max-height:calc(100vh - 82px)!important;
  transform:translate(-50%,-50%)!important;
  z-index:520!important;
  border:1px solid rgba(213,222,217,.92)!important;
  border-radius:22px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  box-shadow:0 32px 90px rgba(10,34,27,.30)!important;
  animation:demoSyncModalIn .18s cubic-bezier(.2,.8,.2,1) both!important;
}
.record-drawer .drawer-brand{border-radius:22px 22px 0 0!important}
@keyframes demoSyncModalIn{from{opacity:0;transform:translate(-50%,-48%) scale(.985)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}

/* Bring common cards closer to the production app's density. */
.kpis{gap:15px!important;margin-bottom:20px!important}
.kpi{min-height:118px!important;border-radius:16px!important;padding:17px!important;box-shadow:0 8px 28px rgba(30,52,44,.04)!important}
.dashboard-grid{gap:18px!important;margin-bottom:18px!important}
.panel,.table-card,.account,.chart-card,.marketing-card,.setting-card{border-color:#e0e6e3!important;box-shadow:0 1px 2px rgba(24,42,35,.025)!important}

@media(max-width:1320px){
  .sidebar:hover{width:210px!important}
  .sidebar:hover>.sidebar-profile{width:210px!important}
  .logo,#demoNav,.demo-saved-views{width:210px!important}
  #demoNav button{width:190px!important}
  .search{width:min(620px,56vw)!important}
  .demo-team-layout{grid-template-columns:minmax(0,1fr) 300px}
  .demo-org-banner{grid-template-columns:1fr}
}

@media(max-width:980px){
  .demo-banner span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .demo-banner a{display:none}
  .workspace{min-width:50px!important;width:50px!important}
  .workspace strong,.workspace>i{display:none!important}
  .demo-team-layout{grid-template-columns:1fr}
  .demo-team-row{grid-template-columns:1.5fr .8fr .45fr .45fr .7fr}.demo-team-row>*:nth-child(4),.demo-team-row>*:nth-child(5){display:none}
  .record-drawer{width:min(760px,calc(100vw - 40px))!important}
}
