/* Finovas Global - app shell layout */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 14px; gap: 6px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--gradient); display: grid; place-items: center;
  box-shadow: 0 5px 16px rgba(99,102,241,.4);
}
.logo-mark svg { width: 22px; height: 22px; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
.brand-tag { font-size: 11px; color: var(--text-soft); font-weight: 600;
  margin-top: -2px; }

.nav-group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-soft);
  padding: 14px 10px 5px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px; padding: 10px 12px 10px 18px;
  border-radius: var(--r-sm); color: var(--text-muted); font-weight: 600;
  font-size: 13.5px; cursor: pointer; transition: .18s var(--ease);
  border: 1px solid transparent;
  overflow: hidden;
}
.nav-item svg {
  width: 18px; height: 18px; flex: none;
  transition: transform .22s var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover svg { transform: scale(1.08); }
.nav-item.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow:
    0 8px 22px -4px color-mix(in srgb, var(--brand) 55%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}
/* Crisp white accent strip on the inner left edge of the active nav item -
   matches the Finovas marketing site's sidebar treatment. */
.nav-item.on::before {
  content: "";
  position: absolute;
  left: 4px; top: 8px; bottom: 8px;
  width: 4px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, .75) 50%,
    rgba(255, 255, 255, .9) 100%);
  border-radius: 4px;
  box-shadow:
    0 0 12px rgba(255, 255, 255, .55),
    0 0 22px rgba(255, 255, 255, .25);
}
/* Soft aurora bloom behind the active item icon */
.nav-item.on::after {
  content: "";
  position: absolute;
  top: -30%; right: -20%;
  width: 140px; height: 140px;
  background: radial-gradient(circle,
    rgba(255, 255, 255, .25), transparent 60%);
  pointer-events: none;
  filter: blur(8px);
}
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--surface-3); color: var(--text-muted);
  padding: 1px 7px; border-radius: 99px;
  position: relative; z-index: 1;
}
.nav-item.on .count {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  backdrop-filter: blur(4px);
}
.nav-item > * { position: relative; z-index: 1; }

.sidebar-foot { margin-top: auto; padding: 12px 8px 4px; }
.api-pill {
  display: flex; align-items: center; gap: 8px; font-size: 11.5px;
  color: var(--text-muted); font-weight: 600;
}
.api-pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.api-pill .dot.on { background: var(--pos); box-shadow: 0 0 0 3px var(--pos-bg); }
.api-pill .dot.off { background: var(--text-soft); }

/* ── Topbar ──────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center;
  gap: 14px; padding: 0 26px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar .crumb { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.topbar .crumb b { color: var(--text); }
.topbar-spacer { flex: 1; }

.client-switch {
  position: relative; display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer;
  font-weight: 600; font-size: 13px; min-width: 190px;
}
.client-switch:hover { border-color: var(--border-strong); }
.client-switch .sw-av { width: 24px; height: 24px; border-radius: 7px;
  font-size: 11px; }
.client-switch .sw-name { flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.switch-menu {
  position: absolute; top: calc(100% + 7px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px;
  z-index: 40; max-height: 340px; overflow: auto; animation: fvPop .15s var(--ease);
}
.switch-menu .sw-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px;
  border-radius: var(--r-sm); cursor: pointer; font-size: 13px; font-weight: 600;
}
.switch-menu .sw-row:hover { background: var(--surface-2); }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted); cursor: pointer;
  transition: .14s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* ── Content ─────────────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 26px; }
.content-inner { max-width: 1240px; margin: 0 auto; animation: fvFadeUp .28s var(--ease); }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.page-head .pt { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.page-head h1 { margin-top: 2px; }
.page-actions { display: flex; gap: 10px; }

.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 16px; }
.row.wrap { flex-wrap: wrap; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar {
    flex-direction: row; align-items: center; overflow-x: auto;
    padding: 10px 12px; gap: 4px;
  }
  .sidebar .brand { padding: 0 10px 0 4px; }
  .brand-tag, .nav-group-label, .sidebar-foot, .nav-item .count { display: none; }
  .nav-item span { display: none; }
  .nav-item { padding: 9px; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px; }
  .client-switch { min-width: 0; }
  .client-switch .sw-name { display: none; }
}
