/* ══════════════════════════════════════
   PERMISSIONS PAGE
══════════════════════════════════════ */
.perm-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.perm-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--n160);
  text-decoration: none;
  padding: 4px 4px;
  border-radius: var(--radius-sm);
}
.back-link:hover { color: var(--accent); background: var(--n30); }

.perm-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--n190);
}

.dd-menu-check {
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
}
.dd-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  color: var(--n160);
  cursor: pointer;
  white-space: nowrap;
}
.dd-check-item:hover { background: var(--n30); color: var(--n190); }
.dd-check-item input { cursor: pointer; }

.matrix-scroll {
  overflow: auto;
  max-height: 68vh;
  border: 1px solid var(--n60);
  border-radius: var(--radius-lg);
  background: var(--n0);
}

.perm-matrix {
  border-collapse: collapse;
  font-size: 12.5px;
}

.perm-matrix th, .perm-matrix td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--n40);
  text-align: left;
  white-space: nowrap;
}

.perm-matrix thead th {
  position: sticky;
  top: 0;
  background: var(--n30);
  color: var(--n160);
  font-size: 11px;
  font-weight: 700;
  z-index: 1;
}

.perm-matrix tbody tr:hover { background: var(--accent-light); }

.perm-matrix .col-name {
  position: sticky;
  left: 0;
  background: var(--n0);
  font-weight: 600;
  z-index: 2;
  width: 220px;
  min-width: 220px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.perm-matrix thead .col-name { background: var(--n30); z-index: 3; }
.perm-matrix tbody tr:hover .col-name { background: var(--accent-light); }

.perm-matrix .col-name a {
  color: var(--n190);
  text-decoration: none;
}
.perm-matrix .col-name a:hover { color: var(--accent); }

.perm-matrix .col-type { width: 110px; }

.perm-matrix .col-role {
  text-align: center;
  width: 70px;
  min-width: 70px;
}

.perm-code {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--n40);
  color: var(--n190);
}

@media (max-width: 700px) {
  .perm-main { padding: 12px 10px 36px; }
}
