/* === Role-Based UI =====================================================
 * Applied via body.role-{admin|partner|employee|none}. See js/lib/role.js
 * The REAL security boundary is Firestore rules. These are UX hides only.
 * ======================================================================= */

/* ─── Sidebar: hide partner financials from employees ──────────────── */
body.role-employee .nav-link[data-module="partners"],
body.role-employee .nav-link[data-module="distribution"] {
  display: none !important;
}

/* ─── Generic admin-only elements ──────────────────────────────────── */
/* Any element tagged data-admin-only is hidden for non-admins.
   Used on create/edit/delete buttons. */
body:not(.role-admin) [data-admin-only] {
  display: none !important;
}

/* ─── Role pill next to user's name ────────────────────────────────── */
.userchip__role {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--b1);
  color: var(--t3);
  vertical-align: middle;
}
body.role-admin .userchip__role {
  background: var(--primary-tint);
  color: var(--primary-deep);
}
body.role-partner .userchip__role {
  background: rgba(79, 70, 229, 0.12);
  color: #4F46E5;
}
body.role-employee .userchip__role {
  background: rgba(245, 158, 11, 0.12);
  color: #B45309;
}

/* ─── Subtle banner across the top for read-only roles ────────────── */
body.role-partner #app-shell::before,
body.role-employee #app-shell::before {
  content: "View-only access — only admin can make changes";
  display: block;
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.06), rgba(79, 70, 229, 0.10));
  color: #4F46E5;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(79, 70, 229, 0.15);
}
body.role-employee #app-shell::before {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.10));
  color: #B45309;
  border-bottom-color: rgba(245, 158, 11, 0.15);
}
