/* Elinom Control — Roles & Permissions (desktop + mobile parity) */

.rbac-preview-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(99, 102, 241, 0.2));
  border-bottom: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
  font-size: 0.86rem;
  font-weight: 600;
}

.rbac-preview-banner.is-active {
  display: flex;
}

.rbac-search-wrap {
  position: relative;
  min-width: 180px;
  max-width: 280px;
  flex: 1;
}

.rbac-search-wrap input {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 7px 12px 7px 32px;
  font-size: 0.82rem;
}

.rbac-search-wrap i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.78rem;
}

.rbac-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  max-height: 320px;
  overflow: auto;
}

.rbac-search-results.is-open {
  display: block;
}

.rbac-search-results button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #e2e8f0;
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
}

.rbac-search-results button:hover {
  background: rgba(99, 102, 241, 0.15);
}

.rbac-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 1rem;
}

.rbac-toolbar input,
.rbac-toolbar select {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.rbac-matrix-wrap {
  overflow: auto;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0f172a;
}

.rbac-matrix {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.rbac-matrix th,
.rbac-matrix td {
  padding: 8px 10px;
  border-bottom: 1px solid #1e293b;
  font-size: 0.78rem;
  text-align: center;
}

.rbac-matrix th:first-child,
.rbac-matrix td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #0f172a;
  min-width: 180px;
}

.rbac-matrix .rbac-group-row td {
  background: #111827;
  color: #94a3b8;
  font-weight: 700;
  text-align: left;
}

.rbac-sensitive {
  color: #fbbf24;
}

.rbac-cards,
.rbac-staff-cards {
  display: none;
}

.rbac-card {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #0f172a;
}

.rbac-card h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.rbac-staff-card {
  color: #e2e8f0;
}

.rbac-staff-card p {
  margin: 0 0 6px;
  font-size: 0.8rem;
}

.rbac-staff-meta {
  color: #94a3b8;
}

.rbac-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #cbd5e1;
  padding: 4px 0;
}

.rbac-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.rbac-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  font-size: 0.74rem;
  margin: 0 6px 6px 0;
}

.rbac-workspace {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 0 0 1.2rem;
}

.rbac-empty {
  color: #94a3b8;
  font-size: 0.85rem;
}

@media (max-width: 860px) {
  .rbac-matrix-wrap {
    display: none;
  }

  .rbac-cards,
  .rbac-staff-cards {
    display: block;
  }

  .rbac-staff-table {
    display: none;
  }

  .rbac-search-wrap {
    max-width: none;
    min-width: 0;
  }

  .rbac-preview-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}
