/* ============================================================
   ATLAS V7 — Contextual sub-nav (P1.2) + role-based nav (P1.4)
   Additive layer; loads after v7-tools.css. Single gold accent, receded
   chrome (full saturation reserved for the active tab only).

   The sub-nav is a flex child of .main-col, between the statusbar and the
   .canvas. When shown it shrinks the canvas — the 1920×1080 no-scroll frame
   is preserved (atlas-dashboard.md #3). When hidden it leaves layout entirely.
   ============================================================ */

.v7-subnav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 30px;
  background: var(--surface, #fffdf8);
  border-bottom: 1px solid var(--line, #d7d0c3);
  font-family: var(--font-ui, Inter, "Segoe UI", system-ui, sans-serif);
}
.v7-subnav[hidden] { display: none; }

.v7-subnav-section {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #647184);
  white-space: nowrap;
}
.v7-subnav-sep { color: var(--faint, #8a95a3); font-size: 14px; line-height: 1; }

.v7-subnav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;            /* horizontal internal scroll only — frame holds */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.v7-subnav-tabs::-webkit-scrollbar { display: none; }

.v7-subnav-tab {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted, #647184);
  transition: background .14s ease, color .14s ease;
}
.v7-subnav-tab:hover { background: var(--bg3, #ebe7de); color: var(--ink, #101722); }
.v7-subnav-tab:focus-visible { outline: 2px solid var(--gold, #c18a25); outline-offset: 1px; }
.v7-subnav-tab.is-active {
  color: var(--gold, #c18a25);
  background: var(--champagne-soft, #fbecd0);
  font-weight: 700;
}

/* ── Role-based nav (P1.4) — bound to current_user × current_org role.
   Members (agent tier) get a focused nav: admin / governance surfaces are
   hidden from the rail AND the All-Tools grid. Admin (default, or unknown
   role) sees everything — fails open, because real tenant isolation is
   enforced server-side at the fetcher (multi-tenant.md), not in CSS.
   js/v7-nav.js sets body[data-role] from the active membership. ── */
body[data-role="member"] .rail-item[data-dept="admin"],
body[data-role="member"] .rail-item[data-dept="trust-center"],
body[data-role="member"] .rail-item[data-dept="integrations"],
body[data-role="member"] .rail-item[data-dept="automation"],
body[data-role="member"] .rail-item[data-dept="users"],
body[data-role="member"] .v7-tile[data-goto="admin"],
body[data-role="member"] .v7-tile[data-goto="trust-center"],
body[data-role="member"] .v7-tile[data-goto="integrations"],
body[data-role="member"] .v7-tile[data-goto="automation"],
body[data-role="member"] .v7-tile[data-goto="users"] {
  display: none !important;
}

/* ── Global "+ New" quick-action (P1.3) ───────────────────────────────────
   Bordered secondary button so it doesn't compete with the gold "Ask Atlas"
   primary; gold is reserved for hover/active (single-accent V6 rule). ── */
.v7-new-wrap { position: relative; }
.v7-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line, #d7d0c3);
  border-radius: 9px;
  background: var(--surface, #fffdf8);
  color: var(--ink, #101722);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.v7-new-btn svg { width: 16px; height: 16px; }
.v7-new-btn:hover { border-color: var(--gold, #c18a25); box-shadow: 0 1px 0 rgba(193,138,37,.12); }
.v7-new-btn:focus-visible { outline: 2px solid var(--gold, #c18a25); outline-offset: 1px; }
.v7-new-btn[aria-expanded="true"] { border-color: var(--gold, #c18a25); background: var(--champagne-soft, #fbecd0); }

.v7-new-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 80;
  min-width: 210px;
  padding: 6px;
  background: var(--surface, #fffdf8);
  border: 1px solid var(--line, #d7d0c3);
  border-radius: 12px;
  box-shadow: var(--shadow, 0 18px 44px rgba(29, 24, 14, .16));
}
.v7-new-menu[hidden] { display: none; }
.v7-new-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink, #101722);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.v7-new-opt svg { width: 17px; height: 17px; color: var(--muted, #647184); flex: 0 0 auto; }
.v7-new-opt:hover { background: var(--bg3, #ebe7de); }
.v7-new-opt:hover svg { color: var(--gold, #c18a25); }
.v7-new-opt:focus-visible { outline: 2px solid var(--gold, #c18a25); outline-offset: -1px; }
