/* NEXUS — dashboard layout styles
   Brand: Slate #5F6F7A · Teal #2FB4B4 · Off-White #F7F8F9 · Deep #33434A · White */

.dash-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--white);
  border-right: 1px solid var(--line); position: fixed; top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; z-index: 50; transition: transform 0.25s ease;
}
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); font-weight: 800; color: var(--deep); }
.sidebar-head .nucleus { width: 46px; height: 46px; }
.side-nav { padding: 14px 12px; flex: 1; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.side-nav .sn-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate); padding: 14px 12px 6px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--slate); font-weight: 600; font-size: 0.93rem; transition: all 0.15s; }
.side-nav a .sn-ic { width: 20px; text-align: center; }
.side-nav a:hover { background: var(--offwhite); color: var(--deep); }
.side-nav a.active { background: var(--teal-soft); color: var(--teal-dark); }
.side-foot { padding: 16px 22px; border-top: 1px solid var(--line-soft); font-size: 0.78rem; color: var(--slate); }

/* Main */
.main { flex: 1; margin-left: 248px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(247,248,249,0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 16px 28px;
}
.tb-left { display: flex; align-items: center; gap: 14px; }
.topbar h1 { font-size: 1.3rem; font-weight: 800; }
.tb-sub { font-size: 0.84rem; color: var(--slate); }
.tb-right { display: flex; align-items: center; gap: 12px; }
.range-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: 0.84rem; font-weight: 600; color: var(--deep); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); animation: livepulse 1.8s infinite; }
@keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.menu-btn { display: none; background: none; border: none; font-size: 1.4rem; color: var(--deep); cursor: pointer; }

.content { padding: 28px; display: flex; flex-direction: column; gap: 22px; }

/* KPI cards */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.kpi-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow-sm); transition: all 0.2s; }
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.kc-label { font-size: 0.76rem; font-weight: 600; color: var(--slate); text-transform: uppercase; letter-spacing: 0.04em; }
.kc-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--teal-soft); display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--teal-dark); }
.kc-value { font-size: 1.85rem; font-weight: 800; color: var(--deep); margin-top: 12px; }
.kc-delta { font-size: 0.8rem; font-weight: 700; }
.kc-delta.up { color: var(--teal-dark); }
.kc-delta.down { color: #E25C5C; }
.kc-spark { margin-top: 12px; }

/* Panels / grids */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head h3 { font-size: 1.02rem; font-weight: 700; }
.ph-sub { font-size: 0.8rem; color: var(--slate); margin-top: 2px; }

/* Area chart */
.area-chart { width: 100%; height: 240px; }
.area-chart svg { width: 100%; height: 100%; }
.area-chart .grid line { stroke: var(--line-soft); stroke-width: 1; }
.area-chart .axis text { font-size: 9px; fill: var(--slate); }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut svg { width: 150px; height: 150px; }
.donut .donut-center { font-size: 1.4rem; font-weight: 800; fill: var(--deep); }
.donut-legend { display: flex; flex-direction: column; gap: 11px; flex: 1; }
.dl-item { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--deep); }
.dl-dot { width: 10px; height: 10px; border-radius: 3px; }
.dl-val { margin-left: auto; font-weight: 700; color: var(--slate); }

/* Vertical bars */
.vbar-list { display: flex; flex-direction: column; gap: 15px; }
.vb-top { display: flex; justify-content: space-between; font-size: 0.88rem; margin-bottom: 6px; }
.vb-name { font-weight: 600; }
.vb-val { color: var(--slate); }
.vbar-track { height: 8px; background: var(--offwhite); border-radius: 999px; overflow: hidden; }
.vbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--teal-dark)); width: 0; transition: width 0.7s cubic-bezier(0.4,0,0.2,1); }

/* Tables */
table.dtable { width: 100%; border-collapse: collapse; }
table.dtable th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate); font-weight: 700; padding: 0 12px 12px; border-bottom: 1px solid var(--line-soft); }
table.dtable td { padding: 13px 12px; font-size: 0.88rem; border-bottom: 1px solid var(--line-soft); }
table.dtable tr:last-child td { border-bottom: none; }
table.dtable .num { text-align: right; font-variant-numeric: tabular-nums; }
table.dtable tbody tr { transition: background 0.15s; }
table.dtable tbody tr:hover { background: var(--offwhite); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.73rem; font-weight: 700; }
.pill.new { background: #EAF6F6; color: var(--teal-dark); }
.pill.scored { background: #EEF0FF; color: #5B4DDB; }
.pill.routed { background: #FFF4E6; color: #B57914; }
.pill.returned { background: #FDECEC; color: #C44545; }

.score-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; border-radius: 6px; font-size: 0.76rem; font-weight: 700; padding: 0 6px; }
.score-h { background: var(--teal); color: #fff; }
.score-m { background: var(--teal-soft); color: var(--teal-dark); }
.score-l { background: var(--offwhite); color: var(--slate); }

.pnl-up { color: var(--teal-dark); font-weight: 700; }
.pnl-down { color: #E25C5C; font-weight: 700; }

/* Responsive */
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .menu-btn { display: block; }
  .grid-2b { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpi-row { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
}
