/* =====================================================================
   Nigraan demo - application shell
   Purpose : Brand rule, deep-teal sidebar, white top bar, main content
             area and their responsive behaviour.
   Related : js/core/shell.js (markup), css/tokens.css
   Version : 0.2
   ===================================================================== */
/* signature: the ADS bar (teal with a gold end segment, as on the brand sheet) */
.brand-rule { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 60; background: linear-gradient(90deg, var(--brand) 0 82%, var(--gold) 82% 100%); }

.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.app.no-shell { display: block; }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--brand-deep); color: #d8ebe6; padding-top: 4px;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; text-decoration: none; color: #fff; }
.side-brand img { width: 40px; height: auto; flex: none; }
.side-brand .nm { font-family: var(--f-display); font-weight: 800; font-size: 21px; letter-spacing: .01em; line-height: 1; color: #fff; }
.side-brand .sub { font-size: 11px; line-height: 1.3; color: #a9cdc5; margin-top: 4px; }
.side-nav { flex: 1 1 auto; overflow-y: auto; padding: 6px 10px 12px; scrollbar-width: thin; scrollbar-color: #2a5c55 transparent; }
.side-nav .grp { font-size: 11.5px; color: #8fb8af; padding: 14px 10px 6px; font-weight: 600; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none;
  color: #d8ebe6; font-size: 13.5px; font-weight: 500; line-height: 1.25;
}
.side-nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a[aria-current="page"] { background: rgba(255, 255, 255, .11); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side-nav a .count { margin-left: auto; font-size: 11.5px; color: #9fc3bb; font-weight: 600; }
.side-nav a.dom { padding: 6px 10px 6px 38px; font-size: 13px; font-weight: 450; color: #bcd9d2; }
.side-nav a.dom[aria-current="page"] { color: #fff; }
.side-foot { padding: 12px 14px 14px; border-top: 1px solid rgba(255, 255, 255, .09); }
.who { display: flex; align-items: center; gap: 10px; }
.who .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--brand-deeper); font-weight: 700; font-size: 13px; flex: none; }
.who .nm { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.2; }
.who .sc { font-size: 11.5px; color: #9fc3bb; }
.side-actions { display: flex; gap: 6px; margin-top: 10px; }
.side-actions button { flex: 1; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #e3f1ed; border-radius: 7px; padding: 6px 8px; font-size: 12px; }
.side-actions button:hover { background: rgba(255, 255, 255, .14); }
.credit { margin-top: 10px; font-size: 11px; color: #7fa89f; }
.side-guide { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 12px; background: transparent; border: 1px solid rgba(189, 171, 56, .55); color: #e9dd94; border-radius: 7px; padding: 6px 8px; font-size: 12.5px; font-weight: 600; }
.side-guide:hover { background: rgba(189, 171, 56, .12); color: #fff3b0; }
.side-actions button { white-space: nowrap; }

/* ---------- top bar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 4px; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 10px;
  padding: 0 22px; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid var(--line);
}
.top .menu-btn { display: none; }
.crumb { font-size: 13px; color: var(--muted); min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top > .ctl, .top > .btn, .top > .dummy { flex: none; }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--brand-ink); text-decoration: underline; }
.content { padding: 22px 24px 48px; max-width: 1640px; width: 100%; }
.content.wide { max-width: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 80; transform: translateX(-104%); transition: transform .25s var(--ease); }
  .side.open { transform: none; box-shadow: var(--shadow-pop); }
  .scrim { position: fixed; inset: 0; background: rgba(7, 42, 38, .35); z-index: 70; }
  .top .menu-btn { display: inline-flex; }
  .content { padding: 16px 14px 40px; }
  .top { padding: 0 12px; }
}
@media (max-width: 760px) {
  .top { height: auto; flex-wrap: wrap; row-gap: 8px; column-gap: 8px; padding: 8px 12px; }
  .top .crumb { flex: 1 1 calc(100% - 52px); }
  .top .spacer { display: none; }
  .top > .ctl, .top > .btn, .top > .switch { flex: 1 1 auto; justify-content: center; }
  .top > .dummy { order: 9; }
}
