/* Permissions CSS (shared by Toggler & Check) */
.pm-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
}

.pm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.pm-header-left h2 { font-size: 16px; font-weight: 700; color: #111827; display: inline-block; margin-right: 8px; }
.pm-breadcrumb { font-size: 11px; color: #6b7280; display: inline-block; }

.pm-btn-outline {
  border: 1px solid #e5e7eb; background: #fff;
  padding: 6px 14px; border-radius: 6px;
  font-size: 11px; font-weight: 600; color: #374151;
  cursor: pointer; transition: 0.2s;
}
.pm-btn-outline:hover { background: #f9fafb; }

.pm-btn-primary {
  background: #3b82f6; border: none;
  padding: 7px 18px; border-radius: 6px;
  font-size: 12px; font-weight: 600; color: #fff;
  cursor: pointer; transition: 0.2s;
}
.pm-btn-primary:hover { background: #2563eb; }

/* Layout */
.pm-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1024px) { .pm-layout { grid-template-columns: 1fr; } }

/* Card */
.pm-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}

.pm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
  gap: 12px;
}

.pm-card-title { font-size: 14px; font-weight: 700; color: #111827; }
.pm-card-body { padding: 0; }

/* Role Tabs */
.pm-role-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.pm-role-tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid transparent;
}

.pm-role-tab:hover { background: #e5e7eb; }
.pm-role-tab.pm-tab-active { background: #3b82f6; color: #fff; }

/* Permission Group */
.pm-perm-group { border-bottom: 1px solid #f3f4f6; }
.pm-perm-group:last-child { border-bottom: none; }

.pm-perm-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
}

.pm-perm-group-title { font-size: 12px; font-weight: 700; color: #111827; }
.pm-perm-group-sub { font-size: 11px; color: #6b7280; }

/* Toggle Row */
.pm-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid #f9fafb;
}
.pm-toggle-row:last-child { border-bottom: none; }
.pm-toggle-row:hover { background: #fdfdfd; }

.pm-perm-info { flex: 1; }
.pm-perm-name { font-size: 12px; font-weight: 600; color: #111827; }
.pm-perm-desc { font-size: 11px; color: #6b7280; margin-top: 2px; line-height: 1.4; }

/* Toggle switch */
.pm-toggle {
  position: relative;
  display: inline-block;
  width: 38px; height: 22px;
  flex-shrink: 0;
  margin-left: 24px;
}
.pm-toggle input { opacity: 0; width: 0; height: 0; }
.pm-toggle span {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #e5e7eb;
  transition: .3s;
  border-radius: 34px;
}
.pm-toggle span:before {
  position: absolute; content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s; border-radius: 50%;
}
.pm-toggle input:checked + span { background-color: #10b981; }
.pm-toggle input:checked + span:before { transform: translateX(16px); }

/* Checkbox row (for Permissions Check page) */
.pm-check-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid #f9fafb;
}
.pm-check-row:last-child { border-bottom: none; }
.pm-check-row:hover { background: #fdfdfd; }

.pm-check-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pm-checkbox {
  width: 16px; height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
}

/* Header row for check columns */
.pm-col-header-row {
  display: grid;
  grid-template-columns: 1fr repeat(4, 80px);
  padding: 10px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
@media (max-width: 640px) {
  .pm-col-header-row { grid-template-columns: 1fr repeat(2, 60px); }
}

.pm-col-head {
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
  text-align: center;
}
.pm-col-head:first-child { text-align: left; }

.pm-perm-check-row {
  display: grid;
  grid-template-columns: 1fr repeat(4, 80px);
  padding: 12px 24px;
  border-bottom: 1px solid #f9fafb;
  align-items: center;
}
@media (max-width: 640px) {
  .pm-perm-check-row { grid-template-columns: 1fr repeat(2, 60px); }
}
.pm-perm-check-row:last-child { border-bottom: none; }
.pm-perm-check-row:hover { background: #fdfdfd; }

.pm-perm-check-cell { display: flex; justify-content: center; align-items: center; }

/* Save footer */
.pm-save-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}

/* KB Cards */
.pm-kb-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #eff6ff; color: #3b82f6;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; font-size: 14px;
}
.pm-kb-title { font-size: 12px; font-weight: 700; color: #111827; margin-bottom: 8px; line-height: 1.4; }
.pm-kb-desc { font-size: 11px; color: #6b7280; line-height: 1.5; margin-bottom: 12px; }
.pm-link-blue { font-size: 10px; font-weight: 700; color: #3b82f6; text-decoration: none; text-transform: uppercase; }
.pm-link-blue:hover { text-decoration: underline; }

/* FAQ */
.pm-faq-title { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 16px; }
.pm-faq-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid #f3f4f6; cursor: pointer; }
.pm-faq-item:last-child { border-bottom: none; }
.pm-faq-q { font-size: 12px; font-weight: 500; color: #374151; }
.pm-faq-icon { color: #9ca3af; font-size: 13px; }
.pm-faq-item:hover .pm-faq-q { color: #111827; }

/* Illus grid */
.pm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 640px) { .pm-grid-2 { grid-template-columns: 1fr; } }

.pm-illus-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 24px; display: flex; flex-direction: column;
  position: relative; overflow: hidden; min-height: 175px;
}
.pm-illus-card-title { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 10px; }
.pm-illus-card p { font-size: 11px; color: #6b7280; line-height: 1.5; margin-bottom: 20px; max-width: 55%; }
.pm-illus-card a { font-size: 10px; font-weight: 700; color: #3b82f6; text-transform: uppercase; text-decoration: none; }
.pm-illus-img { position: absolute; right: 16px; bottom: 16px; width: 140px; height: auto; }
