/* ===================================
   Permission Management Styles
   =================================== */

/* Load error state */
.perm-load-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #fce8e6;
  border: 1px solid #d13212;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13px;
  color: #d13212;
}

.perm-load-error i {
  font-size: 16px;
  flex-shrink: 0;
}

/* Modal header */
.perm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #dee2e6;
}

.perm-modal-header .modal-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #16191f;
}

.perm-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  font-weight: 300;
  color: #545b64;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.perm-modal-close:hover {
  color: #16191f;
}

/* Modal body */
.perm-modal-body {
  padding: 16px 24px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Role section */
.perm-role-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #eaeded;
}

.perm-role-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.perm-role-header {
  font-size: 14px;
  color: #16191f;
  margin-bottom: 4px;
}

.perm-role-description {
  font-size: 12px;
  color: #687078;
  margin-bottom: 12px;
  margin-top: 0;
}

/* Input row */
.perm-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.perm-type-select {
  min-width: 160px;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid #aab7b8;
  border-radius: 2px;
  font-size: 13px;
  color: #16191f;
  background-color: #fff;
}

.perm-type-select:focus {
  border-color: #0073bb;
  outline: none;
  box-shadow: 0 0 0 1px #0073bb;
}

.perm-id-input {
  flex: 1;
  height: 32px;
  padding: 4px 10px;
  border: 1px solid #aab7b8;
  border-radius: 2px;
  font-size: 13px;
  color: #16191f;
}

.perm-id-input:focus {
  border-color: #0073bb;
  outline: none;
  box-shadow: 0 0 0 1px #0073bb;
}

.perm-id-input::placeholder {
  color: #aab7b8;
}

.perm-input-error {
  border-color: #d13212 !important;
  box-shadow: 0 0 0 1px #d13212 !important;
}

.perm-input-error:focus {
  border-color: #d13212 !important;
}
.perm-add-btn {
  height: 32px;
  padding: 4px 12px;
  white-space: nowrap;
  font-size: 13px;
}

/* Inline error per role section */
.perm-inline-error {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #fce8e6;
  border: 1px solid #d13212;
  border-radius: 4px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #d13212;
}

.perm-inline-error i {
  color: #d13212;
  flex-shrink: 0;
}

.perm-inline-error-dismiss {
  background: none;
  border: none;
  color: #d13212;
  font-size: 16px;
  cursor: pointer;
  margin-left: auto;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}

/* Tags container */
.perm-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  align-items: center;
}

/* Tag */
.perm-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid #0073bb;
  border-radius: 16px;
  padding: 3px 8px;
  font-size: 12px;
  background-color: #f1faff;
  color: #0073bb;
  max-width: 100%;
}

.perm-tag-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background-color: rgba(0, 115, 187, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 5px;
  color: #0073bb;
}

.perm-tag-id {
  margin-right: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perm-tag-remove {
  background: none;
  border: none;
  color: #0073bb;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.perm-tag-remove:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.perm-tag-remove:hover {
  color: #d13212;
}

.perm-no-principals {
  font-size: 12px;
  color: #aab7b8;
  font-style: italic;
}

/* Modal footer */
.perm-modal-footer {
  padding: 12px 24px;
  border-top: 1px solid #dee2e6;
  text-align: right;
}

/* Group heading on detail page */
.perm-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.perm-group-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #16191f;
}

.perm-group-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.perm-group-divider {
  border: none;
  border-top: 1px solid #eaeded;
  margin: 12px 0 0 0;
}

/* Scope info banner in view modal */
.perm-scope-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background-color: #f1faff;
  border: 1px solid #0073bb;
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 18px;
  color: #0073bb;
}

.perm-scope-banner i {
  margin-top: 2px;
  flex-shrink: 0;
}

.perm-scope-banner span {
  font-size: 13px;
  color: #16191f;
}

.perm-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #eaeded;
  border-radius: 4px;
}

.perm-table thead th {
  background-color: #fafafa;
  border-bottom: 1px solid #eaeded;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #545b64;
  text-transform: uppercase;
  text-align: left;
}

.perm-table tbody td {
  padding: 10px 16px;
  font-size: 13px;
  color: #16191f;
  border-bottom: 1px solid #eaeded;
  vertical-align: middle;
}

.perm-table tbody tr:last-child td {
  border-bottom: none;
}

.perm-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.perm-role-badge-ADMIN {
  background-color: #fce8e6;
  color: #d13212;
}

.perm-role-badge-EDIT {
  background-color: #fef6e0;
  color: #8a6116;
}

.perm-role-badge-READ {
  background-color: #e3f2fd;
  color: #0073bb;
}

.perm-empty-state {
  text-align: center;
  padding: 24px;
  color: #687078;
  font-size: 13px;
}

.perm-loading {
  text-align: center;
  padding: 16px;
  color: #687078;
}
