/* ========================================
   ROLES PAGE STYLES
   ======================================== */

.roles-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  height: calc(100vh - 200px);
  min-height: 500px;
}

.roles-sidebar {
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.roles-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.roles-sidebar-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.roles-list {
  flex: 1;
  overflow-y: auto;
}

.role-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}

.role-item:hover {
  background: var(--bg-tertiary);
}

.role-item.active {
  background: var(--accent-primary);
  background: rgba(29, 155, 240, 0.15);
  border-left: 3px solid var(--accent-primary);
}

.role-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.role-item-name {
  font-weight: 500;
  font-size: 14px;
}

.role-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.role-system-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--accent-warning);
  color: #000;
  border-radius: 4px;
  font-weight: 600;
}

.roles-editor {
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 24px;
  overflow-y: auto;
}

.roles-editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  gap: 16px;
}

.roles-editor-empty svg {
  opacity: 0.3;
}

.role-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.role-editor-title h2 {
  margin: 0 0 4px 0;
  font-size: 20px;
}

.role-editor-name {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
}

.role-editor-actions {
  display: flex;
  gap: 8px;
}

.role-editor-info {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.permissions-editor {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 20px;
}

.permissions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.permissions-header h3 {
  margin: 0;
  font-size: 16px;
}

.permissions-actions {
  display: flex;
  gap: 8px;
}

.permissions-table-edit {
  width: 100%;
  border-collapse: collapse;
}

.permissions-table-edit th,
.permissions-table-edit td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.permissions-table-edit th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.perm-module-col {
  width: 40%;
}

.perm-action-col {
  width: 15%;
  text-align: center !important;
}

.perm-module-name {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.perm-expand {
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 16px;
}

.perm-spacer {
  width: 16px;
  display: inline-block;
}

.perm-row-parent .perm-module-name {
  font-weight: 600;
}

.perm-checkbox-cell {
  text-align: center !important;
}

.perm-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.perm-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.perm-checkbox-mark {
  display: none;
}

/* Responsive */
@media (max-width: 1024px) {
  .roles-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .roles-sidebar {
    max-height: 300px;
  }
  
  .role-editor-info {
    flex-direction: column;
  }
}
