/* Unified navigation - modern glassmorphism sidebar */
.sidebar{
  width:224px;
  padding:20px 14px 16px;
  background:linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color:#1e293b;
  border-right:1px solid rgba(226,232,240,0.8);
  box-shadow:4px 0 24px rgba(33,100,243,0.04);
  font-family:"PingFang SC","Microsoft YaHei UI","Microsoft YaHei",system-ui,sans-serif;
  backdrop-filter:blur(20px);
}

.sidebar .brand{
  gap:12px;
  padding:4px 10px 20px;
  margin:0 0 4px;
  border-bottom:1px solid rgba(226,232,240,0.6);
}

.sidebar .brand-mark{
  width:40px;
  height:40px;
  border-radius:12px;
  font-size:18px;
  font-weight:800;
  box-shadow:0 8px 24px rgba(33,100,243,0.25);
  background:linear-gradient(145deg,#5489ff,#1d5bea);
  color:#fff;
}

.sidebar .brand strong{
  color:#1e293b;
  font-size:15px;
  font-weight:700;
  line-height:18px;
  letter-spacing:-0.01em;
}

.sidebar .brand small{
  margin-top:3px;
  color:#94a3b8;
  font-size:11px;
  line-height:14px;
  letter-spacing:0.02em;
}

.sidebar nav{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.sidebar .nav-group{
  display:block;
  margin:16px 12px 6px;
  padding:0;
  color:#94a3b8;
  font-size:10px;
  font-weight:600;
  line-height:14px;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.sidebar .nav-group:first-child{
  margin-top:8px;
}

.sidebar .nav-item{
  position:relative;
  display:flex;
  align-items:center;
  width:100%;
  height:38px;
  margin:0;
  padding:0 11px;
  gap:10px;
  border:1px solid transparent;
  border-radius:11px;
  background:transparent;
  color:#64748b;
  font-size:13px;
  font-weight:500;
  line-height:1;
  text-align:left;
  letter-spacing:0;
  transition:all .2s cubic-bezier(0.4,0,0.2,1);
  cursor:pointer;
}

.sidebar .nav-item:hover{
  background:rgba(33,100,243,0.06);
  color:#334155;
  border-color:rgba(33,100,243,0.08);
  transform:translateX(2px);
}

.sidebar .nav-item.active{
  background:linear-gradient(135deg, rgba(33,100,243,0.12) 0%, rgba(99,138,255,0.08) 100%);
  border-color:rgba(33,100,243,0.15);
  color:#2164f3;
  font-weight:600;
  box-shadow:0 4px 12px rgba(33,100,243,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
}

.sidebar .nav-item.active::before{
  content:'';
  position:absolute;
  left:-14px;
  top:50%;
  transform:translateY(-50%);
  width:4px;
  height:22px;
  background:linear-gradient(180deg,#5489ff,#1d5bea);
  border-radius:0 4px 4px 0;
  box-shadow:0 2px 8px rgba(33,100,243,0.4);
}

.sidebar .nav-item.active .nav-icon{
  color:#2164f3;
}

.sidebar .nav-icon{
  display:grid!important;
  flex:0 0 18px;
  width:18px!important;
  height:18px;
  place-items:center;
  margin:0!important;
  color:#94a3b8;
  transition:color .2s ease;
}

.sidebar .nav-icon svg{
  display:block;
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
}

.sidebar .nav-item:hover .nav-icon{
  color:#475569;
}

.sidebar .nav-label{
  display:block;
  width:auto!important;
  margin:0!important;
  font-size:13px;
  line-height:20px;
  text-align:left;
  white-space:nowrap;
}

.sidebar .side-foot{
  left:14px;
  right:14px;
  width:auto;
  padding:14px 10px 4px;
  border-color:rgba(226,232,240,0.6);
  margin-top:auto;
}

.sidebar .side-foot b{
  color:#475569;
  font-size:12px;
  font-weight:600;
}

.sidebar .side-foot small{
  color:#94a3b8;
  font-size:10px;
}

.sidebar .status-dot{
  width:8px;
  height:8px;
  background:#30bd85;
  box-shadow:0 0 0 4px rgba(48,189,133,0.12);
}

main{
  margin-left:224px;
  padding-left:32px;
  padding-right:32px;
}

.page-query-bar{
  min-height:70px;
  padding:13px 16px;
  gap:14px;
}

.page-range-label{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.page-range-label>span{
  flex:none;
  min-width:52px;
  color:#52647a;
  font-size:12px;
  font-weight:700;
  line-height:1;
}

.page-range-button{
  height:46px;
  min-width:310px;
  padding:0 14px 0 16px;
  gap:13px;
  border-color:#d8e1ec;
  border-radius:14px;
  background:rgba(255,255,255,0.9);
  color:#18283d;
  box-shadow:0 2px 8px rgba(33,100,243,0.04), inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter:blur(10px);
  font-family:inherit;
  transition:all .2s ease;
}

.page-range-button:hover{
  border-color:#a9bee2;
  background:#fff;
  box-shadow:0 4px 12px rgba(33,100,243,0.08);
}

.page-range-button b{
  font-size:13px;
  font-weight:650;
  line-height:1;
}

.page-range-button i{
  font-size:15px;
  line-height:1;
  color:#97a6b8;
}

.page-range-calendar-icon{
  display:block;
  flex:0 0 18px;
  width:18px;
  height:18px;
  margin-left:auto;
  fill:none;
  stroke:#71839a;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.page-range-presets{
  align-items:center;
}

.page-range-presets button{
  height:36px;
  padding:0 12px;
  font-family:inherit;
  font-size:11px;
  font-weight:600;
  border-radius:10px;
}

.page-range-apply{
  height:42px;
  border-radius:12px;
  font-family:inherit;
  font-size:12px;
}

.custom-select{
  min-width:145px;
}

.custom-select-button{
  height:44px;
  padding:0 13px 0 15px;
  gap:12px;
  border-color:#d8e1ec;
  border-radius:12px;
  background:rgba(255,255,255,0.9);
  color:#42536a;
  backdrop-filter:blur(10px);
  font-family:inherit;
  font-size:12px;
  font-weight:500;
  line-height:1;
  text-align:left;
  transition:all .2s ease;
}

.custom-select-button:hover{
  border-color:#adc0df;
  background:#fff;
  box-shadow:0 4px 12px rgba(33,100,243,0.06);
}

.custom-select-button:focus-visible{
  outline:3px solid rgba(33,100,243,.13);
  border-color:#3974ee;
}

.custom-select-button>span{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  line-height:18px;
}

.custom-select-chevron{
  display:block;
  flex:0 0 17px;
  width:17px;
  height:17px;
  fill:none;
  stroke:#8797aa;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.custom-select-menu{
  top:49px;
  padding:8px;
  border-radius:14px;
  box-shadow:0 12px 40px rgba(0,0,0,0.12);
  border:1px solid rgba(226,232,240,0.8);
}

.custom-select-menu button{
  min-height:36px;
  padding:9px 11px;
  font-family:inherit;
  font-size:12px;
  line-height:18px;
  border-radius:8px;
}

.analysis-filter{
  display:flex;
  align-items:flex-end;
  gap:12px;
  padding:14px 16px;
}

.analysis-filter label{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:7px;
  color:#53647a;
  font-size:11px;
  font-weight:700;
  line-height:1;
}

.analysis-filter label .custom-select{
  min-width:178px;
}

.analysis-filter #resetFilters{
  height:44px;
  margin:0;
  padding:0 18px;
  align-self:flex-end;
  border-radius:12px;
  font-size:12px;
}

.filter-bar{
  align-items:flex-end;
}

.filter-bar label{
  gap:7px;
}

.filter-bar input,.filter-bar button{
  min-height:44px;
  border-radius:12px;
}

.live-state .custom-select{
  min-width:66px;
}

.live-state .custom-select-button{
  height:32px;
  padding:0 8px;
  border:0;
  background:rgba(33,100,243,0.08);
  font-size:10px;
  border-radius:8px;
}

.live-state .custom-select-chevron{
  width:14px;
  height:14px;
}

@media(max-width:1000px){
  .sidebar{
    width:200px;
  }
  .sidebar .nav-item{
    padding:0 10px;
  }
  main{
    margin-left:200px;
    padding-left:22px;
    padding-right:22px;
  }
  .page-query-bar{
    flex-wrap:wrap;
  }
  .page-range-apply{
    margin-left:0;
  }
  .analysis-filter{
    flex-wrap:wrap;
  }
}

@media(max-width:720px){
  .sidebar{
    position:static;
    width:auto;
    height:auto;
    padding:15px;
  }
  .sidebar .brand{
    padding-bottom:12px;
  }
  .sidebar nav{
    display:flex;
    overflow:auto;
  }
  .nav-item{
    width:auto;
    white-space:nowrap;
  }
  .side-foot{
    display:none;
  }
  main{
    margin:0;
    padding:0 15px 30px;
  }
  header{
    height:auto;
    padding:22px 0;
    align-items:flex-start;
    gap:15px;
  }
  .header-actions{
    flex-wrap:wrap;
    justify-content:flex-end;
  }
  .metrics{
    grid-template-columns:1fr 1fr;
  }
  .overview-grid{
    grid-template-columns:1fr;
  }
}
