.shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0,1fr) var(--right-w);
  grid-template-areas: "nav main aside";
  height: 100vh;
  gap: var(--gap);
  padding: var(--gap);
}

/* NAV */
.nav {
  grid-area: nav;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  overflow: hidden;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.nav-logo-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.nav-logo-text { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.nav-logo-sub  { font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.nav-section { margin-bottom: 8px; }
.nav-section-label {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); padding: 0 8px; margin-bottom: 4px;
}
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r-md);
  color: var(--text-2); font-size: 13px; font-weight: 400;
  transition: background 150ms, color 150ms;
  position: relative;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--text); font-weight: 500; }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-item .ni-icon { width: 16px; height: 16px; display: grid; place-items: center; opacity: 0.6; flex-shrink: 0; }
.nav-item.active .ni-icon { opacity: 1; }
.nav-divider { height: 1px; background: var(--border); margin: 10px 0; }
.nav-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.status-badge { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-md); background: var(--green-dim); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.status-badge-label { font-size: 12px; font-weight: 500; color: var(--green); }
.status-badge-date  { font-size: 10.5px; color: var(--text-3); margin-top: 1px; }

/* MAIN */
.main {
  grid-area: main;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  gap: var(--gap);
  min-height: 0;
}
.header {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  backdrop-filter: blur(24px);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.header-left { flex: 1; min-width: 180px; }
.header-eyebrow { font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.header-title { font-size: clamp(18px, 1.8vw, 26px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.header-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.header-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.content-wrap { min-height: 0; overflow: hidden; }
.screen { display: none; height: 100%; overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.screen.active { display: block; }
.screen-inner { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }

/* ASIDE */
.aside { grid-area: aside; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.right-card { background: var(--glass); border: 1px solid var(--border); border-radius: var(--r-xl); backdrop-filter: blur(20px); padding: 16px; }
.right-card-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; letter-spacing: -0.01em; }
.aside-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 30; }

/* RESPONSIVE */
@media (max-width: 1380px) { :root { --right-w: 250px; } }

@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--nav-w) minmax(0,1fr); grid-template-areas: "nav main"; }
  .aside {
    display: none; position: fixed;
    top: var(--gap); right: var(--gap);
    width: min(290px, calc(100vw - 2 * var(--gap)));
    max-height: calc(100vh - 2 * var(--gap));
    z-index: 40; background: var(--bg-1);
    border-radius: var(--r-xl); border: 1px solid var(--border-strong);
    padding: var(--gap); box-shadow: var(--shadow);
  }
  .aside.open { display: flex; }
  .aside-overlay.open { display: block; }
  .mobile-toggle-btn { display: inline-flex !important; }
}

@media (max-width: 900px) {
  :root { --nav-w: 200px; }
  .two-col, .three-col { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  html, body { overflow: auto; }
  .shell { grid-template-columns: 1fr; grid-template-areas: "nav" "main"; height: auto; min-height: 100vh; }
  .nav { border-radius: var(--r-xl); padding: 14px 10px; }
  .nav-section-label { display: none; }
}

@media (max-width: 480px) {
  :root { --gap: 10px; }
  .header { padding: 12px 14px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
