/* Counsiva Control Center — premium brand refinement
   Additive visual layer only. No API, CMS, SSO or data-flow behavior changes. */

:root{
  --navy:#0D1B4C;
  --blue:#1E5BFF;
  --teal:#0DB894;
  --slate:#64748B;
  --bg:#F2F4F8;
  --white:#FFFFFF;
  --surface:#FFFFFF;
  --surface-soft:#F8FAFD;
  --surface-blue:#F5F8FF;
  --line:#DCE4F0;
  --line-strong:#CBD6E5;
  --text:#0B163B;
  --muted:#64748B;
  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:20px;
  --radius-xl:24px;
  --shadow-sm:0 6px 20px rgba(13,27,76,.055);
  --shadow-md:0 14px 40px rgba(13,27,76,.085);
  --shadow-lg:0 22px 64px rgba(13,27,76,.13);
  --focus:0 0 0 4px rgba(30,91,255,.12);
}

html{background:var(--bg)}
body{
  background:
    radial-gradient(circle at 88% -10%,rgba(30,91,255,.07),transparent 28rem),
    var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

/* Sidebar */
.sidebar{
  width:284px;
  padding:22px 16px 18px;
  background:
    radial-gradient(circle at 12% 4%,rgba(30,91,255,.26),transparent 16rem),
    linear-gradient(180deg,#0D1B4C 0%,#0C1844 55%,#091437 100%);
  border-right:1px solid rgba(255,255,255,.07);
  box-shadow:18px 0 50px rgba(13,27,76,.08);
}
.brand{
  gap:13px;
  padding:4px 7px 25px;
  margin-bottom:5px;
  border-bottom:1px solid rgba(255,255,255,.09);
}
.brand-mark{
  width:44px;
  height:44px;
  border-radius:14px;
  background:rgba(255,255,255,.98);
  box-shadow:0 8px 24px rgba(0,0,0,.16),inset 0 0 0 1px rgba(13,27,76,.06);
}
.brand strong{font-size:19px;letter-spacing:-.015em}
.brand span{font-size:11px;letter-spacing:.025em;opacity:.68;margin-top:3px}
.nav{gap:5px;padding-top:7px}
.nav-item{
  position:relative;
  min-height:45px;
  padding:12px 13px 12px 15px;
  border-radius:13px;
  color:#D5E0F8;
  font-size:13px;
  font-weight:690;
  letter-spacing:.002em;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}
.nav-item:not(:disabled):hover{background:rgba(255,255,255,.075);color:#fff;transform:translateX(2px)}
.nav-item.active{
  background:linear-gradient(90deg,rgba(30,91,255,.30),rgba(30,91,255,.14));
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(117,157,255,.16);
}
.nav-item.active::before{
  content:"";
  position:absolute;
  left:0;
  top:11px;
  bottom:11px;
  width:3px;
  border-radius:999px;
  background:var(--teal);
  box-shadow:0 0 18px rgba(13,184,148,.45);
}
.nav-item:disabled{opacity:.47}
.nav-item em{
  padding:4px 7px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  font-size:9px;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.sidebar-foot{
  margin:18px 7px 0;
  padding:17px 2px 3px;
  border-top:1px solid rgba(255,255,255,.08);
  color:#8FA5D0;
  font-size:10px;
  letter-spacing:.025em;
}

/* Main shell / topbar */
.main{margin-left:284px;padding:26px 30px 34px;max-width:1800px}
.topbar{
  min-height:64px;
  margin-bottom:22px;
  padding:0 2px;
}
.topbar h1{font-size:28px;line-height:1.1;letter-spacing:-.025em;font-weight:790}
.topbar p{font-size:13px;color:var(--muted);margin-top:6px}
.top-actions{gap:9px}
.ghost,.user-pill,.menu-btn,.icon-btn{
  border:1px solid var(--line);
  background:rgba(255,255,255,.92);
  border-radius:12px;
  box-shadow:var(--shadow-sm);
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease,background .18s ease;
}
.ghost:hover,.user-pill:hover,.menu-btn:hover,.icon-btn:hover{
  border-color:#BFCDE0;
  background:#fff;
  box-shadow:0 9px 24px rgba(13,27,76,.09);
  transform:translateY(-1px);
}
.user-pill{color:var(--navy)}

/* Buttons */
.primary,.secondary,.open-btn{transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease}
.primary{
  background:linear-gradient(135deg,#1E5BFF,#174DDB);
  border-radius:12px;
  box-shadow:0 8px 20px rgba(30,91,255,.20);
}
.primary:hover{transform:translateY(-1px);box-shadow:0 11px 26px rgba(30,91,255,.25)}
.primary:active{transform:none}
.secondary{background:var(--surface-blue);border-color:#C8D8FF}
.open-btn{border-radius:9px;padding:7px 9px}
.open-btn:hover{background:#EEF3FF}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:none;box-shadow:var(--focus)}

/* Stat cards */
.stats{gap:13px;margin-bottom:17px}
.stats article{
  position:relative;
  overflow:hidden;
  min-height:112px;
  padding:18px 19px;
  border:1px solid rgba(203,214,229,.86);
  border-radius:18px;
  background:linear-gradient(180deg,#fff,#FBFCFF);
  box-shadow:var(--shadow-sm);
}
.stats article::after{
  content:"";
  position:absolute;
  width:88px;
  height:88px;
  right:-38px;
  top:-38px;
  border-radius:50%;
  background:rgba(30,91,255,.055);
}
.stats article:nth-child(4n+2)::after{background:rgba(13,184,148,.07)}
.stats span{font-size:10px;letter-spacing:.075em;color:#74839A}
.stats strong{font-size:30px;letter-spacing:-.035em;margin-top:10px;color:var(--navy)}

/* Toolbars / form controls */
.toolbar{
  gap:11px;
  padding:13px;
  margin-bottom:14px;
  background:rgba(255,255,255,.72);
  border:1px solid rgba(220,228,240,.92);
  border-radius:16px;
  box-shadow:0 4px 18px rgba(13,27,76,.035);
  backdrop-filter:blur(8px);
}
.toolbar input,.toolbar select,.detail-body input,.detail-body select,.detail-body textarea,.auth-dialog input,
.cms-grid input,.cms-grid textarea,.user-form-body input,.user-form-body select{
  border-color:var(--line-strong);
  border-radius:11px;
  background:#fff;
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
.toolbar input:hover,.toolbar select:hover,.detail-body input:hover,.detail-body select:hover,.detail-body textarea:hover,
.cms-grid input:hover,.cms-grid textarea:hover,.user-form-body input:hover,.user-form-body select:hover{border-color:#AEBED4}
.toolbar input:focus,.toolbar select:focus,.detail-body input:focus,.detail-body select:focus,.detail-body textarea:focus,.auth-dialog input:focus,
.cms-grid input:focus,.cms-grid textarea:focus,.user-form-body input:focus,.user-form-body select:focus{border-color:var(--blue);box-shadow:var(--focus)}

/* Panels / tables */
.panel,.panel-lite{
  border:1px solid rgba(203,214,229,.84);
  border-radius:20px;
  box-shadow:var(--shadow-md);
  background:rgba(255,255,255,.98);
}
.panel-head{padding:19px 21px;background:linear-gradient(180deg,#fff,#FCFDFF)}
.panel-head h2{font-size:17px;letter-spacing:-.01em}
th,td{padding:14px 18px}
th{
  background:#F8FAFD;
  color:#718096;
  font-size:10px;
  letter-spacing:.07em;
  border-bottom:1px solid #E3EAF3;
}
tbody tr{transition:background .14s ease}
tbody tr:hover{background:#FAFCFF}
td{border-bottom-color:#EDF1F7}
.lead-name{color:var(--navy);font-weight:780}
.muted{color:#718096}
.badge,.role-badge,.account-status,.owner-chip{border:1px solid transparent;letter-spacing:.01em}
.badge.NEW{border-color:#D7E2FF}
.badge.WON,.account-status.ACTIVE{border-color:#CDEFE3}
.badge.LOST,.account-status.SUSPENDED{border-color:#F5D3D3}

/* Dialogs */
dialog{
  border:1px solid rgba(220,228,240,.92);
  border-radius:22px;
  box-shadow:0 32px 90px rgba(5,16,48,.28);
}
dialog::backdrop{background:rgba(7,15,39,.58);backdrop-filter:blur(7px) saturate(.92)}
.detail-head{
  padding:19px 21px;
  background:linear-gradient(180deg,#fff,#FBFCFF);
}
.detail-head h2{letter-spacing:-.018em}
.detail-body{background:#fff}
.info-card{
  padding:14px;
  border-color:#DCE4F0;
  background:#FBFCFE;
  border-radius:13px;
}
.note{background:#FBFCFE;border-color:#DEE6F0}

/* SSO / secure access */
.auth-dialog{
  width:min(470px,calc(100vw - 28px));
  overflow:hidden;
  border-radius:24px;
}
.auth-dialog form{
  position:relative;
  padding:34px 34px 30px;
  gap:15px;
  background:
    radial-gradient(circle at 100% 0,rgba(30,91,255,.09),transparent 15rem),
    #fff;
}
.auth-dialog form::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:100%;
  height:4px;
  background:linear-gradient(90deg,var(--blue),var(--teal));
}
.auth-brand{
  display:inline-flex;
  width:max-content;
  padding:6px 10px;
  border-radius:999px;
  background:#EEF3FF;
  color:var(--blue);
  font-size:10px;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.auth-dialog h2{font-size:27px;letter-spacing:-.03em;color:var(--navy);margin-top:2px}
.auth-dialog p{color:#64748B}
.auth-dialog label span{color:#52627A;text-transform:uppercase;letter-spacing:.045em;font-size:10px}
#googleSignInBtn{
  min-height:47px;
  border:1px solid #CFD9E8!important;
  border-radius:12px!important;
  background:#fff!important;
  color:#142042!important;
  box-shadow:0 6px 18px rgba(13,27,76,.06)!important;
}
#googleSignInBtn:hover{border-color:#B7C5D8!important;background:#F9FBFE!important;transform:translateY(-1px)}
.auth-dialog small{padding-top:2px;color:#7B8799}

/* CMS + Users visual consistency */
.cms-intro>div:first-child,.users-hero{
  background:
    radial-gradient(circle at 92% 12%,rgba(30,91,255,.34),transparent 18rem),
    linear-gradient(135deg,#0D1B4C,#112A6E);
  border:1px solid rgba(255,255,255,.06);
  border-radius:22px;
  box-shadow:var(--shadow-lg);
}
.cms-intro .eyebrow,.users-hero .eyebrow{color:#9CB8FF}
.cms-page.active{background:linear-gradient(90deg,#EEF3FF,#F5F8FF);box-shadow:inset 3px 0 0 var(--blue)}
.cms-status-card{border-color:#D6E0EC;box-shadow:var(--shadow-sm)}
.users-hero .primary{box-shadow:0 9px 24px rgba(0,0,0,.12)}

/* Mobile */
@media(max-width:980px){
  .sidebar{width:284px;box-shadow:24px 0 70px rgba(5,16,48,.28)}
  .main{margin-left:0;padding:18px 19px 28px;max-width:none}
  .topbar{min-height:58px}
}

@media(max-width:720px){
  body{background:#F4F6FA}
  .main{padding:12px 12px 24px}
  .topbar{gap:10px;margin-bottom:15px;align-items:center}
  .topbar>div:nth-child(2){min-width:0}
  .topbar h1{font-size:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar p{font-size:11px;max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .menu-btn{flex:0 0 auto;padding:9px 11px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .stats article{min-height:96px;padding:14px;border-radius:15px}
  .stats strong{font-size:25px}
  .toolbar{grid-template-columns:minmax(0,1fr) 122px;padding:9px;border-radius:14px}
  .panel,.panel-lite{border-radius:17px;box-shadow:0 10px 30px rgba(13,27,76,.065)}
  .lead-card{padding:15px;background:#fff}
  .lead-card:active{background:#F8FAFD}
  .detail-dialog,.user-dialog{border-radius:22px 22px 0 0}
  .detail-head{padding:16px}
  .detail-body{padding:16px}
  .auth-dialog form{padding:28px 22px 24px}
  .auth-dialog h2{font-size:24px}
  .cms-intro>div:first-child,.users-hero{border-radius:18px}
}

@media(max-width:420px){
  .top-actions{gap:6px}
  .user-pill{max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .stats span{font-size:9px}
  .toolbar{grid-template-columns:1fr}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}
